-
Notifications
You must be signed in to change notification settings - Fork 596
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
First Version of a weight-based splitter #7643
Conversation
If we like this -- we also need to
|
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedSplitIntervals.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedSplitIntervals.java
Outdated
Show resolved
Hide resolved
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.
@kcibul Sorry for the extreme lateness, and the extreme number of comments. I ended up having a lot more to say than I expected. It really needs at least 1 integration test to show that it runs without exploding. If you're marking it as either a beta too or experimental we can get away with somewhat less responding to nitpicks and lower depth of testing, although if we're delivering things based on it we might at least want a test that asserts that a complex input interval list and weights file doesn't result in any LOST intervals anywhere.
Feel free to disregard what you think is over the top.
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedInterval.java
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedInterval.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedInterval.java
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedInterval.java
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedInterval.java
Outdated
Show resolved
Hide resolved
src/test/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedSplitIntervalsTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedSplitIntervals.java
Outdated
Show resolved
Hide resolved
System.out.println("Total Weight:"+totalWeight + " scatterCount: " + scatterCount + " target:" + targetWeightPerScatter); | ||
|
||
final int maxNumberOfPlaces = Math.max((int)Math.floor(Math.log10(scatterCount-1))+1, numDigits); | ||
final String formatString = "%0" + maxNumberOfPlaces + "d"; |
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.
heh, recursive format strings.
src/main/java/org/broadinstitute/hellbender/tools/gvs/common/WeightedSplitIntervals.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
// write the final list | ||
currentList.uniqued().sorted().write(new File(outputDir, prefix + String.format(formatString, scatterPiece++) + extension)); |
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.
Lets make this file name construction into a function since it's repeated. We could move it into the newly created OutputScatterArgumentCollection
if we went that route.
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, but this doesn't feel a whole lot cleaner 🤷
See Issue #7622 for more details
In addition to unit tests, here is how I validated: