Uncertainty in RNA
1. Introduction
This github repository contains code to reproduce the analysis in our paper "Uncertainty in RNA-seq gene expression data". A copy of the paper can be found here.
1.1. Additional Figures
This github includes a large number of additional supplementary figures, not present in the online version of this paper.
- Additional Fig1 : Example of a few discordant Genes in TCGA
- Additional Fig2 : Example of a few discordant Genes in GTEx
- Additional Fig 3. TCGA batch effects
- Additional Fig 4: GTEX batch effects
2. Downloading Data
2.1. Data folder Organization
To run our code, you need to download data from two different sources
a) Download all source data and processed Summarized Experiment objects from Amazon S3 bucket.
b) These vignettes from the github directory.
Both the folder from Amazon s3 bucket (ie OriginalTCGAGTExData) and the folder containing vignettes (git repository) should be saved in the same folder. As an example, one could save both of the above folders under "Downloads" as shown below
# folder where S3BUCKET data and github directory are stored. eg: ~/Downloads # github directory eg: ~/Downloads/UncertaintyRNA # S3 bucket directory eg: ~/Downloads/OriginalTCGAGTExData # when you run our RMD files, a new subfolder called "data will be created" # This will essentially remake the "data" subfolder from github repository. # eg:~/Downloads/data
2.2. Amazon S3 Bucket Data
2.2.1. Download Processed Data
If you want to download only the final SE Objects to recreate figures in our paper, the below mentioned code will create a folder called "OriginalTCGAGTExData" and only one sub-folder "SE_objects" and its contents will be downloaded to it.
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/SE_objects/index.html /results
2.2.2. Download complete data in chunks
If you would like to download all the data associated with this Paper, it is recommended to download the data in chunks using the following commands
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/annotations/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_XENA/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_GDC/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_GTEX_v6/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_MSKCC/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_PICCOLO/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_RECOUNT2_GTEX/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/datasource_RECOUNT2_TCGA/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/combined_SEobjects/index.html /results
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/SE_objects/index.html /results
2.2.3. Complete Data Download
WARNING: Please note that downloading all the data will take take a long time.
wget --recursive -nH --cut-dirs=1 https://s3-us-west-2.amazonaws.com/fh-pi-holland-e/OriginalTCGAGTExData/index.html /results
The above line will create a folder called "OriginalTCGAGTExData" and the following sub-folders
- annotations
- data source_GDC
- data source_GTEX_v6
- data source_MSKCC
- data source_PICCOLO
- data source_RECOUNT2_GTEX
- data source_RECOUNT2_TCGA
- data source_XENA
- combined_SEobjects
- SE_objects
2.3. Clone this github repository
One can clone this github repository with :
git clone https://github.com/sonali-bioc/UncertaintyRNA.git
Or you can use Nextjournal's GitHub access component:
ls -lah /UncertaintyRNA
2.4. MD5SUM for downloaded files
The md5sum for all downloaded files from s3 bucket have been places here.
3. Vignette Overview
The steps below provide a roadmap for the analysis done in the paper:
3.1. Acquiring TCGA data
In this vignette we show in detail how data was downloaded from each source of TCGA Data. For easier manipulation of this large data set, we convert the large text files to SummarizedExperiment objects.
3.2. Acquiring GTEX data
In this vignette we show in detail how data was downloaded from each source of GTEx Data. For easier manipulation of this large data set, we convert the large text files to SummarizedExperiment objects.
3.3. Creating TPM Normalized SE objects for TCGA data.
In this vignette , we first find common genes and common samples present in each source of TCGA Data. Next, we convert RPKM normalized data to TPM normalized data.
3.4. Creating TPM Normalized SE objects for GTEx data
In this vignette , we first find common genes and common samples present in each source of GTEx Data. Next, we convert RPKM normalized data to TPM normalized data.
3.5. PCA using RPKM normalized data
In this vignette, we take RPKM normalized data from all sources of TCGA and GTEx data and compute Principal Components to see how similar/dissimilar these data sources are. The results from PCA analysis are stored as text files, which can be used later on for plotting in multi-panel figures.
3.6. PCA using TPM normalized data
In this vignette, we use TPM normalized data from all sources of TCGA and GTEx data and compute Principal Components to see how similar/dissimilar these data sources are. The results from PCA analysis are stores as text files, which can be used later on for plotting in multi-panel figures.
3.7. Discordant Genes
In this vignette, we calculate
- discordant genes across various TCGA sources
- discordant genes across various GTEx sources
- discordant samples across various TCGA sources
- discordant samples across various GTEx sources
- compare the discordant genes to disease related genes
- compare the discordant genes to multi-mapped reads as reported by Robert et al.
3.8. 7(b) Differences in absolute log2 fold change of discordant samples within a data source
In this vignette, we show detailed calculation for Fig2b of our paper.
3.9. 7(c) Discordant Genes
The authors from Xena/Toil have made available both the log2(TPM+0.001) and log2(FPKM+0.001) counts. In this vignette, we explore the two datasets from Xena/Toil, and explain why we use one source over the other.
3.10. Supplemental Tables
In this vignette, we calculate various Supplemental Tables for our paper. These tables are also subsequently used in our analysis. They include
- mRNA correlations across various TCGA sources
- mRNA correlations across various GTEx sources
- Protein-mRNA correlations across various TCGA sources
3.11. Supplemental Figures
In this vignette, we make various supplemental figure for our paper.
3.12. Batches in TCGA Data
In this vignette, we make various PCA plots for each type of cancer using the following Batch variables: TSS, PlateID and Sequencing center for various source of TCGA data.
3.13. Batches in GTEx Data
In this vignette, we make various PCA plots using "Nucleic Acid" and "Genotype" Batches for all sources of GTEx data.
3.14. Combining GTEx and TCGA Data
In this vignette, we follow the approach showed in Wang et al, to taking three example regions = "Thyroid, Stomach and Liver" from GTEx, and their corresponding cancer Types( "THCA", "LIHC", "STAD") and making PCA plots for each data source to see how similar/dissimilar TCGA and GTEx data are, for various data sources.
3.15. Figure 1 of submitted paper
In this vignette, we reproduce Figure 1 of our paper.
3.16. Figure 2 of submitted paper
In this vignette, we reproduce Figure 2 of our paper.
4. References
- Grossman, Robert L., Heath, Allison Pet al. (2016) Toward a Shared Vision for Cancer Genomic Data. New England Journal of Medicine
- Vivian J, Rao AA, Nothaft FA, et al. (2017) Toil enables reproducible, open source, big biomedical data analyses. Nature biotechnology.
- Collado-Torres L, Nellore A, et al (2017) Reproducible RNA-seq analysis using recount2. Nature biotechnology.
- Q. Wang, J Armenia, C. Zhang, A.V. Penson, E. Reznik, L. Zhang, T. Minet, A. Ochoa, B.E. Gross, C. A. Iacobuzio-Donahue, D. Betel, B.S. Taylor, J. Gao, N. Schultz. Unifying cancer and normal RNA sequencing data from different sources. Scientific Data 5:180061, 2018.
- Rahman M, et al. (2015) Alternative preprocessing of RNA-Sequencing data in TCGA leads to improved analysis results. Bioinformatics.
- The GTEx Consortium. The Genotype-Tissue Expression (GTEx) project. (2013) Nature genetics.
- Robert, C. & Watson, M. Errors in RNA-Seq quantification affect genes of relevance to human disease. Genome Biol 16, 177 (2015)
- R Core Team (2018). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
5. Tools used for analysis
All our analysis is done in R. We found the following R/Biocondcutor packages extremely useful in our analysis.
- SummarizedExperiment for creating and storing TCGA and GTEX data as SE objects.
- GenomicRanges for manipulating genomic ranges.
- rtracklayer for reading in GTF files quickly as GenomicRanges objects
- ggplot2 for making most of the plots in our paper.
- pheatmap for making heatmaps
- We also used RColorBrewer, UpSetR and eulerr
To ensure smooth execution of code in this repository, please install the following packages
if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install(c("SummarizedExperiment", "GenomicRanges", "rtracklayer", "ggplot2", "pheatmap", "RColorBrewer", "UpSetR", "eulerr", "gridExtra"))