This function reads a standard Eigenstrat *.snp file into a tibble.
readr::read_table2() to do it efficiently.
Input file (whatever is accepted by
A tibble with columns:
Eigenstrat SNP format reference: https://github.com/DReichLab/EIG/tree/master/CONVERTF
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# to read "data.snp", run like this: # snp <- read_snp("data") # this also works # snp <- read_snp("data.snp") # The following example is more awkward # because package sample data has to be specified in this weird way: # read an existing Eigenstrat *.snp file file <- system.file("extdata", 'sample.snp', package = "genio", mustWork = TRUE) snp <- read_snp(file) snp # can specify without extension file <- sub('\\.snp$', '', file) # remove extension from this path on purpose file # verify .snp is missing snp <- read_snp(file) # load it anyway! snp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.