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

index fails using samtools v1.0+ when providing .bai filename #40

Open
ethering opened this issue Feb 11, 2015 · 4 comments
Open

index fails using samtools v1.0+ when providing .bai filename #40

ethering opened this issue Feb 11, 2015 · 4 comments

Comments

@ethering
Copy link
Contributor

As documented here:
http://sourceforge.net/p/samtools/mailman/message/32904732/
providing the SAMtools index method with an outfile name (e.g. 'samtools index aln.bam alignment.bai') causes an error.

Removing the code in test_sam.rb test_index() after
#as above, but give the output a different name
would fix the test, but a fix is needed in the method itself.

@homonecloco
Copy link
Collaborator

So, I'm looking at the code and I could add an option to move the file after the option is set. Which is a bit patchy, but it could work. However, I'm wondering if that will be useful, given the current approach of samtools of having default names.

homonecloco added a commit to homonecloco/bioruby-samtools that referenced this issue Feb 24, 2015
@danmaclean
Copy link
Collaborator

Does SAMtools generate the .bai by default? Then use that unless a filename is given - so yes, implement an mv if providing a filename doesn't work.

@homonecloco
Copy link
Collaborator

samtools generates a default name. It fails when you provide a name, but it generates a bai file, that only has the header, so it wasn't picked up by the unit tests (it just validates it existed before).

@danmaclean
Copy link
Collaborator

Then I think your proposed fix is sensible - mv to the provided name if it is there, but dont pass the provided name to SAMtools. MonkeyPatch

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

3 participants