convert_012_to_bed: create a PLINK bed file from and 012 matrix

Description Usage Arguments Details

View source: R/plink-admixture-etc.R

Description

This clearly does not preserve Ref and Alt alleles, etc., but can be a quick way to get to a bed file. It also allows the user to override the chromosome names so that they play nicely with ADMIXTURE. This function expects that plink is on the system PATH somewhere.

Usage

1
convert_012_to_bed(W, chromo_override = FALSE, prefix = "plink")

Arguments

W

the matrix that results from read_012.

chromo_override

If TRUE, this sets the chromosome names to 1 so that ADMIXTURE will work.

prefix

Prefix for the output files.

Details

This function assumes everyone is unrelated and nobody has a phenotype to be coded in plink.

It also currently is hardwired to deal with contig names the way they come out of our pipeline and get catenated by read_012. That is, when it sees: scaffold2|size4533513--4321992 it knows that the contig comes before the – and the position in bp comes after that.


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