-
Notifications
You must be signed in to change notification settings - Fork 592
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
Support for flow based sequencing #7876
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
3bc069d
Squashed changes brought in by flow based support
ilyasoifer cd53841
MERGE fixes WIP
ilyasoifer 0ab1477
Merge fixes
ilyasoifer 1ab0d75
Fixed ClipAdapters test that was broken during code refactor
ilyasoifer a148f47
Output for cram splitter fixed
ilyasoifer 33f7577
Fixed what seems to be a bug in adding allele to the last base
ilyasoifer 82bab71
Chances that the Assembly bug is solved
ilyasoifer 46ec62e
Ramp test upated
ilyasoifer f821535
fixed a rebase issue for loop in the readThradingAssembler
jamesemery 5ddb833
cleaning up mistaken gga code in assembly from rebase
jamesemery ce8d3b1
removing failed documenation line from WellbasedFlowBasedReadFilter
jamesemery e2be5d6
removing failed documenation line from WellbasedFlowBasedReadFilter
jamesemery 5d705d2
Fixed an edge case in insertAllele when deleting the edge bases
ilyasoifer 8cce72c
fixed a very rare edge case in the adaptive chain pruner where the ja…
jamesemery 1e913cf
re-creation of #113 to the correct branch (#122)
ilyasoifer f85c60a
fixing rebase issue
jamesemery e433e15
Fixing a bug in allele filtering (#7877)
ilyasoifer ddfa3f5
Test fix
ilyasoifer de2035f
Ramped tests updated
ilyasoifer 6fc79b9
temporary fix
ilyasoifer c65b47a
Reverted test
ilyasoifer 1737bba
Fixed data files
ilyasoifer b3e418a
slightly improving the error message for this zip utility
jamesemery 5459af0
Fixed the Zip comaprison to hopefully be agnostic to filecompression
jamesemery 9253917
updating the test hopefully one last time
jamesemery 6a19613
i have no idea why the index bytes mismatch inside of the zip file so…
jamesemery 3ce718d
Lookahead Covariates moved to UG_feature_branch
dror27 64990d2
(post filter) read transformers can be added on command line
dror27 4a990c0
Quality and attribute mappers
dror27 a285cee
Revert "Quality and attribute mappers"
dror27 0038bb2
Revert "(post filter) read transformers can be added on command line"
dror27 efe28a3
throwing in the towel
jamesemery 8df983e
more random bits
jamesemery cf5c0ce
a cudgle to fix the memory
jamesemery 3135494
fixed the zip test and added a utility to unzip archives to files
jamesemery 8baee5c
annoying test
jamesemery a6f439f
SplitCRAM: limit number of output shards
dror27 70463ba
PR fixes
ilyasoifer 4b29a5f
DK PR Changes
dror27 862bbe7
PR comments
ilyasoifer d3c7cf4
PR comments
ilyasoifer e8926ea
adding documentation for RawGtCount
meganshand cc670d2
removed cloudbuild.yml
jamesemery 1c8d481
resolving various issues from the code review comments
jamesemery cd5bd81
added documented feature to the new flow based read filters
jamesemery 825a63f
Revert "Lookahead Covariates moved to UG_feature_branch"
dror27 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/org/broadinstitute/hellbender/cmdline/programgroups/FlowBasedProgramGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.broadinstitute.hellbender.cmdline.programgroups; | ||
|
||
import org.broadinstitute.barclay.argparser.CommandLineProgramGroup; | ||
import org.broadinstitute.hellbender.utils.help.HelpConstants; | ||
|
||
/** | ||
* Tools that perform variant calling and genotyping for short variants (SNPs, SNVs and Indels) on | ||
* flow-based sequencing platforms | ||
*/ | ||
public class FlowBasedProgramGroup implements CommandLineProgramGroup { | ||
|
||
@Override | ||
public String getName() { return HelpConstants.DOC_CAT_SHORT_FLOW_BASED; } | ||
|
||
@Override | ||
public String getDescription() { return HelpConstants.DOC_CAT_SHORT_FLOW_BASED_SUMMARY; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/main/java/org/broadinstitute/hellbender/engine/PartialReadWalker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package org.broadinstitute.hellbender.engine; | ||
|
||
import org.broadinstitute.hellbender.engine.filters.CountingReadFilter; | ||
import org.broadinstitute.hellbender.utils.SimpleInterval; | ||
import org.broadinstitute.hellbender.utils.read.GATKRead; | ||
|
||
import java.util.Spliterator; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
import java.util.function.BiConsumer; | ||
import java.util.stream.Stream; | ||
|
||
/** | ||
* A specialized read walker that may be gracefully stopped before the input stream ends | ||
* | ||
* A tool derived from this class should implement {@link PartialReadWalker#shouldExitEarly(GATKRead)} | ||
* to indicate when to stop. This method is called before {@link ReadWalker#apply(GATKRead, ReferenceContext, FeatureContext)} | ||
* | ||
*/ | ||
abstract public class PartialReadWalker extends ReadWalker { | ||
|
||
/** | ||
* traverse is overridden to consult the implementation class whether to stop | ||
* | ||
* The stoppage is implemented using a custom forEach method to compensate for the | ||
* lack of .takeWhile() in Java 8 | ||
*/ | ||
|
||
@Override | ||
public void traverse() { | ||
|
||
final CountingReadFilter countedFilter = makeReadFilter(); | ||
breakableForEach(getTransformedReadStream(countedFilter), (read, breaker) -> { | ||
|
||
// check if we should stop | ||
if ( shouldExitEarly(read) ) { | ||
breaker.set(true); | ||
} else { | ||
// this is the body of the iteration | ||
final SimpleInterval readInterval = getReadInterval(read); | ||
apply(read, | ||
new ReferenceContext(reference, readInterval), // Will create an empty ReferenceContext if reference or readInterval == null | ||
new FeatureContext(features, readInterval)); // Will create an empty FeatureContext if features or readInterval == null | ||
|
||
progressMeter.update(readInterval); | ||
} | ||
}); | ||
|
||
logger.info(countedFilter.getSummaryLine()); | ||
} | ||
|
||
/** | ||
* Method to be overridden by the implementation class to determine when to stop the read stream traversal | ||
* @param read - the read to be processed next (in case it is needed) | ||
* @return boolean indicator: true means stop! | ||
*/ | ||
protected abstract boolean shouldExitEarly(GATKRead read); | ||
|
||
/** | ||
* Java 8 does not have a .takeWhile() on streams. The code below implements a custom forEach to allow | ||
* breaking out of a stream prematurely. | ||
* | ||
* code adapted from: https://www.baeldung.com/java-break-stream-foreach | ||
*/ | ||
private static <T> void breakableForEach(Stream<T> stream, BiConsumer<T, AtomicBoolean> consumer) { | ||
Spliterator<T> spliterator = stream.spliterator(); | ||
boolean hadNext = true; | ||
AtomicBoolean breaker = new AtomicBoolean(); | ||
|
||
while (hadNext && !breaker.get()) { | ||
hadNext = spliterator.tryAdvance(elem -> { | ||
consumer.accept(elem, breaker); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ideally every new walker type should have an example implementation in
org.broadinstitute.hellbender.tools.examples
. It's fine to just open a github issue to implement one in a future PR rather than adding it here.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.
PartialReadWalk example and integration test added. Resolved