I have a file describing allele frequencies and I am trying to use awk to print lines if either one of the frequencies in the two last columns are equal or greater than 0.01. Below is the format of the frequency file: I am interested in the last two frequencies.
2L 10000133 A 125/125 115/131 0/125 16/131
2L 10000374 A 121/124 143/143 3/124 0/143
From my limited knowledge of awk, I wrote the following code.
cat myfile.txt |
awk ' BEGIN { {FS="/"}{OFS="\t"}
if( ($8>0) && ($8/$9 >= "0.01") || ($10>0) && ($10/$11 >= "0.01"))
{ print $1,$2 }
}' > myfilteredfile.txt
However, the output file myfilteredfile.txt is empty. I expected that the output file would have printed:
2L 10000133
2L 10000374
...Because both lines contain a frequency in the last two columns that is equal or greater than 0.01. Any advice?