statgen / pheweb

A tool to build a website to browse hundreds or thousands of GWAS.
MIT License
160 stars 67 forks source link

Phecodes #183

Open vkp3 opened 3 years ago

vkp3 commented 3 years ago

Hello,

Please forgive these naive questions as I am new to PheWAS analysis.

For the UK Biobank dataset, I have run a PHESANT (https://github.com/MRCIEU/PHESANT) analysis for a subgroup of individuals known to be carriers of mutations associated with a given trait of interest. In other words, I've let PHESANT test association of the group of carriers to non-carriers for all available UKB phenotypes. I have an output file that lists association test results for each of these tests, with associated beta, pvalue.

My questions are 1) how can I convert the individual phenotypes to groups under related phecodes, such as I see in your plots on PheWeb instances (e.g. you have phenotypes color-coded / categorized into "infectious diseases","neoplams","neurological","circulatory system", etc.)?

2) Could you please point me to code (preferably R code within PheWeb) that allows color-coded plotting of a 'phewas' manhattan coded by the groups I mentioned above?

Thank you so much for fielding my fairly naive questions!

Vamsee

ttbek commented 1 year ago

For question 1. The groups are made based on the 'category' variable you can include in the pheno-list.json, see step 4 in the README file. They just need to be strings, the names don't need to be ICD codes. I find it easiest to get my pheno-list.json by making a .csv file first and then doing the conversion. They show how this is done as the 1st of the 'other' methods to create the pheno-list.json https://github.com/statgen/pheweb/blob/df1530809e0821b53dd5feb1e405277d1a74c9bc/etc/detailed-loading-instructions.md#making-pheno-listjson TOPMED decides that however they want, ask them directly I suppose.

For 2, I think you're stuck with python for Pheweb, I think the section you would want to start with is https://github.com/statgen/pheweb/blob/df1530809e0821b53dd5feb1e405277d1a74c9bc/pheweb/load/manhattan.py

There is R code for that could be modified for this, just not in Pheweb as far as I know.