read_012: read a set of 012 files from vcftools into a matrix of...

Description Usage Arguments Value

View source: R/read_012.R

Description

Uses data.table::fread for speed. Note that the individual names should be unique! So should the locus names. The .pos file should have two columns of names (at least things are hard-wired for that at the moment).

Usage

1
read_012(prefix, gz = FALSE)

Arguments

prefix

the (path) prefix on the files to be read. The files will be prefix.012, prefix.012.indv, and prefix.012.pos

gz

if this is set to TRUE, then the function expects that the 012 file ends in 012.gz and is gzipped. For this to work, you have to have a decent shell on your system with gzcat for gunzipping the file to a stream. If you are on a Mac, that should be fine. If you are on Windows, probably not. If there are any problems, don't keep your file gzipped!

Value

Returns a matrix with n-indiv rows and n-loci columns. The rownames are the indv names and the colnames are the pos's.


eriqande/genoscapeRtools documentation built on Dec. 27, 2021, 8:01 a.m.