Introduction

This vignette shows a complete workflow of the TCGAbiolinks package. The code is divided in 4 case study:

  1. Expression pipeline (BRCA)
  2. Expression pipeline (GBM)
  3. Integration of DNA methylation and RNA expression pipeline (COAD)
  4. ELMER pipeline (KIRC)

Case study n. 1: Pan Cancer downstream analysis BRCA

Using TCGAnalyze_DEA, we identified 3,390 differentially expression genes (DEG) (log fold change >=1 and FDR < 1%) between 114 normal and 1097 BRCA samples. In order to understand the underlying biological process from DEGs we performed an enrichment analysis using TCGAnalyze_EA_complete function.

TCGAbiolinks outputs bar chart with the number of genes for the main categories of three ontologies (GO:biological process, GO:cellular component, and GO:molecular function, respectively).

The figure resulted from the code above is shown below.

The Kaplan-Meier analysis was used to compute survival univariate curves, and
log-Ratio test was computed to assess the statistical significance by using TCGAanalyze_SurvivalKM function; starting with 3,390 DEGs genes we found 555 significantly genes with p.value <0.05.

Cox-regression analysis was used to compute survival multivariate curves, and cox p-value was computed to assess the statistical significance by using TCGAnalyze_SurvivalCoxNET function. Survival multivariate analysis found 160 significantly genes according to the cox p-value FDR 5.00e-02. From DEGs that we found to correlate significantly with survival by both univariate and multivariate analyses we analyzed the following network.

The interactome network graph was generated using STRING.,org.Hs.string version 10 (Human functional protein association network). The network graph was resized by dnet package considering only multivariate survival genes, with strong interaction (threshold = 700) we obtained a subgraphsub graph of 24 nodes and 31 edges.

The figure resulted from the code above is shown below.

Case study n. 2: Pan Cancer downstream analysis LGG

We focused on the analysis of LGG samples. In particular, we used TCGAbiolinks to download 293 samples with molecular subtypes. Link the complete complete code. .

First, we searched for possible outliers using the TCGAanalyze_Preprocessing function, which performs an Array Array Intensity correlation AAIC. We used all samples in expression data which contain molecular subtypes, filtering out samples without molecular information, and using only IDHmut-codel (n=85), IDHmut-non-codel (n=141) and IDHwt (n=56), NA (11), to define a square symetric matrix of pearson correlation among all samples (n=293). According to this matrix we found no samples with low correlation (cor.cut = 0.6) that can be identified as possible outliers, so we continued our analysis with 70 samples.

Second, using the TCGAanalyze_Normalization function we normalized mRNA transcripts and miRNA, using EDASeq package. This function does use Within-lane normalization procedures to adjust for GC-content effect (or other gene-level effects) on read counts: loess robust local regression, global-scaling, and full-quantile normalization (Risso et al. 2011) and between-lane normalization procedures to adjust for distributional differences between lanes (e.g., sequencing depth): global-scaling and full-quantile normalization (Bullard et al. 2010).

Third, using the TCGAanalyze_Filtering function we applied 3 filters removing features / mRNAs with low signal across samples obtaining 4578, 4284, 1187 mRNAs respectively.

Then we applied two Hierarchical cluster analysis on 1187 mRNAs after the three filters described above, the first cluster using as method ward.D2, and the second with ConsensusClusterPlus.

After the two clustering analysis, with cut.tree = 4 we obtained n= 4 espression clusters (EC).

The next steps will be to visualize the data. First, we created the survival plot.

The result is showed below:

We will also, create a heatmap of the expression.

The result is shown below:

Finally, we will take a look in the mutation genes. We will first download the MAF file with GDCquery_Maf. In this example we will investigate the gene “ATRX”.

Case study n. 3: Integration of methylation and expression for ACC

In recent years, it has been described the relationship between DNA methylation and gene expression and the study of this relationship is often difficult to accomplish.

This case study will show the steps to investigate the relationship between the two types of data.

First, we downloaded ACC DNA methylation data for HumanMethylation450k platforms, and ACC RNA expression data for Illumina HiSeq platform.

