writeDosagefile: Write a file with segregation types and dosage scores

View source: R/fitPolyTools.R

writeDosagefileR Documentation

Write a file with segregation types and dosage scores

Description

Write a file with for each marker the segregation type and the dosage scores of the parental and ancestor samples, the parental consensus dosages and the F1 samples.

Usage

writeDosagefile(chk, scores, parent1, parent2, F1,
ancestors=character(0), other=character(0),
polysomic=TRUE, disomic=FALSE, mixed=FALSE,
ploidy, ploidy2, shiftParents, scorefile)

Arguments

chk

data frame as returned by checkF1

scores

data frame as read from the scores file produced by function fitMarkers of package fitPoly (or a subset with at least columns MarkerName, SampleName and geno)

parent1

character vector with the sample names of parent 1

parent2

character vector with the sample names of parent 2

F1

character vector with the sample names of the F1 individuals

ancestors

character vector with the sample names of any other ancestors

other

other samples that should be treated like the F1

polysomic

TRUE or FALSE; should be the same as used by checkF1 to calculate the chk data frame

disomic

TRUE or FALSE; should be the same as used by checkF1 to calculate the chk data frame

mixed

TRUE or FALSE; should be the same as used by checkF1 to calculate the chk data frame

ploidy

the ploidy of parent 1 (must be even, 2 (diploid) or larger) and the same as used by checkF1 to calculate the chk data frame

ploidy2

the ploidy of parent 2. If omitted it is assumed to be equal to ploidy. Should be the same as used by checkF1 to calculate the chk data frame

shiftParents

if there is a column shift in chk the F1 dosages will be shifted. If shiftParents is TRUE the parents and ancestors will be shifted together with the F1, if FALSE only the F1 will be shifted in that case.
If shiftParents is missing or NA it will be set to TRUE except if ploidy2 != ploidy: in that case this will result in an error (because it may be that the parents are not genotyped or scored together with the F1, the user should specify explicitly what to do)

scorefile

filename for tab-separated text file with the dosages,; if NA no file is written. For details of the contents see the return value

Value

A data frame with columns:

  • MarkerName: the name of the marker

  • segtype: the segregation type

  • parental and ancestor samples: the dosages of those samples

  • parent1: the consensus dosage for parent1 as determined by checkF1

  • parent2: the consensus dosage for parent2 as determined by checkF1

  • F1 samples: the dosages for those samples

  • other samples: the dosages for those samples


fitPoly documentation built on April 3, 2025, 8:58 p.m.