seppinho/mutserve

`htsjdk.samtools.SAMException: Unable to find entry for contig: rCRS`

williamrowell opened this issue · 5 comments

Hi,

I'm really excited to try some of your mtDNA tools with long PacBio amplicons. Since it's a new data type, I'm never sure whether I'm hitting an issue related to the data type or completely unrelated. I really appreciate any suggestions you have to help with this.

Does mutation-server require the contig name rCRS? It appears to be asking for a specific contig name, but I can't understand what is expected from the error message.

$ samtools idxstats bc1001.minimap2.aln.bam
NC_012920.1     16569   23070   0
*       0       0       0

$ head ../rCRS.fasta.fai
NC_012920.1     16569   57      70      71

$ $MUTATIONSERVER analyse-local --input . --reference ../rCRS.fasta --level 0.01 --outputRaw raw.txt --outputVar var.txt --baq true --baseQ 20 --mapQ 20 --alignQ 30 --indel true
Command [--input, ., --reference, ../rCRS.fasta, --level, 0.01, --outputRaw, raw.txt, --outputVar, var.txt, --baq, true, --baseQ, 20, --mapQ, 20, --alignQ, 30, --indel, true]
Mutation Server v1.1.6 -- Low-frequency Variant Detection
Division of Genetic Epidemiology - Medical University of Innsbruck
(c) Sebastian Schoenherr, Hansi Weissensteiner, Lukas Forer

 Processing: bc1001.minimap2.aln.bam
htsjdk.samtools.SAMException: Unable to find entry for contig: rCRS
        at htsjdk.samtools.reference.FastaSequenceIndex.getIndexEntry(FastaSequenceIndex.java:202)
        at htsjdk.samtools.reference.IndexedFastaSequenceFile.getSubsequenceAt(IndexedFastaSequenceFile.java:217)
        at genepi.mut.util.BaqAlt.calcBAQFromHMM(BaqAlt.java:669)
        at genepi.mut.util.BaqAlt.baqRead(BaqAlt.java:928)
        at genepi.mut.pileup.BamAnalyser.analyseRead(BamAnalyser.java:145)
        at genepi.mut.pileup.PileupToolLocal.analyseReads(PileupToolLocal.java:208)
        at genepi.mut.pileup.PileupToolLocal.run(PileupToolLocal.java:159)
        at genepi.base.Tool.start(Tool.java:193)
        at genepi.base.Toolbox.start(Toolbox.java:44)
        at genepi.mut.Server.main(Server.java:38)

It appears that mutation-server requires the reference contig to be named rCRS. I changed the name and it seems to have fixed the issue.

HI,
I got the simillar error,but i am not sure the which is the reference contig.to change the bam header or change the fasta??

It's been a long time since I tried this, but I think I had to change it both in the BAM header and the fasta.

Thank you very much for your reply! I will try it !

Thanks @williamrowell and @Jiafeng-Li-leon, and sorry for the delayed answer. It's best to use athe reference sequence, where the filename and the contig name are the same. Not necessarily needed to change the BAM header. Hope this helps