This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sorting of SNPs which has less than 0.05 threshold P-Value

How can we get total number of SNPs in plink association output file as "qassoc" and "adjusted file" which has less than 0.05 P values?

snp plink

please post some example lines from that files.

1 answer

From the plink manuals the pvalue column for qassoc file is the 9th. So we can use awk to keep the 1st row header, then filter on 9th column value, see example:

awk '(NR==1) || ($9 < 0.05) ' myfile.qassoc > myfile_subset.qassoc

To get the number of rows:

awk '$9 < 0.05' myfile.qassoc | wc -l

Thank you very much zx8754 :) it works.

Hi aarvaBioinfo,

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.
Upvote|Bookmark|Accept

Log in to answer this question.