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

Fix issue in read_bam implementation, it got the wrong contig name #206

Merged
merged 6 commits into from
May 19, 2024

Conversation

gamazeps
Copy link
Contributor

@gamazeps gamazeps commented May 1, 2024

pysam's rname actually returns the index of the contig instead of the contig name (which is poor naming on their end, but they deprecated that API).

We should use reference_name instead to get the contig name

Also added 2 integration tests for reading bam and sam files, None for cram because it would require a fasta and I don't have a dummy one to use.

Fixed a bug in the json serialization, where if the tag was a list it ended up not being serializable (probably an edge case, but the dummy samtools test file had one)

Also added filetype inference to be able to read sam and cram files

bioframe/io/fileops.py Outdated Show resolved Hide resolved
bioframe/io/fileops.py Outdated Show resolved Hide resolved
Copy link
Member

@nvictus nvictus left a comment

Choose a reason for hiding this comment

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

LGTM. My only suggestion is to remove the OrderedDict but it's not urgent.

@gamazeps
Copy link
Contributor Author

All done :)

@nvictus nvictus merged commit 660ba3f into open2c:main May 19, 2024
7 checks passed
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.

2 participants