Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix BEDCodec.canDecode() to handle block-compressed extensions #704
Conversation
magicDGS
referenced
this pull request
in broadinstitute/gatk
Sep 12, 2016
Merged
Tabix support for IndexFeatureFile, and move to htsjdk 2.6.1 #2131
coveralls
commented
Sep 12, 2016
lbergelson
self-assigned this
Sep 12, 2016
lbergelson
commented on the diff
Sep 12, 2016
| @@ -226,4 +226,15 @@ private void createIndex(File testFile, File idxFile) throws IOException { | ||
| public void testGetTabixFormat() { | ||
| Assert.assertEquals(new BEDCodec().getTabixFormat(), TabixFormat.BED); | ||
| } | ||
| + |
lbergelson
Contributor
|
lbergelson
and 1 other
commented on an outdated diff
Sep 12, 2016
| @@ -197,7 +201,13 @@ private void createExons(int start, String[] tokens, FullBEDFeature gene, | ||
| @Override | ||
| public boolean canDecode(final String path) { | ||
| - return path.toLowerCase().endsWith(".bed"); | ||
| + final String toDecode; | ||
| + if (AbstractFeatureReader.hasBlockCompressedExtension(path)) { | ||
| + toDecode = path.substring(0, path.lastIndexOf(".")); | ||
| + } else { | ||
| + toDecode = path; | ||
| + } | ||
| + return toDecode.toLowerCase().endsWith(".bed"); |
magicDGS
Contributor
|
lbergelson
and 1 other
commented on an outdated diff
Sep 12, 2016
| import htsjdk.tribble.AsciiFeatureCodec; | ||
| import htsjdk.tribble.annotation.Strand; | ||
| import htsjdk.tribble.index.tabix.TabixFormat; | ||
| import htsjdk.tribble.readers.LineIterator; | ||
| import htsjdk.tribble.util.ParsingUtils; | ||
| +import org.apache.commons.compress.compressors.FileNameUtil; |
|
|
|
@magicDGS Looks good, two small comments. Thanks for the pull request! (And sorry I haven't gotten back to you yet on some of your older ones. I'll try to get those reviewed soon!) |
coveralls
commented
Sep 12, 2016
|
I addressed your comments (except test) -- Back to you @lbergelson |
coveralls
commented
Sep 13, 2016
coveralls
commented
Sep 13, 2016
|
|
magicDGS commentedSep 12, 2016
•
edited
Description
When using
canDecode("filename.bed.gz")it will return false, but theAbstractFeatureReadercould support block-compressed bed files. This could cause problems when trying to find the codec for a file (for instance, broadinstitute/gatk#2131).I added here a check for block-compression extensions and tests for them.
Checklist