Open ethering opened 9 years ago
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.
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.
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).
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
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.