readSimulation {cancerTiming} | R Documentation |
Simulate reads based on an event matrix
Description
Simulate reads based on an event matrix
Usage
readSimulation(B, alleleSet, q, totalCopy, mutRate = NULL, seqError = 0,
fixedN = FALSE, normCont = 0, aveReadCoverage = 30, countDistribution = NULL)
Arguments
B |
the number of simulated data sets to make |
alleleSet |
a vector of expected allele frequencies, without contamination or sequencing error accounted for |
q |
integer. the number of expected allele frequencies??? |
totalCopy |
integer. The total number of copies in the final stage, i.e. at the end of the event |
mutRate |
a number between 0 and 1. The mutation rate, defined as the number of mutations observed divided by number of nucleotides sequenced or examined |
seqError |
a number between 0 and 1 representing the sequencing error. The default value is 0, i.e. no sequencing error. |
fixedN |
logical. Should the number of mutations be fixed? By default set to FALSE. If set to TRUE, the expected number of mutations is used, i.e. mutRate*B |
normCont |
a number between 0 and 1 describing the amount of normal contamination present in the sample. The default value is 0, i.e. no normal contamination. |
aveReadCoverage |
average read coverage of an allele. The default value is 30 reads per allele. |
countDistribution |
optional. Provide an empirical distribution for read coverage. If given, the argument aveReadCoverage is ignored, and the mean of the empirical distribution is used. By default, set to NULL. |
Value
Returns a data frame with simulated read counts under the normal contamination, sequencing error, allele frequency distribution, and read count distributions provided.
Author(s)
Elizabeth Purdom
Examples
#simulate from CNLOH event with pi[0]=.1
Amat<-makeEventHistory(totalCopy=2,type="LOH")[[1]]
piVal<-c(.1,.9)
qvec<-prop.table(Amat%*%piVal)
sims<-readSimulation(10, alleleSet=allAF(totalCopy=2)[[1]], q=qvec,
totalCopy=2, mutRate = 100, seqError = 0.1, fixedN = TRUE,
normCont = 0.1, aveReadCoverage = 30)