importPGSCatalogPRSs

Import PRS models from the PGS Catalog

Description

importPGSCatalogPRSs() is a high-level adapter that imports one or more polygenic score (PGS) models from the PGS Catalog using the suggested package quincunx, and converts them into a PolyGeniusModelSet.

Usage

importPGSCatalogPRSs(
  ids,
  id.type = c("auto", "pgs", "publication", "trait"),
  name = NULL
)

Arguments

ids

Character vector of identifiers. Interpretation depends on id.type:

  • If id.type = “pgs”: treated as PGS Catalog score IDs (e.g. “PGS002280”).

  • If id.type = “publication”: treated as publication identifiers, i.e. PGS Catalog publication IDs (e.g. “PGP000001”) or PubMed IDs (numeric strings; e.g. “30554720”).

  • If id.type = “trait”: treated as trait identifiers, either EFO IDs (e.g. “EFO_0007992”) or trait terms (e.g. “Alzheimer’s disease”), which are mapped to EFO IDs via quincunx::get_traits().

  • If id.type = “auto” (default): strings matching ⁠^PGS\d+$⁠ are interpreted as PGS IDs; strings matching ⁠^PGP\d+$⁠ or 1+$⁠ are interpreted as publication IDs; any remaining strings are treated as trait identifiers.

id.type

Character scalar specifying how to interpret ids. One of: “auto”, “pgs”, “publication”, or “trait”.

name

Optional name character for the returned PolyGeniusModelSet

Details

Resolution happens in two steps:

  1. Resolve PGS IDs:

    • id.type = “pgs” / “auto”: ⁠^PGS\d+$⁠ used directly.

    • id.type = “publication”: ⁠^PGP\d+$⁠ mapped via quincunx::pgp_to_pgs() (PGP → PGS), numeric strings treated as PubMed IDs and mapped via quincunx::get_scores(pubmed_id = …) and (scores?)$pgs_id⁠.

    • id.type = “trait”: ⁠^EFO_\d+⁠ mapped via quincunx::get_scores(efo_id = …); other strings treated as trait terms, mapped to EFO IDs via quincunx::get_traits(trait_term = …) and then to PGS IDs via quincunx::get_scores(efo_id = …).

  2. Import scoring files:

    • For each PGS ID, quincunx::read_scoring_file() is used to download the scoring file.

    • Each scoring table is converted into a PolyGeniusModel with columns chr, position, ea, nea, beta, pval and with build taken from the PGS Catalog genome_build.

    • The full scoring metadata is stored under model$gwas with an additional source = “PGS Catalog” entry.

Value

A PolyGeniusModelSet containing one PolyGeniusModel per resolved PGS score.

Examples

## Not run: 
# Import two PGS models by PGS ID
PGSs <- importPGSCatalogPRSs(c("PGS002280", "PGS001828"), id.type = "pgs")
PGSs[[1]]

# Let the function auto-detect identifier types
PGSs <- importPGSCatalogPRSs(
  ids    = c("PGS002280", "PGP000001", "30554720", "EFO_0007992", "Alzheimer's disease"),
  id.type = "auto"
)

# Explicitly resolve by publication (PGP IDs or PubMed IDs)
PGSs <- importPGSCatalogPRSs("PGP000001", id.type = "publication")

# Explicitly resolve by trait (EFO IDs or trait terms)
PGSs <- importPGSCatalogPRSs("EFO_0007992", id.type = "trait")

## End(Not run)

Footnotes

  1. 0-9↩︎