lassosum icon indicating copy to clipboard operation
lassosum copied to clipboard

p2cor generating NaNs

Open Fnyasimi opened this issue 4 years ago • 8 comments

@tshmak thanks for the nice tool I have been using for a while

I have these two snps in my summary stats which have really low pvalue and end up generating NaN correlations when using p2cor function. The sample size is above 1000

snp af effectsize se pvalue
snp1  NA 0.6433 0.08915 4.940656e-324
snp2  NA 0.6434 0.08916 4.940656e-324

What is the best approach to handle such snps in this function/tool because the NaNs present issues downstream. I would really appreciate your feedback on this issue.

Fnyasimi avatar Aug 30 '21 15:08 Fnyasimi

You could probably derive these correlations yourself using the formula from p2cor(): https://github.com/tshmak/lassosum/blob/master/R/p2cor.R#L20

where t is basically effectsize / se and n is the sample size.

privefl avatar Aug 30 '21 15:08 privefl

Thank you so much.

Does the package work on R 4.0.5 on macOS BigSur 11.6? I am getting this error here when I try to load it

Error: package or namespace load failed for ‘lassosum’:
 package ‘lassosum’ was installed before R 4.0.0: please re-install it

I installed the package using the instructions here

Fnyasimi avatar Oct 20 '21 16:10 Fnyasimi

Restart and reinstall?

privefl avatar Oct 20 '21 18:10 privefl

I have done that still getting the same error

Fnyasimi avatar Oct 25 '21 16:10 Fnyasimi

Hello, did you solve the problem? I have same problem here but didn't know how to solve it

nini-tech23 avatar Jul 27 '23 00:07 nini-tech23

Have you tried uninstalling lassosum and re-installing?

tshmak avatar Jul 31 '23 01:07 tshmak

My package is working well, but I have a problem of getting NaN correlations values when running pcor2. There are 48 SNPs which have very low p-value, so I want to ask whether it is okay for excluding those SNPs from the analysis

nini-tech23 avatar Jul 31 '23 02:07 nini-tech23

You mean the p-value is less than the 2.2e-308 (i.e. double.xmin)? If so, I think a better idea is to replace these with double.xmin, since low p-values are supposed to indicate important SNPs.

tshmak avatar Jul 31 '23 02:07 tshmak