cmd.SeqGen.run: Command line generator for 'prog.PANGEA.SeqGen.run'

Description Usage Value Examples

Description

prog.PANGEA.SeqGen.run reads file infile.sg in directory indir.sg that was created with the SeqGen input file creator. The simulated partial sequences are collected, coerced back into Gag, Pol, Env genes, and written in fasta format to directory outdir. Patient Metavariables are stored in the same directory, and zip files are created.

Usage

1
2
cmd.SeqGen.run(indir.epi, infile.epi, indir.sg, infile.sg, infile.args, outdir,
  prog = PR.SEQGEN.SIMULATOR)

Value

command line string

Examples

 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
61
62
63
64
65
66
67
68
69
##--------------------------------------------------------------------------------------------------------
##	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
##	4)
##	Call SeqGen and clean up
##--------------------------------------------------------------------------------------------------------
## 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/tmp140908'
#	simulation input files from the epi-simulator
infile.ind		<- '140716_RUN001_IND.csv'
infile.trm		<- '140716_RUN001_TRM.csv'
#	
#	step: sequence sampler
#
tmpdir.HPTN071	<- paste(tmpdir,'/HPTN071parser',sep='')
dir.create(tmpdir.HPTN071, showWarnings=FALSE)
#	output files from the sequence sampler
outfile.ind		<- '140716_RUN001_IND.csv'
outfile.trm		<- '140716_RUN001_TRM.csv'
#	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, tmpdir.HPTN071,  infile.trm, infile.ind)				 
argv			<<- unlist(strsplit(cmd,' '))
#	run the 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)
prog.args		<- '-demoModel Logistic -N0 100000 -growthRate 0.0001 -t50 -0.04'
#	Ne=1.5e5 times 2 days generation time
#prog.args		<- '-demoModel Logistic -N0 300000 -growthRate XXX -t50 -XXX'
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, tmpdir.SG)
argv			<<- unlist(strsplit(cmd,' '))
prog.PANGEA.SeqGen.createInputFile()
#	
#	step: run Seq-Gen and clean up
#
outfile			<- substr(infile.ind, 1, nchar(infile.ind)-7)
cmd				<- cmd.SeqGen.run(tmpdir.HPTN071, infile.epi, tmpdir.SG, outfile, tmpdir)
argv			<<- unlist(strsplit(cmd,' '))
prog.PANGEA.SeqGen.run()

## End(Not run)

olli0601/PANGEA.HIV.sim documentation built on May 24, 2019, 12:52 p.m.