Skip to main content

Convenient and powerfull Polygenic Risk Score creation.

Project description

prstools

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

It contains various tools to make PRS generation easier. 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 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 installed using conda (or mamba if you have that), by running conda install "python>=3.9" For other install issues please check the (install guide is still pretty basic) install guide or send us a mail.

How to use

Next to this very brief discription of what prstools can do, there is also more complete Getting Started Tutorial. 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 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 --pred ./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.


More generally you can use prstools by typing into the command-line interface:

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 a help 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.

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

For more information and a hands on demonstration of what prstools can do have a look at the Getting Started Tutorial. Or load that same tutorial in a free cloud instance by clicking here: Binder

Contact

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

Project details


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.49.tar.gz (1.9 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.49-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prstools-0.0.49.tar.gz
  • Upload date:
  • Size: 1.9 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.49.tar.gz
Algorithm Hash digest
SHA256 10941d21218977cc653d665d82ba2a33b8b76b31ce3786171b3336827bffe8e8
MD5 171c7d866fe9d02140645f546cab724d
BLAKE2b-256 db9d63b9247bfbd764fd139d85bf257bf71432e556f4d36de36ad3ff3638c373

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prstools-0.0.49-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.49-py3-none-any.whl
Algorithm Hash digest
SHA256 ad094ddb32f39b798eadf499ec41b53dcbe2dbd6a183a717d4d715d1cbc0c46b
MD5 59620c35af1c6ab54b03cac10cf8e9b1
BLAKE2b-256 527c059812787b0ce6668739af34eba5673904a475667c874f074538042f6bc1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page