pgxLoader: Load data from Progenetix database via the Beacon v2 API with...

View source: R/pgxLoader.R

pgxLoaderR Documentation

Load data from Progenetix database via the Beacon v2 API with some extensions

Description

This function loads various data from Progenetix database via the Beacon v2 API with some extensions (BeaconPlus).

Usage

pgxLoader(
  type = NULL,
  output = NULL,
  biosample_id = NULL,
  individual_id = NULL,
  filters = NULL,
  limit = 0,
  skip = NULL,
  dataset = NULL,
  codematches = FALSE,
  save_file = FALSE,
  filename = "variant",
  num_cores = 1,
  domain = "http://progenetix.org",
  entry_point = "beacon"
)

Arguments

type

A string specifying output data type. Available options are "biosamples", "individuals", "analyses", "g_variants", "cnv_frequency", "cnv_fraction", and "sample_count". The options "biosamples", "individuals", and "analyses" return corresponding information. "g_variants" returns variants data. The options "cnv_frequency", "cnv_fraction" and "sample_count" are based on data in Progenetix, returning precomputed CNV frequency, CNV fraction per sample, and the count of samples for the given filter, respectively.

output

A string specifying output data format. The available options depend on the type parameter. When type is "g_variants", available options are NULL (default), "pgxseg", or "seg"; When type is "cnv_frequency", available options are "pgxfreq" or "pgxmatrix"; when type is "cnv_fraction", available options are NULL (default) or "pgxmatrix".

biosample_id

Identifiers used in the query database for identifying biosamples.

individual_id

Identifiers used in the query database for identifying individuals.

filters

Identifiers used in public repositories, bio-ontology terms, or custom terms such as c("NCIT:C7376", "PMID:22824167"). When multiple filters are used, they are combined using AND logic when the parameter type is "biosamples", "individuals", or "analyses"; OR logic when the parameter type is "cnv_frequency" or "sample_count".

limit

Integer to specify the number of returned profiles. Default is 0 (return all).

skip

Integer to specify the number of skipped profiles. E.g. if skip = 2, limit=500, the first 2*500 =1000 profiles are skipped and the next 500 profiles are returned. Default is NULL (no skip).

dataset

A string specifying the dataset to query from the Beacon response. Default is NULL, which includes results from all datasets.

codematches

A logical value determining whether to exclude samples from child concepts of specified filters in the ontology tree. If TRUE, only samples exactly matching the specified filters will be included. Do not use this parameter when filters include ontology-irrelevant filters such as PMID and cohort identifiers. Default is FALSE.

save_file

A logical value determining whether to save variant data as a local file instead of direct return. Only used when the parameter type is "g_variants". Default is FALSE.

filename

A string specifying the path and name of the file to be saved. Only used if the parameter save_file is TRUE. Default is "variants" in current work directory.

num_cores

Integer to specify the number of cores used for the variant query. Only used when the parameter type is "g_variants". Default is 1.

domain

A string specifying the domain of the query data resource. Default is "http://progenetix.org".

entry_point

A string specifying the entry point of the Beacon v2 API. Default is "beacon", resulting in the endpoint being "http://progenetix.org/beacon".

Value

Data from Progenetix database

Examples

## query metadata
biosamples <- pgxLoader(type="biosamples", filters = "NCIT:C3512")
## query variants
seg <- pgxLoader(type="g_variants", biosample_id = "pgxbs-kftvgx4y")
## query CNV frequency
freq <- pgxLoader(type="cnv_frequency", output ='pgxfreq', filters="NCIT:C3512")

progenetix/pgxRpi documentation built on Sept. 14, 2024, 2:21 p.m.