I am trying to filter reads with an AS below 50. I found that I could use sambamba for this with the command:
sambamba view -F '[AS]' >= 50 /path/to/input/file > /path/to/output/file
The problem with this command is that if a read has a mate with an AS above that threshold, that read won't be deleted and the flag of the mate with no pair still says that it is read is paired. Is there a command with sambamba to filter both pairs if 1 has a lower AS than the threshold or can I filter unpaired reads with a wrong flag with another tool?
Kind Regards, Jelle