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

Passing missing --reference incorrectly reports cram file missing as well #1723

Closed
ASLeonard opened this issue Dec 19, 2023 · 1 comment
Closed
Assignees

Comments

@ASLeonard
Copy link

Hi,
This is more of a user error, but maybe a helpful bug to fix. This is on

samtools 1.19-1-ga4c73e4-dirty
Using htslib 1.19-1-g61b037bb-dirty

If I try to do something with a cram, but pass a non-existant reference (in this case a typo) samtools stats --reference <ref_with_typo> sample.cram, I get the following output that misleadingly suggests the cram file itself doesn't exist.

[E::refs_load_fai] Failed to open reference file '<ref_with_typo>'
[E::hts_open_format] Failed to open file "sample.cram" : No such file or directory
samtools stats: failed to open "sample.cram": No such file or directory

Oddly, in the case of stats I get a segfault, but in other operations like view I just get the errors that the reference can't be opened and the cram doesn't exist. I would guess the expected behaviour would be error out when the reference couldn't be loaded and avoid misleading the user the cram file doesn't exist (and potentially segfault).

Best,
Alex

@vasudeva8
Copy link
Contributor

samtools and htslib are updated to avoid the segfault.
The error display is updated to show file not found on reference file open in faibuild3core and invalid argument on hts_open_format on cram file.

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

No branches or pull requests

2 participants