KolmogorovLab / hapdup

Pipeline to convert a haploid assembly into diploid
Other
85 stars 8 forks source link

Please add CLI option to specify location of BAM index #8

Closed bkmartinjr closed 2 years ago

bkmartinjr commented 2 years ago

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

mikolmogorov commented 2 years ago

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

bkmartinjr commented 2 years ago

Your work-around was cleverer than mine!

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

mikolmogorov commented 2 years ago

Now incorporated into 0.5 release.