xinhe-lab / ctwas

package for the causal TWAS project
https://xinhe-lab.github.io/ctwas/
MIT License
32 stars 12 forks source link

Reading PredictDB Weights | Don't hardcode rsid as the SNP identifier #7

Open shugamoe opened 11 months ago

shugamoe commented 11 months ago

https://github.com/xinhe-lab/ctwas/blob/47c0e3b114799af5cf2ef86de2569b58f78e0751/R/ctwas_read_data.R#L434

When reading in weights from a .db it can be inconvenient to have rsid hard coded as the SNP identifier. Especially since there is another column, varID, which could be used. While working with predictdb mashr gtex v8 eQTL and sQTL models, I've used that identifier instead. Some of the SNPs in these models, if rsid is missing for whatever reason, use varID as a backup in the rsid row anyway as well.

Here's an example of a db_id parameter added to allow the user to specify the SNP identifier from a .db weight source. https://github.com/shugamoe/ctwas/commit/bd42fc0924bf6b944f4338c2ec5abf108e80b62a