pappewaio / r-stats-c-streamer

0 stars 0 forks source link

Return NA instead of inf #15

Closed pappewaio closed 2 years ago

pappewaio commented 2 years ago

When one value is NA, it is better to return NA instead if inf, which now is the case for inference of N, using an incomplete list of allele frequencies, which happens when adding 1000 genomes AF:s

pappewaio commented 2 years ago

Test case data:

RSID    B   SE  Z   P   N   AFREQ
rs4819391_G 0.233253438056324   0.127172429896691   1.83415098890387    0.0668444836995174  1397    NA
rs11089128_G    -0.057230689617411  0.0707237246183849  -0.809214869921227  0.418529557835942   1397    NA
rs7288972_C -0.0603896529952508 0.0561292812495112  -1.07590283807129   0.282156749586622   NA  0.166428060128848
rs2032141_A 2.04506156636745    0.987859595989405   2.07019456476422    NA  1397    0.000357909806728704
rs11912265_C    0.0730128523576906  0.148272187537675   NA  0.622496796832969   1397    0.0164638511095204
rs4321465_T 0.0184879350623236  NA  0.0558985901144536  0.955430598683162   1397    0.00322118826055834
rs11167319_G    NA  0.0539111323459842  -0.946776039745882  0.343916880859673   1397    0.134216177523264
rs8138488_C -0.0636612849960759 0.0377416410861792  -1.68676515286423   0.0918721012352699  1397    0.374015748031496
rs2186521_A 0.0549469615715985  0.060835465298906   0.903206070696177   0.366572470028154   1397    0.10773085182534

Test case execution:

cat tmp_test_data.txt | ./build/r-stats-c-streamer --functionfile functiontestfile.txt --skiplines 1 --index 1 --pvalue 5 --beta 2 --standarderror 3 --Nindividuals 6 --zscore 4 --allelefreq 7 --statmodel lin | head | column -t