Generate sample data file for testing purpose. Depending the input_type, the following sample files will be generated:

  • ssc_samplebpti_HNcoCACB.txt, for testing unassigned_bamorc() function

  • csvsample_input.csv, sample file in csv format

  • scsample_input_sc.txt, sample file with semicolon as delimiter

  • wssample_input_ws.txt, sample file with white space as delimiter

sample_data_generator(input_type)

Arguments

input_type

flag indicates what sample data will be generated

Value

save a sample file in a temporary location for demonstration

Examples

input_type = "ws" sample_data_generator(input_type = input_type) head(read_raw_file("sample_input_ws.txt", delim="ws"))
#> Parsed with column specification: #> cols( #> X1 = col_double(), #> X2 = col_double() #> )
#> [[1]] #> [1] "NHQDHNNFQTLPYVPCSTCEGNLACLSLCHIE" #> #> [[2]] #> # A tibble: 32 x 2 #> X1 X2 #> <dbl> <dbl> #> 1 NA 38.6 #> 2 NA 28.8 #> 3 56.3 30.4 #> 4 54.4 41.3 #> 5 NA 28.8 #> 6 55.1 38.9 #> 7 NA 38.8 #> 8 NA 39.3 #> 9 NA 30.3 #> 10 62.1 69.8 #> # ... with 22 more rows #>
unlink("sample_input_ws.txt") input_type = "csv" sample_data_generator(input_type = input_type) head(read_raw_file("sample_input.csv", delim="comma"))
#> Parsed with column specification: #> cols( #> X1 = col_double(), #> X2 = col_double() #> )
#> Warning: number of columns of result is not a multiple of vector length (arg 2)
#> Warning: 1 parsing failure. #> row # A tibble: 1 x 5 col row col expected actual file expected <int> <chr> <chr> <chr> <chr> actual 1 33 <NA> 2 columns 1 columns 'sample_input.csv' file # A tibble: 1 x 5
#> [[1]] #> [1] "NHQDHNNFQTLPYVPCSTCEGNLACLSLCHIE" #> #> [[2]] #> # A tibble: 33 x 2 #> X1 X2 #> <dbl> <dbl> #> 1 NA 38.6 #> 2 NA 28.8 #> 3 56.3 30.4 #> 4 54.4 41.3 #> 5 NA 28.8 #> 6 55.1 38.9 #> 7 NA 38.8 #> 8 NA 39.3 #> 9 NA 30.3 #> 10 62.1 69.8 #> # ... with 23 more rows #>
unlink("sample_input.csv") input_type = "sc" sample_data_generator(input_type = input_type) head(read_raw_file("sample_input_sc.txt", delim="semicolon"))
#> Parsed with column specification: #> cols( #> X1 = col_double(), #> X2 = col_double() #> )
#> [[1]] #> [1] "NHQDHNNFQTLPYVPCSTCEGNLACLSLCHIE" #> #> [[2]] #> # A tibble: 32 x 2 #> X1 X2 #> <dbl> <dbl> #> 1 NA 38.6 #> 2 NA 28.8 #> 3 56.3 30.4 #> 4 54.4 41.3 #> 5 NA 28.8 #> 6 55.1 38.9 #> 7 NA 38.8 #> 8 NA 39.3 #> 9 NA 30.3 #> 10 62.1 69.8 #> # ... with 22 more rows #>
unlink("sample_input_sc.txt")