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

SamSequenceDictionaryExtractor for cram #1305

Merged
merged 2 commits into from
Feb 26, 2019

Conversation

lindenb
Copy link
Contributor

@lindenb lindenb commented Feb 26, 2019

Description

I'm currently working on a "Reference registry" that would allow to find the path to a fasta REF for a given sequence dictionary.

I wish it works on cram but SAMSequenceDictionaryExtractor currently doesn't handle the CRAM format. This PR adds the support for CRAM.

overview

In CRAMIterator I wrote a static method extractDictionaryto open a CRAM file without a CRAMReferenceSource (well, a fake one that shouldn't be called) to only get the CRAM header+dict

In SAMSequenceDictionaryExtractor.java I added a new enum for CRAM that calls CRAMIterator.extractDictionary

I also added two test files: toy.cram and toy.dict

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)

@codecov-io
Copy link

codecov-io commented Feb 26, 2019

Codecov Report

Merging #1305 into master will decrease coverage by 0.002%.
The diff coverage is 70%.

@@               Coverage Diff               @@
##              master     #1305       +/-   ##
===============================================
- Coverage     67.644%   67.642%   -0.002%     
- Complexity      8188      8189        +1     
===============================================
  Files            560       560               
  Lines          33462     33472       +10     
  Branches        5635      5635               
===============================================
+ Hits           22635     22641        +6     
- Misses          8644      8648        +4     
  Partials        2183      2183
Impacted Files Coverage Δ Complexity Δ
.../variant/utils/SAMSequenceDictionaryExtractor.java 73.171% <100%> (-1.188%) 1 <0> (-1)
src/main/java/htsjdk/samtools/CRAMIterator.java 80.282% <62.5%> (-1.062%) 34 <2> (+2)

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.

This looks good to me. Very logical extension of the existing utility. Thank you @lindenb

@lbergelson lbergelson merged commit 205d5f0 into samtools:master Feb 26, 2019
@lindenb lindenb deleted the pl_cram_dict_extractor branch February 26, 2019 20:07
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.

3 participants