This is a test version of Biostars. For the public version, visit https://www.biostars.org.
samtools view manual

Hi! Could you please explain me the differense between -f and -F in samtools view while filtering bam file?

sequence

What is unclear based on the entry in the manual?

-f INT
Only output alignments with all bits set in INT present in the FLAG field. INT can be specified in hex by beginning with `0x' (i.e. /^0x[0-9A-F]+/) or in octal by beginning with `0' (i.e. /^0[0-7]+/) [0].

-F INT
Do not output alignments with any bits set in INT present in the FLAG field. INT can be specified in hex by beginning with `0x' (i.e. /^0x[0-9A-F]+/) or in octal by beginning with `0' (i.e. /^0[0-7]+/) [0].

1 answer

Hi doramora, those are samtools options,

-f (required flag) -F (filtering flag)

Let say that you want to count all entries mapping to the positive strand, you can use this called "flag", -F 16 where you are filtering the reverse strand.

In this website as well as many others more, you can find a specific number based on what you require or filtering

https://www.samformat.info/sam-format-flag

all the best :)

thank you for the website! i have found, that i've got 4 Flag, but i still can't understand, where do i need to use -f

it depends on what you want to use or not, for example "do this" -f or "don't do this" -F , followed by the number which describes the action

I hope that is clear

It is clear! Thank you a lot! My mind feels better)

Log in to answer this question.