This is a test version of Biostars. For the public version, visit https://www.biostars.org.
txt file process in linux

Dear all, How can I extract the lines with "qvalue" <0.01 and "meth.diff" >25

Best!

    chr start   end strand  pvalue  qvalue  meth.diff
1   chr1    5615    5615    +   1   0.846983772 0
2   chr1    6164    6164    +   0.758505476 0.846983772 -5.555555556
3   chr1    6223    6223    +   0.017866522 0.128440966 45.71428571
4   chr1    6230    6230    +   0.130641065 0.34493409  -14.28571429
5   chr1    7074    7074    +   1   0.846983772 0
6   chr1    7090    7090    +   0.014258153 0.117110985 42.85714286
7   chr1    7103    7103    +   0.246427048 0.483690518 -25.71428571
8   chr1    7140    7140    +   0.010863121 0.100794245 57.14285714
linux awk

This should work:

awk '$8  > 25 && $7 < 0.01' file.txt

1 answer

Assuming that file is tab de-limited and first column is chr, try this:

$ awk 'NR==1;$5<0.01 && $7>25' input.txt

Log in to answer this question.