There's no 'XT:A:U' tag for bwa-mem outputs. How can I get the uniquely mapped reads?
Unconfigured Ad
Collapse
X
-
Keep in mind that "uniqeness" is not a clear cut variable. Rather is a probability that the position of the read is wrong. Specifically, p_wrong= 10^(-mapq/10).
So for mapq 10 you have p_wrong= 0.1, for mapq 20 p_wrong= 0.01. In practice I see that most of the reads are either mapq 0 or mapq pretty high (>30) with little in between, so the exact threshold makes little difference. But this depends of course on your study system.
Comment
-
Thanks for your reply. But it seems that I can't say that the reads with high mapq are the reads only mapped to one location in the genome. In my study, I only need the reads that were just mapped to one location and my collaborators don't wanna see it elsewhere. My fastq files are pair-end ones.Originally posted by dariober View PostKeep in mind that "uniqeness" is not a clear cut variable. Rather is a probability that the position of the read is wrong. Specifically, p_wrong= 10^(-mapq/10).
So for mapq 10 you have p_wrong= 0.1, for mapq 20 p_wrong= 0.01. In practice I see that most of the reads are either mapq 0 or mapq pretty high (>30) with little in between, so the exact threshold makes little difference. But this depends of course on your study system.
I have checked many resources and I know it's hard to definite the 'unique' reads. So is it secure to take the down-stream analysis on the reads with mapq > 30? Or can I make a more filter to choose reads from the mapq>30 reads?
Comment
-
No, that will eliminate huge numbers of reads that have variations, or errors, or are mapped to somewhat repetitive areas, and generally eliminate coverage from a lot of places and give a severe ref-bias everywhere else, so the results will not be trustworthy.Originally posted by Yamol View PostSo is it secure to take the down-stream analysis on the reads with mapq > 30? Or can I make a more filter to choose reads from the mapq>30 reads?
If you filter to remove anything with mapq<=3 you will get only reads that the aligner considers as having one mapping location that is better than any other.
Comment
-
I agree that going above q30 is probably unnecessarily harsh. However there might be cases where you prefer to loose coverage in some regions rather than accepting uncertain read positions.Originally posted by Brian Bushnell View PostNo, that will eliminate huge numbers of reads that have variations, or errors, or are mapped to somewhat repetitive areas, and generally eliminate coverage from a lot of places and give a severe ref-bias everywhere else, so the results will not be trustworthy.
Isn't <=3 a little too relaxed though? It means that a read with q4 has 10^(-4/10) ~ 0.4 chance to be wrong.If you filter to remove anything with mapq<=3 you will get only reads that the aligner considers as having one mapping location that is better than any other.
Anyway, as I said above I find it makes little difference the exact threshold between say 5 and 20. These are the number of reads mapped to mouse chr18 (bowtie2), read length 75, it's a pull-down experiment:
Code:samtools view -c -q0 grm056_i1_KO_carcass.bam 18 8184447 samtools view -c -q1 grm056_i1_KO_carcass.bam 18 8039114 samtools view -c -q3 grm056_i1_KO_carcass.bam 18 7838063 samtools view -c -q5 grm056_i1_KO_carcass.bam 18 7816288 samtools view -c -q10 grm056_i1_KO_carcass.bam 18 7707885 samtools view -c -q20 grm056_i1_KO_carcass.bam 18 7635921 samtools view -c -q30 grm056_i1_KO_carcass.bam 18 7313124 samtools view -c -q40 grm056_i1_KO_carcass.bam 18 7106571
Comment
-
I think the reason why there's little difference is that your data quality and map quality are hyper good.Originally posted by dariober View PostI agree that going above q30 is probably unnecessarily harsh. However there might be cases where you prefer to loose coverage in some regions rather than accepting uncertain read positions.
Isn't <=3 a little too relaxed though? It means that a read with q4 has 10^(-4/10) ~ 0.4 chance to be wrong.
Anyway, as I said above I find it makes little difference the exact threshold between say 5 and 20. These are the number of reads mapped to mouse chr18 (bowtie2), read length 75, it's a pull-down experiment:
Code:samtools view -c -q0 grm056_i1_KO_carcass.bam 18 8184447 samtools view -c -q1 grm056_i1_KO_carcass.bam 18 8039114 samtools view -c -q3 grm056_i1_KO_carcass.bam 18 7838063 samtools view -c -q5 grm056_i1_KO_carcass.bam 18 7816288 samtools view -c -q10 grm056_i1_KO_carcass.bam 18 7707885 samtools view -c -q20 grm056_i1_KO_carcass.bam 18 7635921 samtools view -c -q30 grm056_i1_KO_carcass.bam 18 7313124 samtools view -c -q40 grm056_i1_KO_carcass.bam 18 7106571
Comment
-
The question was specifically about multimapping, not mismapping. If a read has a QV>=3, the mapper thinks it has a >50% chance that the site is correct, therefore there cannot be any other sites to which the read maps equally well. It's true that you will eliminate more incorrectly mapped reads by setting the threshold higher, but there's no reason to do that if the goal is strictly to eliminate multimapped reads.Originally posted by dariober View PostIsn't <=3 a little too relaxed though? It means that a read with q4 has 10^(-4/10) ~ 0.4 chance to be wrong.
Thanks for sharing the empirical results of filtering with various thresholds! But, I'd like to point out that the scalar result of reads remaining does not necessarily reflect the damage potentially done to the analysis results. As an example, a typical human has ~3 million mutations compared to the reference, or around a 0.1% rate. With 100bp error-free reads, then, about 90% of them would be expected to map to the reference with 0 mismatches. If you set your quality threshold high enough, you can will eliminate all of the reads that indicate a variation... but still retain 90% of your reads, which looks pretty good!
Comment
-
Actually I interpreted the question as asking for surely mapped reads but anyway, let's leave this to the OP, hopefully s/he got the message.Originally posted by Brian Bushnell View PostThe question was specifically about multimapping, not mismapping.
I see your point and I agree that increasing mapq to much becomes detrimental, but I'm not sure that lowering the mapq threshold helps. As a thought experiment, imagine a region of 100bp with several SNP relative to the reference, say 20. In order to map a read there you need to lower the mapq score. This could mean that a read truly coming from that region could map even better somewhere else and reads truly mapping somewhere else could end up in this critical region. (I don't do SNP calling so I may get this wrong...)Thanks for sharing the empirical results of filtering with various thresholds! But, I'd like to point out that the scalar result of reads remaining does not necessarily reflect the damage potentially done to the analysis results. As an example, a typical human has ~3 million mutations compared to the reference, or around a 0.1% rate. With 100bp error-free reads, then, about 90% of them would be expected to map to the reference with 0 mismatches. If you set your quality threshold high enough, you can will eliminate all of the reads that indicate a variation... but still retain 90% of your reads, which looks pretty good!
Comment
-
That's true, but it should only be a problem if you use an incomplete reference. If the reference is complete the read should map to the correct location.Originally posted by dariober View PostAs a thought experiment, imagine a region of 100bp with several SNP relative to the reference, say 20. In order to map a read there you need to lower the mapq score. This could mean that a read truly coming from that region could map even better somewhere else and reads truly mapping somewhere else could end up in this critical region.
It's always possible to take a read from some region, apply a bunch of mutations to it, and have the resulting read map perfectly to somewhere else, while having too many differences to map to the correct location at all. These events are very unlikely and tend to be ignored; increasing the mapq threshold will not protect you from them. Of course, there's always some gray area in between. But generally, the higher the mapq threshold, the more reference-bias you will get, which greatly interferes with variant calling.
Comment
Latest Articles
Collapse
-
by SEQadmin2
Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?
Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating...-
Channel: Articles
10-14-2026, 09:55 AM -
-
by SEQadmin2
Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.
We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing...-
Channel: Articles
-
ad_right_rmr
Collapse
News
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, 10-15-2026, 10:52 AM
|
0 responses
23 views
0 reactions
|
Last Post
by SEQadmin2
10-15-2026, 10:52 AM
|
||
|
Started by SEQadmin2, 10-14-2026, 05:39 AM
|
0 responses
27 views
0 reactions
|
Last Post
by SEQadmin2
10-14-2026, 05:39 AM
|
||
|
Started by SEQadmin2, 10-13-2026, 09:56 AM
|
0 responses
24 views
0 reactions
|
Last Post
by SEQadmin2
10-13-2026, 09:56 AM
|
||
|
Started by SEQadmin2, 10-09-2026, 11:14 AM
|
0 responses
28 views
0 reactions
|
Last Post
by SEQadmin2
10-09-2026, 11:14 AM
|
Comment