Description Usage Value Examples
The VirusTreeSimulator
reads files from the sequence sampler in directory indir
and writes detailed nexus files
in directory outdir
for the virus tree simulator. The program generates within-host phylogenies
for sampled and unsampled individuals in a transmission chain along the specified within host coalescent
model. Within-host phylogenies are then concatenated into a between-host phylogeny for each transmission chain.
1 2 3 | cmd.VirusTreeSimulator(indir, infile.trm, infile.ind, outdir, outfile,
prog = PR.VIRUSTREESIMULATOR,
prog.args = "-demoModel Logistic -N0 0.1 -growthRate 1.5 -t50 -4")
|
command line string
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 38 39 40 41 42 43 44 45 46 | ##--------------------------------------------------------------------------------------------------------
## simulate sequence sampling for epi simulation
## sequences are sampled assuming an exponentially growing sequence sampling rate so that
## 1% is sampled in 1980
## 25% is sampled in 2020
## In addition, 10% of transmissions are broken and treated as imported from outside the simulated population.
## The infected of a broken transmission chain is considered a new index case of a transmission chain within the
## simulated population
## Then call virus tree simulator with input args as below
##--------------------------------------------------------------------------------------------------------
## Not run:
indir <- system.file(package="PANGEA.HIV.sim", "misc")
indir <- ifelse(indir=='','/Users/Oliver/git/HPTN071sim/raw_trchain',indir)
# re-name the following:
tmpdir <- '/Users/Oliver/git/HPTN071sim/tmp140910'
dir.create(tmpdir, showWarnings=FALSE)
tmpdir.HPTN071 <- paste(tmpdir,'/HPTN071parser',sep='')
dir.create(tmpdir.HPTN071, showWarnings=FALSE)
# simulation input files from the epi-simulator
infile.ind <- '140716_RUN001_IND.csv'
infile.trm <- '140716_RUN001_TRM.csv'
# input arguments for the pipeline
pipeline.args <- sim.regional.args( yr.start=1980, yr.end=2020, seed=42, s.PREV.min=0.01, s.PREV.max=0.25, epi.dt=1/48, epi.import=0.1,
v.N0tau=3.58e4, v.r=2, v.T50=-1 )
infile.args <- paste(tmpdir,'/',substr(infile.ind, 1, nchar(infile.ind)-7), 'PipeArgs.R',sep='')
save(pipeline.args, file=infile.args)
# get input into 'argv'. this is needed because the input parser is usually called from the command line, and 'argv' mimics the way input is provided when the parser is called from the command line
cmd <- cmd.HPTN071.input.parser.v2(indir, infile.trm, infile.ind, infile.args, tmpdir.HPTN071, infile.trm, infile.ind)
argv <<- unlist(strsplit(cmd,' '))
#
# step: sequence sampler
#
prog.HPTN071.input.parser.v2()
#
# step: virus tree sampler
#
tmpdir.VTS <- paste(tmpdir,'/VirusTreeSimulator',sep='')
dir.create(tmpdir.VTS, showWarnings=FALSE)
# output file prefix for virus tree sampler
outfile <- substr(infile.ind, 1, nchar(infile.ind)-7)
# logistic growth within host coalescent model
prog.args <- paste('-demoModel Logistic -N0 ',pipeline.args['v.N0tau',][,v] ,' -growthRate ', pipeline.args['v.r',][,v],' -t50 ',pipeline.args['v.T50',][,v], sep='')
cmd <- cmd.VirusTreeSimulator(tmpdir.HPTN071, infile.trm, infile.ind, tmpdir.VTS, outfile, prog.args=prog.args)
cat(cmd)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.