Description Details Author(s) References Examples
Functions for inference of ploidy from (Genotyping-by-sequencing) GBS data, including a function to infer allelic ratios and allelic proportions in a Bayesian framework.
The DESCRIPTION file:
This package was not yet installed at build time.
Index: This package was not yet installed at build time.
A typical analysis will begin by estimating allelic proportions using the estprops
function. This is done in a Bayesian framework and is the most computationally intensive part of the analysis (i.e., depending on the size of the data set, this might take a day or more). This function depends on rjags
, which means the user needs to install the stand-alone program JAGS
as well. Principal component analysis and discriminant analysis are then used to obtain cytotype assignment probabilities via the estploidy
function. This can be done with or without a training set of individuals with known ploidies.
Zachariah Gompert
Maintainer: Zachariah Gompert <zach.gompert@usu.edu>
Gompert Z. and Mock K. (XXXX) Detection of individual ploidy levels with genotyping-by-sequencing (GBS) analysis. Molecular Ecology Resources, submitted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ## load a simulated data set
data(dat)
## Not run:
## obtain posterior estimates of allelic proportions; short chains are used for
## the example, we recommend increasing this to at least 1000 MCMC steps with a
## 500 step burnin
props<-estprops(cov1=t(dat[[1]]),cov2=t(dat[[2]]),mcmc.steps=20,mcmc.burnin=5,
mcmc.thin=2)
## calculate observed heterozygosity and depth of coverage from the allele count
## data
hx<-apply(is.na(dat[[1]]+dat[[2]])==FALSE,1,mean)
dx<-apply(dat[[1]]+dat[[2]],1,mean,na.rm=TRUE)
## run estploidy without using known ploidy data
pl<-estploidy(alphas=props,het=hx,depth=dx,train=FALSE,pl=NA,set=NA,nclasses=2,
ids=dat[[3]],pcs=1:2)
## boxplots to visualize posterior assignment probabilities by true ploidy
## (which is known because these are simulated data)
boxplot(pl$pp[,1] ~ dat[[3]],ylab="assignment probability",xlab="ploidy")
## run estploidy with a training data set with known ploidy; the data set is
## split into 100 individuals with known ploidy and 100 that are used for
## inference
truep<-dat[[3]]
trn<-sort(sample(1:200,100,replace=FALSE))
truep[-trn]<-NA
plt<-estploidy(alphas=props,het=hx,depth=dx,train=TRUE,pl=truep,set=trn,
nclasses=2,ids=dat[[3]],pcs=1:2)
## boxplots to visualize posterior assignment probabilities for individuals that
## were not part of the training set by true ploidy (which is known because
## these are simulated data)
boxplot(plt$pp[,1] ~ dat[[3]][-trn],ylab="assignment probability",xlab="ploidy")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.