cbioportalR
R package to wrap cBioPortal's API to pull data from public or private cBioPortal databases
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: pubmed.ncbi, ncbi.nlm.nih.gov -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.3%) to scientific vocabulary
Keywords
r-package
Last synced: 9 months ago
·
JSON representation
Repository
R package to wrap cBioPortal's API to pull data from public or private cBioPortal databases
Basic Info
- Host: GitHub
- Owner: karissawhiting
- License: other
- Language: R
- Default Branch: main
- Homepage: https://www.karissawhiting.com/cbioportalR/
- Size: 15.2 MB
Statistics
- Stars: 22
- Watchers: 1
- Forks: 11
- Open Issues: 8
- Releases: 5
Topics
r-package
Created over 5 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Changelog
Contributing
License
Code of conduct
Codemeta
README.Rmd
---
output: github_document
editor_options:
chunk_output_type: inline
---
```{r, setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
# fig.path = "man/figures/readme-",
out.width = "100%"
)
library(tidyverse)
```
[](https://github.com/karissawhiting/cbioportalR/actions)
[](https://app.codecov.io/gh/karissawhiting/cbioportalR?branch=master)
[](https://CRAN.R-project.org/package=cbioportalR)
## cbioportalR
{cbioportalR} allows you to access [cBioPortal's](https://www.cbioportal.org/) genomic and clinical data sets directly through R. The package wraps cBioPortal's API endpoints so R users can easily leverage the [existing API](https://www.cbioportal.org/api/swagger-ui/index.html) to access genomic data on mutations, copy number alterations and fusions as well as data on tumor mutational burden (TMB), microsatellite instability status (MSI) and select clinical data points (depending on the study).
This package was created to work with both the public [cBioPortal website](https://www.cbioportal.org/), as well as private institutional cBioPortal instances (e.g. MSKCC, GENIE) with appropriate credentials and [authentication].
This package is compatible with cBioPortal v5, but is subject to change as [cBioPortal updates are released](https://github.com/cBioPortal/cbioportal/releases). To see if your cBioPortal instance is compatible, look for its version in the footer of the homepage or check `portalVersion` in the output of `YOUR_CBIOPORTAL_INSTANCE/api/info`. For more information on cBioPortal, see the following publications:
- [Gao et al. Sci. Signal. 2013](https://pubmed.ncbi.nlm.nih.gov/23550210/)
- [Cerami et al. Cancer Discov. 2012](https://pubmed.ncbi.nlm.nih.gov/22588877/)
For full documentation on the cBioPortal API, please see the following links:
- [cBioPortal API and API Clients documentation](https://docs.cbioportal.org/web-api-and-clients/)
- [Full reference documentation for API](https://www.cbioportal.org/api/swagger-ui/index.html)
*Note: If you are a MSK researcher working on IMPACT data, you should connect to MSK's cBioPortal instance to get the most up to date IMPACT data, and you must follow the MSK-IMPACT publication guidelines when using this data*
{cbioportalR} is part of the [genomeverse](https://mskcc-epi-bio.github.io/genomeverse/), a collection of R packages designed to work together seamlessly to create reproducible clinico-genomic analysis pipelines.
## Installation
You can install {cbioportalR} with the following code:
```{r, eval=F}
install.packages("cbioportalR")
```
Install the development version of {cbioportalR} with:
```{r ,eval=F}
remotes::install_github("karissawhiting/cbioportalR")
```
Load the package:
```{r}
library(cbioportalR)
```
## Authentication {#authentication}
If you are using the public domain https://www.cbioportal.org/, you don't need a token to start pulling data. If you are using a private instance of cBioPortal (like MSKCC's institutional database), you will need to acquire a token and save it to your `.Renviron` file (or wherever you store credentials). Simply log in to your institution's cBioPortal site, acquire a token (usually through the 'Data Access Token' link in your username menu in the upper right) and save it in your `.Renviron` file. This will save the token as an environmental variable so you don't have to hard code the secret key in your scripts.
*Tip: The following {usethis} function can easily find and open the `.Renviron` for you:*
```{r,eval=F}
usethis::edit_r_environ()
```
Paste the token you were given (using the format below) in the .Renviron file and save the file changes. *After saving you should restart your R session to ensure the token is saved and recognized.*
```{r, eval=F}
CBIOPORTAL_TOKEN = 'YOUR_TOKEN'
```
You can test that your token was saved using:
```{r,eval = F}
get_cbioportal_token()
```
For every new R session, you need to set your database URL. The `set_cbioportal_db()` function will set an environmental variable for your session that tells the package which database to point to for all API calls. You can set it to point to the public database with `db = 'www.cbioportal.org'` or `db = 'public'`. If using a private database you will pass your institutions cBioPortal URL as `db`. This function will both set your URL and check the connection.
```{r}
set_cbioportal_db(db = "public")
```
You are now set up for the remainder of your session! API calls depend on your internet connection and possibly a VPN connection so you can use the following to check your connection at any time throughout your session:
```{r}
test_cbioportal_db()
```
## cBioPortal Data Model
There are many ways to identify and pull data (e.g. by study ID, by sample ID, by molecular profile ID). Having an understanding of how data is organized in cBioPortal will help you determine which functions you need. The figure below outlines the general data schema for cBioPortal and which functions access which levels of the schema:
```{r, results = FALSE, echo=FALSE, eval = FALSE }
x <- tibble::tibble(
level = c("Database", "Studies", "Molecular Profiles", "Patients & Samples"),
functions = list(
c("`available_studies()`",
"`available_profiles()`",
"`available_gene_panels()`",
"`get_genes()`"),
c("`available_profiles()`",
"`get_study_info()`",
"`available_clinical_attributes()`",
"`get_genetics_by_study()`",
"`get_mutations_by_study()`",
"`get_cna_by_study()`",
"`get_fusions_by_study()`",
"`get_clinical_by_study()`",
"`available_samples()`",
"available_patients()",
"available_sample_lists()"),
c("`get_genetics_by_study()`",
"`get_mutations_by_study()`",
"`get_cna_by_study()`",
"`get_fusions_by_study()`"),
c("`get_genetics_by_sample()`",
"`get_mutations_by_study()`",
"`get_cna_by_sample()`",
"`get_fusions_by_sample()`",
"`get_clinical_by_sample()`",
"`get_clinical_by_patient()`",
"`get_panel_by_sample()`",
"`get_samples_by_patient()`"))) %>%
mutate(level =
forcats::fct_relevel(level, "Database", "Studies",
"Molecular Profiles", "Patients & Samples"))
table_funs <- x %>%
gt::gt() %>%
gt::cols_label(level = gt::md("**Level**"),
functions = gt::md("**Functions**")) %>%
gt::tab_options(table.font.size = 'small') %>%
gt::data_color(
columns = level,
colors = scales::col_factor(
palette = c("BlueViolet", "SlateBlue", "DodgerBlue", "LightSeaGreen", "SandyBrown"),
domain = NULL,
# reverse = TRUE
),
alpha = 0.6
) %>%
gt::cols_align(
align = "left",
columns = functions
) %>%
gt::tab_style(
style = list(
gt::cell_text(weight = "bold")
),
locations = gt::cells_body(
columns = level,
rows = everything()
)
) %>%
gt::tab_options(table.width = "500px")
raw_html_table <- table_funs %>%
gt::as_raw_html()
# | `r raw_html_table` | #
Owner
- Login: karissawhiting
- Kind: user
- Repositories: 4
- Profile: https://github.com/karissawhiting
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "cbioportalR",
"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.",
"name": "cbioportalR: Browse and Query Clinical and Genomic Data from cBioPortal",
"relatedLink": [
"https://www.karissawhiting.com/cbioportalR/",
"https://CRAN.R-project.org/package=cbioportalR"
],
"codeRepository": "https://github.com/karissawhiting/cbioportalR",
"issueTracker": "https://github.com/karissawhiting/cbioportalR/issues",
"license": "https://spdx.org/licenses/MIT",
"version": "1.1.1",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.2.2 (2022-10-31)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"author": [
{
"@type": "Person",
"givenName": "Karissa",
"familyName": "Whiting",
"email": "karissa.whiting@gmail.com",
"@id": "https://orcid.org/0000-0002-4683-1868"
}
],
"copyrightHolder": [
{
"@type": "Person",
"givenName": "Karissa",
"familyName": "Whiting",
"email": "karissa.whiting@gmail.com",
"@id": "https://orcid.org/0000-0002-4683-1868"
}
],
"maintainer": [
{
"@type": "Person",
"givenName": "Karissa",
"familyName": "Whiting",
"email": "karissa.whiting@gmail.com",
"@id": "https://orcid.org/0000-0002-4683-1868"
}
],
"softwareSuggestions": [
{
"@type": "SoftwareApplication",
"identifier": "testthat",
"name": "testthat",
"version": ">= 3.1.4",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=testthat"
},
{
"@type": "SoftwareApplication",
"identifier": "knitr",
"name": "knitr",
"version": ">= 1.39",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=knitr"
},
{
"@type": "SoftwareApplication",
"identifier": "rmarkdown",
"name": "rmarkdown",
"version": ">= 2.14",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rmarkdown"
},
{
"@type": "SoftwareApplication",
"identifier": "covr",
"name": "covr",
"version": ">= 3.5.1",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=covr"
},
{
"@type": "SoftwareApplication",
"identifier": "spelling",
"name": "spelling",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=spelling"
}
],
"softwareRequirements": {
"1": {
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 2.10"
},
"2": {
"@type": "SoftwareApplication",
"identifier": "httr",
"name": "httr",
"version": ">= 1.4.3",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=httr"
},
"3": {
"@type": "SoftwareApplication",
"identifier": "tibble",
"name": "tibble",
"version": ">= 3.1.7",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tibble"
},
"4": {
"@type": "SoftwareApplication",
"identifier": "purrr",
"name": "purrr",
"version": ">= 0.3.4",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=purrr"
},
"5": {
"@type": "SoftwareApplication",
"identifier": "magrittr",
"name": "magrittr",
"version": ">= 2.0.3",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=magrittr"
},
"6": {
"@type": "SoftwareApplication",
"identifier": "rlang",
"name": "rlang",
"version": ">= 1.0.3",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rlang"
},
"7": {
"@type": "SoftwareApplication",
"identifier": "glue",
"name": "glue",
"version": ">= 1.6.2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=glue"
},
"8": {
"@type": "SoftwareApplication",
"identifier": "jsonlite",
"name": "jsonlite",
"version": ">= 1.8.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=jsonlite"
},
"9": {
"@type": "SoftwareApplication",
"identifier": "tidyr",
"name": "tidyr",
"version": ">= 1.2.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=tidyr"
},
"10": {
"@type": "SoftwareApplication",
"identifier": "dplyr",
"name": "dplyr",
"version": ">= 1.0.9",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
"11": {
"@type": "SoftwareApplication",
"identifier": "stringr",
"name": "stringr",
"version": ">= 1.4.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=stringr"
},
"12": {
"@type": "SoftwareApplication",
"identifier": "cli",
"name": "cli",
"version": ">= 3.3.0",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=cli"
},
"SystemRequirements": null
},
"fileSize": "2289.853KB",
"releaseNotes": "https://github.com/karissawhiting/cbioportalR/blob/master/NEWS.md",
"readme": "https://github.com/karissawhiting/cbioportalR/blob/main/README.md",
"contIntegration": [
"https://github.com/karissawhiting/cbioportalR/actions",
"https://app.codecov.io/gh/karissawhiting/cbioportalR?branch=master"
],
"keywords": "r-package"
}
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 4
- Watch event: 2
- Delete event: 1
- Issue comment event: 1
- Push event: 13
- Pull request event: 3
- Fork event: 2
Last Year
- Create event: 1
- Release event: 1
- Issues event: 4
- Watch event: 2
- Delete event: 1
- Issue comment event: 1
- Push event: 13
- Pull request event: 3
- Fork event: 2
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| karissawhiting | w****k@m****g | 188 |
| michaelcurry1123 | 3****3 | 4 |
| laveryj | l****j@m****g | 2 |
| lins5 | s****n@g****m | 1 |
| Ino de Bruijn | i****o@i****o | 1 |
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 43
- Total pull requests: 29
- Average time to close issues: 3 months
- Average time to close pull requests: 23 days
- Total issue authors: 11
- Total pull request authors: 3
- Average comments per issue: 1.07
- Average comments per pull request: 0.38
- Merged pull requests: 28
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 1
- Average time to close issues: 6 days
- Average time to close pull requests: 6 days
- Issue authors: 3
- Pull request authors: 1
- Average comments per issue: 1.33
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- karissawhiting (31)
- edrill (3)
- ypradat (2)
- clarrity (1)
- Almogkm (1)
- grainneireland (1)
- jgarces02 (1)
- karomanchuk (1)
- kmezhoud (1)
- morriso1 (1)
- drhmoosavi (1)
Pull Request Authors
- karissawhiting (25)
- michaelcurry1123 (4)
- jalavery (2)
- stl2137 (1)
Top Labels
Issue Labels
priority (3)
help wanted (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 623 last-month
- Total docker downloads: 21,613
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: cbioportalR
Browse and Query Clinical and Genomic Data from cBioPortal
- Homepage: https://github.com/karissawhiting/cbioportalR
- Documentation: http://cran.r-project.org/web/packages/cbioportalR/cbioportalR.pdf
- License: MIT + file LICENSE
-
Latest release: 1.1.1
published over 1 year ago
Rankings
Docker downloads count: 0.6%
Forks count: 9.6%
Stargazers count: 12.8%
Average: 18.0%
Dependent repos count: 23.8%
Dependent packages count: 28.6%
Downloads: 32.4%
Maintainers (1)
Last synced:
9 months ago
Dependencies
.github/workflows/R-CMD-check.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/check-r-package v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml
actions
- actions/checkout v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION
cran
- R >= 2.10 depends
- cli >= 3.3.0 imports
- dplyr >= 1.0.9 imports
- glue >= 1.6.2 imports
- httr >= 1.4.3 imports
- jsonlite >= 1.8.0 imports
- magrittr >= 2.0.3 imports
- purrr >= 0.3.4 imports
- rlang >= 1.0.3 imports
- stringr >= 1.4.0 imports
- tibble >= 3.1.7 imports
- tidyr >= 1.2.0 imports
- covr >= 3.5.1 suggests
- knitr >= 1.39 suggests
- rmarkdown >= 2.14 suggests
- spelling >= 2.2 suggests
- testthat >= 3.1.4 suggests