TCGAbiolinks adds by default the subtypes classification already published by researchers.

We will use this classification to do our examples. So, selected the groups CIMP-low and CIMP-high to do RNA expression and DNA methylation comparison.

For DNA methylation, we perform a DMR (different methylated region) analysis, which will give the difference of DNA methylation for the probes of the groups and their significance value. The output can be seen in a volcano plot. Note: Depending on the number of samples this function can be very slow due to the wilcoxon test, taking from hours to days.

The figure resulted from the code above is shown below:

For the expression analysis, we do a DEA (differential expression analysis) which will give the fold change of gene expression and their significance value.

The figure resulted from the code above is shown below:

Finally, using both previous analysis we do a starburst plot to select the genes that are Candidate Biologically Significant.

Observation: over the time, the number of samples has increased and the clinical data updated. We used only the samples that had a classification in the examples.

The figure resulted from the code above is shown below:

Case study n. 4: Elmer pipeline - KIRC

An example of package to perform DNA methylation and RNA expression analysis is ELMER (L. Yao et al. 2015,Chedraoui Silva et al. (2017),Yao, Berman, and Farnham (2015)). ELMER, which is designed to combine DNA methylation and gene expression data from human tissues to infer multi-level cis-regulatory networks. ELMER uses DNA methylation to identify distal probes, and correlates them with the expression of nearby genes to identify one or more transcriptional targets. Transcription factor (TF) binding site analysis of those anti-correlated distal probes is coupled with expression analysis of all TFs to infer upstream regulators. This package can be easily applied to TCGA public available cancer data sets and custom DNA methylation and gene expression data sets.

ELMER analyses have the following steps:

  1. Organize data as a MultiAssayExperiment object
  2. Identify distal probes with significantly different DNA methylation level when comparing two sample groups.
  3. Identify putative target genes for differentially methylated distal probes, using methylation vs. expression correlation
  4. Identify enriched motifs for each probe belonging to a significant probe-gene pair
  5. Identify master regulatory Transcription Factors (TF) whose expression associate with DNA methylation changes at multiple regulatory regions.

We will present this the study KIRC by TCGAbiolinks and ELMER integration.

For the DNA methylation data we will search the platform HumanMethylation450. After, we will download the data and prepared into a SummarizedExperiment object.

For gene expression we will use Gene Expression Quantification.

A MultiAssayExperiment object from the r BiocStyle::Biocpkg(“MultiAssayExperiment”) package is the input for multiple main functions of r BiocStyle::Biocpkg(“ELMER”).

We will first need to get distal probes (2 KB away from TSS).

To create it you can use the createMAE function. This function will keep only samples that have both DNA methylation and gene expression.

We will execute ELMER to identify probes that are hypomethylated in tumor samples compared to the normal samples.

group.col <- "definition"
group1 <-  "Primary solid Tumor"
group2 <- "Solid Tissue Normal"
direction <- "hypo"
dir.out <- file.path("kirc",direction)
dir.create(dir.out, recursive = TRUE)
#--------------------------------------
# STEP 3: Analysis                     |
#--------------------------------------
# Step 3.1: Get diff methylated probes |
#--------------------------------------
sig.diff <- get.diff.meth(data = mae, 
                          group.col = group.col,
                          group1 =  group1,
                          group2 = group2,
                          minSubgroupFrac = 0.2,
                          sig.dif = 0.3,
                          diff.dir = direction, # Search for hypomethylated probes in group 1
                          cores = 1, 
                          dir.out = dir.out, 
                          pvalue = 0.01)

#-------------------------------------------------------------
# Step 3.2: Identify significant probe-gene pairs            |
#-------------------------------------------------------------
# Collect nearby 20 genes for Sig.probes
nearGenes <- GetNearGenes(data = mae, 
                          probes = sig.diff$probe, 
                          numFlankingGenes = 20, # 10 upstream and 10 dowstream genes
                          cores = 1)

