Skip to content

Copy of mitochondria best practices pipeline - #5566

Merged
meganshand merged 17 commits into
masterfrom
ms_wdl_mt
Jan 25, 2019
Merged

meganshand merged 17 commits into
masterfrom
ms_wdl_mt

Conversation

@meganshand

Copy link
Copy Markdown
Contributor

@ldgauthier or @jsotobroad Could you take a quick look? This is a direct copy of the wdls in the spec-ops repo.

@codecov-io

codecov-io commented Jan 9, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #5566 into master will decrease coverage by 0.012%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##              master     #5566       +/-   ##
===============================================
- Coverage     87.046%   87.034%   -0.012%     
- Complexity     31524     31535       +11     
===============================================
  Files           1928      1930        +2     
  Lines         145340    145443      +103     
  Branches       16089     16090        +1     
===============================================
+ Hits          126513    126585       +72     
- Misses         12966     12999       +33     
+ Partials        5861      5859        -2
Impacted Files Coverage Δ Complexity Δ
...r/tools/walkers/mutect/Mutect2FilteringEngine.java 80.743% <0%> (-4.581%) 89% <0%> (ø)
...ute/hellbender/utils/test/FuncotatorTestUtils.java 95.161% <0%> (-3.084%) 7% <0%> (+1%)
...GATKPlugin/GATKReadFilterPluginDescriptorTest.java 88.62% <0%> (-1.76%) 48% <0%> (+1%)
...Plugin/GATKAnnotationPluginDescriptorUnitTest.java 88.235% <0%> (-1.43%) 58% <0%> (+1%)
.../tools/walkers/haplotypecaller/RefVsAnyResult.java 100% <0%> (ø) 3% <0%> (+1%) ⬆️
...ools/walkers/annotator/VariantAnnotatorEngine.java 91.304% <0%> (ø) 70% <0%> (ø) ⬇️
...line/GATKPlugin/testpluggables/TestAnnotation.java 0% <0%> (ø) 0% <0%> (?)
...line/GATKPlugin/testpluggables/TestReadFilter.java 0% <0%> (ø) 0% <0%> (?)
...nder/tools/funcotator/FuncotatorTestConstants.java 98.333% <0%> (+0.028%) 1% <0%> (ø) ⬇️
...dataSources/vcf/VcfFuncotationFactoryUnitTest.java 98.104% <0%> (+0.055%) 30% <0%> (+1%) ⬆️
... and 11 more

@lbergelson

Copy link
Copy Markdown
Contributor

Do we want a test for this wdl like the others do?

@meganshand

Copy link
Copy Markdown
Contributor Author

Ok, we have a working test! It runs the plumbing NA12878 through the whole pipeline. @ldgauthier or @jsotobroad this is ready for review (the wdl is a direct copy with one change to add more memory to RevertSam because I tested it with PAPI v2 and it needed more memory than was specified). Thanks!

@jsotobroad jsotobroad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments/questions

Comment thread .travis.yml
@@ -94,7 +94,7 @@ before_install:
fi;
# Download Cromwell jar -- if you change the version, please change the CROMWELL_JAR env variable above, too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might have to do this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Cromwell bump necessary for this PR? If so, we should go back and update all other WDLs as appropriate. This is long overdue and would be good to get done before 4.1, anyway.

BTW, does this change the verbosity of the Travis logs?

@droazen @davidbenjamin @LeeTL1220 might want to chime in.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the Cromwell bump was necessary to get the mitochondria wdl to work. The only change I needed to make to get the other wdls to work was change the imports in the CNV wdl. At some point they changed to relative paths (the import is now a relative path from the wdl itself). But nothing else I saw needed updating.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does 36 still require exposing all task-level parameters for a subworkflow in order to access them from a higher workflow? See #3980. I haven't been keeping tabs on things like this. Also there are things like #5015.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meganshand I do not know if this will change the verbosity.

sudo java -jar $CROMWELL_JAR run $WORKING_DIR/gatk/scripts/mutect2_wdl/mutect2_multi_sample.wdl -i $WORKING_DIR/test_m2_wdl_multi_mod_to.json -m $WORKING_DIR/test_m2_wdl_to.metadata

echo "Running Mitochondria M2 WDL through cromwell"
sudo java -jar $CROMWELL_JAR run $WORKING_DIR/gatk/scripts/mitochondria_m2_wdl/MitochondriaPipeline.wdl -i $WORKING_DIR/gatk/scripts/m2_cromwell_tests/test_mitochondria_m2_wdl.json --imports $WORKING_DIR/gatk/scripts/mitochondria_m2_wdl/MitochondriaPipelineDependencies.zip -m $WORKING_DIR/test_mitochondria_m2_wdl.metadata

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this test be run under .../m2_cromwell_tests/...? (not sure if this is a m2 test or if it should be in its own directory)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok in the m2 tests. It doesn't make the testing take any longer (since the integration tests are still longer than the m2 wdl tests) and I think this keeps the wdl tests cleaner.

