checkF1 {fitPoly}R Documentation

Identify the best-fitting F1 segregation types

Description

For a given set of F1 and parental samples, this function finds the best-fitting segregation type. It can perform a dosage shift prior to selecting the segregation type.

Usage

checkF1(scores, parent1, parent2, F1, ancestors=character(0),
polysomic, disomic, mixed, ploidy, ploidy2, outfile,
critweight=c(1.0, 0.4, 0.4),
scores_long=TRUE, Pvalue_threshold=0.0001, fracInvalid_threshold=0.05,
fracNA_threshold=0.25, shiftmarkers, parentsScoredWithF1,
shiftParents=parentsScoredWithF1, showAll=FALSE, append_shf=FALSE)

Arguments

scores

A 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), or a data frame as returned by function scores2wide. In the first case (default) parameter scores_long must be TRUE, in the second case it must be FALSE.

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 or other samples of interest. The dosages of these samples will be shown in the output (shifted if shiftParents TRUE) but they are not used in the selection of the segregation type.

polysomic

if TRUE at least all polysomic segtypes are considered; if FALSE these are not specifically selected (but if e.g. disomic is TRUE, any polysomic segtypes that are also disomic will still be considered)

disomic

if TRUE at least all disomic segtypes are considered (see param polysomic)

mixed

if TRUE at least all mixed segtypes are considered (see param polysomic). A mixed segtype occurs when inheritance in one parent is polysomic (random chromosome pairing) and in the other parent disomic (fully preferential chromosome pairing)

ploidy

The ploidy of parent 1 (must be even, 2 (diploid) or larger).

ploidy2

The ploidy of parent 2. If omitted it is assumed to be equal to ploidy.

outfile

the tab-separated text file to write the output to; if NA a temporary file checkF1.tmp is created in the current working directory and deleted at end

critweight

NA or a numeric vector containing the weights of three quality criteria; do not need to sum to 1. If NA, the output will not contain a column qall_weights. Else the weights specify how qall_weights will be calculated from quality parameters q1, q2 and q3.

scores_long

TRUE if scores is in "long format", FALSE if it is in "wide format" (see parameter scores)

Pvalue_threshold

a minimum threshold value for the Pvalue of the bestParentfit segtype (with a smaller Pvalue the q1 quality parameter will be set to 0)

fracInvalid_threshold

a maximum threshold for the fracInvalid of the bestParentfit segtype (with a larger fraction of invalid dosages in the F1 the q1 quality parameter will be set to 0)

fracNA_threshold

a maximum threshold for the fraction of unscored F1 samples (with a larger fraction of unscored samples in the F1 the q3 quality parameter will be set to 0)

shiftmarkers

if specified, shiftmarkers must be a data frame with columns MarkerName and shift; for the markernames that match exactly (upper/lowercase etc) those in scores, the dosages are increased by the amount specified in column shift, e.g. if shift is -1, dosages 2..ploidy are converted to 1..(ploidy-1) and dosage 0 is a combination of old dosages 0 and 1, for all samples. The segregation check is then performed with the shifted dosages. A shift=NA is allowed, these markers will not be shifted. The sets of markers in scores and shiftmarkers may be different, but markers may occur only once in shiftmarkers. A column shift is added at the end of the returned data frame.
If parameter shiftParents is TRUE, the parental and ancestor scores are shifted as the F1 scores, if FALSE they are not shifted.

parentsScoredWithF1

TRUE means parents are scored in the same experiment and the same fitPoly run as the F1, else FALSE. If TRUE, the fraction missing scores and conflicts in the parents tell something about the quality of the scoring. If FALSE (e.g. when the F1 is triploid and the parents are diploid and tetraploid) the quality of the F1 scores can be independent of that of the parents.
If not specified, TRUE is assumed if ploidy2 == ploidy and FALSE if ploidy2 != ploidy

shiftParents

only used if parameter shiftmarkers is specified. If TRUE, apply the shifts also to the parental and ancestor scores. By default TRUE if parentsScoredWithF1 is TRUE, else FALSE

showAll

(default FALSE) if TRUE, for each segtype 3 columns are added to the returned data frame with the frqInvalid, Pvalue and matchParents values for these segtype (see the description of the return value)

append_shf

if TRUE and parameter shiftmarkers is specified, _shf is appended to all marker names where shift is not 0. This is not required for any of the functions in this package but may prevent duplicated marker names when using other software.

Details

For each marker is tested how well the different segregation types fit with the observed parental and F1 dosages. The results are summarized by columns bestParentfit (which is the best fitting segregation type, taking into account the F1 and parental dosages) and columns qall_mult and/or qall_weights (how good is the fit of the bestParentfit segtype: 0=bad, 1=good).
Column bestfit in the results gives the segtype best fitting the F1 segregation without taking account of the parents. This bestfit segtype is used by function correctDosages, which tests for possible "shifts" in the marker models. Both bestfit and bestParentfit are restricted by the parameters polysomic, disomic and mixed. Further they are restricted to segtypes that can only occur when the parental dosages are equal, if parent1 and parent2 list the same samples (but not if both are empty).
In case the parents are not scored together with the F1 (e.g. if the F1 is triploid and the parents are diploid and tetraploid) the scores data frame should be edited to contain the parental as well as the F1 scores. In case the diploid and tetraploid parent are scored in the same run of function fitMarkers (package fitPoly) the diploid is initially scored as nulliplex-duplex-quadruplex (dosage 0, 2 or 4); that must be converted to the true diploid dosage scores (0, 1 or 2). Similar corrections are needed with other combinations, such as a diploid parent scored together with a hexaploid population etc.

Value

A data frame with one row per markers, with the following columns:

qall_mult and/or qall_weights can be used to compare the quality of the SNPs within one analysis and one F1 population but not between analyses or between different F1 populations.
If parameter showAll is TRUE there are 3 additional columns for each segtype with names frqInvalid_<segtype>, Pvalue_<segtype> and matchParent_<segtype>; see the corresponding columns for bestfit for an explanation. These extra columns are inserted directly before the bestfit column.


[Package fitPoly version 4.0.0 Index]