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

Description Usage Arguments Value

View source: R/scan_012.R

Description

This one skips data.table::fread and just scans things directly. 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
scan_012(prefix, gz = FALSE, gzpos = FALSE, posfile_columns)

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!

gzpos

logical flag saying whether the pos file is gzipped.

posfile_columns

The number of columns in the .pos file. This seems to usually be 1 or 2. If this is 1, then it is assumed that the locus names are unique. If it is greater than 1, then the first two columns are catenated together with "–" to form the position names.

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.