a. Is there a SAM flag that specifies all reads? b. Is there a SAM flag that specifies none of the reads?
So that if I run samtools view -f (a) -F (b) the result will be all reads of the file (as if omitting the specification) ?
Bioinformatics Stack Exchange is a question and answer site for researchers, developers, students, teachers, and end users interested in bioinformatics. It only takes a minute to sign up.
Sign up to join this communityInstead of doing this kind of tweaking I would write my script in a way that these options are passed as strings that can be empty. Something like:
#/ dummy syntax just for illustration:
if(you_want_filtering){
filter_f='-f something'
filter_F='-F something_else'
} else {
filter_f=filter_F=''
}
samtools view (...) ${filter_f} ${filter_F}
So if you want all reads then make these strings empty. That is far more generic than your idea because it can well be that the flag values you need do not exist.
-f
unless all of the reads happen to have a given flag set (or all not have a particular flag set). The best you could do was exclude a flag of 4 to ensure only mapped reads.
$\endgroup$
Oct 12, 2021 at 20:25