-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add piped input tests for RevertSam, MergeBamAlignment #1974
Conversation
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.
I assume you tested that the tests fail when you don't have that work around in place One request for additional comment and then good to merge. Thank you!
@@ -269,7 +269,7 @@ protected int doWork() { | |||
} | |||
|
|||
final boolean sanitizing = SANITIZE; | |||
final SamReader in = SamReaderFactory.makeDefault().referenceSequence(referenceSequence.getReferencePath()).validationStringency(VALIDATION_STRINGENCY).open(SamInputResource.of(INPUT.toPath())); // tsato: confirm this won't break piped input | |||
final SamReader in = SamReaderFactory.makeDefault().referenceSequence(referenceSequence.getReferencePath()).validationStringency(VALIDATION_STRINGENCY).open(SamInputResource.of(INPUT.toPath())); |
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.
@takutosato Could you put a comment here referencing this PR or the related issue? Just too save us some time when we forget and someone tries to change it.
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.
Done
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.
👍
@lbergelson yes the test fails when the workaround is removed. |
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.
👍
Description
When we cloudify a Picard tool, we change the input and output file types from
FILE
toPicardHtsPath.
This could trigger a "java.io.IOException: Illegal seek" if the input SAM is piped (/dev/stdin). I believe this is related to a known issue (see samtools/htsjdk#1084, samtools/htsjdk#1077). The workaround is to wrap a Path object inSamInputResource.of()
, which was put in place in samtools/htsjdk#1124. The tests in PR should safeguard us from inadvertently removing the workaround until a more robust fix can be implemented.The targeted tools are RevertSam and MergeBamAlignment, both of which are used with piped input in warp pipelines. For example, see
https://github.com/broadinstitute/warp/blob/develop/tasks/broad/UltimaGenomicsWholeGenomeGermlineTasks.wdl
https://github.com/broadinstitute/warp/blob/develop/tasks/broad/Alignment.wdl
To reproduce the bug, change Line 272 of RevertSam from:
to
That is, remove the wrapper
SamInputResource.of()
.Checklist (never delete this)
Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.
Content
Review
For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests