gusevlab / fusion_twas

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

MHC locus selection #41

Closed saramonteiromartins closed 2 years ago

saramonteiromartins commented 2 years ago

Hello,

Just a heads up regarding the MHC locus.

I had a couple of hits on Chr 6 that weren't saved separately on ".MHC". I realized that since P0 and P1 are character vectors, R wasn't correctly selecting MHC. I solved my problem by simply adding as.numeric: mhc = out.tbl$CHR == 6 & as.numeric(out.tbl$P0) > 26e6 & as.numeric(out.tbl$P1) < 34e6

Dummy example in R version 4.0.5:

"28000000"<34e6 [1] TRUE "31615212"<34e6 [1] FALSE

Best wishes, Sara

sashagusev commented 2 years ago

Hi Sara, thanks for spotting this, I've incorporated it into the code. However I also recommend double checking how your data is being loaded, the fact that these positions were parsed as strings may be indicative of some other formatting issues. If all entries in the file are numeric they should be read in as numeric by default.