gusevlab / fusion_twas

methods for functional summary-based imputation
http://gusevlab.org/projects/fusion/
GNU General Public License v3.0
75 stars 45 forks source link

Single SNP Weights Break FUSION.post_process.R #62

Open travismize opened 1 year ago

travismize commented 1 year ago

Hello,

I have been building single eQTL weights and have noticed that this breaks the FUSION.post_process.R script in multiple places. This is due to datatype changes where matrices are coerced to vectors. For example, this line:

wgt.matrix = wgt.matrix[m.keep,]

will be coerced from a matrix to a vector when m.keep has a length of one. This will then cause the script to error out at these lines:

wgt.matrix[qc$flip,] = -1 wgt.matrix[qc$flip,] ge_g.matrix[,i] = cur.genos %% wgt.matrix[ , mod ]

Currently, I have made edits to this script to have it run successfully, but I would like to request the ability to run FUSION.post_process.R with weights that consist of a single SNP.

Best, -Travis Mize