nadavbra / pwas

Proteome-Wide Association Study
40 stars 4 forks source link

ValueError: zero-size array to reduction operation maximum which has no identity #5

Open KoalaQin opened 3 years ago

KoalaQin commented 3 years ago

Hello,

I was running pwas for my own dataset, without providing a covariate file for the test run, and I have trouble solving it myself. I ran into this error, I wonder if it's because I didn't provide a covariate JSON file. Just for the convenience, since I'm not working on UKB data, can I just provide normal csv file for covariates if the covariate file is a must for the command? Thanks in advance for your help.

Traceback (most recent call last): File "/usr/local/bin/pwas_test_genes", line 4, in import('pkg_resources').run_script('pwas==1.0.4', 'pwas_test_genes') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1470, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python3.8/dist-packages/pwas-1.0.4-py3.8.egg/EGG-INFO/scripts/pwas_test_genes", line 144, in File "/usr/local/lib/python3.8/dist-packages/pwas-1.0.4-py3.8.egg/EGG-INFO/scripts/pwas_test_genes", line 66, in handle_covariate_separation File "/usr/local/lib/python3.8/dist-packages/pwas-1.0.4-py3.8.egg/pwas/shared_utils/util.py", line 512, in find_linearly_independent_columns File "<__array_function__ internals>", line 5, in matrix_rank File "/usr/local/lib/python3.8/dist-packages/numpy/linalg/linalg.py", line 1903, in matrix_rank tol = S.max(axis=-1, keepdims=True) max(M.shape[-2:]) finfo(S.dtype).eps File "/usr/local/lib/python3.8/dist-packages/numpy/core/_methods.py", line 39, in _amax return umr_maximum(a, axis, None, out, keepdims, initial, where) ValueError: zero-size array to reduction operation maximum which has no identity

KoalaQin commented 3 years ago

I used the solution from the other post and it seems working, by including covariates with json list. So pwas can't run without covariates?

nadavbra commented 3 years ago

I think it can be run without covariates, but it is really not recommended. Without at least including the ~5 first PCs of genetic variation, you are likely to get spurious associations driven by population structure (like in standard GWAS). If you run on a dataset of both males and females, then you probably also want to include sex as a covariate. And age as well.

What is the full command-line that you were running when it failed?