This is a fork of Pheweb specifically for the Dog Aging Project (DAP)
This is a slight modification of the original PheWeb which should be cited: Gagliano Taliun, S.A., VandeHaar, P. et al. Exploring and visualizing large-scale genetic associations by using PheWeb. Nat Genet 52, 550–552 (2020).
pip3 install phewebIf on ASU SOL cluster then read the "sol_install_notes.txt"
Traditional PheWeb only works for hg19 or hg38, so I've hardcoded changes for dog. This means that the config.py isn't used, so might as well put hg19.
There are multiple options, but PheWeb expects files to look like:
chrom,pos,ref,alt,pval
1,629,C,T,0.0856026
1,2076,G,T,0.835506
1,2388,C,T,0.0574887
This conversion was done with a simple python script mlma_to_csv.py
and the files were stored in the mlmas/ subdir.
Inside of your data directory, you need a file named pheno-list.json that looks like this:
[
{
"assoc_files": [
"mlmas/DogAgingProject_gp-0.70_biallelic-snps_N-6358_maf-0.01_geno-0.05_hwe-1.0E-20-midp-keep-fewhet_phe-dd_weight_lbs_N-6279_cov-dd_sex_N-6279_qcov-Estimated_Age_Years_at_HLES_N-6279_chr1.loco.csv"
],
"phenocode": "Weight",
"category": "Physical"
},
{
"assoc_files": [
"mlmas/DogAgingProject_gp-0.70_biallelic-snps_N-6358_maf-0.01_geno-0.05_hwe-1.0E-20-midp-keep-fewhet_phe-pa_activity_level_N-6279_cov-dd_sex_N-6279_qcov-Estimated_Age_Years_at_HLES-dd_weight_lbs_N-6279_chr1.loco.csv"
],
"phenocode": "Activity level",
"category": "Activity"
},
{
"assoc_files": [
"mlmas/DogAgingProject_gp-0.70_biallelic-snps_N-6358_maf-0.01_mp_dental_extraction_N-1524_cov-dd_sex_N-6279_Estimated_Age_Years_at_HLES-dd_weight_lbs_N-6279_chr1.loco.csv"
],
"phenocode": "Dental extraction",
"category": "Dental"
}
]Each phenotype needs assoc_files (a list of paths to association files) and phenocode (a string representing your phenotype that is used in filenames and URLs, comprised of [A-Za-z0-9_~-]).
If you want, you can also include:
phenostring(string): a name for the phenotype. Shown in tables and tooltips and page headers.category(string): groups together phenotypes in the PheWAS plot. Shown in tables and tooltips.num_cases,num_controls, and/ornum_samples(number): if your input data only hasACorMAC, this will be used to calculatedAForMAF. Shown in tooltips. If your input data has correctly-named columns for these, the commandpheweb phenolist read-info-from-association-fileswill add them into your existingpheno-list.json.- anything else you want, but you'll have to modify templates to use it.
Run pheweb process.
To distribute jobs across a cluster, follow these instructions.
To include VEP annotations, follow these instructions.
If something breaks and you can't understand the error message or it's something that PheWeb should support by default, open an issue on github or email me.
Run pheweb serve --open.
That command should either open a browser to your new PheWeb, or it should give you a URL that you can open in your browser to access your new PheWeb. If it doesn't, follow the directions for hosting a PheWeb and accessing it from your browser.
To run pheweb through systemd, see sample file here. To use Apache2 or Nginx, see instructions here. To require login via OAuth, see instructions here. To track page views with Google Analytics, see instructions here. To reduce storage use, see instructions here. To customize page contents, see instructions here.
PheWeb can display phenotype correlations generated by another tool.
To use this feature, set show_correlations = True in config.py and place the output of the rg pipeline as pheno-correlations.txt in the same folder as pheno-list.json.
To hide the button for downloading summary stats, add download_pheno_sumstats = "secret" and SECRET_KEY = "your random string" in config.py. That will make a secret page (printed to the console when you start the server) to share summary stats.
To hide the button for downloading top hits and phenotypes, add download_top_hits = "hide" and download_phenotypes = "hide" respectively.
To allow dynamically filtering the manhattan plot, run pheweb best-of-pheno and set show_manhattan_filter_button=True in config.py.
Here are the steps I took to get a development installation of PheWeb running on my mac laptop:
- Clone the DAP PheWeb repo
git clone https://github.com/AkeyLab/DAP_pheweb.git
- cd into the repo and create a virtual environment. I used python 3.8 after I had some trouble with 3.11
-
cd DAP_pheweb -
python3.8 -m venv .venv -
source .venv/bin/activate
- Install wheel and then pheweb as editable
-
pip install wheel -
pip install -e .
- Check that pheweb is installed
which pheweb
- Run the included tests, hopefully they should all pass
-
pip install pytest -
python -m pytest
- Do a test run of the server. Run the following command, and while that is running, open a browser window and go to http://0.0.0.0:8000/ and there should be a small pheweb example application running.
./tests/run-all.sh