This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools Multicov Need A Bam Index File Specification Option

bedtools version 2.16.2 multicov used to compute the multiple sample coverage given a feature file(gtf bed).

format: bedtools multicov -bams alin1.bam aln2.bam .. -bed capturRegion.bed >out.coverage

official doc has mentioned that input bam files should be sorted and indexed, but it does not mention the details. suppose the bam file name is: sample1.bam, then the index file should be named: sample1.bam.bai(not sample1.bai) ,otherwise multicov will report an error: indexes not found.

I think it would be better to add an option which will allow the user to specify the bam index files or the suffix used for these index files.

bedtools coverage bam sort index

1 answer

Like many things in bioinformatics this comes from a convention.

  • This is the default name that is generated from samtools index
  • many tools follow this convention (bedtools, IGV, IGB, UCSC etc...)
  • if you follow this convention like everybody, life will be easier
  • if at all this should be a feature request in bedtools not a "Tip"

can not agree more

thanks for the reply and the "feature request but tip" suggestion. well, i can not agree more with that life would be easier when we follow some convention. but there are always exceptions, picard output bam index file with the default form sample1.bai. and probably this is much better when the sample file name is long(LHX?_mix?_index?.recal.reduce.xxxx). I just mention it here to avoid someone who is newer like me in sequence file handling spending time googling the "indexes file not found" error.

Log in to answer this question.