Entering edit mode
6.4 years ago
roalva1
▴
90
Hello,
I am running this command line in bedtools 2.27.1
bedtools coverage -nonamecheck -d -sorted -a file.bed -b file.bam > file.cov
and I get this error
ERROR: Database file file.bam contains chromosome chrM, but the query file does not.
Please rerun with the -g option for a genome file.
See documentation for details.
I don't have access to the genome file and I guess nonamecheck is not working,
Thanks a lot
Best regards
Wouldn't be -nonamecheck enaugh for this?
Are you mixing and matching the genomes by any chance? BED file from one provider where as BAM aligned to a different one?
No no, I have got just a bam
Hm, I don't know what
-nonamecheck
does behind the scene.. Maybe it just ignores lower/upper cases and leading zeros?genomax suggested to me, that it also could be a naming mismatch between the
bam
file and yourbed
file. How is the name for chrM in the bed file? Maybe chrMT or just MT.?fin swimmer
My bed file doesn't have any region in chrMT nor chrM
Interesting. Then why are you getting this? Or you just don't have any chrM regions in your bed file (and that is just a warning).
Yes, I don't have any chrM regions in my bed file, but I do have in my bam. The message of bedtools should be a warning but it is not. Bedtools stops and the coverage in chrX regions are not calculated.
This has solved my problem, but still, with bedtools 2.17 we didn't need this, and I think it is not intuitive.
You can
accept
@fin swimmer's answer (green check mark) to provide to closure to this thread since your problem is solved.