Repository navigation
the long awaited FastaAlternateReferenceMaker - #5549
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5549 +/- ##
==============================================
- Coverage 87.09% 87.018% -0.072%
- Complexity 31524 31706 +182
==============================================
Files 1930 1943 +13
Lines 145231 146064 +833
Branches 16095 16137 +42
==============================================
+ Hits 126482 127102 +620
- Misses 12900 13077 +177
- Partials 5849 5885 +36
|
4ec7a34 to
f98fa90
Compare
* new walker type ReferenceWalker
* changes to close behavior in FastaWriter and adding additional buffering
* new walkers:
CountBasesInReference
FastaReferenceMaker
FastaAlternateReferenceMaker
f98fa90 to
4e60787
Compare
droazen
left a comment
There was a problem hiding this comment.
Minor comments only -- back to @lbergelson. Merge once these are addressed.
| import org.broadinstitute.hellbender.utils.iterators.IntervalLocusIterator; | ||
|
|
||
| /** | ||
| * A reference walker is a tool which process each position in a given reference. |
There was a problem hiding this comment.
each position -> each base that overlaps a set of intervals? (ie., describe the traversal more precisely here)
| * A reference walker is a tool which process each position in a given reference. | ||
| * | ||
| * ReferenceWalker authors must implement the apply() method to process each position, and may optionally implement | ||
| * {@link #onTraversalStart()} and/or {@link #onTraversalSuccess()}. See the {@link ExampleReferenceWalker} walker for an example. |
There was a problem hiding this comment.
Mention getReferenceWindow() here as an additional method that tool authors might want to override.
|
|
||
| /** | ||
| * Determine the window to use when creating the ReferenceContext in apply. This determines which reference bases are | ||
| * see at each position, as well as which reads / features are considered to overlap the reference site. |
| final CountingReadFilter readFilter = makeReadFilter(); | ||
|
|
||
| for(SimpleInterval locus : getIntervalIterator()){ | ||
| SimpleInterval referenceWindow = getReferenceWindow(locus); |
There was a problem hiding this comment.
locus and referenceWindow should both be final
There was a problem hiding this comment.
huh, I wonder why intellij didn't remind me of that.
| @@ -0,0 +1,78 @@ | |||
| package org.broadinstitute.hellbender.tools.examples; | |||
|
|
|||
| import com.netflix.servo.util.VisibleForTesting; | |||
There was a problem hiding this comment.
Wrong VisibleForTesting annotation...
There was a problem hiding this comment.
changed to com.hulu.util.VisibleForTesting
| public class CountBasesInReferenceIntegrationTest extends CommandLineProgramTest { | ||
|
|
||
| @Test | ||
| public void testExampleReferenceWalker(){ |
There was a problem hiding this comment.
testExampleReferenceWalker() -> testCountBasesInReferenceWithInterval()
| } | ||
|
|
||
| @Test | ||
| public void testExampleReferenceWalkerFull(){ |
There was a problem hiding this comment.
testExampleReferenceWalkerFull() -> testCountBasesInReferenceFull()
| Assert.assertEquals(BaseUtils.basesToIUPAC((byte)'A', (byte)'T'), 'W', "testing A/T=W"); | ||
| Assert.assertEquals(BaseUtils.basesToIUPAC((byte)'T', (byte)'A'), 'W', "testing T/A=W"); | ||
| Assert.assertEquals(BaseUtils.basesToIUPAC((byte) 'G', (byte) 'T'), 'K', "testing G/T=K"); | ||
| Assert.assertEquals(BaseUtils.basesToIUPAC((byte) 'T', (byte) 'G'), 'K', "testing T/G=K"); |
There was a problem hiding this comment.
This test doesn't cover all the possibilities -- could you add the missing cases? (should be pretty easy)
| import java.util.Arrays; | ||
| import java.util.Map; | ||
|
|
||
| public class FastaTestUtils { |
There was a problem hiding this comment.
final (and make the default constructor private)
|
|
||
| public class FastaTestUtils { | ||
|
|
||
| public static void assertOutput(final Path path, final boolean mustHaveIndex, final boolean mustHaveDictionary, |
There was a problem hiding this comment.
Add docs for these methods (and give assertOutput() a more descriptive name)
There was a problem hiding this comment.
I moved most of these back to the unit test they originally came from. I had intended to use them in my tests but they ended up being to brittle to adapt. I documented what was left.
CountBasesInReference
FastaReferenceMaker
FastaAlternateReferenceMaker