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

"xxx.bam" indexes as "xxx.bai" or "xxx.bam.bai" #5

Open
russHyde opened this issue May 21, 2019 · 2 comments
Open

"xxx.bam" indexes as "xxx.bai" or "xxx.bam.bai" #5

russHyde opened this issue May 21, 2019 · 2 comments

Comments

@russHyde
Copy link

I was wondering whether you'd accept a pull request to modify how bam-indexes are found by csam.

Currently, for a given "xxx.bam", the csaw functions die if xxx.bam.bai can't be found.

As a suggestion, I think csaw should allow either "xxx.bam.bai" (samtools default) or "xxx.bai" (picard default) names for indexes (and die if neither are present; choose the newer of the two if both are present).

@LTLA
Copy link
Owner

LTLA commented May 22, 2019

Ah, at last. 5 years ago I wondered whether I should provide this option, but I decided against it for simplicity. I was expecting more frequent complaints about this, but yours is the first.

I was wondering whether you'd accept a pull request to modify how bam-indexes are found by csam.

In principle, yes. In practice, I'm still waiting on events that will allow #4 to go through. You could make a PR off htsfree, but that's a moving target in itself... you're more than welcome to give it a go, though. I have some suggestions for how to do this if you're interested.

As a suggestion, I think csaw should allow either "xxx.bam.bai" (samtools default) or "xxx.bai" (picard default) names for indexes (and die if neither are present; choose the newer of the two if both are present).

I would prefer the behaviour to be a bit simpler, and avoid checking time stamps:

  1. Check if indices are supplied as part of the input. If so, use them.
  2. Add .bam.bai to the end of the file names, and if they're there, use them.
  3. Add .bai to the end of the file names, and if they're there, use them.
  4. Die.

@russHyde
Copy link
Author

Thanks for the reply. In your new branch, it looks like bam-file handling has been pushed down to Rsamtools; this should mean that picard-style indexes are handled (and if not I'll move this issue to the rsamtools repository) and that this is no longer an issue. All the best

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