Samtools: exclude secondary and supplementary alignments
0
0
Entering edit mode
3 months ago
Alexandra • 0

Hello!

I have a question regarding how samtools -F handles certain flags. I have bam files from RNA-seq and wish to exclude supplementary and secondary alignments, so part of my analysis includes the following command(s):

samtools collate -@ 32 -O input.bam tmp_prefix | \
samtools fixmate -@ 32 -mu - - | \
samtools sort -@ 32 -u - | \
samtools view -@ 6 -F 256,2048 -q 20 -h - -b -o output_filtered.bam

In my output bam file I have reads with flags such as 292, which is also not a primary alignment. I assumed that by specifying 256 and 2048 these reads would also be excluded. Do I have to specify all possible flags that would indicate a not primary alignment in my script then?

Thanks :)

samtools • 247 views
ADD COMMENT
1
Entering edit mode

You can give a single flag that contains all relevant filters. Just click here (https://broadinstitute.github.io/picard/explain-flags.html) everything you don't want, and then provide the calculated flag the -F.

ADD REPLY

Login before adding your answer.

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