R script to calculate Polygenic Risk Score from genotype data, and eventually plot them.
Clone the repository locally:
git clone https://github.com/TesiNicco/jordan.git
You may need to make the main file executable by typing:
chmod +x ./jordan/bin/jordan.R
Make sure you have the required R packages in place:
argparse
data.table
stringr
ggplot2
In addition to R packages, you need to have https://www.cog-genomics.org/plink/2.0/ and https://www.cog-genomics.org/plink/1.9/ installed in your system.
If all this is OK, then you should be able to run the script.
By running:
./bin/jordan.R -h
will display jordan
options. To run, jordan
requires:
- genotype data (PLINK or VCF format)
- snplist (list of SNPs to use for the PRS, including CHROM, POS, EFFECT_ALLELE, BETA (or OR)
- outname (the name of the output folder)
- isdosage: binary flag whether data is genotyped or imputed (TRUE/FALSE)
- plot: binary flag to plot densities of not (TRUE/FALSE)
To test everything is allright, you can use the following script alongside the example datasets provided in the repository. The example data will make a PRS from 85 SNPs associated with Alzheimer's Disease in individuals from the 1000Genome Project:
./bin/jordan.R --genotype example_data/example_data_plink --snplist example_data/AD_snps.txt --outname test_output --isdosage TRUE --plot TRUE
This should run successfully, and will display results in the output directory specified:
- PRS_density.pdf: density of the PRS across individuals
- PRS_SNPs.pdf: SNPs included/excluded from the PRS, and relative effect sizes
- PRS_table.txt: tab-delimited table with samples in rows and PRS in column
- snpsInterest.txt: tab-delimited table with information about included/excluded SNPs.
For comments, feedbacks, or question, feel free to reach me at [email protected] or open an issue.