Skip to content

Comments

Fix #653#672

Merged
yfarjoun merged 8 commits intosamtools:masterfrom
bioinformagik:dgs_fix_tribblefeature_blockcompression
Aug 10, 2016
Merged

Fix #653#672
yfarjoun merged 8 commits intosamtools:masterfrom
bioinformagik:dgs_fix_tribblefeature_blockcompression

Conversation

@magicDGS
Copy link
Member

@magicDGS magicDGS commented Jul 27, 2016

Simple patch as suggested in #653. TribbleIndexedFeatureReader.isGZIPPath() is not used anymore and it could be removed.

try {
is = ParsingUtils.openInputStream(path);
if (isGZIPPath(path)) {
if (hasBlockCompressedExtension(path) || hasBlockCompressedExtension(new URI(path))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that the first part of if statement is only good for improving performance, but this isn't a performance bottleneck. is it needed for anything else?

Copy link
Member Author

@magicDGS magicDGS Aug 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited: I was thinking in a different change of code, not in this PR when I write the first comment.
I don't think so, so I will change it. I just reproduced the behaviur of isGZIPPath. I think that it will be even better to modify the AbstractFeatureReader.hasBlockCompressedExtension (final File file) to be something like:

public static boolean hasBlockCompressedExtension (final File file) {
    return hasBlockCompressedExtension(new URI(file));
}

@droazen droazen mentioned this pull request Aug 9, 2016
@magicDGS
Copy link
Member Author

I addressed your comment and added other stuff:

  • Bgzipped test file (.bgz extension) + test
  • Fixing WFIterator (I forgot to do it in the previous commit)
  • Deprecation of isGZIPPath(final String path)

Because the deprecated method is not used anymore, should I remove it and get rid of the tests too?

Back to you, @yfarjoun!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 68.801% when pulling 5dd44c8 on magicDGS:dgs_fix_tribblefeature_blockcompression into 87b1e87 on samtools:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 68.801% when pulling a21f906 on magicDGS:dgs_fix_tribblefeature_blockcompression into 87b1e87 on samtools:master.

}

//Visible for testing
@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if deprecating, please comment what should be used instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but because it is package specific I wasn't sure if it will be better to remove...

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 68.801% when pulling a4ea9aa on magicDGS:dgs_fix_tribblefeature_blockcompression into 87b1e87 on samtools:master.

@magicDGS
Copy link
Member Author

@yfarjoun, I added the comment for the deprecated method.

@yfarjoun yfarjoun merged commit c8202f2 into samtools:master Aug 10, 2016
@yfarjoun
Copy link
Contributor

💯

jamesemery pushed a commit to jamesemery/htsjdk that referenced this pull request Sep 1, 2016
* added checking for AbstractFeatureReader.BLOCK_COMPRESSED_EXTENSIONS in TribbleIndexedFeatureReader

* fixing WFIterator checking of compressed file

* isGZIPPath deprecation

* added test for new functionality

* fixing URL encoding

* added no-remote test file with spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants