Even better: add -F12 to make sure you remove the ones that are not mapped and whose mate is not mapped. Believe it or not, the "mapped in proper pair" flag can be given to... unmapped reads.
Explanation from the SAM format specs (according to a previous post): "If 0x4 is set, no assumptions can be made about RNAME, POS, CIGAR, MAPQ, bits 0x2, 0x10 and 0x100 and the bit 0x20 of the next segment in the template.".
Conclusion: don't trust the sole "proper pair" nor the "mapq" flag and always control for the mapping status.
Seqanswers Leaderboard Ad
Collapse
Announcement
Collapse
No announcement yet.
X
-
From samtools (http://samtools.sourceforge.net/samtools.shtml)
-f INT Only output alignments with all bits in INT present in the FLAG field. INT can be in hex in the format of /^0x[0-9A-F]+/ [0]
-F INT Skip alignments with bits present in INT [0]
From the SAM spec: (http://samtools.sourceforge.net/SAM1.pdf)
FLAG: bitwise FLAG. Each bit is explained in the following table:
Bit Description
0x1 template having multiple segments in sequencing
0x2 each segment properly aligned according to the aligner
0x4 segment unmapped
Though the flag explainer is new to me; thanks for posting it.Last edited by winsettz; 02-04-2013, 10:03 AM.
Leave a comment:
-
Originally posted by swbarnes2 View PostYou want
Code:samtools view -bhF 2 in.bam > out.bam
Leave a comment:
-
You want
Code:samtools view -bhF 2 in.bam > out.bam
Leave a comment:
-
Originally posted by paolo.kunder View PostDear All,
I would like use Samtools to discard reads from the bam file that fail to map as a proper pair.
Is this command correct?
Code:samtools view -b-h -f 4 -o out.bam in.bam
Thanks,
Paolo
Code:samtools view -bh -f2 in.bam > out.bam
FYI, a flag reader is available here
Leave a comment:
-
Discard reads from file that fail to map as a proper pair.
Dear All,
I would like use Samtools to discard reads from the bam file that fail to map as a proper pair.
Is this command correct?
Code:samtools view -b-h -f 4 -o out.bam in.bam
Thanks,
PaoloTags: None
Latest Articles
Collapse
-
by seqadmin
Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.
Long-Read Sequencing
Long-read sequencing has seen remarkable advancements,...-
Channel: Articles
12-02-2024, 01:49 PM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, Yesterday, 07:41 AM
|
0 responses
6 views
0 likes
|
Last Post
by seqadmin
Yesterday, 07:41 AM
|
||
Started by seqadmin, 12-11-2024, 07:45 AM
|
0 responses
11 views
0 likes
|
Last Post
by seqadmin
12-11-2024, 07:45 AM
|
||
Started by seqadmin, 12-10-2024, 07:59 AM
|
0 responses
12 views
0 likes
|
Last Post
by seqadmin
12-10-2024, 07:59 AM
|
||
Newborn Genomic Screening Shows Promise in Reducing Infant Mortality and Hospitalization
by seqadmin
Started by seqadmin, 12-09-2024, 08:22 AM
|
0 responses
9 views
0 likes
|
Last Post
by seqadmin
12-09-2024, 08:22 AM
|
Leave a comment: