KolmogorovLab/hapdup

Please add CLI option to specify location of BAM index

bkmartinjr opened this issue · 3 comments

Could you add an additional command line parameter, allowing the specification of the BAM index location? Eg,

hapdup --bam /some/where/abam.bam --bam-index /other/location/a_bam_index.bam.csi

And then pass that optional value to pysam.AlignmentFile() argument filepath_index?

Motivation: I'm wrapping hapdup and some other steps in a WDL script, and need to pass each file separately (ie, they are localized as individual files, and there is no guarantee they end up in the same directory when hapdup is invoked). The current hapdup assumes the index and bam are in the same directory, and fails.

Thanks!

CC: @0seastar0

Hi! I was struggling with WDL recently as well, my "solution" was to reindex inside the WDL task :)

I've added the --bam-index option as requested, and created an updated docker image: mkolmogo/hapdup:0.4-bamindex. Let me know if it works for you - I will include it in the next release.

Mikhail

Your work-around was cleverer than mine!

I have confirmed that the new option works as expected. Many thanks for the quick fix!

Now incorporated into 0.5 release.