read.SATlotyper.output: read the haplotyping results from the SATlotyper output

Description Usage Arguments Details Value

View source: R/PolyHaplotyper.R


read the haplotyping results from the SATlotyper output


read.SATlotyper.output(fname, output="", allelecodes=c("A", "B"),
sep, haploblockname="")



filename of an xml file produced by SATlotyper


character vector, console output of SATlotyper; this contains a table of calculated haplotypes with more info than the xml file


the codes used for the ref and alt SNP alleles in make.SATlotyper.input, default "A" and "B"


the separator used in make.SATlotyper.input (SATlotyper cleverly identifies this separator and uses it for its output), default tab


if not "" (default) the haplotype IDs are given as <haploblockname>_<hapnr>, else just as <hapnr>, left_padded with zeroes


The xml file is parsed using the package XML. The resulting list has 3 items named source, bootstrapping and haplotyping. In this function source is ignored and the results are obtained from haplotypings[[1]] (i.e. even if multiple haplotypings were done only the first is extracted), with the haplotype score from the bootstrapping item added to the


a list with 3 items:
$hapdos is a matrix with individuals in columns and haplotypes in rows, giving the dosages of the haplotypes in each individual (summing to ploidy). This is the same format as the hapdos components of the inferHaplotypes results of PolyHaplotyper
$ is a data.frame that is a combination of information from two or three tables:
columns Haplotype and necessity are from element haplotypings[[1]]$haplotypes in the xml file,
column hapnr gives the PolyHaplotyper equivalents of the Haplotypes,
column score is from element bootstrapping in the xml file,
columns id, number, frequency, homozygous, necessary, distance and neighbours are from (the console) output if present.
The data.frame is ordered by hapnr.
$HaplotypingScore is the single number in $haplotyping[[1]]$score.

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