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 = "variants.tsv",
  num_cores = 1,
  domain = "http://progenetix.org",
  entry_point = "beacon"
)

Arguments

type

A string specifying the type of output data. Available options include:

  • "individuals": Returns information about individuals.

  • "biosamples": Returns information about biosamples.

  • "analyses": Returns information about analyses.

  • "g_variants": Returns variants data.

  • "filtering_terms": Returns all available filtering terms.

  • "cnv_frequency": Returns precomputed CNV frequency data from Progenetix.

  • "cnv_fraction": Returns CNV fraction per sample based on Progenetix data.

  • "sample_count": Returns the count of samples for the specified filter based on Progenetix data.

output

A string specifying the format of the output data. The available options depend on the value of the type parameter:

  • If type is "g_variants", the available options are NULL (default), "pgxseg", or "seg".

  • If type is "cnv_frequency", the available options are "pgxfreq" or "pgxmatrix".

  • If type is "cnv_fraction", the 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

An integer specifying the number of profiles to skip. For example, if skip = 2 and limit = 500, the first 2 * 500 = 1000 profiles are skipped, and the next 500 profiles are returned. Default is NULL, meaning no profiles are skipped.

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 indicating whether to exclude samples from child concepts of the specified filters in the ontology tree. If TRUE, only samples that exactly match the specified filters will be included. This parameter should not be used when filters include ontology-irrelevant filters, such as PMID or cohort identifiers. Default is FALSE. This option is applicable only when querying data resources are Progenetix or cancercelllines.org.

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. This parameter is used only when save_file is set to TRUE. The default value is "variants.tsv", saved in the current working 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 Jan. 20, 2025, 5:10 p.m.