genome / bam-readcount

Count bases in BAM/CRAM files
MIT License
298 stars 95 forks source link

Error when path_to_bam have bam in middle #88

Open sssimonyang opened 2 years ago

sssimonyang commented 2 years ago

Version: bam-readcount 0.8 py37pl526h94a8ba4_4 bioconda

When path contains bam in middle, it will give index not found error.

$ bam-readcount -q 10 -b 10 -w 0 -f ${hg19} 1-bam/1-normal/Case1_normal.bam 17:7579300-7579300
Minimum mapping quality is set to 10
Expect library: Case1_NC in BAM
[bam_index_load] fail to load BAM index.
BAM indexing file is not available.

And cd 1-bam and rerun:

$ cd 1-bam/
$ bam-readcount -q 10 -b 10 -w 0 -f ${hg19} 1-normal/Case1_normal.bam 17:7579300-7579300
Minimum mapping quality is set to 10
Expect library: Case1_NC in BAM
17      7579300 A       239     =:0:0.00:0.00:0.00:0:0:0.00:0.00:0.00:0:0.00:0.00:0.00  A:239:60.00:32.53:0.00:134:105:0.55:0.00:2.84:134:0.50:145.08:0.43      C:0:0.00:0.00:0.00:0:0:0.00:0.00:0.00:0:0.00:0.00:0.00  G:0:0.00:0.00:0.00:0:0:0.00:0.00:0.00:0:0.00:0.00:0.00 T:0:0.00:0.00:0.00:0:0:0.00:0.00:0.00:0:0.00:0.00:0.00   N:0:0.00:0.00:0.00:0:0:0.00:0.00:0.00:0:0.00:0.00:0.00

So the mistake comes from bam in middle in path_to_bam.

I didn't test 1.0 cause I can't find it in bioconda.

I can bypass the mistake but I think it should be fixed.