Title: | Browse and Query Clinical and Genomic Data from cBioPortal |
---|---|
Description: | Provides R users with direct access to genomic and clinical data from the 'cBioPortal' web resource via user-friendly functions that wrap 'cBioPortal's' existing API endpoints <https://www.cbioportal.org/api/swagger-ui/index.html>. Users can browse and query genomic data on mutations, copy number alterations and fusions, as well as data on tumor mutational burden ('TMB'), microsatellite instability status ('MSI'), 'FACETS' and select clinical data points (depending on the study). See <https://www.cbioportal.org/> and Gao et al., (2013) <doi:10.1126/scisignal.2004088> for more information on the cBioPortal web resource. |
Authors: | Karissa Whiting [aut, cre, cph] |
Maintainer: | Karissa Whiting <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.1 |
Built: | 2024-11-21 23:21:47 UTC |
Source: | CRAN |
Get all available clinical attribute IDs for a study
available_clinical_attributes(study_id = NULL, base_url = NULL)
available_clinical_attributes(study_id = NULL, base_url = NULL)
study_id |
cbioportal study ID |
base_url |
The database URL to query.
If |
a data frame of available clinical attributes for that study
## Not run: available_clinical_attributes("acc_tcga", base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: available_clinical_attributes("acc_tcga", base_url = 'www.cbioportal.org/api') ## End(Not run)
Get Available Gene Panels For a Database
available_gene_panels(base_url = NULL)
available_gene_panels(base_url = NULL)
base_url |
The database URL to query.
If |
a dataframe of metadata regarding each available panel
## Not run: set_cbioportal_db("public") available_gene_panels() ## End(Not run)
## Not run: set_cbioportal_db("public") available_gene_panels() ## End(Not run)
Get All Patient IDs in a Study
available_patients(study_id = NULL, base_url = NULL)
available_patients(study_id = NULL, base_url = NULL)
study_id |
A character string indicating which study ID should be searched. Only 1 study ID allowed. |
base_url |
The database URL to query
If |
A dataframe of patient_ids in a given study
## Not run: set_cbioportal_db("public") available_samples(study_id = "acc_tcga") ## End(Not run)
## Not run: set_cbioportal_db("public") available_samples(study_id = "acc_tcga") ## End(Not run)
Get Available Genomic Profiles For a Study or Database
available_profiles(study_id = NULL, base_url = NULL)
available_profiles(study_id = NULL, base_url = NULL)
study_id |
A character vector of length 1 indicating study_id.
See |
base_url |
The database URL to query.
If |
A dataframe of available genetic profiles and their profile ids
## Not run: set_cbioportal_db("public") available_profiles() available_profiles(study_id = "acc_tcga") ## End(Not run)
## Not run: set_cbioportal_db("public") available_profiles() available_profiles(study_id = "acc_tcga") ## End(Not run)
Get All Sample Lists Available For a Study
available_sample_lists(study_id = NULL, base_url = NULL)
available_sample_lists(study_id = NULL, base_url = NULL)
study_id |
A character string indicating which study ID should be searched. Only 1 study ID allowed. |
base_url |
The database URL to query
If |
A dataframe of patient_ids in a given study
## Not run: set_cbioportal_db("public") available_sample_lists(study_id = "acc_tcga") ## End(Not run)
## Not run: set_cbioportal_db("public") available_sample_lists(study_id = "acc_tcga") ## End(Not run)
Pulls all available sample IDs for a given study ID or sample list ID.
Either a study ID or sample list ID must be passed. If both sample_list
and study_id
are not NULL
,
sample_list
ID will be searched and study_id
will be ignored.
available_samples(study_id = NULL, sample_list_id = NULL, base_url = NULL)
available_samples(study_id = NULL, sample_list_id = NULL, base_url = NULL)
study_id |
A character string indicating which study ID should be searched. Only 1 study ID allowed. |
sample_list_id |
A character string indicating which sample list ID should be searched. Only 1 sample list ID allowed. |
base_url |
The database URL to query
If |
A dataframe of sample_ids in a given study
## Not run: set_cbioportal_db("public") available_samples(study_id = "acc_tcga") available_samples(sample_list_id = "acc_tcga_cna") ## End(Not run)
## Not run: set_cbioportal_db("public") available_samples(study_id = "acc_tcga") available_samples(sample_list_id = "acc_tcga_cna") ## End(Not run)
Get Metadata on All Available Studies in a Database
available_studies(base_url = NULL)
available_studies(base_url = NULL)
base_url |
The database URL to query.
If |
A dataframe of available studies and their metadata
## Not run: set_cbioportal_db("public") available_studies() ## End(Not run)
## Not run: set_cbioportal_db("public") available_studies() ## End(Not run)
This function grabs known gene aliases for a given Hugo Symbol.
You may notice that genes -alias pairs are not always consistent. For example
get_alias("KMT2D") will return "MLL2" but get_alias("MLL2") will not return "KMT2D"
This function relies on the existing cBioPortal API which controls this database
of aliases. Therefore, this is a convenience function but
you may want to consider a more carefully curated alias list like cbioportalR::impact_gene_info
get_alias(hugo_symbol = NULL, base_url = NULL)
get_alias(hugo_symbol = NULL, base_url = NULL)
hugo_symbol |
a hugo symbol for which to return aliases |
base_url |
The database URL to query |
A character string with all aliases
## Not run: get_alias(hugo_symbol = "FGFR3", base_url = 'www.cbioportal.org/api') get_alias(hugo_symbol = c("FGFR3", "TP53"), base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_alias(hugo_symbol = "FGFR3", base_url = 'www.cbioportal.org/api') get_alias(hugo_symbol = c("FGFR3", "TP53"), base_url = 'www.cbioportal.org/api') ## End(Not run)
Convenience function that retrieves cBioPortal token System Environment variable "CBIOPORTAL_TOKEN"
get_cbioportal_token()
get_cbioportal_token()
Returns a string with cBioPortal token if successfully authenticated, or a warning that token could not be found.
Karissa Whiting, Daniel D. Sjoberg
## Not run: get_cbioportal_token() ## End(Not run)
## Not run: get_cbioportal_token() ## End(Not run)
Get clinical data by attribute, study ID and patient ID
get_clinical_by_patient( study_id = NULL, patient_id = NULL, patient_study_pairs = NULL, clinical_attribute = NULL, base_url = NULL )
get_clinical_by_patient( study_id = NULL, patient_id = NULL, patient_study_pairs = NULL, clinical_attribute = NULL, base_url = NULL )
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
patient_id |
a cBioPortal patient_id |
patient_study_pairs |
A dataframe with columns: |
clinical_attribute |
one or more clinical attributes for your study. If none provided, will return all attributes available for studies |
base_url |
The database URL to query
If |
a dataframe of a specific clinical attribute
## Not run: ex <- tibble::tribble( ~patientID, ~study_id, "P-0001453", "blca_nmibc_2017", "P-0002166", "blca_nmibc_2017", "P-0003238", "blca_nmibc_2017", "P-0000004", "msk_impact_2017", "P-0000023", "msk_impact_2017") x <- get_clinical_by_patient(patient_study_pairs = ex, clinical_attribute = NULL, base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: ex <- tibble::tribble( ~patientID, ~study_id, "P-0001453", "blca_nmibc_2017", "P-0002166", "blca_nmibc_2017", "P-0003238", "blca_nmibc_2017", "P-0000004", "msk_impact_2017", "P-0000023", "msk_impact_2017") x <- get_clinical_by_patient(patient_study_pairs = ex, clinical_attribute = NULL, base_url = 'www.cbioportal.org/api') ## End(Not run)
Get clinical data by attribute, study ID and sample ID
get_clinical_by_sample( study_id = NULL, sample_id = NULL, sample_study_pairs = NULL, clinical_attribute = NULL, base_url = NULL )
get_clinical_by_sample( study_id = NULL, sample_id = NULL, sample_study_pairs = NULL, clinical_attribute = NULL, base_url = NULL )
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
sample_id |
a vector of sample IDs (character) |
sample_study_pairs |
A dataframe with columns: |
clinical_attribute |
one or more clinical attributes for your study. If none provided, will return all attributes available for studies |
base_url |
The database URL to query
If |
a dataframe of a specific clinical attribute
## Not run: get_clinical_by_sample(study_id = "acc_tcga", sample_id = "TCGA-OR-A5J2-01", clinical_attribute = "CANCER_TYPE", base_url = 'www.cbioportal.org/api') ex <- tibble::tribble( ~sample_id, ~study_id, "P-0001453-T01-IM3", "blca_nmibc_2017", "P-0002166-T01-IM3", "blca_nmibc_2017", "P-0003238-T01-IM5", "blca_nmibc_2017", "P-0000004-T01-IM3", "msk_impact_2017", "P-0000023-T01-IM3", "msk_impact_2017") x <- get_clinical_by_sample(sample_study_pairs = ex, clinical_attribute = NULL, base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_clinical_by_sample(study_id = "acc_tcga", sample_id = "TCGA-OR-A5J2-01", clinical_attribute = "CANCER_TYPE", base_url = 'www.cbioportal.org/api') ex <- tibble::tribble( ~sample_id, ~study_id, "P-0001453-T01-IM3", "blca_nmibc_2017", "P-0002166-T01-IM3", "blca_nmibc_2017", "P-0003238-T01-IM5", "blca_nmibc_2017", "P-0000004-T01-IM3", "msk_impact_2017", "P-0000023-T01-IM3", "msk_impact_2017") x <- get_clinical_by_sample(sample_study_pairs = ex, clinical_attribute = NULL, base_url = 'www.cbioportal.org/api') ## End(Not run)
Returns all sample-level and patient-level clinical data for a given study
get_clinical_by_study( study_id = NULL, clinical_attribute = NULL, base_url = NULL )
get_clinical_by_study( study_id = NULL, clinical_attribute = NULL, base_url = NULL )
study_id |
study ID |
clinical_attribute |
one or more clinical attributes for your study.
If none provided, will return all attributes available for
that study ( |
base_url |
The database URL to query.
If |
a dataframe of all available clinical attributes and their values
## Not run: get_clinical_by_study(study_id = "acc_tcga", clinical_attribute = "CANCER_TYPE", base_url = 'www.cbioportal.org/api') get_clinical_by_study(study_id = "acc_tcga", base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_clinical_by_study(study_id = "acc_tcga", clinical_attribute = "CANCER_TYPE", base_url = 'www.cbioportal.org/api') get_clinical_by_study(study_id = "acc_tcga", base_url = 'www.cbioportal.org/api') ## End(Not run)
Get CNA By Sample ID
get_cna_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, add_hugo = TRUE, base_url = NULL )
get_cna_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, add_hugo = TRUE, base_url = NULL )
sample_id |
a vector of sample IDs (character) |
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
molecular_profile_id |
A string indicating the molecular profile ID from which to pull data. If ID supplied, will
guess the molecular profile ID based on the study ID. Only 1 molecular profile ID can be passed. If mutations from
more than 1 study needed, see |
sample_study_pairs |
A dataframe with columns: |
genes |
A vector of Entrez ids or Hugo symbols. If Hugo symbols are supplied, they will be converted to entrez ids using the |
panel |
One or more panel IDs to query (e.g. 'IMPACT468').
If |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
A data frame of CNAs
## Not run: set_cbioportal_db("public") get_cna_by_sample(sample_id = c("s_C_36924L_P001_d"), study_id = "prad_msk_2019") ## End(Not run)
## Not run: set_cbioportal_db("public") get_cna_by_sample(sample_id = c("s_C_36924L_P001_d"), study_id = "prad_msk_2019") ## End(Not run)
Get CNA By Study
get_cna_by_study( study_id = NULL, molecular_profile_id = NULL, add_hugo = TRUE, base_url = NULL )
get_cna_by_study( study_id = NULL, molecular_profile_id = NULL, add_hugo = TRUE, base_url = NULL )
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. |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
A dataframe of CNAs
## Not run: get_cna_by_study(study_id = "prad_msk_2019") get_cna_by_study(molecular_profile_id = "prad_msk_2019_cna") ## End(Not run)
## Not run: get_cna_by_study(study_id = "prad_msk_2019") get_cna_by_study(molecular_profile_id = "prad_msk_2019_cna") ## End(Not run)
Get Entrez Gene ID for a given set of Hugo Symbols
get_entrez_id(hugo_symbol = NULL, base_url = NULL)
get_entrez_id(hugo_symbol = NULL, base_url = NULL)
hugo_symbol |
a character vector of Hugo Symbols |
base_url |
The database URL to query |
A dataframe with Entrez Gene IDs and Hugo Symbols
## Not run: get_entrez_id(hugo_symbol = "TAP1", base_url = 'www.cbioportal.org/api') get_entrez_id(hugo_symbol = c("FGFR1", "TP53") , base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_entrez_id(hugo_symbol = "TAP1", base_url = 'www.cbioportal.org/api') get_entrez_id(hugo_symbol = c("FGFR1", "TP53") , base_url = 'www.cbioportal.org/api') ## End(Not run)
Get Fusions By Sample ID
get_fusions_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, base_url = NULL ) get_structural_variants_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, base_url = NULL )
get_fusions_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, base_url = NULL ) get_structural_variants_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, base_url = NULL )
sample_id |
a vector of sample IDs (character) |
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
molecular_profile_id |
A string indicating the molecular profile ID from which to pull data. If ID supplied, will
guess the molecular profile ID based on the study ID. Only 1 molecular profile ID can be passed. If mutations from
more than 1 study needed, see |
sample_study_pairs |
A dataframe with columns: |
genes |
A vector of Entrez ids or Hugo symbols. If Hugo symbols are supplied, they will be converted to entrez ids using the |
panel |
One or more panel IDs to query (e.g. 'IMPACT468').
If |
base_url |
The database URL to query
If |
A data frame of Fusions
## Not run: set_cbioportal_db("public") #' # These return the same results get_fusions_by_sample(sample_id = c("s_C_CAUWT7_P001_d"), study_id = "prad_msk_2019") get_structural_variants_by_sample(sample_id = c("s_C_CAUWT7_P001_d"), study_id = "prad_msk_2019") ## End(Not run)
## Not run: set_cbioportal_db("public") #' # These return the same results get_fusions_by_sample(sample_id = c("s_C_CAUWT7_P001_d"), study_id = "prad_msk_2019") get_structural_variants_by_sample(sample_id = c("s_C_CAUWT7_P001_d"), study_id = "prad_msk_2019") ## End(Not run)
Get Fusions By Study
get_fusions_by_study( study_id = NULL, molecular_profile_id = NULL, base_url = NULL ) get_structural_variants_by_study( study_id = NULL, molecular_profile_id = NULL, base_url = NULL )
get_fusions_by_study( study_id = NULL, molecular_profile_id = NULL, base_url = NULL ) get_structural_variants_by_study( study_id = NULL, molecular_profile_id = NULL, base_url = NULL )
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. |
base_url |
The database URL to query
If |
A dataframe of fusions
## Not run: # These return the same results get_fusions_by_study(molecular_profile_id = "prad_msk_2019_structural_variants") get_structural_variants_by_study(molecular_profile_id = "prad_msk_2019_structural_variants") ## End(Not run)
## Not run: # These return the same results get_fusions_by_study(molecular_profile_id = "prad_msk_2019_structural_variants") get_structural_variants_by_study(molecular_profile_id = "prad_msk_2019_structural_variants") ## End(Not run)
Retrieve Genes Included For a Specified Panel ID
get_gene_panel(panel_id = NULL, base_url = NULL)
get_gene_panel(panel_id = NULL, base_url = NULL)
panel_id |
name of panel. See |
base_url |
The database URL to query.
If |
A dataframe of genes in a specified panel
## Not run: get_gene_panel(panel_id = "IMPACT468", base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_gene_panel(panel_id = "IMPACT468", base_url = 'www.cbioportal.org/api') ## End(Not run)
Get A List of Genes for a Specified Database
get_genes(base_url = NULL)
get_genes(base_url = NULL)
base_url |
The database URL to query
If |
A dataframe of gene ids, hugo symbols, and gene types
## Not run: get_genes(base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_genes(base_url = 'www.cbioportal.org/api') ## End(Not run)
Get All Genomic Information By Sample IDs
get_genetics_by_sample( sample_id = NULL, study_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, add_hugo = TRUE, base_url = NULL, return_segments = FALSE )
get_genetics_by_sample( sample_id = NULL, study_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, add_hugo = TRUE, base_url = NULL, return_segments = FALSE )
sample_id |
a vector of sample IDs (character) |
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
sample_study_pairs |
A dataframe with columns: |
genes |
A vector of Entrez ids or Hugo symbols. If Hugo symbols are supplied, they will be converted to entrez ids using the |
panel |
One or more panel IDs to query (e.g. 'IMPACT468').
If |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
return_segments |
Default is |
A list of mutations, cna and structural variants (including fusions), if available. Will also return copy number segmentation data if return_segments = TRUE
.
## Not run: get_genetics_by_sample(sample_id = c("TCGA-OR-A5J2-01","TCGA-OR-A5J6-01"), study_id = "acc_tcga", return_segments = TRUE) ## End(Not run)
## Not run: get_genetics_by_sample(sample_id = c("TCGA-OR-A5J2-01","TCGA-OR-A5J6-01"), study_id = "acc_tcga", return_segments = TRUE) ## End(Not run)
Get All Genomic Information By Study
get_genetics_by_study( study_id = NULL, add_hugo = TRUE, base_url = NULL, return_segments = FALSE )
get_genetics_by_study( study_id = NULL, add_hugo = TRUE, base_url = NULL, return_segments = FALSE )
study_id |
A study ID to query mutations. If NULL, guesses study ID based on molecular_profile_id. |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
return_segments |
Default is |
A list of mutations, cna and structural variants (including fusions), if available. Will also return copy number segmentation data if return_segments = TRUE
.
## Not run: get_genetics_by_study(study_id = "prad_msk_2019") ## End(Not run)
## Not run: get_genetics_by_study(study_id = "prad_msk_2019") ## End(Not run)
Get Hugo Symbol for a given set of Entrez IDs
get_hugo_symbol(entrez_id = NULL, base_url = NULL)
get_hugo_symbol(entrez_id = NULL, base_url = NULL)
entrez_id |
a character or numeric vector of Entrez gene IDs |
base_url |
The database URL to query |
A dataframe with Entrez Gene IDs and Hugo Symbols
## Not run: get_hugo_symbol(entrez_id = 2261, base_url = 'www.cbioportal.org/api') get_hugo_symbol(entrez_id = c(2261, 7157) , base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_hugo_symbol(entrez_id = 2261, base_url = 'www.cbioportal.org/api') get_hugo_symbol(entrez_id = c(2261, 7157) , base_url = 'www.cbioportal.org/api') ## End(Not run)
Get Mutations By Sample ID
get_mutations_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, add_hugo = TRUE, base_url = NULL )
get_mutations_by_sample( sample_id = NULL, study_id = NULL, molecular_profile_id = NULL, sample_study_pairs = NULL, genes = NULL, panel = NULL, add_hugo = TRUE, base_url = NULL )
sample_id |
a vector of sample IDs (character) |
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
molecular_profile_id |
A string indicating the molecular profile ID from which to pull data. If ID supplied, will
guess the molecular profile ID based on the study ID. Only 1 molecular profile ID can be passed. If mutations from
more than 1 study needed, see |
sample_study_pairs |
A dataframe with columns: |
genes |
A vector of Entrez ids or Hugo symbols. If Hugo symbols are supplied, they will be converted to entrez ids using the |
panel |
One or more panel IDs to query (e.g. 'IMPACT468').
If |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
A data frame of mutations (maf file format)
## Not run: get_mutations_by_sample(sample_id = c("TCGA-OR-A5J2-01","TCGA-OR-A5J6-01"), study_id = "acc_tcga", base_url = "public") ## End(Not run)
## Not run: get_mutations_by_sample(sample_id = c("TCGA-OR-A5J2-01","TCGA-OR-A5J6-01"), study_id = "acc_tcga", base_url = "public") ## End(Not run)
Get Mutations By Study ID
get_mutations_by_study( study_id = NULL, molecular_profile_id = NULL, add_hugo = TRUE, base_url = NULL )
get_mutations_by_study( study_id = NULL, molecular_profile_id = NULL, add_hugo = TRUE, base_url = NULL )
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. |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
A dataframe of mutations (maf file format)
## Not run: get_mutations_by_study(study_id = "prad_msk_2019") get_mutations_by_study(molecular_profile_id = "prad_msk_2019_mutations") ## End(Not run)
## Not run: get_mutations_by_study(study_id = "prad_msk_2019") get_mutations_by_study(molecular_profile_id = "prad_msk_2019_mutations") ## End(Not run)
Get Gene Panel by study ID and sample ID
get_panel_by_sample( study_id = NULL, sample_id = NULL, sample_study_pairs = NULL, base_url = NULL )
get_panel_by_sample( study_id = NULL, sample_id = NULL, sample_study_pairs = NULL, base_url = NULL )
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
sample_id |
a vector of sample IDs (character) |
sample_study_pairs |
A dataframe with columns: |
base_url |
The database URL to query
If |
a dataframe of a specific clinical attribute
## Not run: get_panel_by_sample(study_id = "blca_plasmacytoid_mskcc_2016", sample_id = "DS-sig-010-P2", base_url = 'www.cbioportal.org/api') ## End(Not run)
## Not run: get_panel_by_sample(study_id = "blca_plasmacytoid_mskcc_2016", sample_id = "DS-sig-010-P2", base_url = 'www.cbioportal.org/api') ## End(Not run)
Get sample IDs for a given set of patient IDs
get_samples_by_patient(patient_id = NULL, study_id = NULL, base_url = NULL)
get_samples_by_patient(patient_id = NULL, study_id = NULL, base_url = NULL)
patient_id |
A character string of sample IDs to query |
study_id |
A character string indicating which study ID should be searched. Only 1 study allowed. If NULL, we will guess a default study ID based on your database URL. |
base_url |
The database URL to query
If |
A dataframe of patient IDs and corresponding sample IDs. If patient has multiple samples, there will be multiple rows per patient.
## Not run: get_samples_by_patient(patient_id = c("P-0000034", "P-0000036")) ## End(Not run)
## Not run: get_samples_by_patient(patient_id = c("P-0000034", "P-0000036")) ## End(Not run)
Get Copy Number Segmentation Data By Sample ID
get_segments_by_sample( sample_id = NULL, study_id = NULL, sample_study_pairs = NULL, base_url = NULL )
get_segments_by_sample( sample_id = NULL, study_id = NULL, sample_study_pairs = NULL, base_url = NULL )
sample_id |
a vector of sample IDs (character) |
study_id |
A string indicating the study ID from which to pull data. If no study ID, will
guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from
more than 1 study needed, see |
sample_study_pairs |
A dataframe with columns: |
base_url |
The database URL to query
If |
A dataframe of CNA segments
## Not run: set_cbioportal_db("public") get_segments_by_sample(sample_id = c("s_C_CAUWT7_P001_d"), study_id = "prad_msk_2019") ## End(Not run)
## Not run: set_cbioportal_db("public") get_segments_by_sample(sample_id = c("s_C_CAUWT7_P001_d"), study_id = "prad_msk_2019") ## End(Not run)
Get Copy Number Segmentation Data By Study
get_segments_by_study(study_id = NULL, add_hugo = TRUE, base_url = NULL)
get_segments_by_study(study_id = NULL, add_hugo = TRUE, base_url = NULL)
study_id |
A study ID to query mutations. If NULL, guesses study ID based on molecular_profile_id. |
add_hugo |
Logical indicating whether |
base_url |
The database URL to query
If |
A dataframe of CNA segments
## Not run: get_segments_by_study(study_id = "prad_msk_2019") get_segments_by_study(molecular_profile_id = "prad_msk_2019_cna") ## End(Not run)
## Not run: get_segments_by_study(study_id = "prad_msk_2019") get_segments_by_study(molecular_profile_id = "prad_msk_2019_cna") ## End(Not run)
Get Metadata on All Available Studies in Database or a Specified Study
get_study_info(study_id = NULL, base_url = NULL)
get_study_info(study_id = NULL, base_url = NULL)
study_id |
one or more study IDs (see |
base_url |
The database URL to query.
If |
A dataframe of study metadata
## Not run: set_cbioportal_db("public") get_study_info("acc_tcga") ## End(Not run)
## Not run: set_cbioportal_db("public") get_study_info("acc_tcga") ## End(Not run)
Dataframe labeling all genes included in IMPACT panels along with their corresponding platform ID and Entrez ID.
impact_gene_info
impact_gene_info
A data frame with 470 genes
Factor w/ 574 levels, Column containing all HUGO symbols genes included in IMPACT
Integer, contains all Entrez IDs for genes included in IMPACT
Character, indicates whether each gene was included in
IMPACT platform 341. Options are included
and not included
Character, indicates whether each gene was included in
IMPACT platform 410. Options are included
and not included
Character, indicates whether each gene was included in
IMPACT platform 468. Options are included
and not included
A nested dataframe of aliases for each gene and corresponding entrez gene ids for aliases if they exist
This is a general look up function that can take a study ID or patient ID and return what samples exist across entire cBioPortal website (depends on your base URL) that match that ID. It will return which studies include that sample or patient.
lookup_id(lookup_id = NULL, base_url = NULL)
lookup_id(lookup_id = NULL, base_url = NULL)
lookup_id |
a sample ID or patient ID |
base_url |
The database URL to query
If |
This can also be useful to see all samples a particular patient has available across all studies on
cBioPortal (see also get_samples_by_patient()
).
A dataframe of general info for sample of patient IDs given
## Not run: lookup_id <- c("P-0001453-T01-IM3", "P-0000004-T01-IM3", "TCGA-OR-A5JA") x <- lookup_id(lookup_id = lookup_id, base_url = 'www.cbioportal.org/api') x ## End(Not run)
## Not run: lookup_id <- c("P-0001453-T01-IM3", "P-0000004-T01-IM3", "TCGA-OR-A5JA") x <- lookup_id(lookup_id = lookup_id, base_url = 'www.cbioportal.org/api') x ## End(Not run)
This function sets a base cBioPortal URL
set_cbioportal_db(db = NULL)
set_cbioportal_db(db = NULL)
db |
The database URL to use as base URL for calls, or "public" for https://www.cbioportal.org/ |
No return value, called for side effects. Will display an alert notifying if the user has successfully authenticated to cBioPortal.
Karissa Whiting, Daniel D. Sjoberg
## Not run: set_cbioportal_db(db = "public") ## End(Not run)
## Not run: set_cbioportal_db(db = "public") ## End(Not run)
Helps troubleshoot API issues during an R session
test_cbioportal_db()
test_cbioportal_db()
No return value, called for side effects. Will display an alert notifying if the user has successfully authenticated to cBioPortal
Karissa Whiting, Daniel D. Sjoberg
## Not run: set_cbioportal_db("public") test_cbioportal_db() ## End(Not run)
## Not run: set_cbioportal_db("public") test_cbioportal_db() ## End(Not run)