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

Path-enable IndexFactory. #1430

Merged
merged 1 commit into from
Oct 30, 2019
Merged

Conversation

cmnbroad
Copy link
Collaborator

Prerequisite for broadinstitute/gatk#6161.

@codecov-io
Copy link

codecov-io commented Oct 25, 2019

Codecov Report

Merging #1430 into master will decrease coverage by 0.009%.
The diff coverage is 72.549%.

@@              Coverage Diff               @@
##              master    #1430       +/-   ##
==============================================
- Coverage     68.359%   68.35%   -0.009%     
- Complexity      8486     8489        +3     
==============================================
  Files            583      583               
  Lines          34373    34389       +16     
  Branches        5730     5729        -1     
==============================================
+ Hits           23497    23505        +8     
- Misses          8655     8665       +10     
+ Partials        2221     2219        -2
Impacted Files Coverage Δ Complexity Δ
...c/main/java/htsjdk/tribble/index/IndexFactory.java 75.148% <72.549%> (-0.669%) 33 <14> (+5)
...tsjdk/tribble/index/linear/LinearIndexCreator.java 78.571% <0%> (-4.762%) 13% <0%> (-1%)
...k/tribble/index/interval/IntervalIndexCreator.java 84.906% <0%> (-3.774%) 13% <0%> (-1%)
...java/htsjdk/tribble/index/DynamicIndexCreator.java 76.563% <0%> (-3.125%) 13% <0%> (-1%)
src/main/java/htsjdk/samtools/BAMFileReader.java 68.466% <0%> (+0.852%) 52% <0%> (+1%) ⬆️

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

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

@cmnbroad Thank you for doing this. I see this includes Jonn's change. Should we wait for that to go in before merging this?

@@ -224,7 +229,20 @@ else if (indexFile.endsWith(FileExtensions.TABIX_INDEX)) {
* @param codec the codec to use for decoding records
*/
public static LinearIndex createLinearIndex(final File inputFile, final FeatureCodec codec) {
return createLinearIndex(inputFile, codec, LinearIndexCreator.DEFAULT_BIN_WIDTH);
return createLinearIndex(
Copy link
Member

Choose a reason for hiding this comment

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

You can use IOUtil.toPath(file) which does a null safe conversion to path and then just have the null check in the final one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yeah - done.


// We _MUST_ call getPathToDataFile here to preserve behavior of codecs that rely on config files
// that point to other files to be indexed. This is CRITICALLY IMPORTANT to downstream tools.
this.inputPath = Paths.get(codec.getPathToDataFile(inputPath.toUri().toString()));
Copy link
Member

Choose a reason for hiding this comment

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

ugh... path -> uri -> string -> string -> path Not much to do about it though :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I considered changing getPathToDataFile to return a Path instead of a String, but decided that was too much scope creep.

@cmnbroad
Copy link
Collaborator Author

@lbergelson I don't think the order in which we merge these matters, but we should probably wait for @jonn-smith 's redirect test before we merge either one.

@lbergelson
Copy link
Member

Sorry, I merged mine which caused a conflict :(

@lbergelson
Copy link
Member

@cmnbroad I merged the xsv fix.

@cmnbroad
Copy link
Collaborator Author

@lbergelson Rebased and conflicts resolved.

Copy link
Member

@lbergelson lbergelson left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@cmnbroad cmnbroad merged commit a83f2b3 into samtools:master Oct 30, 2019
lbergelson added a commit that referenced this pull request Oct 30, 2019
* While adding Path variants of File methods in #1430 we accidentally replaced a method instead of adding a new one.  
* Add that method back in and 1 additional overload which we missed.
@cmnbroad cmnbroad deleted the cn_index_cloud branch August 25, 2020 13:39
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.

4 participants