-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix SB tag parsing #1203
fix SB tag parsing #1203
Conversation
Test PASSed. |
Note - I realize its less than ideal that so many count assertions had to be changed in the tests in this PR due to changing of small.vcf For the multi-allele issue in #1202 I'll look at making a new test vcf file in another directory so as to not have side effects on the counts, and we may also want to find an alternative in this PR's test component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM! I'm OK with the .count
s changing throughout the test suite. That's not a big issue from my side. Thanks for taking this on, @jpdna!
@@ -17,6 +17,9 @@ | |||
*/ | |||
package org.bdgenomics.adam.converters | |||
|
|||
import scala.collection.JavaConversions._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: these should go at the end. Actually, we should lex sort all the imports here, since it should be htsjdk
, org.apache
, then scala
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, no whitespace.
* @param attr Attribute to convert. | ||
* @return Attribute as a java.util.List[Integer] | ||
*/ | ||
private def attrAsIntList(attr: Object): Object = attr match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test that covers this function?
@@ -187,7 +201,7 @@ private[converters] object VariantAnnotationConverter extends Serializable { | |||
AttrKey("phaseQuality", attrAsInt _, new VCFFormatHeaderLine(VCFConstants.PHASE_QUALITY_KEY, 1, VCFHeaderLineType.Float, "Read-backed phasing quality")), | |||
AttrKey("phaseSetId", attrAsInt _, new VCFFormatHeaderLine(VCFConstants.PHASE_SET_KEY, 1, VCFHeaderLineType.Integer, "Phase set")), | |||
AttrKey("minReadDepth", attrAsInt _, new VCFFormatHeaderLine("MIN_DP", 1, VCFHeaderLineType.Integer, "Minimum DP observed within the GVCF block")), | |||
AttrKey("strandBiasComponents", attrAsInt _, new VCFFormatHeaderLine("SB", 4, VCFHeaderLineType.Integer, "Per-sample component statistics which comprise the Fisher's Exact Test to detect strand bias.")) | |||
AttrKey("strandBiasComponents", attrAsIntList _, new VCFFormatHeaderLine("SB", 4, VCFHeaderLineType.Integer, "Per-sample component statistics which comprise the Fisher's Exact Test to detect strand bias.")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a doc link for the SB
tag being used for genotypes (i.e. as a FORMAT key)? What are the 4 different values? Are there always 4 values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GATK docs define it as always with Number=4
https://software.broadinstitute.org/gatk/gatkdocs/org_broadinstitute_gatk_tools_walkers_annotator_StrandBiasBySample.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SB components are a 2x2 matrix: forward/rev strand on one axis, ref/alt on the other axis
Ping @jpdna for adding tests, small import cleanup, then I am good to merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jpdna; additional commit looks good. I will squash down and merge when tests pass.
Test FAILed. Build result: FAILURE[...truncated 3 lines...]Building remotely on amp-jenkins-worker-05 (centos spark-test) in workspace /home/jenkins/workspace/ADAM-prbWiping out workspace first.Cloning the remote Git repositoryCloning repository https://github.com/bigdatagenomics/adam.git > /home/jenkins/git2/bin/git init /home/jenkins/workspace/ADAM-prb # timeout=10Fetching upstream changes from https://github.com/bigdatagenomics/adam.git > /home/jenkins/git2/bin/git --version # timeout=10 > /home/jenkins/git2/bin/git -c core.askpass=true fetch --tags --progress https://github.com/bigdatagenomics/adam.git +refs/heads/:refs/remotes/origin/ # timeout=15 > /home/jenkins/git2/bin/git config remote.origin.url https://github.com/bigdatagenomics/adam.git # timeout=10 > /home/jenkins/git2/bin/git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > /home/jenkins/git2/bin/git config remote.origin.url https://github.com/bigdatagenomics/adam.git # timeout=10Fetching upstream changes from https://github.com/bigdatagenomics/adam.git > /home/jenkins/git2/bin/git -c core.askpass=true fetch --tags --progress https://github.com/bigdatagenomics/adam.git +refs/pull/:refs/remotes/origin/pr/ # timeout=15 > /home/jenkins/git2/bin/git rev-parse origin/pr/1203/merge^{commit} # timeout=10 > /home/jenkins/git2/bin/git branch -a --contains 213dda5 # timeout=10 > /home/jenkins/git2/bin/git rev-parse remotes/origin/pr/1203/merge^{commit} # timeout=10Checking out Revision 213dda5 (origin/pr/1203/merge) > /home/jenkins/git2/bin/git config core.sparsecheckout # timeout=10 > /home/jenkins/git2/bin/git checkout -f 213dda53041f413f1501f44eb4e88ee9deb2f339First time build. Skipping changelog.Triggering ADAM-prb ? 2.6.0,2.11,1.5.2,centosTriggering ADAM-prb ? 2.6.0,2.10,1.5.2,centosTouchstone configurations resulted in FAILURE, so aborting...Notifying endpoint 'HTTP:https://webhooks.gitter.im/e/ac8bb6e9f53357bc8aa8'Test FAILed. |
This test failure is weird - and only on Spark 1.5.2, and I wouldn't think that the very last commit would have broken anything related to these failures. Thoughts? |
Note that the build matrix chart doesn't accurately show what happened here, to keep build times down, Jenkins only builds 2.6.0,2.10,1.5.2,centos and 2.6.0,2.11,1.5.2,centos. If those builds succeed, then it builds out the rest of the matrix. So in this case, the two red dots represent new failed builds from this pull request, and the green dots are successful builds from something earlier. It appears you need to update the new pipe API related tests to match the VCF changes you made in this pull request. |
Test failures repro for me locally. But, it's a simple fix. Will shoot your way in 1 min @jpdna . |
@jpdna I've opened PR #1209 with 3536385, which fixes the issue. We added two tests in #1114 that used the VCF that you added a record to, so I just updated the tests to account for the new record. I also rebased your PR on ToT. Let me know if #1209 looks good to you, and I will squash it down and merge it when tests pass. |
My mistake here is that I should have re-based before the PR myself first, and then I would have seen the failure locally that Jenkins saw - correct? Yes - #1209 looks good to me. Thanks! |
Yeah, exactly. No worries! I did the same thing yesterday with #1114, actually... |
The SB tag defined as "Per-sample component statistics which comprise the Fisher's Exact Test to detect strand bias":
is not parsed properly in existing code or covered by tests.
This came to light in trying to parse the gVCF file:
http://bioinformaticstools.mayo.edu/research/wp-content/plugins/download.php?url=https://s3-us-west-2.amazonaws.com/mayo-bic-tools/variant_miner/gvcfs/NA12878.chr22.g.vcf.gz
This PR correctly parses this SB tag and adds a variant with this tag to
small.vcf
and updates tests.