Samtool flag with meaning of -F
1
0
Entering edit mode
10.0 years ago
mangfu100 ▴ 810

Hi.

while using samtools, I have been encountering samtools flag with -F.

looking into the specification of samtool, it is written that

-F int Skip alignments with bits present in INT [0]

Could you give me more information with some examples?However, I don't understand just looking the document above.

alignment next-gen sequence • 4.5k views
ADD COMMENT
7
Entering edit mode
10.0 years ago
Dan D 7.4k

The SAM specification indicates that column two of each line is a bitwise FLAG. This integer value contains a wealth of information about the particular alignment, but it's not easy to decode just by looking at it.

At this page, you can enter an integer value that will tell you exactly what a particular flag means. You can also construct your own flag by checking the various boxes.

Using this flag in combination with the -Fparameter in samtools view will Filter out any alignments which contain the parameters specified in the flag.

For example: to have samtools view not show any alignment that's flagged as a duplicate AND has an unmapped mate, you would use the following command:

samtools view -F 1032 [your.bam]

Let's say you don't want to see any read 2s of a paired-end dataset:

samtools view -F 128 [your.bam]

One more for grins. Let's say you wanted to skip any reads that were part of a pair AND where both reads mapped properly as a pair AND where the properly-mapped pair is not the primary alignment for that read pair:

samtools view -F 259 [your.bam]
ADD COMMENT

Login before adding your answer.

Traffic: 1920 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