Using RTCGA package to download methylation data that are included in RTCGA.methylation package

Date of datasets release: 2015-11-01

Marcin Kosiński


RTCGA package

The Cancer Genome Atlas (TCGA) Data Portal provides a platform for researchers to search, download, and analyze data sets generated by TCGA. It contains clinical information, genomic characterization data, and high level sequence analysis of the tumor genomes. The key is to understand genomics to improve cancer care.

RTCGA package offers download and integration of the variety and volume of TCGA data using patient barcode key, what enables easier data possession. This may have a benefcial infuence on development of science and improvement of patients’ treatment. RTCGA is an open-source R package, available to download from Bioconductor


or from GitHub


Furthermore, RTCGA package transforms TCGA data into form which is convenient to use in R statistical package. Those data transformations can be a part of statistical analysis pipeline which can be more reproducible with RTCGA.

Use cases and examples are shown in RTCGA packages vignettes:


How to download methylation data to gain the same datasets as in RTCGA.methylation package?

There are many available date times of TCGA data releases. To see them all just type:


Version 1.0 of RTCGA.methylation package contains methylation datasets which were released 2015-11-01. They were downloaded in the following way (which is mainly copied from

Available cohorts

All cohort names can be checked using:

For all cohorts the following code downloads the mRNA data.

Downloading tarred files

Reading downloaded methylation dataset

Removing NA files from data2

The existance of NA files mean that there were no methylation data for these cohorts.

Reading methylation data using readTCGA

Because of the fact that methylation data are transposed in downloaded files, there has been prepared special function readTCGA to read and transpose data automatically. Code is below

Saving methylation data to RTCGA.methylation package

OV.methylation[1:300,] -> OV.methylation1
OV.methylation[301:612,] -> OV.methylation2
grep( "methylation", ls(), value = TRUE) %>%
   grep("path", x=., value = TRUE, invert = TRUE) %>%
   cat( sep="," ) #can one to id better? as from use_data documentation:
   # ...    Unquoted names of existing objects to save
                     # overwrite = TRUE,