Skip to main content

prstools

prstools is software to create Polygenic Risk Scores (PRS) directly from the commandline.

It makes PRS generation easier, compared to previous tools, by:

  • Super fast reading and matching of sumstats (handles odd formats).
  • Rapid creation of the model.
  • Automatic generation of the PRS Prediction for target plink files.

All the above, for a real GWAS sumstat, within 30 minutes using only 1 command. Installation and running the demo example should not take more than 10 minutes.

We are actively developing prstools and feedback by mail or our feedback form (with 🏆 lottery) is much appreciated!

Install

To install use the following command.

pip install -U --prefer-binary prstools

For it to work, you should have python3.8 or later installed (pip is included in python3.8+). If the command above does not work directly you can install using conda (or mamba if you have that), by running conda install "python>=3.9". For other install issues please check the install guide or send us a mail.

How to use

Immediately after installing prstools, it should be possible to download & run the demo example (~4mb), by pasting the following into the commandline (if not see install guide):

# Makes 'example' dir with data in current path:
prstools downloadutil --pattern example --destdir ./; cd example

# Run the model with example data:
prstools prscs2 --ref ldref_1kg_pop --target target \
                --sst sumstats.tsv --n_gwas 2565 --out ./result 

This will run PRS-CS2 on the example data, using the new implementation to demonstrate the capabilities of prstools and makes PRS predictions for the example dataset. The best and fastest way to get a PRS for your case is to try the Tutorial below.

There is also the prstools documentation, residing inside of the command-line interface, which you can see by typing prstools or a subcommand.
Forinstance typing prstools prscs2 will output the documentation for the prscs2 subcommand:

Usage:
 prst prscs2 [-h  --cpus <num-of-cpus>] --ref <dir/refcode> --target <bim-prefix>
                   --sst <file> --out <dir+prefix> [--n_gwas <num>  --chrom <chroms>]
                   [--colmap <colnames>  --rsidmode <yes/no>  --pred <yes/no>]
                   [--n_iter <n_iter>  --n_burnin <n_burnin>  --n_slice <n_slice>]
                   [--seed <seed>  --a <a>  --b <b>  --phi <phi>  --clip <clip>]
                   [--sampler <sampler>  --n_jobs <n_jobs>]

PRS-CS v2: A polygenic prediction method that infers posterior SNP effect sizes under 
continuous shrinkage (CS) priors.

General Options:
 -h, --help                 Show this help message and exit.

... [omitted for readability] ...

 --n_jobs <n_jobs>          This sets the number of jobs for parallel processing. (default:
                            8)

# Examples (get data, run model) --> can be directly copy-pasted (:
prstools downloadutil --pattern example --destdir ./; cd example        
prst prscs2 --ref ldref_1kg_pop -t target -s sumstats.tsv --n_gwas 2565 --out result-prscs2

As can be seen, there are examples at the end of the help output to illustrate usage, which should work with a simple copy-paste.

There is now also an online version of all this documentation (https://prstools.readthedocs.io/).

Tutorial + Video

For more information and a hands on demonstration of what prstools can do have a look at the Getting Started Tutorial. There is also a Video. The tutorial+video is a tiny bit older than the current prstools version, which has more functionality. You can load the tutorial in a free cloud instance by clicking here: Google Colab.

Contact

For questions and support please send a mail (menno.j.witteveen@gmail.com).

Metadata

Release files for prstools 0.0.77

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prstools 0.0.77
File Size Uploaded
prstools-0.0.77.tar.gz 2.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for prstools 0.0.77
File Interpreter ABI Platform
prstools-0.0.77-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 MB

Release files / prstools-0.0.77.tar.gz

Download URL prstools-0.0.77.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
57d80de60ab736329f28a4df9b1fa8bbd8e29de39a9dd886b76a7c121f9b2596
BLAKE2b-256 checksum
How to use checksums
3900c50ba75060b5b9c6ac3d077340f693f2e9ae7bc2829c6f18a1353bc6b055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4

Release files / prstools-0.0.77-py3-none-any.whl

Download URL prstools-0.0.77-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a406b32f680b083188e94a2a8ff506dac6c77277efca3b5857f81b8504c04392
BLAKE2b-256 checksum
How to use checksums
895686e174254a6a1db060e6cb3936a378cd92c8f0448be7bff5ac9cad420a8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page