hypo_import_snps imports SNP based statistics (such as VCFtools output).

hypo_import_snps(file, gz = FALSE, run, ...)

Arguments

file

string scalar (mandatory), the input file

gz

logical scalar (optional), is the input file gz compressed?

run

string scalar (optional), appends a column RUN as ID if several files should be merged later

...

parameters passed to vroom::vroom()

Details

This function imports SNP based statistics. The input is expected to be tab separated, to contain a CHROM and POS column and can optionally be gz compressed. After import, the CHROM based position is transposed to a genome wide position for continuous visualization.

See also

Examples

file_snps <- system.file("extdata", "example.weir.fst.gz", package = "hypogen") hypo_import_snps(file = file_snps, gz = TRUE)
#> Rows: 235 #> Columns: 3 #> Delimiter: "\t" #> chr [1]: CHROM #> dbl [2]: POS, WEIR_AND_COCKERHAM_FST #> #> Use `spec()` to retrieve the guessed column specification #> Pass a specification to the `col_types` argument to quiet this message
#> # A tibble: 235 x 5 #> CHROM POS WEIR_AND_COCKERHAM_FST GSTART GPOS #> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 LG01 321 -0.0134 0 321 #> 2 LG01 1258 -0.0112 0 1258 #> 3 LG01 1373 0.00286 0 1373 #> 4 LG01 1398 0.00686 0 1398 #> 5 LG01 1403 -0.0000585 0 1403 #> 6 LG01 1494 -0.00282 0 1494 #> 7 LG01 1495 -0.0114 0 1495 #> 8 LG01 2121 0.0148 0 2121 #> 9 LG01 3079 0.0145 0 3079 #> 10 LG01 3085 -0.0136 0 3085 #> # … with 225 more rows