Description Usage Value Examples
The prog.PANGEA.SeqGen.createInputFile
reads files from the virus tree simulator in directory indir.vts
and writes input files for SeqGen
to directory outdir
. The program reads simulated transmission chain phylogenies with branches in units of calendar time
for sampled and unsampled individuals in a transmission chain. Within host evolutionary rates are drawn from a distribution, and
within host branch lengths are converted into the expected number of substitutions along the branch. Transmission branches are
multiplied with a multiplier to allow for slower evolution between hosts. The multiplier is drawn from a distribution. Starting sequences
are drawn from a pool of precomputed sequences. GTR parameters are drawn from a distribution. This is all that s needed to specify
the SeqGen input files for each transmission chain.
1 2 | cmd.SeqGen.createInputFiles(indir.epi, infile.epi, indir.vts, infile.vts,
infile.args, outdir, prog = PR.SEQGEN.FILECREATOR)
|
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ##--------------------------------------------------------------------------------------------------------
## 1)
## 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
## 2)
## Call virus tree simulator with input args as below
## 3)
## Call SeqGen input file creator
##--------------------------------------------------------------------------------------------------------
## 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()
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)
# TODO run this command
cat(cmd)
#
# step: Seq-Gen input file creator
#
tmpdir.SG <- paste(tmpdir,'/SeqGen',sep='')
dir.create(tmpdir.SG, showWarnings=FALSE)
infile.epi <- paste( substr(infile.ind, 1, nchar(infile.ind)-7),'SAVE.R', sep='' )
infile.vts <- substr(infile.ind, 1, nchar(infile.ind)-7)
cmd <- cmd.SeqGen.createInputFiles(tmpdir.HPTN071, infile.epi, tmpdir.VTS, infile.vts, infile.args, tmpdir.SG)
argv <<- unlist(strsplit(cmd,' '))
prog.PANGEA.SeqGen.createInputFile()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.