UCSCXenaTools is an R package for accessing genomics data from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq. Public omics data from UCSC Xena are supported through multiple turn-key Xena Hubs, which are a collection of UCSC-hosted public databases such as TCGA, ICGC, TARGET, GTEx, CCLE, and others. Databases are normalized so they can be combined, linked, filtered, explored and downloaded.

Who is the target audience and what are scientific applications of this package?

Installation

Install stable release from CRAN with:

You can also install devel version of UCSCXenaTools from github with:

If you want to build vignette in local, please add two options:

The minimum versions to run the vignette is 1.2.4. GitHub Issue is a place for discussing any problem.

Data Hub List

All datasets are available at https://xenabrowser.net/datapages/.

Currently, UCSCXenaTools supports 10 data hubs of UCSC Xena.

If any url of data hub is changed or a new data hub is online, please remind me by emailing to or opening an issue on GitHub.

Usage

Download UCSC Xena datasets and load them into R by UCSCXenaTools is a workflow with generate, filter, query, download and prepare 5 steps, which are implemented as XenaGenerate, XenaFilter, XenaQuery, XenaDownload and XenaPrepare functions, respectively. They are very clear and easy to use and combine with other packages like dplyr.

To show the basic usage of UCSCXenaTools, we will download clinical data of LUNG, LUAD, LUSC from TCGA (hg19 version) data hub.

XenaData data.frame

UCSCXenaTools uses a data.frame object (built in package) XenaData to generate an instance of XenaHub class, which records information of all datasets of UCSC Xena Data Hubs.

You can load XenaData after loading UCSCXenaTools into R.

library(UCSCXenaTools)
#> =========================================================================================
#> UCSCXenaTools version 1.2.7
#> Project URL: https://github.com/ropensci/UCSCXenaTools
#> Usages: https://cran.r-project.org/web/packages/UCSCXenaTools/vignettes/USCSXenaTools.html
#> 
#> If you use it in published research, please cite:
#> Wang et al., (2019). The UCSCXenaTools R package: a toolkit for accessing genomics data
#>   from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq.
#>   Journal of Open Source Software, 4(40), 1627, https://doi.org/10.21105/joss.01627
#> =========================================================================================
#>                               --Enjoy it--
data(XenaData)

head(XenaData)
#> # A tibble: 6 x 17
#>   XenaHosts XenaHostNames XenaCohorts XenaDatasets SampleCount DataSubtype
#>   <chr>     <chr>         <chr>       <chr>              <int> <chr>      
#> 1 https://… publicHub     Breast Can… ucsfNeve_pu…          51 gene expre…
#> 2 https://… publicHub     Breast Can… ucsfNeve_pu…          57 phenotype  
#> 3 https://… publicHub     Glioma (Ko… kotliarov20…         194 copy number
#> 4 https://… publicHub     Glioma (Ko… kotliarov20…         194 phenotype  
#> 5 https://… publicHub     Lung Cance… weir2007_pu…         383 copy number
#> 6 https://… publicHub     Lung Cance… weir2007_pu…         383 phenotype  
#> # … with 11 more variables: Label <chr>, Type <chr>,
#> #   AnatomicalOrigin <chr>, SampleType <chr>, Tags <chr>, ProbeMap <chr>,
#> #   LongTitle <chr>, Citation <chr>, Version <chr>, Unit <chr>,
#> #   Platform <chr>

Workflow

Select datasets.

Sometimes we only know some keywords, XenaScan() can be used to scan all rows to detect if the keywords exist in XenaData.

Query and download.

Prepare data into R for analysis.

Browse datasets

Create two XenaHub objects:

  • to_browse - a XenaHub object containing a cohort and a dataset.
  • to_browse2 - a XenaHub object containing 2 cohorts and 2 datasets.

XenaBrowse() function can be used to browse dataset/cohort links using your default web browser. At default, this function limits one dataset/cohort for preventing user to open too many links at once.

When you make sure you want to open multiple links, you can set multiple option to TRUE.

More usages

The core functionality has been described above. I write more usages about this package in my website but not here because sometimes package check will fail due to internet problem.

A use case for survival analysis has been published on rOpenSci, please read UCSCXenaTools: Retrieve Gene Expression and Clinical Information from UCSC Xena for Survival Analysis.

QA

How to resume file from breakpoint

Thanks to the UCSC Xena team, the new feature ‘resume from breakpoint’ is added and can be done by XenaDownload() with the method and extra flags specified.

Of note, the corresponding wget or curl command must be installed by your OS and can be found by R.

The folliwng code gives a test example, the data can be viewed on web page.

Citation

Cite me by the following paper.

Wang et al., (2019). The UCSCXenaTools R package: a toolkit for accessing genomics data
  from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq. 
  Journal of Open Source Software, 4(40), 1627, https://doi.org/10.21105/joss.01627

# For BibTex
  
@article{Wang2019UCSCXenaTools,
    journal = {Journal of Open Source Software},
    doi = {10.21105/joss.01627},
    issn = {2475-9066},
    number = {40},
    publisher = {The Open Journal},
    title = {The UCSCXenaTools R package: a toolkit for accessing genomics data from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq},
    url = {http://dx.doi.org/10.21105/joss.01627},
    volume = {4},
    author = {Wang, Shixiang and Liu, Xuesong},
    pages = {1627},
    date = {2019-08-05},
    year = {2019},
    month = {8},
    day = {5},
}

Cite UCSC Xena by the following paper.

Goldman, Mary, et al. "The UCSC Xena Platform for cancer genomics data 
    visualization and interpretation." BioRxiv (2019): 326470.

Acknowledgments

This package is based on XenaR, thanks Martin Morgan for his work.