trait()andtraits()now request coloc pairs and full associations in the API's columnar format (format=columnar), which is smaller and faster to serialise and parse for large traits. Columns keep their types, soimputed,false_positive,false_negativeandin_coloc_groupare now logical rather than 0/1.
First CRAN release. Requires version 1.1.0 of the GPMap API.
- An R client for the 'OpenGWAS' Genotype-Phenotype Map API
(https://gpmap.opengwas.io): look up traits, genes, variants and regions
with their colocalization groups, rare-variant results and associations;
search the map with
search_gpmap(); fetch LD proxies, pleiotropy summaries and duplicate traits; upload, fetch and delete your own GWAS. - Requests that hit the API rate limit (HTTP 429) are retried with exponential backoff.
- The API version is checked on the first request of a session rather than
when the package loads, so
library(gpmapr)needs no network access. If the installed gpmapr does not support the API version, the first request stops with instructions to update the package. - API errors and connection failures now give an informative error message.
- New
gpmap_available()reports whether the API can be reached. search_gpmap()for a variant now reports a per-row number of colocalizing studies and rare results (previously every row showed the first row's counts), and gains anrsqcolumn with each proxy's r-squared with the searched variant. Variant searches no longer download the full list of traits and genes.- Breaking: GWAS upload results (
get_gwas(), andtrait()/traits()with a GUID) have the same tables and column names as other results.- One
study_extractionstable holds the upload's study extractions and the existing ones it colocalizes with;upload_study_extractionsis gone. - Rows of
study_extractionsandcoloc_groupshave asourcecolumn ("upload" or "existing") and agwas_upload_id(the upload the row comes from;NAfor existing rows). Upload and existing study extractions have separate ids, so identify one bysourceand its id together. The upload's own rows aresource == "upload" & gwas_upload_id == result$trait$id. - Coloc groups use
study_extraction_idfor both sides, and coloc pairs usestudy_extraction_a_id/study_extraction_b_idwithsource_a/source_b, replacing theupload_*/existing_*id columns. - Upload rows are named after their upload (
trait_name), havedata_type"Phenotype" and notrait_idorstudy_id.
- One
- New
compare_upload()lines up a GWAS upload with another trait (or a compared upload): each one's effect in every coloc group they share, and the coloc pairs between them. - Coloc pairs from
gene(),genes(),variant()andget_gwas()include the trait name, data type, tissue and gene of both sides (trait_name_a,trait_name_b, ...), so they no longer need joining tostudy_extractions. - Breaking:
traitis nowpipeline_id(the GPMap pipeline's id for the trait, such as its OpenGWAS dataset id) andcategoryis nowvariable_type(continuous or categorical), inall_traits(),trait(),traits()and GWAS uploads. - Breaking:
$associationsis no longer returned. Withinclude_associations = TRUE, each study's association at its variant (beta,se,p,eaf,imputed) is added tocoloc_groups,rare_resultsandstudy_extractions.get_gwas()now adds them too, astrait(<guid>)already did, and so doestraits()for GUIDs. - Associations of variants a study did not report are placeholders in the
GPMap (beta 0, se 1, p 1); they are now returned with
beta,se,pandeafset toNA. upload_gwas()takesvariable_typein place ofcategory, which still works but is deprecated.traits()no longer errors when given a GWAS upload GUID alongside trait ids.ld_proxies()andld_matrix()gain anrsqcolumn.ld_matrix()returns an empty table when none of the variants are a lead variant and its proxy.genes()andtraits()drop empty elements, asgene()andtrait()do, andgenes()no longer returnstissues.region(),gene(),trait(),variant()and their plural forms no longer error withinclude_associations = TRUEwhen the API returns no associations.