Samtools view -F

Hello,

I’m trying to analyze my data following a published bash pipeline where the authors use this samtools command: -F780.
What parameter do I need to select in the -F panel in Galaxy?

Thank you,

Irene

Hi @bioiz,
in the Galaxy tool Samtools view, the meaning of the -F option is explained as “Exclude reads with any of the following flags set”, and then it presents you with a multi-select of plain-English flags.

samtools, the command line tool, however, does not let you select the flags you want so conveniently, but instead requires you to specify a sum of flag-specific numbers. The SAM/BAM FLAG field and its specification are explained in this tutorial of the Galaxy Training Network.

Once you’ve understood the binary nature of the FLAG field, you can try to find out what 780 from the published pipeline corresponds to. To do so you can convert this decimal number to its binary representation, in Python, for example, with bin(780) and see which bits it has set.

bin(780) turns out to be 1100001100, so from right to left the 3rd, 4th, 9th and 10th bit are set. Consulting the FLAG field table from the tutorial above or counting through the options in the Galaxy tool, you can then learn that these correspond to:

  • the read is unmapped
  • the mate is unmapped
  • alignment of the read is not primary
  • read fails platform/vendor quality checks

Hope this helps,
Wolfgang

1 Like