Learn R Programming

cbioportalR (version 1.1.0)

.get_data_by_study: Internal Function to Get Mutations/CNA/Fusion By Study ID

Description

Endpoints for retrieving mutation and cna data are structurally similar. This internal function allows you to pull data from either endpoint. It has logic for sensible default guesses at study_id and molecular_profile_id when those are NULL

Usage

.get_data_by_study(
  study_id = NULL,
  molecular_profile_id = NULL,
  data_type = c("mutation", "cna", "fusion", "structural_variant", "segment"),
  base_url = NULL,
  add_hugo = TRUE
)

Value

a dataframe of mutations, CNAs or structural variants

Arguments

study_id

A study ID to query mutations. If NULL, guesses study ID based on molecular_profile_id.

molecular_profile_id

a molecular profile to query mutations. If NULL, guesses molecular_profile_id based on study ID.

data_type

specify what type of data to return. Options aremutation, cna, fusion, orstructural_variant (same as fusion), and segment (copy number segmentation data)..

base_url

The database URL to query If NULL will default to URL set with set_cbioportal_db(<your_db>)

add_hugo

Logical indicating whether HugoGeneSymbol should be added to your resulting data frame, if not already present in raw API results. Argument is TRUE by default. If FALSE, results will be returned as is (i.e. any existing Hugo Symbol columns in raw results will not be removed).

Examples

Run this code
if (FALSE) {
set_cbioportal_db("public")
.get_data_by_study(study_id = "prad_msk_2019", data_type = "cna")
.get_data_by_study(study_id = "prad_msk_2019", data_type = "mutation")
.get_data_by_study(study_id = "prad_msk_2019", data_type = "fusion")

.get_data_by_study(molecular_profile_id = "prad_msk_2019_cna", data_type = "cna")
.get_data_by_study(molecular_profile_id = "prad_msk_2019_mutations", data_type = "mutation")
.get_data_by_study(molecular_profile_id = "prad_msk_2019_structural_variants", data_type = "fusion")
}

Run the code above in your browser using DataLab