cBioPortal | R Documentation |
This section of the documentation lists the functions that allow
users to access the cBioPortal API. The main representation of the API can
be obtained from the cBioPortal
function. The supporting functions listed
here give access to specific parts of the API and allow the user to explore
the API with individual calls. Many of the functions here are listed for
documentation purposes and are recommended for advanced usage only. Users
should only need to use the cBioPortalData
main function to obtain data.
cBioPortal(
hostname = "www.cbioportal.org",
protocol = "https",
api. = "/api/v2/api-docs",
token = character()
)
getStudies(api, buildReport = FALSE)
clinicalData(api, studyId = NA_character_)
molecularProfiles(
api,
studyId = NA_character_,
projection = c("SUMMARY", "ID", "DETAILED", "META")
)
fetchData(
api,
studyId,
molecularProfileIds = NA_character_,
entrezGeneIds = NULL,
sampleIds = NULL
)
mutationData(
api,
molecularProfileIds = NA_character_,
entrezGeneIds = NULL,
sampleIds = NULL
)
molecularData(
api,
molecularProfileIds = NA_character_,
entrezGeneIds = NULL,
sampleIds = NULL
)
copyNumberData(
api,
molecularProfileIds = NA_character_,
entrezGeneIds = NULL,
sampleIds = NULL,
sampleListId = NULL,
discreteCopyNumberEventType = c("HOMDEL_AND_AMP", "HOMDEL", "AMP", "GAIN", "HETLOSS",
"DIPLOID", "ALL"),
projection = c("SUMMARY", "ID", "DETAILED", "META")
)
searchOps(api, keyword)
samplesInSampleLists(api, sampleListIds = NA_character_)
sampleLists(api, studyId = NA_character_)
allSamples(api, studyId = NA_character_)
getSampleInfo(
api,
studyId = NA_character_,
sampleListIds = NULL,
projection = c("SUMMARY", "ID", "DETAILED", "META")
)
genePanels(api)
getGenePanel(api, genePanelId = NA_character_)
genePanelMolecular(
api,
molecularProfileId = NA_character_,
sampleListId = NULL,
sampleIds = NULL
)
getGenePanelMolecular(api, molecularProfileIds = NA_character_, sampleIds)
geneTable(api, pageSize = 1000, pageNumber = 0, ...)
queryGeneTable(
api,
by = c("entrezGeneId", "hugoGeneSymbol"),
genes = NA_character_,
genePanelId = NA_character_
)
getDataByGenes(
api,
studyId = NA_character_,
genes = NA_character_,
genePanelId = NA_character_,
by = c("entrezGeneId", "hugoGeneSymbol"),
molecularProfileIds = NULL,
sampleListId = NULL,
sampleIds = NULL,
...
)
hostname |
|
protocol |
|
api. |
|
token |
|
api |
An API object of class |
buildReport |
|
studyId |
|
projection |
|
molecularProfileIds |
|
entrezGeneIds |
|
sampleIds |
|
sampleListId |
|
discreteCopyNumberEventType |
|
keyword |
|
sampleListIds |
|
genePanelId |
|
molecularProfileId |
|
pageSize |
|
pageNumber |
|
... |
Additional arguments to lower level API functions |
by |
|
genes |
|
cBioPortal: An API object of class 'cBioPortal'
cBioPortalData: A data object of class 'MultiAssayExperiment'
getStudies: Obtain a table of studies and associated metadata and
optionally include a buildReport
status (default FALSE) for each
study. When enabled, the 'api_build' and 'pack_build' columns will
be added to the table and will show if MultiAssayExperiment
objects
can be generated for that particular study identifier (studyId
). The
'api_build' column corresponds to datasets obtained with
cBioPortalData
and the 'pack_build' column corresponds to datsets
loaded via cBioDataPack
.
searchOps - Search through API operations with a keyword
sampleLists - obtain all sampleListIds
for a particular studyId
allSamples - obtain all samples within a particular studyId
genePanels - Show all available gene panels
geneTable - Get a table of all genes by 'entrezGeneId' and 'hugoGeneSymbol'
queryGeneTable - Get a table for only the genes
or genePanelId
of
interest. Gene inputs are identified with the by
argument
clinicalData - Obtain clinical data for a particular study identifier ('studyId')
molecularProfiles - Produce a molecular profiles dataset for a given study identifier ('studyId')
fetchData - A convenience function to download both mutation and
molecular data with molecularProfileId
, entrezGeneIds
, and
sampleIds
mutationData - Produce a dataset of mutation data using
molecularProfileId
, entrezGeneIds
, and sampleIds
molecularData - Produce a dataset of molecular profile data based on
molecularProfileId
, entrezGeneIds
, and sampleIds
copyNumberData - Produce a dataset of copy number data based on
molecularProfileId
, sampleListId
, discreteCopyNumberEventType
, and
projection
samplesInSampleLists - get all samples associated with a 'sampleListId'
getSampleInfo - Obtain sample metadata for a particular studyId
or
sampleListId
getGenePanels - Obtain the gene panel for a particular 'genePanelId'
genePanelMolecular - get gene panel data for a particular
molecularProfileId
and either a vector of sampleListId
or sampleId
getGenePanelMolecular - get gene panel data for multiple
molecularProfileId
s and a vector of sampleIds
getDataByGenes - Download data for a number of genes within
molecularProfileId
indicators, optionally a sampleListId
can be
provided.
cbio <- cBioPortal()
getStudies(api = cbio)
clinicalData(cbio, "acc_tcga")
molecularProfiles(cbio, "acc_tcga")
fetchData(
api = cbio, studyId = "acc_tcga",
molecularProfileIds = c(
"acc_tcga_mutations", "acc_tcga_gistic", "acc_tcga_rppa"
),
entrezGeneIds = 1:1000,
sampleIds = c("TCGA-OR-A5J1-01", "TCGA-OR-A5J2-01")
)
mutationData(
api = cbio,
molecularProfileIds = "acc_tcga_mutations",
entrezGeneIds = 1:1000,
sampleIds = c("TCGA-OR-A5J1-01", "TCGA-OR-A5J2-01")
)
molecularData(
api = cbio,
molecularProfileIds = c("acc_tcga_rna_seq_v2_mrna", "acc_tcga_rppa"),
entrezGeneIds = 1:100,
sampleIds = c("TCGA-OR-A5J1-01", "TCGA-OR-A5J2-01")
)
## obtain molecularProfileId for discrete copy number alteration data
molecularProfiles(cbio, "acc_tcga") |>
dplyr::filter(
molecularAlterationType == "COPY_NUMBER_ALTERATION" &
datatype == "DISCRETE"
)
copyNumberData(
api = cbio,
molecularProfileIds = "acc_tcga_gistic",
entrezGeneIds = 25,
sampleListId = "acc_tcga_all"
)
searchOps(api = cbio, keyword = "molecular")
samplesInSampleLists(
api = cbio,
sampleListIds = c("acc_tcga_rppa", "acc_tcga_cnaseq")
)
sampleLists(api = cbio, studyId = "acc_tcga")
genePanels(cbio)
getGenePanel(cbio, "AmpliSeq")
queryGeneTable(api = cbio, by = "entrezGeneId", genes = 7157)
getDataByGenes(
api = cbio,
studyId = "acc_tcga",
genes = 1,
by = "entrezGeneId",
molecularProfileIds = "acc_tcga_rna_seq_v2_mrna",
sampleListId = "acc_tcga_rna_seq_v2_mrna"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.