This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extracting Snps with pvalue <5x10-8 from gwas result

I am working on Multivariate GWAS analysis and I have my results output from the analysis. I would like to extract Snps which have the pvalue < 5x10-8. However,I used

awk '{ if($4 < 5e-8) { print $1 }}' file | head

and

awk '{ if($4 < 0.00000005) { print $1 }}' file |  head

This two commands didnt output any data.

snp

what does the input look like ? show us a few lines.

CHR     SNP     POS     P
1       rs147324274     11063   0.788453971217744
1       rs144804129     30741   0.3335653075464541
1       rs6602381       51427   0.7555139906863562
1       rs189891329     58396   0.9016132067991081
1       rs114824410     69487   0.44423311912092556
1       rs573719411     69569   0.23298959712788614
1       rs574200131     77470   0.7608982219420641
1       rs538386461     85435   0.1200837784195348
1       rs751479053     108658  0.021944278384597855

Above is my dataset

Make sure you have such p-values. Maybe try with $4<=0.01 ?

Thanks for the input. I used the previous command with another dataset and there was an output. I then sorted my data and discovered that there was no pvalues at that threshold. In conclusion the problem wasnt from the command but rather from the dataset.

1 answer

with the example your provided above, the following awk script works:

awk '($4<1E-1) {print $1}' input.txt

furthermore: check your LOCALE : https://www.gnu.org/software/gawk/manual/html_node/Locale-influences-conversions.html

Log in to answer this question.