% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cBioPortal.R
\name{cBioPortal}
\alias{cBioPortal}
\alias{getStudies}
\alias{clinicalData}
\alias{molecularProfiles}
\alias{mutationData}
\alias{molecularData}
\alias{searchOps}
\alias{samplesInSampleLists}
\alias{sampleLists}
\alias{allSamples}
\alias{getSampleInfo}
\alias{genePanels}
\alias{getGenePanel}
\alias{genePanelMolecular}
\alias{getGenePanelMolecular}
\alias{geneTable}
\alias{queryGeneTable}
\alias{getDataByGenes}
\title{The R interface to the cBioPortal API Data Service}
\usage{
cBioPortal(
  hostname = "www.cbioportal.org",
  protocol = "https",
  api. = "/api/api-docs",
  token = character()
)

getStudies(api, buildReport = FALSE)

clinicalData(api, studyId = NA_character_)

molecularProfiles(
  api,
  studyId = NA_character_,
  projection = c("SUMMARY", "ID", "DETAILED", "META")
)

mutationData(
  api,
  molecularProfileIds = NA_character_,
  entrezGeneIds = NULL,
  sampleIds = NULL
)

molecularData(
  api,
  molecularProfileIds = NA_character_,
  entrezGeneIds = NULL,
  sampleIds = NULL
)

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,
  ...
)
}
\arguments{
\item{hostname}{character(1) The internet location of the service
(default: 'www.cbioportal.org')}

\item{protocol}{character(1) The internet protocol used to access the
hostname (default: 'https')}

\item{api.}{character(1) The directory location of the API protocol within
the hostname (default: '/api/api-docs')}

\item{token}{character(1) The Authorization Bearer token e.g.,
"63eba81c-2591-4e15-9d1c-fb6e8e51e35d" or a path to text file.}

\item{api}{An API object of class `cBioPortal` from the `cBioPortal`
function}

\item{buildReport}{logical(1) Indicates whether to append the build
information to the `getStudies()` table (default FALSE)}

\item{studyId}{character(1) Indicates the "studyId" as taken from
`getStudies`}

\item{projection}{character(default: "SUMMARY") Specify the projection
type for data retrieval for details see API documentation}

\item{molecularProfileIds}{character() A vector of molecular profile IDs}

\item{entrezGeneIds}{numeric() A vector indicating entrez gene IDs}

\item{sampleIds}{character() Sample identifiers}

\item{keyword}{character(1) Keyword or pattern for searching through
available operations}

\item{sampleListIds}{character() A vector of 'sampleListId' as obtained from
`sampleLists`}

\item{genePanelId}{character(1) Identifies the gene panel, as obtained
from the `genePanels` function}

\item{molecularProfileId}{character(1) Indicates a molecular profile ID}

\item{sampleListId}{character(1) A sample list identifier as obtained from
`sampleLists()``}

\item{pageSize}{numeric(1) The number of rows in the table to return}

\item{pageNumber}{numeric(1) The pagination page number}

\item{...}{Additional arguments to lower level API functions}

\item{by}{character(1) Either 'entrezGeneId' or 'hugoGeneSymbol' for row
metadata (default: 'entrezGeneId')}

\item{genes}{character() Either Entrez gene identifiers or Hugo gene
symbols. When included, the 'by' argument indicates the type of
identifier provided and 'genePanelId' is ignored. Preference is
given to Entrez IDs due to faster query responses.}
}
\value{
cBioPortal: An API object of class 'cBioPortal'

    cBioPortalData: A data object of class 'MultiAssayExperiment'
}
\description{
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.
}
\section{API Metadata}{

    * 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
}

\section{Patient Data}{

     * clinicalData - Obtain clinical data for a particular study identifier
     ('studyId')
}

\section{Molecular Profiles}{

     * molecularProfiles - Produce a molecular profiles dataset for a given
     study identifier ('studyId')


    * molecularData - Produce a dataset of molecular profile data based on
    `molecularProfileId`, `entrezGeneIds`, and `sampleIds`
}

\section{Mutation Data}{

    * mutationData - Produce a dataset of mutation data using
    `molecularProfileId`, `entrezGeneIds`, and `sampleIds`
}

\section{Sample Data}{

    * samplesInSampleLists - get all samples associated with a 'sampleListId'


    * getSampleInfo - Obtain sample metadata for a particular `studyId` or
    `sampleListId`
}

\section{Gene Panels}{

    * 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`
}

\section{Genes}{

    * getDataByGenes - Download data for a number of genes within
    `molecularProfileId` indicators, optionally a `sampleListId` can be
    provided.
}

\examples{
cbio <- cBioPortal()

getStudies(api = cbio)

searchOps(api = cbio, keyword = "molecular")

## obtain clinical data
acc_clin <- clinicalData(api = cbio, studyId = "acc_tcga")
acc_clin

molecularProfiles(api = cbio, studyId = "acc_tcga")

genePanels(cbio)

(gp <- getGenePanel(cbio, "AmpliSeq"))

muts <- mutationData(
    api = cbio,
    molecularProfileIds = "acc_tcga_mutations",
    entrezGeneIds = 1:1000,
    sampleIds = c("TCGA-OR-A5J1-01", "TCGA-OR-A5J2-01")
)
exps <- molecularData(
    api = cbio,
    molecularProfileIds = c("acc_tcga_rna_seq_v2_mrna", "acc_tcga_rppa"),
    entrezGeneIds = 1:1000,
    sampleIds = c("TCGA-OR-A5J1-01", "TCGA-OR-A5J2-01")
)

sampleLists(api = cbio, studyId = "acc_tcga")

samplesInSampleLists(
    api = cbio,
    sampleListIds = c("acc_tcga_rppa", "acc_tcga_cnaseq")
)

genePanels(api = cbio)

getGenePanel(api = cbio, genePanelId = "IMPACT341")

queryGeneTable(api = cbio, by = "entrezGeneId", genes = 7157)


getDataByGenes(
    cbio, studyId = "acc_tcga", genes = 1:3,
    by = c("entrezGeneId", "hugoGeneSymbol"),
    molecularProfileId = "acc_tcga_rppa",
    sampleListId = "acc_tcga_rppa"
)

}