hypo_import_windows imports window based statistics (such as VCFtools output).

hypo_import_windows(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 window based statistics. The input is expected to be tab separated, to contain a CHROM, BIN_START and BIN END column and can optionally be gz compressed. After import, the CHROM based position (center of the window) is transposed to a genome wide position for continuous visualization.

See also

Examples

file_windowed <- system.file("extdata", "example.windowed.weir.fst.gz", package = "hypogen") hypo_import_windows(file = file_windowed, gz = TRUE)
#> Rows: 49 #> Columns: 6 #> Delimiter: "\t" #> chr [1]: CHROM #> dbl [5]: BIN_START, BIN_END, N_VARIANTS, WEIGHTED_FST, MEAN_FST #> #> Use `spec()` to retrieve the guessed column specification #> Pass a specification to the `col_types` argument to quiet this message
#> # A tibble: 49 x 9 #> CHROM BIN_START BIN_END N_VARIANTS WEIGHTED_FST MEAN_FST GSTART POS GPOS #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 LG01 1 10000 24 -0.00552 -0.00422 0 5000. 5000. #> 2 LG01 1001 11000 27 -0.00577 -0.00454 0 6000. 6000. #> 3 LG01 2001 12000 22 -0.00649 -0.00363 0 7000. 7000. #> 4 LG01 3001 13000 22 -0.00649 -0.00363 0 8000. 8000. #> 5 LG01 4001 14000 18 -0.00797 -0.00710 0 9000. 9000. #> 6 LG01 5001 15000 14 -0.00962 -0.00828 0 10000. 10000. #> 7 LG01 6001 16000 12 -0.0101 -0.00850 0 11000. 11000. #> 8 LG01 7001 17000 12 -0.0101 -0.00850 0 12000. 12000. #> 9 LG01 8001 18000 15 -0.00890 -0.00402 0 13000. 13000. #> 10 LG01 9001 19000 16 -0.00882 -0.00418 0 14000. 14000. #> # … with 39 more rows