Learn R Programming

polyRAD (version 1.1)

PipelineMapping2Parents: Run polyRAD Pipeline on a Mapping Population

Description

This function is a wrapper for AddAlleleFreqMapping, AddGenotypeLikelihood, AddGenotypePriorProb_Mapping2Parents, AddPloidyChiSq, and AddGenotypePosteriorProb. It covers the full pipeline for estimating genotype posterior probabilities from read depth in a "RADdata" object containing data from a mapping population.

Usage

PipelineMapping2Parents(object, n.gen.backcrossing = 0,
                        n.gen.intermating = 0, n.gen.selfing = 0, 
                        donorParentPloidies = object$possiblePloidies, 
                        recurrentParentPloidies = object$possiblePloidies, 
                        minLikelihoodRatio = 10, freqAllowedDeviation = 0.05, 
                        freqExcludeTaxa = c(GetDonorParent(object), 
                                            GetRecurrentParent(object), 
                                            GetBlankTaxa(object)),
                        useLinkage = TRUE, linkageDist = 1e7,
                        minLinkageCorr = 0.5, overdispersion = 9)

Arguments

object

A "RADdata" object.

n.gen.backcrossing

An integer, zero or greater, indicating how many generations of backcrossing to the recurrent parent were performed.

n.gen.intermating

An integer, zero or greater, indicating how many generations of intermating within the population were performed.

n.gen.selfing

An integer, zero or greater, indicating how many generations of selfing were performed.

donorParentPloidies

A list, where each item in the list is an integer vector indicating a potential inheritance mode that could be observed among loci in the donor parent. 2 indicates diploid, 4 indicates autotetraploid, c(2, 2) indicates, allotetraploid, etc.

recurrentParentPloidies

A list in the same format as donorParentPloidies indicating inheritance modes that could be observed among loci in the recurrent parent.

minLikelihoodRatio

The minimum likelihood ratio for determining parental genotypes with confidence, to be passed to GetLikelyGen for both parental taxa.

freqAllowedDeviation

For AddAlleleFreqMapping, the amount by which an allele frequency can deviate from an expected allele frequency in order to be counted as that allele frequency.

freqExcludeTaxa

A character vector indicating taxa to exclude from allele frequency estimates and ploidy \(\chi ^ 2\) estimates.

useLinkage

Boolean. Should genotypes at nearby loci (according to genomic alignment data) be used for updating genotype priors?

linkageDist

A number, in basepairs, indicating the maximum distance for linked loci. Ignored if useLinkage = FALSE.

minLinkageCorr

A number ranging from zero to one. Indicates the minimum correlation coeffienct between weighted mean genotypes at two alleles in order for linkage data to be used for updating genotype priors. Ignored if useLinkage = FALSE.

overdispersion

Overdispersion parameter; see AddGenotypeLikelihood.

Value

A "RADdata" object identical to that passed to the function, with the following slots added: $alleleFreq, $genotypeLikelihood, $priorProb, $priorProbPloidies, $ploidyChiSq, $ploidyChiSqP, and $posteriorProb. See the documentation for the functions listed in the description for more details on the data contained in these slots.

Details

Unlike IterateHWE and IteratePopStruct, PipelineMapping2Parents only runs through each function once, rather than iteratively until convergence.

See Also

SetDonorParent and SetRecurrentParent to indicate which individuals are the parents before running the function.

GetWeightedMeanGenotypes or Export_polymapR for exporting genotypes from the resulting object.

StripDown to remove memory-hogging slots that are no longer needed after the pipeline has been run.

Examples

Run this code
# NOT RUN {
# load data for the example
data(exampleRAD_mapping)

# specify donor and recurrent parents
exampleRAD_mapping <- SetDonorParent(exampleRAD_mapping, "parent1")
exampleRAD_mapping <- SetRecurrentParent(exampleRAD_mapping, "parent2")

# run the pipeline
exampleRAD_mapping <- PipelineMapping2Parents(exampleRAD_mapping,
                                 n.gen.backcrossing = 1)
                                 
# export results
wmgeno <- GetWeightedMeanGenotypes(exampleRAD_mapping)[-(1:2),]
wmgeno
# }

Run the code above in your browser using DataLab