Skip to content

Commit

Permalink
Merge pull request #279 from /issues/278-add-memory-dna-dag
Browse files Browse the repository at this point in the history
Add memory requirement to DNA alignment (resolves #278)
  • Loading branch information
arkal authored May 5, 2018
2 parents 6f71966 + 57c07c2 commit ee863ba
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/protect/alignment/dna.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,35 @@ def align_dna(job, fastqs, sample_type, univ_options, bwa_options):
+- '<sample_type>_fix_pg_sorted.bam.bai': fsID
:rtype: dict
"""
# The mkdup and regroup steps use picard that allots heap space using the Xmx key in the
# univ_options dictionary. This should reflect in the job allotment. Since We want all these
# jobs to occur on the same node, we ened to give them all the same memory requirements.

bwa = job.wrapJobFn(run_bwa, fastqs, sample_type, univ_options, bwa_options,
disk=PromisedRequirement(bwa_disk, fastqs, bwa_options['index']),
memory=univ_options['java_Xmx'],
cores=bwa_options['n'])
sam2bam = job.wrapJobFn(bam_conversion, bwa.rv(), sample_type, univ_options,
bwa_options['samtools'],
disk=PromisedRequirement(sam2bam_disk, bwa.rv()))
disk=PromisedRequirement(sam2bam_disk, bwa.rv()),
memory=univ_options['java_Xmx'])
# reheader takes the same disk as sam2bam so we can serialize this on the same worker.
reheader = job.wrapJobFn(fix_bam_header, sam2bam.rv(), sample_type, univ_options,
bwa_options['samtools'],
disk=PromisedRequirement(sam2bam_disk, bwa.rv()))
disk=PromisedRequirement(sam2bam_disk, bwa.rv()),
memory=univ_options['java_Xmx'])
regroup = job.wrapJobFn(add_readgroups, reheader.rv(), sample_type, univ_options,
bwa_options['picard'],
disk=PromisedRequirement(regroup_disk, reheader.rv()))
disk=PromisedRequirement(regroup_disk, reheader.rv()),
memory=univ_options['java_Xmx'])
mkdup = job.wrapJobFn(mark_duplicates, regroup.rv(), sample_type, univ_options,
bwa_options['picard'],
disk=PromisedRequirement(mkdup_disk, regroup.rv()))
disk=PromisedRequirement(mkdup_disk, regroup.rv()),
memory=univ_options['java_Xmx'])
index = job.wrapJobFn(index_bamfile, mkdup.rv(), sample_type, univ_options,
bwa_options['samtools'], sample_info='fix_pg_sorted',
disk=PromisedRequirement(index_disk, mkdup.rv()))
disk=PromisedRequirement(index_disk, mkdup.rv()),
memory=univ_options['java_Xmx'])
job.addChild(bwa)
bwa.addChild(sam2bam)
sam2bam.addChild(reheader)
Expand Down

0 comments on commit ee863ba

Please sign in to comment.