Dear all,
My paired end reads were mapped using Tophat 2.0.8. Suppose that original number of reads before mapping were (X) reads. I want to find out how many reads (Y) out of the total reads X that have been mapped by Tophat. (Y should include paired-end reads having both reads mapped, or any part of the pair that has been mapped).
I found in the other threads the following command:
samtools view accepted_hits.bam| cut -f 1 | sort | uniq | wc -l
However, this works well for the single-end reads. I am wondering if this works also for paired-end reads. In order to check this, I run:
samtools view accepted_hits.bam| cut -f 1 | sort | uniq > a
samtools view unmapped.bam| cut -f 1 | sort | uniq > b
comm -12 <(cat a) <(cat b) > c
and then I found that (length of a + length of b) - length (c) almost equals the original number of reads.
I am wondering if this is correct to report the percentage of mapped reads for paired-end reads?
My paired end reads were mapped using Tophat 2.0.8. Suppose that original number of reads before mapping were (X) reads. I want to find out how many reads (Y) out of the total reads X that have been mapped by Tophat. (Y should include paired-end reads having both reads mapped, or any part of the pair that has been mapped).
I found in the other threads the following command:
samtools view accepted_hits.bam| cut -f 1 | sort | uniq | wc -l
However, this works well for the single-end reads. I am wondering if this works also for paired-end reads. In order to check this, I run:
samtools view accepted_hits.bam| cut -f 1 | sort | uniq > a
samtools view unmapped.bam| cut -f 1 | sort | uniq > b
comm -12 <(cat a) <(cat b) > c
and then I found that (length of a + length of b) - length (c) almost equals the original number of reads.
I am wondering if this is correct to report the percentage of mapped reads for paired-end reads?
Comment