@@ -0,0 +1,169 @@
workflow AlignmentPipeline {
meta {
description: "Input is an unaligned subset bam of NuMT and chrM reads and their mates. All reads must be paired. Output is aligned duplicate marked coordinate sorted bam."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a parameter_meta description 😅 instead of what the pipeline does

@davidbenjamin

Copy link
Copy Markdown
Contributor

@samuelklee @meganshand I don't object to any cromwell changes here. We're holding off on all our overdue M2 WDL changes while waiting for Firecloud to adopt WDL 1.0.

Comment thread .travis.yml
@@ -94,7 +94,7 @@ before_install:
fi;
# Download Cromwell jar -- if you change the version, please change the CROMWELL_JAR env variable above, too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meganshand I do not know if this will change the verbosity.

@ldgauthier ldgauthier left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some easy suggestions. The hardest part will be moving the docker images out of personal repos. I'm honestly not sure what the use case for parameters_meta is, but I wanted to make sure you had it where you thought it was necessary.

Did we ever commit the NuMT processing script? That doesn't have to go here, but it should be somewhere quasi-public.


# set the bash variable needed for the command-line
bash_ref_fasta=${ref_fasta}
java -Xms5000m -jar /usr/gitc/picard.jar \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to lead the charge, but someday we'll update to Barclay args. That's just FYI -- this is fine for now.

@@ -0,0 +1,28 @@
{
"MitochondriaPipeline.wgs_aligned_input_bam": "input_bam_here",
"MitochondriaPipeline.autosomal_coverage": 30,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be modified to match the input bam, right? Can you put a comment? Otherwise at first glance it looks like a constant.

@@ -0,0 +1,217 @@
workflow MitochondriaCalling {
meta {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The in other WDL there's whitespace before meta, but I'm not a stickler. Should there be parameter_meta here for inputs and outputs? I'm not up on the latest and greatest WDL features.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the whitespace. I think the parameter_meta is optional, just another place for documentation. I'm not inclined to list out every single input and output file (too many reference files), but I can put some documentation for the unclear/major ones.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

File blacklisted_sites_index
Float? autosomal_coverage
Float contamination
#max_read_length is only used for an optimization. If it's too small CollectWgsMetrics might fail, but the results are not effected by this number.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effected -> affected (https://www.diffen.com/difference/Affected_vs_Effected) Okay, maybe I'm a stickler sometimes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugh I always get this one wrong

input_bam: "Aligned Bam"
gga_vcf: "VCF for genotype given alleles mode"
prune: "Pruning factor should be approximately (mean coverage / 500)"
autosomal_coverage: "Median coverage of the autosome for annotating potential polymorphic NuMT variants"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autosomeS

Int disk_size = ceil(size(input_bam_regular_ref, "GB") + size(input_bam_shifted_ref, "GB") + size(ref_fasta, "GB") * 2) + 20

meta {
description: "Remove this hack once there's a GVCF solution."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-D This note is a little more useful in the workflow, though.

runtime {
disks: "local-disk 10 HDD"
memory: "1200 MB"
docker: "mshand/genomesinthecloud:bcftools"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put this somewhere else?

#left align the variants
cmd = """bcftools norm -f ${ref_fasta} pre2_split.vcf > split.vcf""".format(**locals())
result, err = Popen([cmd], stdout=PIPE, stderr=PIPE, shell=True).communicate()
CODE

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was terrifying. I'm going to pretend I never saw it so I don't have nightmares. Do we have a long-term solution?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably remove this from the gatk version, but unfortunately it has to be in the firecloud version for now, since it's for Kristen. I think the long term solution is that hail should be able to handle multi-allelics? I forget where we landed on this.

preemptible: select_first([preemptible_tries, 5])
memory: "3 GB"
disks: "local-disk " + disk_size + " HDD"
docker: "jsotobroad/mtdnaserver:latest"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather put this image somewhere else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but the question was where. Since this will eventually end up in production the idea was that it would eventually end up in the official us.gcr.io/broad-gotc-prod/genomes-in-the-cloud docker images, but it's hard to ask green to make it now before we give them an official pipeline. So for now, this is a public image and eventually we'll be able to update this.

runtime {
disks: "local-disk " + disk_size + " HDD"
memory: "1200 MB"
docker: "us.gcr.io/broad-gotc-prod/genomes-in-the-cloud:2.4.1-1540490856"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this private or is it the one gatk-workflows uses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't private. It's the official one from production. It also looks like gatk-worfkows uses it.

@meganshand

Copy link
Copy Markdown
Contributor Author

@ldgauthier Back to you!

@meganshand

Copy link
Copy Markdown
Contributor Author

@ldgauthier Tests are now passing and we no longer have a personal docker image in the wdl. Back to you!

@ldgauthier ldgauthier left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,217 @@
workflow MitochondriaCalling {
meta {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@meganshand
meganshand merged commit 1ea1036 into master Jan 25, 2019
@meganshand
meganshand deleted the ms_wdl_mt branch January 25, 2019 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants