Learn R Programming

quincunx

The goal of {quincunx} is to provide programmatic access to the Polygenic Score (PGS) Catalog, an open resource for polygenic scores and associated metadata describing their development and respective assessment.

Browse the online documentation at rmagno.eu/quincunx to get started.

Installation

Install {quincunx} from CRAN:

# Install from CRAN
install.packages("quincunx")

You can instead install the development version with:

# install.packages("pak")
pak::pak("ramiromagno/quincunx")

Cheatsheet

Citing this work

{quincunx} was published in Bioinformatics in 2021: https://doi.org/10.1093/bioinformatics/btab522.

To generate a citation for this publication from within R:

citation('quincunx')
#> To cite quincunx in publications use:
#> 
#>   Ramiro Magno, Isabel Duarte, Ana-Teresa Maia, quincunx: an R package
#>   to query, download and wrangle PGS Catalog data, Bioinformatics,
#>   btab522, 16 July 2021, Pages 1-3,
#>   https://doi.org/10.1093/bioinformatics/btab522
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Article{,
#>     title = {quincunx: an R package to query, download and wrangle PGS Catalog data},
#>     author = {Ramiro Magno and Isabel Duarte and Ana-Teresa Maia},
#>     journal = {Bioinformatics},
#>     year = {2021},
#>     volume = {38},
#>     number = {1},
#>     pages = {1--3},
#>     url = {https://doi.org/10.1093/bioinformatics/btab522},
#>   }

Citing PGS Catalog publications

Also, please do not forget to cite the authors behind the original studies and the papers associated with the PGS Catalog project:

  • Lambert, S.A., Gil, L., Jupp, S. et al. The Polygenic Score Catalog as an open database for reproducibility and systematic evaluation. Nat Genet 53, 420–425 (2021). doi: 10.1038/s41588-021-00783-5
  • Wand, H., Lambert, S.A., Tamburro, C. et al. Improving reporting standards for polygenic scores in risk prediction studies. Nature 591, 211–219 (2021). doi: 10.1038/s41586-021-03243-6

Terms of use

Please note that if you use the data provided by the PGS Catalog either directly or via {quincunx} you agree to abide to the EMBL-EBI Terms of Use.

Code of Conduct

Please note that the {quincunx} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Acknowledgements

This work would have not been possible without the precious feedback from the PGS Catalog team, particularly Samuel Lambert and Laurent Gil.

Package name and hex sticker

The package name {quincunx} is another name for Galton Board, that so nicely exemplifies the Central Limit Theorem, which in turn is a key concept of genetics, namely, Fisher’s infinitesimal model… which leads us to Polygenic Scores, the key concept of the PGS Catalog.

The bird in the hex sticker is a Porphyrio porphyrio, an emblematic species native to the Ria Formosa Natural Park, which is a wildlife reserve surrounding the University of Algarve, where the authors are affiliated.

Copy Link

Version

Install

install.packages('quincunx')

Monthly Downloads

314

Version

0.1.9

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Ramiro Magno

Last Published

March 20th, 2025

Functions in quincunx (0.1.9)

get_sample_sets

Get PGS Catalog Sample Sets
first_non_na

Returns the position of the first non-NA value
get_ancestry_categories

Get ancestry categories and classes
get_scores

Get PGS Catalog Scores
get_publications

Get PGS Catalog Publications
get_trait_categories

Get PGS Catalog Trait Categories
is_pgs_id

Is a string a PGS Catalog identifier?
is_paginated

Is the response paginated?
is_pubmed_id

Is a string a PubMed ID?
get_traits

Get PGS Catalog Traits
n

Number of PGS Catalog entities
n_pages

Number of pages
msg_400

Pretty printing of 404 error
list_to_s4

Convert a named list to an S4 object
performance_metrics-class

An S4 class to represent a set of PGS Catalog Performance Metrics
open_in_dbsnp

Browse dbSNP from SNP identifiers.
performance_metrics

Constructor for the S4 performance_metrics object.
offsets

Generate offset values
open_in_pgs_catalog

Browse PGS Catalog entities from the PGS Catalog Web Graphical User Interface
open_in_pubmed

Browse PubMed from PubMed identifiers.
pgs_to_study

Map PGS identifiers to GWAS study identifiers
msg_empty

Pretty printing of empty response
pgs_to_pss

Map PGS identifiers to PSS identifiers
ppm_to_pss

Map PPM identifiers to PSS identifiers
pss_to_pgp

Map PSS identifiers to PGP identifiers
no_msg

Pretty printing of no error message
nr_to_na

Convert NR (Not Recorded) to NA (Not Available)
msg_404

Pretty printing of 404 error
publications-class

An S4 class to represent a set of PGS Catalog Publications
ppm_to_pgp

Map PPM identifiers to PGP identifiers
ppm_to_pgs

Map PPM identifiers to PGS identifiers
pgp_to_pgs

Map PGP identifiers to PGS identifiers
pss_to_pgs

Map PSS identifiers to PGS identifiers
read_scoring_file

Read a polygenic scoring file
releases

Constructor for the S4 releases object.
pgp_to_ppm

Map PGP identifiers to PPM identifiers
pgp_to_pss

Map PGP identifiers to PSS identifiers
releases-class

An S4 class to represent a set of PGS Catalog Releases
pss_to_ppm

Map PSS identifiers to PPM identifiers
remap_id

Remap identifiers
pgs_to_ppm

Map PGS identifiers to PPM identifiers
pgs_to_pgp

Map PGS identifiers to PGP identifiers
pgs_server

PGS REST API server
request_all

Request a paginated resource from the PGS REST API
setop

Set operations on PGS Catalog objects
request

Request a resource from the PGS REST API
scores-class

An S4 class to represent a set of PGS Catalog Polygenic Scores
publications

Constructor for the S4 publications object.
request_warning

Pretty printing of http error
scores

Constructor for the S4 scores object.
sample_sets-class

An S4 class to represent a set of PGS Catalog Sample Sets
study_to_pgs

Map GWAS studies identifiers to PGS identifiers
subset-cohorts

Subset a cohorts object
s4_to_list

Convert an S4 object into a list
sample_sets

Constructor for the S4 sample_sets object.
trait_categories-class

An S4 class to represent a set of PGS Catalog Trait Categories
trait_categories

Constructor for the S4 trait_categories object.
subset-traits

Subset a traits object
stages

Study stages
sure

Are you sure?
subset-scores

Subset a scores object
subset-trait_categories

Subset a trait_categories object
subset-publications

Subset a publications object
subset-performance_metrics

Subset a performance_metrics object
subset-releases

Subset a releases object
subset-sample_sets

Subset a sample_sets object
traits-class

An S4 class to represent a set of PGS Catalog Traits
write_xlsx

Export a PGS Catalog object to xlsx
user_agent_id

User agent identification
traits

Constructor for the S4 traits object.
filter_by_id

Filter PGS Catalog objects by identifier.
cohorts-class

An S4 class to represent a set of cohorts
clear_cache

Clear quincunx cache of memoised functions
bind

Bind PGS Catalog objects
collect_pgs_ids

Collect development and evaluation pgs_ids
ancestry_categories

Ancestry categories and classes
contains_question_mark

Does a string contain a question mark?
count

Extract the count field from a JSON response
cohorts

Constructor for the S4 cohorts object.
collect_samples

Collect samples_variants and samples_training
get_releases

Get PGS Catalog Releases
get_performance_metrics

Get PGS Catalog Performance Metrics
get_cohorts

Get PGS Catalog Cohorts
get_ancestry_symbol_mappings

Get PGS Catalog Ancestry Symbol Mappings