# prstools
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
`prstools` is software to create Polygenic Risk Scores (PRS) directly
from the commandline <br> (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](https://forms.gle/TnvNyBX6qDy7Vupn9) (with 🏆 lottery)
is much appreciated!
## Install
To install use the following command.
``` sh
pip install -U prstools
```
It contains a special read-only access key, since this repo is still
private, which can be shared with people that should have access. <br>
If this did not work there is a chance you need to install `pip`, which
can be done most easily with conda by typing `conda install pip`. For
other install issues please check the (install guide is not yet
available) [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:
``` bash
# Makes 'example' dir with data in current path:
prstools downloadutil --pattern example --destdir ./; cd example
# Run the model with example data:
prstools prscs2 --ref_dir ldref_1kg_pop --bim_prefix target \
--sst_file sumstats.tsv --n_gwas 2565 --out_dir ./result
# prst prscs2 -r ldref_1kg_pop -t target -s sumstats.tsv -n 2565 -o ./result # <- short-form
# Make predictions from weights (plink must be installed):
plink --bfile target --out prspred --score ./result_* 2 4 6
```
This will run PRS-CS2 on the example data, using the new implementation
to demonstrate the capabilities of `prstools` and shows how you can use
output of `prstools` with plink to make predictions.
<br> More generally you can use `prstools` by typing into the
command-line interface:
``` sh
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 Yap yap yap new stuff
xprs XPRS: A very fast `eXPReSs` infitessimal effect-size
prediction method that can estimate heritabilty on the fly.
prscs2 PRS-CS v2: A polygenic prediction method that infers posterior
SNP effect sizes under continuous shrinkage (CS) priors.
<br> By combining `prstools` with another `<command>` a specific model
or other functionality can be used.
``` sh
# The following means exactly the same as 'prstools xprs'
prst prscs2
```
Usage:
prst 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 turned-off completely by setting
it to -1. (default: 1)
Data Arguments (first 5 required):
-r, --ref_dir, --ref <dir/refcode> Path to the directory that contains
the LD reference panel. You can
download this reference data
manually with 'prstools
downloadref'. Soon it will be
possible to automatically download
it on the fly. (required)
-t, --bim_prefix, --target <bim-prefix> Specify the directory and prefix of
the bim file for the target dataset.
(required)
-s, --sst_file, --sst <file> The summary statistics file from
which the model will be created. The
file should contain columns: SNP,
A1, A2, BETA or OR, P or SE
information. At the moment, the file
is assumed to be tab-seperated, if
you like other formats please let
devs know.Alternative column names
can be specified with --columns
(more info below). SNP column should
contain rsid's. See https://tin
yurl.com/sstxampl for an
example. (required)
-o, --out_dir, --out <dir+prefix> Output prefix for the results
(variant weights). This should be a
combination of the desired output
dir and file prefix. (required)
-n, --n_gwas <num> Sample size of the GWAS. Not
required if sumstat has a 'N'
column. (default: None)
--chrom <chroms> Optional: Select specific chromosome
to work with. You can specify a
specific chromosome as e.g. "--chrom
3". All chromosomes are used by
default. (default: all)
--colmap <alternative_colnames> Optional: Allows one to specify an
alterative column name for the
internally used columns
snp,A1,A2,beta,or,pval,se_beta,n_eff
(in that order). Forinstance "--
colmap rsid,a1,a2,beta_gwas,,pvalue,
beta_standard_error," (OR & N are
excluded in this example). When the
command is run a quick this_column
-> that_column conversion table will
be shown. Additionaly prstools has
many internal checks to make sure a
good PRS will be generated! By
default this is the PRS-CS standard.
(default: SNP,A1,A2,BETA,OR,P,SE,N)
--pred, -p Optional: Add this argument to
predict the PRS for the induviduals
in the target dataset.
Model Arguments (all optional):
--n_iter <n_iter> Total number of MCMC iterations.
(default: 1000)
--n_burnin <n_burnin> Number of burn-in iterations if
larger than 1 or fraction of n_iter
if smaller then 1. (default: 0.5)
--n_slice <n_slice> Thinning of the Markov chain.
(default: 1)
--seed <seed> Random seed for reproducibility.
(default: -1)
--a <a> Parameter a in the gamma-gamma
prior. (default: 1.0)
--b <b> Parameter b in the gamma-gamma
prior. (default: 0.5)
--phi <phi> Global shrinkage parameter phi. If
phi is not specified, it will be
learnt from the data using a
Bayesian approach (default: -1.0)
--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.
## Contact
For questions and support please send a mail
(menno.j.witteveen@gmail.com).
Raw data
{
"_id": null,
"home_page": "https://github.com/mennojw/prstools",
"name": "prstools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "PRS PGS polygenic genomics prediction genetics",
"author": "Menno Witteveen et al.",
"author_email": "menno102@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/4a/ef/7c48a86c00858393263dc2a3a3a7bd3d339eb55f84fa86978ffe53eaa3cc/prstools-0.0.12.tar.gz",
"platform": null,
"description": "# prstools\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n`prstools` is software to create Polygenic Risk Scores (PRS) directly\nfrom the commandline <br> (and optionally from inside python).\n\nIt contains various tools to make PRS generation easier. Installation\nand running the demo example should not take more than 10 minutes.\n\nWe are actively developing `prstools` and feedback by mail or our\n[feedback form](https://forms.gle/TnvNyBX6qDy7Vupn9) (with \ud83c\udfc6 lottery)\nis much appreciated!\n\n## Install\n\nTo install use the following command.\n\n``` sh\npip install -U prstools\n```\n\nIt contains a special read-only access key, since this repo is still\nprivate, which can be shared with people that should have access. <br>\nIf this did not work there is a chance you need to install `pip`, which\ncan be done most easily with conda by typing `conda install pip`. For\nother install issues please check the (install guide is not yet\navailable) [install guide]() or send us a mail.\n\n## How to use\n\nImmediately after installing `prstools`, it should be possible to\ndownload & run the demo example (~4mb), by pasting the following into\nthe commandline:\n\n``` bash\n# Makes 'example' dir with data in current path:\nprstools downloadutil --pattern example --destdir ./; cd example\n\n# Run the model with example data:\nprstools prscs2 --ref_dir ldref_1kg_pop --bim_prefix target \\\n --sst_file sumstats.tsv --n_gwas 2565 --out_dir ./result \n# prst prscs2 -r ldref_1kg_pop -t target -s sumstats.tsv -n 2565 -o ./result # <- short-form\n\n# Make predictions from weights (plink must be installed):\nplink --bfile target --out prspred --score ./result_* 2 4 6 \n```\n\nThis will run PRS-CS2 on the example data, using the new implementation\nto demonstrate the capabilities of `prstools` and shows how you can use\noutput of `prstools` with plink to make predictions.\n\n<br> More generally you can use `prstools` by typing into the\ncommand-line interface:\n\n``` sh\nprstools\n```\n\n\n Usage:\n prstools <command> ...\n\n Convenient and powerfull Polygenic Risk Score creation. \n 'prst' is a commandline shorthand for 'prstools'\n\n Models & Utility Commands:\n <command>\n downloadutil Download and unpack LD reference panels and other data.\n combine Yap yap yap new stuff\n xprs XPRS: A very fast `eXPReSs` infitessimal effect-size\n prediction method that can estimate heritabilty on the fly.\n prscs2 PRS-CS v2: A polygenic prediction method that infers posterior\n SNP effect sizes under continuous shrinkage (CS) priors.\n\n<br> By combining `prstools` with another `<command>` a specific model\nor other functionality can be used.\n\n``` sh\n# The following means exactly the same as 'prstools xprs'\nprst prscs2\n```\n\n\n Usage:\n prst prscs2 [-h --cpus <number-of-cpus>] --ref <dir/refcode> --target\n <bim-prefix> --sst <file> --out <dir+prefix>\n [--n_gwas <num> --chrom <chroms>]\n [--colmap <alternative_colnames> --pred]\n [--n_iter <n_iter> --n_burnin <n_burnin>]\n [--n_slice <n_slice> --seed <seed> --a <a> --b <b>]\n [--phi <phi> --clip <clip> --sampler <sampler>]\n\n PRS-CS v2: A polygenic prediction method that infers posterior SNP effect sizes under continuous shrinkage (CS) priors.\n\n General Options:\n -h, --help Show this help message and exit.\n -c, --cpus <number-of-cpus> The number of cpus to use. Generally\n most efficient if chosen to be\n between 1 and 5. Functionality can\n be turned-off completely by setting\n it to -1. (default: 1)\n\n Data Arguments (first 5 required):\n -r, --ref_dir, --ref <dir/refcode> Path to the directory that contains\n the LD reference panel. You can\n download this reference data\n manually with 'prstools\n downloadref'. Soon it will be\n possible to automatically download\n it on the fly. (required)\n -t, --bim_prefix, --target <bim-prefix> Specify the directory and prefix of\n the bim file for the target dataset.\n (required)\n -s, --sst_file, --sst <file> The summary statistics file from\n which the model will be created. The\n file should contain columns: SNP,\n A1, A2, BETA or OR, P or SE\n information. At the moment, the file\n is assumed to be tab-seperated, if\n you like other formats please let\n devs know.Alternative column names\n can be specified with --columns\n (more info below). SNP column should\n contain rsid's. See https://tin\n yurl.com/sstxampl for an\n example. (required)\n -o, --out_dir, --out <dir+prefix> Output prefix for the results\n (variant weights). This should be a\n combination of the desired output\n dir and file prefix. (required)\n -n, --n_gwas <num> Sample size of the GWAS. Not\n required if sumstat has a 'N'\n column. (default: None)\n --chrom <chroms> Optional: Select specific chromosome\n to work with. You can specify a\n specific chromosome as e.g. \"--chrom\n 3\". All chromosomes are used by\n default. (default: all)\n --colmap <alternative_colnames> Optional: Allows one to specify an\n alterative column name for the\n internally used columns\n snp,A1,A2,beta,or,pval,se_beta,n_eff\n (in that order). Forinstance \"--\n colmap rsid,a1,a2,beta_gwas,,pvalue,\n beta_standard_error,\" (OR & N are\n excluded in this example). When the\n command is run a quick this_column\n -> that_column conversion table will\n be shown. Additionaly prstools has\n many internal checks to make sure a\n good PRS will be generated! By\n default this is the PRS-CS standard.\n (default: SNP,A1,A2,BETA,OR,P,SE,N)\n --pred, -p Optional: Add this argument to\n predict the PRS for the induviduals\n in the target dataset.\n\n Model Arguments (all optional):\n --n_iter <n_iter> Total number of MCMC iterations.\n (default: 1000)\n --n_burnin <n_burnin> Number of burn-in iterations if\n larger than 1 or fraction of n_iter\n if smaller then 1. (default: 0.5)\n --n_slice <n_slice> Thinning of the Markov chain.\n (default: 1)\n --seed <seed> Random seed for reproducibility.\n (default: -1)\n --a <a> Parameter a in the gamma-gamma\n prior. (default: 1.0)\n --b <b> Parameter b in the gamma-gamma\n prior. (default: 0.5)\n --phi <phi> Global shrinkage parameter phi. If\n phi is not specified, it will be\n learnt from the data using a\n Bayesian approach (default: -1.0)\n --clip <clip> Clip parameter. The default works\n best in pretty much all cases.\n (default: 1.0)\n --sampler <sampler> Sampler algorithm. Rue sampling is\n the original sampler, which gives\n good results. (default: Rue)\n\n Examples --> can be directly copy-pasted (:\n prst downloadutil --pattern example --destdir ./; cd example # Makes 'example' dir in current path.\n prstools prscs2 --ref ldref_1kg_pop --target target --sst sumstats.tsv --n_gwas 2565 --out ./result-prscs2 # Run the model with example data.\n 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.\n\nAs can be seen, there are examples at the end of the help output to\nillustrate usage, which should work with a simple copy-paste.\n\n## Contact\n\nFor questions and support please send a mail\n(menno.j.witteveen@gmail.com).\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Convenient and powerfull Polygenic Risk Score creation.",
"version": "0.0.12",
"project_urls": {
"Homepage": "https://github.com/mennojw/prstools"
},
"split_keywords": [
"prs",
"pgs",
"polygenic",
"genomics",
"prediction",
"genetics"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e662a3b933303fdf08f64001c5be1042672c6d17528016e3f5db5799b20cc4ca",
"md5": "f7377206533096a13824c94a5ad45745",
"sha256": "0f156f688bc2e2cef2420435e3ece9fa71208002d6bd7822365f51751417bc9f"
},
"downloads": -1,
"filename": "prstools-0.0.12-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f7377206533096a13824c94a5ad45745",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 1957228,
"upload_time": "2025-08-06T22:40:57",
"upload_time_iso_8601": "2025-08-06T22:40:57.240607Z",
"url": "https://files.pythonhosted.org/packages/e6/62/a3b933303fdf08f64001c5be1042672c6d17528016e3f5db5799b20cc4ca/prstools-0.0.12-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4aef7c48a86c00858393263dc2a3a3a7bd3d339eb55f84fa86978ffe53eaa3cc",
"md5": "8f244bf411b183dd2b8d869fd50705a2",
"sha256": "9f517e6da48dec40670e6b668637fda8699102b05daf78e49516b24d356791ca"
},
"downloads": -1,
"filename": "prstools-0.0.12.tar.gz",
"has_sig": false,
"md5_digest": "8f244bf411b183dd2b8d869fd50705a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 1950103,
"upload_time": "2025-08-06T22:40:59",
"upload_time_iso_8601": "2025-08-06T22:40:59.201682Z",
"url": "https://files.pythonhosted.org/packages/4a/ef/7c48a86c00858393263dc2a3a3a7bd3d339eb55f84fa86978ffe53eaa3cc/prstools-0.0.12.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-06 22:40:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mennojw",
"github_project": "prstools",
"github_not_found": true,
"lcname": "prstools"
}