-
Notifications
You must be signed in to change notification settings - Fork 371
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
Simplify BedToIntervalList by not reimplementing coordinate conversion #1292
Simplify BedToIntervalList by not reimplementing coordinate conversion #1292
Conversation
* BedToIntervalList spends a lot of comments complaining about coordinate conversions after explicitely setting the codec to not perform the conversion from [0,..) to [1,..] * Simplified by just using the baked in conversion instead of disabling it.
* so it returns 1-based starts. Ugh. Set to zero. | ||
*/ | ||
final FeatureReader<BEDFeature> bedReader = AbstractFeatureReader.getFeatureReader(INPUT.getAbsolutePath(), new BEDCodec(BEDCodec.StartOffset.ZERO), false); | ||
final FeatureReader<BEDFeature> bedReader = AbstractFeatureReader.getFeatureReader(INPUT.getAbsolutePath(), new BEDCodec(), false); |
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.
will this be able to read a bed that has position 0?
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.
(the tests are not very good...they just test that the dictionary is right and that the program didn't crash...)
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.
Good question.. The tests do actually test the output interval see testBedToIntervalListDataProvider
, that's how we noticed that there was a bug with merging 0-length intervals.
With some experimentation: 0 intervals that start at 0 work, 0-length intervals that start as 0 have never worked... I added a fix and a new test.
To be complete we might want to allow the weird edge case of the zero-length interval AFTER the end of the contig... My guess is that doesn't work either... GATK will almost certainly explode if it sees one of those as well.
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.
#1292) * Simplify BedToIntervalList by not reimplementing coordiant conversion * BedToIntervalList spends a lot of comments complaining about coordinate conversions after explicitely setting the codec to not perform the conversion from [0,..) to [1,..] * Simplified by just using the baked in conversion instead of disabling it. * add more tests and fix for zero-length edge case at the start of the contig
Description
Maybe I'm missing something clever that it's doing here...
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