simulateReads: Simulate Reads

Description Usage Arguments Examples

Description

Simulate reads from a kineticModel object. Will simulate data if the input kineticModel does not already contain simulated data.

Usage

1
2
3
4
## S4 method for signature 'kineticModel'
simulateReads(object, expectedLibSize = 10^6,
  replicates = 2, numSpikeIns = 4, spikeInSizes = NULL,
  dispersionModel = NULL, dispByGene = F)

Arguments

object

A kineticModel object

expectedLibSize

The expected total number of reads per sequencing run/batch. May be supplied as a single number which will be applied uniformly, or a vector of library sizes where each element corresponds to the library depth at a given time point.

replicates

Number of replicates per condition

numSpikeIns

The number of unique spike in transcripts used.

spikeInSizes

The expected number of reads for each type of spike in used. May be a single number used for all spike-in transcripts or an array of abundances for each unique spike-in transcript.

dispersionModel

A function for handling dispersions for a negative bionomial model. If dispByGene = TRUE then the function should take a gene index as an input and return a sigle dispersion estimate as an output. If dispByGene = FALSE then the function should take a mean as an input and return a dispersion estimate based on the value of that mean as an output. See the return values from estimateDispersions for examples.

dispByGene

Boolean controlling the expected nature of the dispersionModel. See dispersionModel description for more details.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##setup
bkm = basicKineticModel(times=0:30,synthRate = 1:10,degRate = rep(0.3,10))
bkm = simulateData(bkm) #optional

##mean based dispersion estimation, equal spikeIns
bkm = simulateReads(bkm,expectedLibSize=10^6,replicates=3,numSpikeIns=4,spikeInSizes=200,dispersionModel=function(x){rep(10^4,length(x))},dispByGene=F)

##unequal spike ins
bkm = simulateReads(bkm,expectedLibSize=10^6,replicates=3,numSpikeIns=4,spikeInSizes=c(100,200,100,300),dispersionModel=function(x){rep(10^4,length(x))},dispByGene=F)

##unequal library sizes
els = seq(10^6,10^8,length.out=31)
bkm = simulateReads(bkm,expectedLibSize=els,replicates=3,numSpikeIns=4,spikeInSizes=200,dispersionModel=function(x){rep(10^4,length(x))},dispByGene=F)

ndukler/tkSim documentation built on May 16, 2019, 8:12 p.m.