Phenowide-wide interaction study (PheWIS) is an R computational tool to evaluate the association between phenotypes and gene-environmental interactions.
Data resource: UK Biobank.
- bgen files are in /project/kylab/lab_shared/UKB/imputationbgen_v1.2_UKBsource.
- Run scripts 1.convert_bgen1.2_to_pgen.sh and 2.filter_imputed_snps.sh
- Use R to do the QC of participants by using script UKB_QC-07082020.R and data file ukb48818_rel_s488282_output.dat
- Run script 3.convert_pfile_bgenUKB.sh to get the bgen files that will be used to generate the genotype data.
- Run scripts 4.generate_geno.sh and generate_geno.R to modify the genotype data into a specific format of PheWIS.
- Use software "createUKBphenome" to transfer the phenotype data into phecode. "createUKBphenome" is an R software that used to transfer data from UK Biobank into phecode.
- The path of file ukb34137.tab is /project/kylab/lab_shared/UKB/pheno. If the others tables will be used, please make sure the table contains the following data: f.41270, f.40002, f.40006, f.40001, f.40013, f.41271, f.41201, f.41202, f.41203, f.41204, f.41205. These data are ICD9 and ICD10 used to generate phecode.
cp ukb34137.tab phew.tab
git clone https://github.com/umich-cphds/createUKBphenome
git clone https://github.com/PheWAS/PheWAS
Rscript ./scripts/function.createUKBphenome.r
The phenotpye_data is in the results directory and the name should follow the pattern "UKB_PHECODE_date.txt"
- Find the field code of your exposure on the website of UKBthen and extract exposure information from the UKB table. For example, the field ID of sex is f.31. The following commands are using to extract the column number of sex.
head -n 1 ukb34137.tab | awk '{for(i=0;++i<=NF;)a[i]=a[i]?a[i] FS $i:$i}END{for(i=0;i++<NF;)print a[i]}' | grep -n "f.31"
- Use the following commands to write the columns to a new file. For example, sex is in the second column of the ukb34137.tab.
cut -f 1,2 ukb34137.tab > sex.txt
The process of covariates data generation is same with exposure data generation. Please see exposure for details.
use script dophewis.R.
use script Manhattan.R
Mengyuan Zhang, [email protected]