mapped reads and unmapped reads not equal total number of reads
1
0
Entering edit mode
5.4 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?

alignment • 2.0k views
ADD COMMENT
1
Entering edit mode

Could you please share the commands used to calculate mapped & unmapped. And also the aligner used with parameters given.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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

samtools view -bhS  aln-mt.sam >aln-mt.bam

samtools view -c -F 260 aln-mt.bam 

samtools view -c -f 4 aln-mt.bam

zcat read1.fq read2.fq  | wc -l (output  divide by 4)
ADD REPLY
2
Entering edit mode
5.4 years ago

They can not always be equal. Why do you think so ? One probable reason is that count of mapped reads includes multi-mapped reads too. A read mapping , say twice (at 2 different loci) , will be counted twice !

ADD COMMENT

Login before adding your answer.

Traffic: 3123 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6