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 doesn't handle CRAMs #731

Closed
cmnbroad opened this issue Oct 26, 2016 · 4 comments
Closed

SAMSequenceDictionaryExtractor doesn't handle CRAMs #731

cmnbroad opened this issue Oct 26, 2016 · 4 comments
Labels

Comments

@cmnbroad
Copy link
Collaborator

Just adding the cram extension to the list of extensions used by the SAM handler won't work unless a method overload is added that accepts a reference. Alternative it would be possible to have a custom handler that bypasses the SAMReader and just retrieves the header directly, since the reference isn't needed to just do that.

@cmnbroad cmnbroad added the cram label Oct 26, 2016
@yfarjoun
Copy link
Contributor

I have an implementation of a solution that involves the following:

  • an "empty" implementation of ReferenceSource (that does nothing and will throw an exception if you ask for the referenceBases)
  • changing the default for MakeDefault of SamReaderFactory so that it will use that referenceSource by default (which will get overridden by any subsequent setReferenceSource, or setReferenceFile call)

Does that sounds like a reasonable solution?

@yfarjoun
Copy link
Contributor

the implementation can be viewed here: #732

@cmnbroad
Copy link
Collaborator Author

One other option - it might be less intrusive to just crack the file open. Given a stream on the file, I think its a one-liner to get the header without the reference, i.e.:

CramIO.readCramHeader(inputStream).getSamFileHeader()

@cmnbroad
Copy link
Collaborator Author

cmnbroad commented Oct 1, 2019

This was fixed in #1308.

@cmnbroad cmnbroad closed this as completed Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants