I ran bwa mem on a fasta file which was created by concatenating two files of paired reads (I needed to treat them as they were single reads).
Problem is, after mapping I tried to use samtools idxstats to get the number of reads that mapped to each reference sequence, but I got the following error:
[W::sam_hdr_create] Duplicated sequence "A00721:137:HYCH3DSXX:1:1101:3667:1047" in file "aln.sam"
I think this is due to the fact that, if I am not wrong, bwa use only the first part of the headers in the fasta file until the first blank space, so probably paired reads have the same header in the sam file. Unfortunately, I did not realize it before mapping.
Do you know any method which would allow me to solve this problem without re-mapping everything to previously fixed headers?