Skip to main content

prstools

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

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 is to try the Tutorial below.


There is also the prstools documentation, which resides inside of the command-line interface, which you can see by typing prstools.

prstools
Usage:
 prstools <command> ...

Convenient and powerfull Polygenic Risk Score creation. 
'prst' is a commandline shorthand for 'prstools'

Models & Utility Commands:
 <command>
  downloadutil  Download and unpack LD reference panels and other data.
  combine       A tool to combine genetics-related text files.
  prscs2        PRS-CS v2: A polygenic prediction method that infers posterior SNP effect sizes
                under continuous shrinkage (CS) priors.

By combining prstools with another <command> a specific model or other functionality can be used.
Forinstance typing prstools prscs2 will output the documentation for the prscs2 subcommand:

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

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.
 -c, --cpus <number-of-cpus>              The number of cpus to use. Generally most efficient if
                                          chosen to be between 1 and 5. Functionality can be

... [omitted for readability] ...


 --clip <clip>                            Clip parameter. The default works best in pretty much
                                          all cases. (default: 1.0)
 --sampler <sampler>                      Sampler algorithm. Rue sampling is the original sampler,
                                          which gives good results. (default: Rue)

Examples --> can be directly copy-pasted (:
 prst downloadutil --pattern example --destdir ./; cd example                                                # Makes 'example' dir in current path.
 prstools prscs2 --ref ldref_1kg_pop --target target --sst sumstats.tsv --n_gwas 2565 --out ./result-prscs2 # Run the model with example data.
 prst prscs2 -r ldref_1kg_pop -t target -s sumstats.tsv -n 2565 -o ./result-prscs2 --pred                  # A shorter version of previous that also does the predictions.

Soon there will be a copy of this documention online too. 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.

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).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prstools-0.0.71.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prstools-0.0.71-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file prstools-0.0.71.tar.gz.

File metadata

  • Download URL: prstools-0.0.71.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for prstools-0.0.71.tar.gz
Algorithm Hash digest
SHA256 2dfcf7b476dcac8dedd33cb10785f3e761ac659b1e6f0820ac49b9fd7306ce04
MD5 7f2bbca6014bb18687c3b9353fa854ce
BLAKE2b-256 f67185e6737ef8ef4d735fe943b409d627b11fde2ce42dfb8d8e221bb1874d8c

See more details on using hashes here.

File details

Details for the file prstools-0.0.71-py3-none-any.whl.

File metadata

  • Download URL: prstools-0.0.71-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for prstools-0.0.71-py3-none-any.whl
Algorithm Hash digest
SHA256 6b71711512539011708e0112169145ce965f334e6ed05d9ca777b03d6d215d35
MD5 2f0655dafb1d9969f4d4145db77c8dc5
BLAKE2b-256 151d1bde038a2216bb9d57997ccfce03b77fb3edc586eafe1e9674282c7891ab

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.71 This release

2 files

0.0.70

2 files

0.0.69

2 files

0.0.68

2 files

0.0.67

2 files

0.0.66

2 files

0.0.65

2 files

0.0.64

2 files

0.0.63

2 files

0.0.61

2 files

0.0.60

2 files

0.0.58

2 files

0.0.57

2 files

0.0.56

2 files

0.0.55

2 files

0.0.54

2 files

0.0.53

2 files

0.0.52

2 files

0.0.51

2 files

0.0.50

2 files

0.0.49

2 files

0.0.48

2 files

0.0.47

2 files

0.0.46

2 files

0.0.45

2 files

0.0.44

2 files

0.0.43

2 files

0.0.42

2 files

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