Hi,
I'm working on RNA-seq data and have aligned my reads to the assembled transcript using bwa-mem. When I tried to run Picard Tools (SamFormatConverter.jar
), the SAM dictionary threw an exception
"Cannot add sequence that already exists in SAMSequenceDictionary".
I then checked for duplication in the SAM file header and sure enough, two entries were duplicated. How do I correct this? Commands used are given below:
bwa index contigs.fa
bwa mem contigs.fa reads_1.fq reads_2.fq >samFile.sam
java -Xmx4g -jar SamFormatConverter.jar INPUT=samFile.sam OUTPUT=bamFile.bam
This is where I faced the error.
I checked for duplicates using:
samtools view -HS samFile.sam | sort | uniq -c
2 @SQ entries were present >1 times.
Any help would be appreciated, thanks!
I do not know whether it's right nor not, but when using bwa mem, you do not use
-M
parameter, Mark short split hits as secondary (which for Picard compatibility), may be you should try this before go to picard.I think that's the problem! I'll run bwa mem again with the
-M
option. Thank you!Hi, A fresh run with the
-M
option turned on still gives the error when I try Picard Tools! :-(