Closed tobiaswolfram closed 1 year ago
First indication that something isn't right is /usr/bin/python3: can't find '__main__' module in 'precimed'
. Could you paste the entire script you're executing?
Thank you for the fast reply! This is my script. Basically I just tried to write a shell-script around your tutorial in the most idiotic way possible.
TRAIT_1=$1 TRAIT_2=$2 N_1=$3 N_2=$4
python3 sumstats.py csv --sumstats ${TRAIT_1} --out ${TRAIT_1}1.csv --force --auto --head 5 --n-val ${N_1} python3 sumstats.py zscore --sumstats ${TRAIT_1}1.csv --out ${TRAIT_1}2.csv --force python3 sumstats.py qc --sumstats ${TRAIT_1}2.csv --exclude-ranges 6:26000000-34000000 --max-or 1e37 --out ${TRAIT_1}.csv --force gzip ${TRAIT_1}.csv
python3 sumstats.py csv --sumstats ${TRAIT_2} --out ${TRAIT_2}1.csv --force --auto --head 5 --n-val ${N_2} python3 sumstats.py zscore --sumstats ${TRAIT_2}1.csv --out ${TRAIT_2}2.csv --force python3 sumstats.py qc --sumstats ${TRAIT_2}2.csv --exclude-ranges 6:26000000-34000000 --max-or 1e37 --out ${TRAIT_2}.csv --force gzip ${TRAIT_2}.csv
for i in $(seq 1 20); do SLURM_ARRAY_TASK_ID=$i python3 precimed/mixer.py fit1 \ --trait1-file ${TRAIT_1}.csv.gz \ --out ${TRAIT_1}.fit.rep${SLURM_ARRAY_TASK_ID} \ --extract 1000G_EUR_Phase3_plink/1000G.EUR.QC.prune_maf0p05_rand2M_r2p8.rep${SLURM_ARRAY_TASK_ID}.snps \ --bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim \ --ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld \ --lib src/build/lib/libbgmg.so
python3 precimed/mixer.py test1 \
--trait1-file ${TRAIT_1}.csv.gz \
--load-params-file ${TRAIT_1}.fit.rep${SLURM_ARRAY_TASK_ID}.json \
--out ${TRAIT_1}.test.rep${SLURM_ARRAY_TASK_ID} \
--bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim \
--ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld \
--lib src/build/lib/libbgmg.so
python3 precimed /mixer.py fit1
--trait1-file ${TRAIT_2}.csv.gz
--out ${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}
--extract 1000G_EUR_Phase3_plink/1000G.EUR.QC.prune_maf0p05_rand2M_r2p8.rep${SLURM_ARRAY_TASK_ID}.snps
--bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim
--ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld
--lib src/build/lib/libbgmg.so
python3 precimed/mixer.py test1
--trait1-file ${TRAIT_2}.csv.gz
--load-params-file ${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}.json
--out ${TRAIT_2}.test.rep${SLURM_ARRAY_TASK_ID}
--bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim
--ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld
--lib src/build/lib/libbgmg.so
python3 python/mixer.py fit2
--trait1-file ${TRAIT_1}.csv.gz
--trait2-file ${TRAIT_2}.csv.gz
--trait1-params-file ${TRAIT_1}.fit.rep${SLURM_ARRAY_TASK_ID}.json
--trait2-params-file ${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}.json
--out ${TRAIT_1}vs${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}
--extract 1000G_EUR_Phase3_plink/1000G.EUR.QC.prune_maf0p05_rand2M_r2p8.rep${SLURM_ARRAY_TASK_ID}.snps
--bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim
--ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld
--lib src/build/lib/libbgmg.so
python3 precimed/mixer.py test2
--trait1-file ${TRAIT_1}.csv.gz
--trait2-file ${TRAIT_2}.csv.gz
--trait1-params-file ${TRAIT_1}.fit.rep${SLURM_ARRAY_TASK_ID}.json
--trait2-params-file ${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}.json
--out ${TRAIT_1}vs${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}
--bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim
--ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld
--lib src/build/lib/libbgmg.so
python3 python/mixer.py test2
--trait1-file ${TRAIT_1}.csv.gz
--trait2-file ${TRAIT_2}.csv.gz
--load-params-file ${TRAIT_1}vs${TRAIT_2}.fit.rep${SLURM_ARRAY_TASK_ID}.json
--out ${TRAIT_1}vs${TRAIT_2}.test.rep${SLURM_ARRAY_TASK_ID}
--bim-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.bim
--ld-file 1000G_EUR_Phase3_plink/1000G.EUR.QC.@.run4.ld
--lib src/build/lib/libbgmg.so
done
python precimed/mixer_figures.py combine --json ${TRAIT_1}vs${TRAIT_2}.fit.rep@.json --out ${TRAIT_1}vs${TRAIT_2}.fit python precimed/mixer_figures.py combine --json ${TRAIT_1}vs${TRAIT_2}.test.rep@.json --out ${TRAIT_1}vs${TRAIT_2}.test python precimed/mixer_figures.py two --json-fit ${TRAIT_1}vs${TRAIT_2}.fit.json --json-test ${TRAIT_1}vs${TRAIT_2}.test.json --out ${TRAIT_1}vs${TRAIT_2}_out --statistic mean std
Space after precimed ?
# Fit and test the second trait
python3 precimed /mixer.py fit1
Gosh, you are probably right. Let me try it.
No, unfortunately the problem still occurs. It seems like it has to be something that happens inside the first call to test1.
ok, but then it's likely to be a missing backslash after fit1.
python3 precimed /mixer.py fit1 --trait1-file ${TRAIT_2}.csv.gz
For some reason it was not that as well. Even after fixing the backslash issues (sorry for that), it still fails after it has already started to run test1.
Ok, then please execute one command at a time and let me know the exact one that fails, and what error message it produces
Well, it seems like it runs through if I execute it step by step (which it did not before), so I suppose your solution indeed fixed it and it was truly just my lack of ability to properly code a loop that caused this commotion. Thank you so much for your help!
No worries, good it's solved!
Hi, really cool tool! I worked through the tutorial and everything was running fine, but now I tried my own GWAS and after successfully debugging a few issues myself, I eventually failed. When running test1 after a succesful run of fit, I get this log:
Not quite sure what is happening here, but libbgmg.so is definitely present. I did all the checks you proposed in an earlier issue and nothing out of the ordinary emerged. Thank you for your help!