mixer icon indicating copy to clipboard operation
mixer copied to clipboard

mixer_figures.py combine: numpy.linalg.LinAlgError: singular matrix

Open Huifang-Xu opened this issue 2 years ago • 6 comments

Hi,

I tried to run bivariate analysis for multiple traits with MiXeR. One of the bivariate analyses fialed to produce results with the error meaasge "numpy.linalg.LinAlgError: singular matrix". No error message was generated in the two steps of fitting and applying model. All json files exist. image

The codes I used:

# Step 1: Fit the model for bivariate analysis
python /mixer/precimed/mixer.py fit2 \
        --trait1-file AN_31308545.a1effect.munge.rmInDels.uniq.noMHC.csv.gz \
        --trait2-file DHA.a1effect.munge.rmInDels.uniq.noMHC.csv.gz \
        --trait1-params-file AN_31308545_noMHC.fit.rep${SLURM_ARRAY_TASK_ID}.json \
        --trait2-params-file DHA_noMHC.fit.rep${SLURM_ARRAY_TASK_ID}.json \
        --out AN_31308545_vs_DHA_noMHC.fit.rep${SLURM_ARRAY_TASK_ID} \
        --extract /mixer/data/1000G.EUR.QC.prune_maf0p05_rand2M_r2p8.rep${SLURM_ARRAY_TASK_ID}.snps \
        --bim-file /mixer/data/[email protected] \
        --ld-file  /mixer/data/[email protected] \
        --lib /mixer/src/build/lib/libbgmg.so       

# Step 2: Apply the model to the entire set of SNPs, without constraining to LDSR/w_hm3.justrs
python mixer/precimed/mixer.py test2 \
        --trait1-file AN_31308545.a1effect.munge.rmInDels.uniq.noMHC.csv.gz \
        --trait2-file DHA.a1effect.munge.rmInDels.uniq.noMHC.csv.gz \
        --load-params-file  AN_31308545_vs_DHA_noMHC.fit.rep${SLURM_ARRAY_TASK_ID}.json \
        --out  AN_31308545_vs_DHA_noMHC.fit.apply.rep${SLURM_ARRAY_TASK_ID} \
        --bim-file /mixer/data/[email protected] \
        --ld-file  /mixer/data/[email protected] \
        --lib /mixer/src/build/lib/libbgmg.so

# Step 3: Visualize the results
python /mixer/precimed/mixer_figures.py combine \
        --json [email protected] \
        --out AN_31308545_vs_DHA_noMHC.fit.combined
python /mixer/precimed/mixer_figures.py combine \
        --json [email protected] \
        --out AN_31308545_vs_DHA_noMHC.fit.apply.combined
python /mixer/precimed/mixer_figures.py two \
        --json-fit AN_31308545_vs_DHA_noMHC.fit.combined.json \
        --json-test AN_31308545_vs_DHA_noMHC.fit.apply.combined.json \
        --out AN_31308545_vs_DHA_noMHC \
        --statistic mean std

I would like to know why this error message occured and how to fix it. Any help is appreciated. Thank you!

Huifang

Huifang-Xu avatar Jun 13 '22 16:06 Huifang-Xu