make.Happyinf.input: convert PolyHaplotyper input data to Happy-inf format

Description Usage Arguments Value Examples

Description

convert PolyHaplotyper input data to Happy-inf format for a single haploblock

Usage

1
2
make.Happyinf.input(mrkDosage, indiv=NULL, haploblock,
ploidy, fname)

Arguments

mrkDosage

matrix or data.frame of allele dosages; same as input for inferHaplotypes. Markers are in rows, individuals in columns, each cell has a marker dosage. All marker dosages must be in 0:ploidy or NA

indiv

the names of the individuals to include in the Happy-inf input data. Default NULL includes all individuals

haploblock

a list of character vectors. The names are the names of the haploblocks, the character vectors have the names of the markers in each haploblock. Only the markers in haploblock will be included in the Happy-inf input data

ploidy

single integer: the ploidy level

fname

filename of a tab-separated output file: this will contain the data in Happy-inf format (the saved data.frame is also the return value). If "" no file is written

Value

a data.frame in the Happy-inf input format: a header row with "SNPID", "block" and names of the individuals and one row per marker, with only the individuals, markers and blocks as specified. #'SNPID has the marker names, "Block" the haploblock names. All markers of a haploblock are in contiguous rows. Missing dosages are represented by "NA"

Examples

1
2
3
4
data(PolyHaplotyper_small)
HAPin <- make.Happyinf.input(mrkDosage=phdos, haploblock=phblocks,
                            ploidy=6, fname="")
HAPin[,1:8]

PolyHaplotyper documentation built on June 17, 2021, 5:12 p.m.