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

BAMIndexMetaData incorrect when index results from .crai->.bai conversion #531

Open
cmnbroad opened this issue Mar 21, 2016 · 4 comments
Open
Labels

Comments

@cmnbroad
Copy link
Collaborator

The BAMIndex metadata that results from internal conversion of a .crai index to a .bai has incorrect values for "alignedRecords" and "unalignedRecords." It looks like alignedRecords is set to the size in bytes of the original slice that corresponds to the CRAI entry (for multi-ref slices there can will be a CRAI entry for each reference covered by the slice), rather than the number of records covered by that entry, and unalignedRecords will always be 0. Either way it way overstates the number of records covered by the index entries. It doesn't appear that the CRAI format has any way to store this information so its lost when the .crai is created.

Note that this doesn't happen when htsjdk produces the .bai index directly, which is the current default behavior, since it has access to the original container and slice.

@droazen
Copy link
Contributor

droazen commented Mar 24, 2016

@vadimzalunin Can you comment on this?

@cmnbroad
Copy link
Collaborator Author

I think the problem is here where the field is set during conversion, though the real problem is that during conversion we don't have access to the correct #.

@vadimzalunin
Copy link
Contributor

the current CRAI spec doesn't have number of records per slice which is required for BAM metadata. Long story, but this is a known issue and should be addressed in the next CRAI release.
samtools/hts-specs#146

@cmnbroad
Copy link
Collaborator Author

cmnbroad commented Nov 6, 2017

See related discussion on proposed CRAI updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants