Entering edit mode
5.4 years ago
elena.syp
•
0
Hi!
I want to filter a sam file (produced by bowtie2) based on alignment score (column 14) >= 5000. I tried:
awk '{ if($14 >= 5000) { print }}' input.sam > output.sam
However, this doesn't work as the values of my column are preceeded by "AS:i:" so it does not identify it as a number. I removed all my "AS:i:" from the file and then the previous command worked, of course, but now I am left out without the AS:i: preceeding the alignment score values. Does somebody have any suggestion on how to do this in a different way?
Thanks!
Elena
with this awk expression, the header is removed...
what is the column 14 ? because the
alignment score
(= MAPQ ?) is usually the 5th column.I assume the
NM
tag.so see : A: filter BAM file for reads that map 100% identity