Re: numpy.linalg.LinAlgError: 0-dimensional array given. Array must be at least two-dimensional

1,187 views
Skip to first unread message
Message has been deleted

sabrin...@gmail.com

unread,
Jun 17, 2022, 11:54:44 AM6/17/22
to PrediXcan/MetaXcan
Hi Roxy, I think I've run into this error before, because the IDs in the GWAS and prediction model didn't match with the covariance file. Can you send a picture of the first couple rows of the covariance file and GWAS?

On Saturday, June 11, 2022 at 2:48:30 AM UTC-4 Roxy Dong wrote:
Hello,

I was running the S-PrediXcan to conduct TWAS by using GWAS summary stats. I tried all 49 tissues from GTEx and got results for most tissues. But I got this error message for 17 tissues e.g. ovary, prostate.

I downloaded the software about a week ago, I think it should be the most updated version.

Do you know what happened behind this error message and what should I do to correct it?

Traceback (most recent call last):
File "/xxxSoftware/MetaXcan/software/SPrediXcan.py", line 65, in <module>
    run(args)
File "/xxx/Software/MetaXcan/software/SPrediXcan.py", line 31, in run
    M04_zscores.run(args, g)
File "/xxx/Software/MetaXcan/software/M04_zscores.py", line 70, in run
    results = run_metaxcan(args, context)
File "/xxx/Software/MetaXcan/software/M04_zscores.py", line 34, in run_metaxcan
    r, snps = AssociationCalculation.association(gene, context, return_snps=True)
File "/xxx/Software/MetaXcan/software/metax/metaxcan/AssociationCalculation.py", line 60, in association
    d_ = numpy.linalg.eig(cov)[0]
File "<__array_function__ internals>", line 6, in eig
File "/home/xxx/.local/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 1316, in eig
    _assert_stacked_2d(a)
File "/home/xxx/.local/lib/python3.6/site-packages/numpy/linalg/linalg.py", line 198, in _assert_stacked_2d
    'at least two-dimensional' % a.ndim)
numpy.linalg.LinAlgError: 0-dimensional array given. Array must be at least two-dimensional

Thank you for your help.

Sinicerely,

Roxy

Roxy Dong

unread,
Jun 20, 2022, 6:47:03 PM6/20/22
to PrediXcan/MetaXcan
Sure. 

GWAS:

MarkerName    Allele1    Allele2    Freq1    FreqSE    MinFreq    MaxFreq    Effect    StdErr    P-value    Direction    HetISq    HetChiSq    HetDf    HetPVal    N

chr15_101436915_G_A_b38 a g 0.0026 0.0000 0.0026 0.0026 0.0999 0.3923 0.799 +??? 0.0 0.000 0 1 1030

chr3_53066069_C_G_b38 c g 0.9642 0.0063 0.9629 0.9956 -0.0018 0.0119 0.8807 -?+? 33.9 1.513 1 0.2186 78363

chr15_44938616_G_A_b38 a g 0.0012 0.0000 0.0012 0.0012 -0.9881 0.5045 0.05016 ??-? 0.0 0.000 0 1 1384

chr2_234097095_A_G_b38 a g 0.2362 0.0592 0.1913 0.3223 -0.0025 0.0029 0.3827 --+- 0.0 1.040 3 0.7915 296363

chr22_28127634_A_G_b38 a g 0.9956 0.0000 0.9956 0.9956 -0.0619 0.3007 0.8369 ??-? 0.0 0.000 0 1 1384

chr12_13470334_A_G_b38 a g 0.9905 0.0028 0.9894 0.9979 0.0910 0.1457 0.5324 +?+? 0.0 0.066 1 0.7972 2935

chr15_48519823_A_G_b38 a g 0.6714 0.1353 0.4407 0.7554 -0.0016 0.0023 0.4922 ---+ 0.0 0.398 3 0.9407 294733

chr2_151356167_C_T_b38 t c 0.0133 0.0007 0.0034 0.0133 0.0133 0.0207 0.5199 +?+? 0.0 0.000 1 0.9948 56231

chr19_9898534_T_A_b38 a t 0.3036 0.1277 0.1504 0.5130 -0.0035 0.0024 0.1522 ---- 27.4 4.129 3 0.2478 291881

GTEx covariance:
GENE RSID1 RSID2 VALUE
ENSG00000000457.13 chr1_169891332_G_A_b38 chr1_169891332_G_A_b38 0.5151626764886431
ENSG00000000457.13 chr1_169891332_G_A_b38 chr1_169894024_A_C_b38 0.07645794966236963
ENSG00000000457.13 chr1_169894024_A_C_b38 chr1_169894024_A_C_b38 0.15745856353591214
ENSG00000000460.16 chr1_169662225_C_T_b38 chr1_169662225_C_T_b38 0.38379373848987164
ENSG00000000460.16 chr1_169662225_C_T_b38 chr1_169661963_G_A_b38 -0.0696746470227135
ENSG00000000460.16 chr1_169662225_C_T_b38 chr1_169883372_G_A_b38 0.11301411909146722
ENSG00000000460.16 chr1_169661963_G_A_b38 chr1_169661963_G_A_b38 0.22928176795580077
ENSG00000000460.16 chr1_169661963_G_A_b38 chr1_169883372_G_A_b38 -0.017618170656844755
ENSG00000000460.16 chr1_169883372_G_A_b38 chr1_169883372_G_A_b38 0.4397176181706562
ENSG00000000938.12 chr1_27636786_T_C_b38 chr1_27636786_T_C_b38 0.04248004910988322
ENSG00000000938.12 chr1_27636786_T_C_b38 chr1_27634281_G_A_b38 -0.007612031921424189
ENSG00000000938.12 chr1_27634281_G_A_b38 chr1_27634281_G_A_b38 0.15383670963781443
ENSG00000001036.13 chr6_143511989_A_G_b38 chr6_143511989_A_G_b38 0.4392265193370166
ENSG00000001167.14 chr6_41074208_T_A_b38 chr6_41074208_T_A_b38 0.17968078575813384
ENSG00000001460.17 chr1_24417003_G_A_b38 chr1_24417003_G_A_b38 0.17562922038060202
Reply all
Reply to author
Forward
0 new messages