I am trying to create a joint covariance of several s-predixcan models that I have created to run with s-multixcan. For this I am using the CovarianceBuilder.py script.
Even though I think the format of my files is correct, I don't get any results. I relate it to a python version issue as I have seen other people in 2018 using the same script with python 2. Has this script been updated?
See my code and files bellow:
There is a point in your data where the script is reading in a str object where it is not required. From your error message it looks like you are using python 3.10, I would suggest you use the python version in this env and see of the error persist.
I am trying to create a joint covariance of several s-predixcan models that I have created to run with s-multixcan. For this I am using the CovarianceBuilder.py script. Even though I think the format of my files is correct, I don't get any results. I relate it to a python version issue as I have seen other people in 2018 using the same script with python 2. Has this script been updated? See my code and files bellow:
python /mnt/lustre/scratch/nlsas/home/otras/fmx/fgs/MetaXcan_tutorial/MetaXcan/software/CovarianceBuilder.py \ --models_folder /mnt/lustre/scratch/nlsas/home/otras/fmx/fgs/PWAS/s_multi_PWAS_Zhang_Schubert/input/models/ \ --model_training_genotype_folder /home/otras/fmx/fgs/LUSTRE/PWAS/s_multi_PWAS_Zhang_Schubert/COVAR_CONJUNTA/input/dosages_covar/final_withchr \ --gtex_snp_file /home/otras/fmx/fgs/LUSTRE/PWAS/s_multi_PWAS_Zhang_Schubert/COVAR_CONJUNTA/input/snp_reference/final_name_var_id.txt \ --impute_to_mean \ --verbosity 1 \ --snp_covariance_output outputt.txt \ --gtex_release_version model_training_v7 \ --throw
$ head UK10K.CEU_MAF0.05_R0.8.PrediXcan.txt.gz -n 50 | gzip -d | cut -f 1,2,3,4,5,6,7,8 varID eQTL-188 eQTL-193 eQTL-178 eQTL-179 eQTL-238 eQTL-243 eQTL-272 1_752566_G_A_b37 1 2 2 2 1 1 2 1_752721_A_G_b37 1 2 2 2 1 1 2 1_753405_C_A_b37 1 2 2 1.988 1 1.083 1.974 1_753541_G_A_b37 1 0 0 0.012 1 0.904 0.026 1_754182_A_G_b37 1 2 2 1.988 1 1.084 1.974 1_754192_A_G_b37 1 2 2 1.988 1 1.084 1.961 1_754334_T_C_b37 1 2 2 1.988 1 1.084 1.974 1_760912_C_T_b37 1 2 2 1.949 1 1.044 1.948 1_761147_T_C_b37 1 2 2 1.949 1 1.044 1.948 1_761732_C_T_b37 0.996 2 2 1.997 1 1.065 1.922 1_775659_A_G_b37 1 2 2 1.994 1 1.097 1.948
head UK10K_v8_CEU_MAF0.05_R0.8snp_covariance_maf0.05_INTERMPHEN_SOCCS_GTExv8.txt GENE RSID1 RSID2 VALUE ENSG00000235358 rs10489167 rs10489167 0.204629552497 ENSG00000235358 rs10489167 rs10489520 0.00666369563371 ENSG00000235358 rs10489167 rs10489521 0.00653718357119 ENSG00000235358 rs10489167 rs10889209 0.0856229591403 ENSG00000235358 rs10489167 rs11207778 0.0425858800544 ENSG00000235358 rs10489167 rs11208754 0.204629552497 ENSG00000235358 rs10489167 rs11209363 0.00644412546721 ENSG00000235358 rs10489167 rs11209531 0.00594114874278 ENSG00000235358 rs10489167 rs11209576 0.0057903950051
With this, the error I have is: `python /mnt/lustre/scratch/nlsas/home/otras/fmx/fgs/MetaXcan_tutorial/MetaXcan/software/CovarianceBuilder.py \
INFO - Loading models... Level 9 - preloading models Level 9 - processing PWAS_AA_AF Level 9 - processing PWAS_CHN_dapg Level 9 - processing PWAS_EU Level 9 - processing PWAS_EUR_dapg Level 9 - processing PWAS_HIS_dapg Level 9 - preparing models (indexing) Level 9 - preparing snp keys Traceback (most recent call last): File "/mnt/lustre/scratch/nlsas/home/otras/fmx/fgs/MetaXcan_tutorial/MetaXcan/software/CovarianceBuilder.py", line 82, in
run(args)
File "/mnt/lustre/scratch/nlsas/home/otras/fmx/fgs/MetaXcan_tutorial/MetaXcan/software/CovarianceBuilder.py", line 31, in run
o.write("GENE\tRSID1\tRSID2\tVALUE\n")
File "/mnt/netapp2/Store_uni/home/otras/fmx/fgs/.conda/envs/MetaXcan-py-3,5/lib/python3.10/gzip.py", line 285, in write
data = memoryview(data)
TypeError: memoryview: a bytes-like object is required, not 'str'`