Limiting interval sizes with awk
Kind of a basic awk question. I have a bed file where I have been doing the following to limit interval sizes to those under 1000bp with the following awk script, how would I go about doing the same thing but limiting the output to those between 150-200bp only? Thanks!
awk '{if($3-$2 <= 1000) print}' test.bedpe > test_under1000.bedpe
• 2,179 views
•
link
1 answer
Use awk AND operator:
awk '{if (CONDITION && CONDITION) print}' test.bedpe > test_between_150-200.bedpe
• 0 views
•
link
Log in to answer this question.
But something like the condition below will not work in awk, will it?
Many thanks!
Natasha
This seems to work fine: