Skip to content
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

Move bad coordinates check #911

Merged
merged 2 commits into from
Feb 5, 2019
Merged

Move bad coordinates check #911

merged 2 commits into from
Feb 5, 2019

Conversation

ronlevine
Copy link
Contributor

@ronlevine ronlevine commented Jun 24, 2017

Description

Follow up to #908.
Move the bad coordinates check to the root method, public Iterator query(final String reg). If this public method is used by an application, the bad coordinates will return an EOF_ITERATOR;

Checklist

  • Code compiles correctly
  • New tests covering changes and new functionality
  • All tests passing
  • Extended the README / documentation, if necessary
  • Is not backward compatible (breaks binary or source compatibility)

@ronlevine ronlevine self-assigned this Jun 24, 2017
@ronlevine ronlevine requested a review from yfarjoun June 24, 2017 15:31
@ronlevine
Copy link
Contributor Author

@yfarjoun Please review.

@codecov-io
Copy link

codecov-io commented Jun 24, 2017

Codecov Report

Merging #911 into master will increase coverage by 0.007%.
The diff coverage is 100%.

@@               Coverage Diff               @@
##              master      #911       +/-   ##
===============================================
+ Coverage     65.084%   65.091%   +0.007%     
- Complexity      7265      7268        +3     
===============================================
  Files            528       528               
  Lines          31948     31946        -2     
  Branches        5455      5453        -2     
===============================================
+ Hits           20793     20794        +1     
  Misses          9011      9011               
+ Partials        2144      2141        -3
Impacted Files Coverage Δ Complexity Δ
.../main/java/htsjdk/tribble/readers/TabixReader.java 68.293% <100%> (+0.148%) 61 <16> (+1) ⬆️
...dk/samtools/seekablestream/SeekableHTTPStream.java 56.061% <0%> (+1.515%) 10% <0%> (+1%) ⬆️
...a/htsjdk/samtools/cram/encoding/rans/Decoding.java 85.714% <0%> (+3.571%) 12% <0%> (+1%) ⬆️

Copy link
Contributor

@yfarjoun yfarjoun left a comment

Choose a reason for hiding this comment

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

minor comment about spaces. also, could you put an issue that parseReg doesn't work for sequences that have colons or dashes in their names?

src/test/java/htsjdk/tribble/readers/TabixReaderTest.java Outdated Show resolved Hide resolved
@yfarjoun
Copy link
Contributor

yfarjoun commented Oct 2, 2017

@ronlevine are you still available to process this?

if not @lbergelson what's the procedure?

@yfarjoun
Copy link
Contributor

@cmnbroad can you take over this?

@cmnbroad cmnbroad assigned cmnbroad and unassigned ronlevine Oct 10, 2017
@cmnbroad
Copy link
Collaborator

@yfarjoun Sure.

@cmnbroad
Copy link
Collaborator

@yfarjoun I don't see anything in this PR that addresses the second issue raised in the ticket. A couple of questions:

Do you think we should we retain the current behavior where querying a non-existent sequence name silently returns an empty iterator ? It seems to me it should throw. Same for start index <= 0. Such queries seem incoherent, but the caller has no way to notify the user. It would be a behavior change though.
It looks like the parseReg method is converting com 1-based to 0-based, and subtracts 1 from the start, but not the end. Unless its intentionally converting from a fully closed interval to half-closed, half-open, that seems wrong. Do you know if thats intentional ? I'd like to add some comments/javadoc and boundary condition tests, but I'm not sure what the intentions are.

iter=tabixReader.query("1",Integer.MAX_VALUE,-1);
Assert.assertNotNull(iter);
Assert.assertNull(iter.next());

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a test case in which end == 0?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also add test cases for the other overloads of query(), since they have difference interval conventions (the String version is 1-based closed, the 3-arg version is 0-based closed-open!)

@droazen
Copy link
Contributor

droazen commented Nov 14, 2017

Review complete, back to @cmnbroad

@yfarjoun
Copy link
Contributor

yfarjoun commented May 1, 2018

ping....

@fleharty
Copy link
Contributor

fleharty commented Jul 2, 2018

@yfarjoun I'm taking this over, but don't have the ability to assign since I don't have commit privileges.

@yfarjoun
Copy link
Contributor

assigned to you @fleharty

@fleharty
Copy link
Contributor

fleharty commented Dec 3, 2018

@droazen Back to you.

@yfarjoun
Copy link
Contributor

@droazen ? @cmnbroad ? who's court is this in now?

@fleharty
Copy link
Contributor

@yfarjoun my court

@codecov-io
Copy link

Codecov Report

Merging #911 into master will increase coverage by 0.016%.
The diff coverage is 100%.

@@              Coverage Diff               @@
##             master      #911       +/-   ##
==============================================
+ Coverage      69.5%   69.517%   +0.016%     
- Complexity     8399      8403        +4     
==============================================
  Files           558       558               
  Lines         33371     33369        -2     
  Branches       5610      5608        -2     
==============================================
+ Hits          23193     23197        +4     
+ Misses         7904      7901        -3     
+ Partials       2274      2271        -3
Impacted Files Coverage Δ Complexity Δ
.../main/java/htsjdk/tribble/readers/TabixReader.java 73.707% <100%> (+0.63%) 66 <17> (+3) ⬆️
...va/htsjdk/samtools/util/AsyncBufferedIterator.java 69.231% <0%> (+1.099%) 17% <0%> (ø) ⬇️
...samtools/util/AsyncBlockCompressedInputStream.java 76% <0%> (+4%) 13% <0%> (+1%) ⬆️

@yfarjoun
Copy link
Contributor

yfarjoun commented Feb 5, 2019

looks good now.

@yfarjoun yfarjoun merged commit 3ae552f into master Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants