Skip to content

Instantly share code, notes, and snippets.

@viklund
Created June 7, 2016 09:45
Show Gist options
  • Save viklund/f78b4432489bde1276d32289942a2835 to your computer and use it in GitHub Desktop.
Save viklund/f78b4432489bde1276d32289942a2835 to your computer and use it in GitHub Desktop.
$ awk '$4>50 && $3>90 && F[$1]++ < 1{print}' blast_result
$4 is column 4 i.e. length, larger than 50bp
$3 percent identity bigger than 90
F[$1]++ < 1 is the tricky part. We count upwards for each query we find and as long as the number
is less than 1 it is true, since the ++ is after the F[$1] the value will be zero the first time
and 1 the second time and so on.
&& is just standard and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment