@@ -202,24 +202,24 @@ task isnvs_per_sample {
202202 }
203203
204204
205- command {
205+ command <<<
206206 intrahost.py --version | tee VERSION
207207 intrahost.py vphaser_one_sample \
208- $ {mapped_bam } \
209- $ {assembly_fasta } \
210- vphaser2 .$ {sample_name }.txt.gz \
211- $ {'--vphaserNumThreads=' + threads } \
212- $ {true ="--removeDoublyMappedReads" false ="" removeDoublyMappedReads } \
213- $ {'--minReadsEach=' + minReadsPerStrand } \
214- $ {'--maxBias=' + maxBias }
215- }
208+ ~ {mapped_bam } \
209+ ~ {assembly_fasta } \
210+ vphaser2 .~ {sample_name }.txt.gz \
211+ ~ {'--vphaserNumThreads=' + threads } \
212+ ~ {true ="--removeDoublyMappedReads" false ="" removeDoublyMappedReads } \
213+ ~ {'--minReadsEach=' + minReadsPerStrand } \
214+ ~ {'--maxBias=' + maxBias }
215+ >>>
216216
217217 output {
218- File isnvsFile = "vphaser2.$ {sample_name }.txt.gz"
218+ File isnvsFile = "vphaser2.~ {sample_name }.txt.gz"
219219 String viralngs_version = read_string ("VERSION" )
220220 }
221221 runtime {
222- docker : "${ docker }"
222+ docker : docker
223223 memory : select_first ([machine_mem_gb , 7 ]) + " GB"
224224 dx_instance_type : "mem1_ssd1_v2_x8"
225225 maxRetries : 2
@@ -250,43 +250,43 @@ task isnvs_vcf {
250250 emailAddress : { description : "email address passed to NCBI if we need to download reference sequences" }
251251 }
252252
253- command {
253+ command <<<
254254 set -ex -o pipefail
255255
256256 intrahost.py --version | tee VERSION
257257
258- SAMPLES = "$ {sep=' ' sampleNames} "
258+ SAMPLES = "~ {sep=' ' sampleNames}"
259259 if [ -n "$SAMPLES " ]; then SAMPLES = "--samples $SAMPLES " ; fi
260260
261- providedSnpRefAccessions = "$ {sep=' ' snpEffRef} "
262- if [ -n "$providedSnpRefAccessions " ]; then
261+ providedSnpRefAccessions = "~ {sep=' ' snpEffRef}"
262+ if [ -n "$providedSnpRefAccessions " ]; then
263263 snpRefAccessions = "$providedSnpRefAccessions " ;
264264 else
265- snpRefAccessions = "$(python -c " from Bio import SeqIO ; print (' ' .join (list (s.id for s in SeqIO.parse ('$ {reference_fasta}' , 'fasta' ))))")"
265+ snpRefAccessions = "$(python -c " from Bio import SeqIO ; print (' ' .join (list (s.id for s in SeqIO.parse ('~ {reference_fasta}' , 'fasta' ))))")"
266266 fi
267267
268268 echo "snpRefAccessions: $snpRefAccessions "
269269
270270 intrahost.py merge_to_vcf \
271- $ {reference_fasta } \
271+ ~ {reference_fasta } \
272272 isnvs.vcf.gz \
273273 $SAMPLES \
274- --isnvs $ {sep =' ' vphaser2Calls } \
275- --alignments $ {sep =' ' perSegmentMultiAlignments } \
274+ --isnvs ~ {sep =' ' vphaser2Calls } \
275+ --alignments ~ {sep =' ' perSegmentMultiAlignments } \
276276 --strip_chr_version \
277- $ {true ="--naive_filter" false ="" naiveFilter } \
277+ ~ {true ="--naive_filter" false ="" naiveFilter } \
278278 --parse_accession
279-
279+
280280 interhost.py snpEff \
281281 isnvs.vcf.gz \
282282 $snpRefAccessions \
283283 isnvs.annot.vcf.gz \
284- $ {'--emailAddress=' + emailAddress }
284+ ~ {'--emailAddress=' + emailAddress }
285285
286286 intrahost.py iSNV_table \
287287 isnvs.annot.vcf.gz \
288288 isnvs.annot.txt.gz
289- }
289+ >>>
290290
291291 output {
292292 File isnvs_vcf = "isnvs.vcf.gz"
@@ -297,7 +297,7 @@ task isnvs_vcf {
297297 String viralngs_version = read_string ("VERSION" )
298298 }
299299 runtime {
300- docker : "${ docker }"
300+ docker : docker
301301 memory : select_first ([machine_mem_gb , 4 ]) + " GB"
302302 dx_instance_type : "mem1_ssd1_v2_x4"
303303 maxRetries : 2
@@ -328,27 +328,27 @@ task annotate_vcf_snpeff {
328328 emailAddress : { description : "email address passed to NCBI if we need to download reference sequences" }
329329 }
330330
331- command {
331+ command <<<
332332 set -ex -o pipefail
333333
334334 intrahost.py --version | tee VERSION
335335
336- providedSnpRefAccessions = "$ {sep=' ' snpEffRef} "
337- if [ -n "$providedSnpRefAccessions " ]; then
336+ providedSnpRefAccessions = "~ {sep=' ' snpEffRef}"
337+ if [ -n "$providedSnpRefAccessions " ]; then
338338 snpRefAccessions = "$providedSnpRefAccessions " ;
339339 else
340- snpRefAccessions = "$(python -c " from Bio import SeqIO ; print (' ' .join (list (s.id for s in SeqIO.parse ('$ {ref_fasta}' , 'fasta' ))))")"
340+ snpRefAccessions = "$(python -c " from Bio import SeqIO ; print (' ' .join (list (s.id for s in SeqIO.parse ('~ {ref_fasta}' , 'fasta' ))))")"
341341 fi
342342 echo "snpRefAccessions: $snpRefAccessions "
343343
344344 vcf_to_use = ""
345- if (file "$ {in_vcf} " | grep -q "gzip" ) ; then
346- echo "$ {in_vcf} is already compressed"
347- vcf_to_use = "$ {in_vcf} "
345+ if (file "~ {in_vcf}" | grep -q "gzip" ) ; then
346+ echo "~ {in_vcf} is already compressed"
347+ vcf_to_use = "~ {in_vcf}"
348348 else
349- echo "$ {in_vcf} is not compressed; gzipping..."
350- bgzip "$ {in_vcf} "
351- vcf_to_use = "$ {in_vcf} .gz"
349+ echo "~ {in_vcf} is not compressed; gzipping..."
350+ bgzip "~ {in_vcf}"
351+ vcf_to_use = "~ {in_vcf}.gz"
352352 fi
353353
354354 # renames the seq id using the first sequence in the alignment
@@ -360,7 +360,7 @@ task annotate_vcf_snpeff {
360360 bgzip -d "temp.vcf.gz"
361361 # rename chr field (first col) in vcf
362362 cat "temp.vcf" | sed "s/^1/$ref_name_no_version /" > "temp2.vcf"
363-
363+
364364 # output the vcf, removing the reference sequence if present as a sample name
365365 bgzip "temp2.vcf"
366366 tabix -p vcf "temp2.vcf.gz"
@@ -377,13 +377,13 @@ task annotate_vcf_snpeff {
377377 echo "Creating vcf index"
378378 bcftools index "$vcf_to_use "
379379 tabix -p vcf "$vcf_to_use "
380-
380+
381381 interhost.py snpEff \
382382 "$vcf_to_use " \
383383 $snpRefAccessions \
384- "$ {output_basename} .annot.vcf.gz" \
385- $ {'--emailAddress=' + emailAddress }
386- }
384+ "~ {output_basename}.annot.vcf.gz" \
385+ ~ {'--emailAddress=' + emailAddress }
386+ >>>
387387
388388 output {
389389 File annot_vcf_gz = "~{output_basename }.annot.vcf.gz"
0 commit comments