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
Comments
@vadimzalunin Can you comment on this? |
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 #. |
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. |
See related discussion on proposed CRAI updates. |
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.
The text was updated successfully, but these errors were encountered: