Entering edit mode
6.0 years ago
Mbillah
▴
140
To remove mitochondria , align with mitochondria reference and reads. After that I collect mapped reads and unmapped reads. But mapped reads + unmapped != total number of reads, Why?
Could you please share the commands used to calculate mapped & unmapped. And also the aligner used with parameters given.
Align:
bwa mem -t 8 -R '@RG\tID:1\tLB:1\tPL:ILLUMINA\tSM:1' mt.fasta read1.fq read2.fq >aln-mt.sam
Unmapped read:
samtools view -@ 12 -b -S -f 12 aln-mt.sam > unmapped.bam
Mapped read:
samtools view -@ 12 -b -S -F 12 aln-mt.sam > mapped.bam
Could you please check if counting by reads rather than by pairs is working fine. i.e. Please use flag -F 260 instead of 12 to get mapped count.Also -f 4 instead of 12 to get unmapped. Please add the above two and see if it totals correctly with input count. example