Skip to main content

Get started

pgsc_calc has a few important software dependencies:

  • Nextflow
  • Docker, Singularity, or Anaconda
  • Linux or macOS

Without these dependencies installed you won't be able to run pgsc_calc.

Step by step setupโ€‹

  1. Install Nextflow
$ java -version # java 17 or later required
$ curl -fsSL get.nextflow.io | bash
$ ./nextflow run hello
  1. Install one of Docker, Singularity/Apptainer, or conda

  2. Run the pgsc_calc test profile:

$ nextflow run pgscatalog/pgsc_calc -r v3-alpha.1 -profile test,<docker|singularity|conda>
info

Please note the test profile genomes are not biologically meaningful, won't produce valid scores, and aren't compatible with other scores on the PGS Catalog. We bundle this test data to simplify installation and automatic tests.

Calculate your first polygenic scoresโ€‹

If you've completed the setup guide successfully then you're ready to calculate scores with your genomic data, which are probably genotypes from real people. Exciting! ๐Ÿงฌ๐Ÿงช

1. Set up a samplesheetโ€‹

info
  • Your target genomes must be indexed VCF/BCF or BGEN files
  • Indexes (csi / tbi / bgi files) must be in the same directory as the target genome file
  • Your target genomes should be multi-sample for best calculation efficiency

First, you need to describe the structure of your genomic data in a standardised way. To do this, set up a spreadsheet that looks like:

samplesetpathchromfile_formatgenotyping_method
1000Gtests/data/bgen/PGS000586_GRCh38.vcf.gzvcfarray

Samplesheets can be in CSV, TSV, JSON, or YAML format.

Samplesheets can describe other ways your data are organised, like genomes split per chromosome or BGEN files. See here for more details.

2. Select scoring filesโ€‹

It's simple to work with polygenic scores that have been published in the PGS Catalog. You can specify one or more scores using the --pgs_id parameter:

--pgs_id PGS001229 # one score
--pgs_id PGS001229,PGS001405 # many scores separated by , (no spaces)
tip

You can also select scores associated with traits (--efo_id) and publications (--pgp_id)

If you would like to use your own scoring file that's not published in the PGS Catalog, that's OK too.

3. Set your target genome buildโ€‹

Users are required to specify the genome build that to their genotyping calls are in reference to using the --target_build parameter. The --target_build parameter only supports builds GRCh37 (hg19) and GRCh38 (hg38).

--target_build GRCh38 # โœ…
--target_build GRCh37 # โœ…
--target_build GRCh36 # โŒ no
info
  • A PGS Catalog score might have been submitted in a different genome build to your target genomes
  • The PGS Catalog makes all scoring files available in GRCh37 and GRCh38 by remapping author-submitted data
  • The pipeline will use the target build parameter to fetch a scoring file that aligns with your target genomes

4. Putting it all togetherโ€‹

For this example, we'll assume that the input genomes are in build GRCh38 and you want to use a scoring file in the PGS Catalog:

$ nextflow run pgscatalog/pgsc_calc \
-profile <docker/singularity/apptainer/conda> \
-r v3-alpha.1 \
--input samplesheet.csv \
--target_build GRCh38 \
--pgs_id PGS001229

Congratulations, you've now (hopefully) calculated some scores! ๐Ÿฅณ

Finallyโ€‹

After the workflow executes successfully, the calculated scores and a summary report should be available in the results/ directory in your current working directory ($PWD) by default.

If you're interested in more information, see the explanations section of the documentation.

warning

When interpreting results users should ensure that the samples used for calculation were not used for PGS development (see Wray et al. (2013)).

Next stepsโ€‹

Good luck!