pair <- get.pair(data = mae,
                 group.col = group.col,
                 group1 =  group1,
                 group2 = group2,
                 nearGenes = nearGenes,
                 minSubgroupFrac = 0.4, # % of samples to use in to create groups U/M
                 permu.dir = file.path(dir.out,"permu"),
                 permu.size = 100, # Please set to 100000 to get significant results
                 raw.pvalue  = 0.05,   
                 Pe = 0.01, # Please set to 0.001 to get significant results
                 filter.probes = TRUE, # See preAssociationProbeFiltering function
                 filter.percentage = 0.05,
                 filter.portion = 0.3,
                 dir.out = dir.out,
                 cores = 1,
                 label = direction)

# Identify enriched motif for significantly hypomethylated probes which 
# have putative target genes.
enriched.motif <- get.enriched.motif(data = mae,
                                     probes = pair$Probe, 
                                     dir.out = dir.out, 
                                     label = direction,
                                     min.incidence = 10,
                                     lower.OR = 1.1)
TF <- get.TFs(data = mae, 
              group.col = group.col,
              group1 =  group1,
              group2 = group2,
              minSubgroupFrac = 0.4,
              enriched.motif = enriched.motif,
              dir.out = dir.out, 
              cores = 1, 
              label = direction)

From this analysis it is possible to verify the relationship between nearby 20 gene expression vs DNA methylation at this probe. The result of this is show by the ELMER scatter plot.

The result is shown below:

Each scatter plot showing the average DNA methylation level of sites with the UA6 motif in all KIRC samples plotted against the expression of the transcription factor ZNF677 and PEG3 respectively.

The result is shown below:

You cen see the anticorrelated pairs of gene and probes by drawing a heatmap.

The result is shown below:

The plot shows the odds ratio (x axis) for the selected motifs with lower boundary of OR above 1.8. The range shows the 95% confidence interval for each Odds Ratio.


Session Information


