This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DepthOfCoverage badly formed genome location error

Hello

I need to get a per read depth coverage for mytest.chrM.bam file. I extract chrM from a whole genome file like this:

samtools view test.wgs.bam chrM -b > test.chrM.bam

When I try to calculate the coverage I get an error:

##### ERROR MESSAGE: Badly formed genome location: Contig chr1 given as location, but this contig isn't present in the Fasta sequence dictionary

This is how I calculate the coverage. I guess the problem is in the bam file header, but how to solve this problem?

java -Djava.io.tmpdir=/home/tmp -Xmx2g -jar /path/to/GenomeAnalysisTK.jar -T DepthOfCoverage -R chrM.fa -I test.chrM.bam -o test.chrM.stat -nt 3
coverage

What happens if you use the whole genome fasta? I think the issue may be that in the bam header you have all chromosomes, but in the fasta you have only the mitochondrion.

0 answers

No answers yet.

Log in to answer this question.