Skip to content

Commit

Permalink
Copy intermediate files
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfeil committed Jul 16, 2016
1 parent c570adf commit 173d82d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/toil_scripts/gatk_germline/germline.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def gatk_germline_pipeline(job, uuid, url, config, bai_url=None):
preprocess = job.wrapJobFn(run_gatk_preprocessing, cores, download_bam.rv(), bam_index.rv(),
config['genome.fa'], config['genome.dict'],
config['genome.fa.fai'], config['phase.vcf'],
config['mills.vcf'], config['dbsnp.vcf'], mem=config['xmx'],
config['mills.vcf'], config['dbsnp.vcf'], config['output_dir'],
mem=config['xmx'],
mock=config['mock_mode']).encapsulate()
haplotype_caller = job.wrapJobFn(gatk_haplotype_caller, preprocess.rv(0), preprocess.rv(1), config)

Expand Down
8 changes: 8 additions & 0 deletions src/toil_scripts/tools/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import multiprocessing

from toil_scripts.lib import require
from toil_scripts.lib.files import upload_or_move_job
from toil_scripts.lib.programs import docker_call


Expand Down Expand Up @@ -234,6 +235,7 @@ def run_preprocessing(job, cores, bam, bai, ref, ref_dict, fai, phase, mills, db


def run_gatk_preprocessing(job, cores, bam, bai, ref, ref_dict, fai, phase, mills, dbsnp,
output_dir,
mem='10G', unsafe=False, mock=False):
"""
Pre-processing steps for running the GATK Germline pipeline
Expand All @@ -252,9 +254,12 @@ def run_gatk_preprocessing(job, cores, bam, bai, ref, ref_dict, fai, phase, mill
:return:
"""
rm_secondary = job.wrapJobFn(samtools_view, bam, flag='0x800', mock=mock)
output_rm_secondary = job.wrapJobFn(upload_or_move_job, 'rm_secondary.bam', rm_secondary.rv(), output_dir)
picard_sort = job.wrapJobFn(picard_sort_sam, rm_secondary.rv(), xmx=mem, mock=mock)
output_picard_sort = job.wrapJobFn(upload_or_move_job, 'picard_sort.bam', picard_sort.rv(0), output_dir)
mdups = job.wrapJobFn(picard_mark_duplicates, picard_sort.rv(0), picard_sort.rv(1),
xmx=mem, mock=mock)
output_mdups = job.wrapJobFn(upload_or_move_job, 'mdups.bam', mdups.rv(0), output_dir)
rtc = job.wrapJobFn(run_realigner_target_creator, cores, mdups.rv(0), mdups.rv(1), ref,
ref_dict, fai, phase, mills, mem, unsafe=unsafe, mock=mock)
ir = job.wrapJobFn(run_indel_realignment, rtc.rv(), bam, bai, ref, ref_dict, fai, phase,
Expand All @@ -266,8 +271,11 @@ def run_gatk_preprocessing(job, cores, bam, bai, ref, ref_dict, fai, phase, mill
# Wiring
job.addChild(rm_secondary)
rm_secondary.addChild(picard_sort)
rm_secondary.addChild(output_rm_secondary)
picard_sort.addChild(mdups)
picard_sort.addChild(output_picard_sort)
mdups.addChild(rtc)
mdups.addChild(output_mdups)
rtc.addChild(ir)
ir.addChild(br)
br.addChild(pr)
Expand Down

0 comments on commit 173d82d

Please sign in to comment.