## R version 3.5.1 Patched (2018-07-12 r74967)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 16.04.5 LTS
## 
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.7-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.7-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
##  [1] grid      parallel  stats4    stats     graphics  grDevices utils    
##  [8] datasets  methods   base     
## 
## other attached packages:
##  [1] TCGAbiolinks_2.8.4          png_0.1-7                  
##  [3] DT_0.4                      dplyr_0.7.6                
##  [5] SummarizedExperiment_1.10.1 DelayedArray_0.6.5         
##  [7] BiocParallel_1.14.2         matrixStats_0.54.0         
##  [9] Biobase_2.40.0              GenomicRanges_1.32.6       
## [11] GenomeInfoDb_1.16.0         IRanges_2.14.11            
## [13] S4Vectors_0.18.3            BiocGenerics_0.26.0        
## 
## loaded via a namespace (and not attached):
##   [1] backports_1.1.2             circlize_0.4.4             
##   [3] aroma.light_3.10.0          plyr_1.8.4                 
##   [5] selectr_0.4-1               ConsensusClusterPlus_1.44.0
##   [7] lazyeval_0.2.1              splines_3.5.1              
##   [9] ggplot2_3.0.0               sva_3.28.0                 
##  [11] digest_0.6.16               foreach_1.4.4              
##  [13] htmltools_0.3.6             magrittr_1.5               
##  [15] memoise_1.1.0               cluster_2.0.7-1            
##  [17] doParallel_1.0.11           limma_3.36.3               
##  [19] ComplexHeatmap_1.18.1       Biostrings_2.48.0          
##  [21] readr_1.1.1                 annotate_1.58.0            
##  [23] R.utils_2.7.0               prettyunits_1.0.2          
##  [25] colorspace_1.3-2            blob_1.1.1                 
##  [27] rvest_0.3.2                 ggrepel_0.8.0              
##  [29] crayon_1.3.4                RCurl_1.95-4.11            
##  [31] jsonlite_1.5                roxygen2_6.1.0             
##  [33] genefilter_1.62.0           bindr_0.1.1                
##  [35] survival_2.42-6             zoo_1.8-3                  
##  [37] iterators_1.0.10            glue_1.3.0                 
##  [39] survminer_0.4.3             gtable_0.2.0               
##  [41] zlibbioc_1.26.0             XVector_0.20.0             
##  [43] GetoptLong_0.1.7            shape_1.4.4                
##  [45] scales_1.0.0                DESeq_1.32.0               
##  [47] DBI_1.0.0                   edgeR_3.22.3               
##  [49] ggthemes_4.0.1              Rcpp_0.12.18               
##  [51] xtable_1.8-3                progress_1.2.0             
##  [53] cmprsk_2.2-7                bit_1.1-14                 
##  [55] matlab_1.0.2                km.ci_0.5-2                
##  [57] htmlwidgets_1.2             httr_1.3.1                 
##  [59] RColorBrewer_1.1-2          pkgconfig_2.0.2            
##  [61] XML_3.98-1.16               R.methodsS3_1.7.1          
##  [63] locfit_1.5-9.1              labeling_0.3               
##  [65] tidyselect_0.2.4            rlang_0.2.2                
##  [67] AnnotationDbi_1.42.1        munsell_0.5.0              
##  [69] tools_3.5.1                 downloader_0.4             
##  [71] RSQLite_2.1.1               devtools_1.13.6            
##  [73] broom_0.5.0                 evaluate_0.11              
##  [75] stringr_1.3.1               yaml_2.2.0                 
##  [77] knitr_1.20                  bit64_0.9-7                
##  [79] survMisc_0.5.5              purrr_0.2.5                
##  [81] bindrcpp_0.2.2              EDASeq_2.14.1              
##  [83] nlme_3.1-137                R.oo_1.22.0                
##  [85] xml2_1.2.0                  biomaRt_2.36.1             
##  [87] compiler_3.5.1              curl_3.2                   
##  [89] testthat_2.0.0              tibble_1.4.2               
##  [91] geneplotter_1.58.0          stringi_1.2.4              
##  [93] highr_0.7                   GenomicFeatures_1.32.2     
##  [95] lattice_0.20-35             Matrix_1.2-14              
##  [97] commonmark_1.5              KMsurv_0.1-5               
##  [99] pillar_1.3.0                GlobalOptions_0.1.0        
## [101] data.table_1.11.4           bitops_1.0-6               
## [103] rtracklayer_1.40.6          R6_2.2.2                   
## [105] latticeExtra_0.6-28         hwriter_1.3.2              
## [107] ShortRead_1.38.0            gridExtra_2.3              
## [109] codetools_0.2-15            assertthat_0.2.0           
## [111] rprojroot_1.3-2             rjson_0.2.20               
## [113] withr_2.1.2                 GenomicAlignments_1.16.0   
## [115] Rsamtools_1.32.3            GenomeInfoDbData_1.1.0     
## [117] mgcv_1.8-24                 hms_0.4.2                  
## [119] tidyr_0.8.1                 rmarkdown_1.10             
## [121] ggpubr_0.1.8

References

Bullard, James H, Elizabeth Purdom, Kasper D Hansen, and Sandrine Dudoit. 2010. “Evaluation of Statistical Methods for Normalization and Differential Expression in mRNA-Seq Experiments.” BMC Bioinformatics 11 (1). BioMed Central Ltd:94.

Chedraoui Silva, Tiago, Simon G. Coetzee, Lijing Yao, Dennis J. Hazelett, Houtan Noushmehr, and Benjamin P. Berman. 2017. “Enhancer Linking by Methylation/Expression Relationships with the R Package Elmer Version 2.” bioRxiv. Cold Spring Harbor Labs Journals. https://doi.org/10.1101/148726.

Risso, Davide, Katja Schwartz, Gavin Sherlock, and Sandrine Dudoit. 2011. “GC-Content Normalization for Rna-Seq Data.” BMC Bioinformatics 12 (1). BioMed Central Ltd:480.

Yao, Lijing, Benjamin P Berman, and Peggy J Farnham. 2015. “Demystifying the Secret Mission of Enhancers: Linking Distal Regulatory Elements to Target Genes.” Critical Reviews in Biochemistry and Molecular Biology 50 (6). Taylor & Francis:550–73.

Yao, L, H Shen, PW Laird, PJ Farnham, and BP Berman. 2015. “Inferring Regulatory Element Landscapes and Transcription Factor Networks from Cancer Methylomes.” Genome Biology 16 (1):105–5.