TCGA re-processed RNA-Seq data from 9264 Tumor Samples and 741 normal samples across 24 cancer types and made it available via GSE62944 from GEO. This data is also available as an ExpressionSet from ExperimentHub and can be used for Differential Expression Analysis.
In the below example, we show how one can download this dataset from ExperimentHub.
library(ExperimentHub)
## Loading required package: BiocGenerics
## Loading required package: parallel
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
##
## clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
## clusterExport, clusterMap, parApply, parCapply, parLapply,
## parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## Filter, Find, Map, Position, Reduce, anyDuplicated, append,
## as.data.frame, basename, cbind, colnames, dirname, do.call,
## duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
## lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
## pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
## tapply, union, unique, unsplit, which, which.max, which.min
## Loading required package: AnnotationHub
## Loading required package: BiocFileCache
## Loading required package: dbplyr
eh = ExperimentHub()
## snapshotDate(): 2020-04-27
query(eh , "GSE62944")
## ExperimentHub with 3 records
## # snapshotDate(): 2020-04-27
## # $dataprovider: GEO
## # $species: Homo sapiens
## # $rdataclass: SummarizedExperiment, ExpressionSet
## # additional mcols(): taxonomyid, genome, description,
## # coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
## # rdatapath, sourceurl, sourcetype
## # retrieve records with, e.g., 'object[["EH1"]]'
##
## title
## EH1 | RNA-Sequencing and clinical data for 7706 tumor samples from The...
## EH1043 | RNA-Sequencing and clinical data for 9246 tumor samples from The...
## EH1044 | RNA-Sequencing and clinical data for 741 normal samples from The...
One can then extract the data for this using
tcga_data <- eh[["EH1"]]
## see ?GSE62944 and browseVignettes('GSE62944') for documentation
## loading from cache
The different cancer types can be accessed using -
head(phenoData(tcga_data)$CancerType)
## [1] GBM GBM GBM GBM GBM OV
## 20 Levels: BLCA BRCA COAD GBM HNSC KICH KIRC KIRP LAML LGG LIHC LUAD ... UCEC
Above we show only the top 6 Cancer subtypes.
We are interested in identifying the IDH1 mutant and IDH1 wild type samples from TCGA’s Low Grade Glioma Samples and then conducting a differential expression analysis using DESeq2
# subset the expression Set to contain only samples from LGG.
lgg_data <- tcga_data[, which(phenoData(tcga_data)$CancerType=="LGG")]
# extract the IDHI mutant samples
mut_idx <- which(phenoData(lgg_data)$idh1_mutation_found=="YES")
mut_data <- exprs(lgg_data)[, mut_idx]
# extract the IDH1 WT samples
wt_idx <- which(phenoData(lgg_data)$idh1_mutation_found=="NO")
wt_data <- exprs(lgg_data)[, wt_idx]
# make a countTable.
countData <- cbind(mut_data, wt_data)
# for DE analysis with DESeq2 we need a sampleTable
samples= c(colnames(mut_data), colnames(wt_data))
group =c(rep("mut",length(mut_idx)), rep("wt", length(wt_idx)))
coldata <- cbind(samples, group)
colnames(coldata) <- c("sampleName", "Group")
coldata[,"Group"] <- factor(coldata[,"Group"], c("wt","mut"))
# Now we can run DE analysis
library(DESeq2)
## Loading required package: S4Vectors
## Loading required package: stats4
##
## Attaching package: 'S4Vectors'
## The following object is masked from 'package:base':
##
## expand.grid
## Loading required package: IRanges
## Loading required package: GenomicRanges
## Loading required package: GenomeInfoDb
## Loading required package: SummarizedExperiment
## Loading required package: DelayedArray
## Loading required package: matrixStats
##
## Attaching package: 'matrixStats'
## The following objects are masked from 'package:Biobase':
##
## anyMissing, rowMedians
##
## Attaching package: 'DelayedArray'
## The following objects are masked from 'package:matrixStats':
##
## colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges
## The following objects are masked from 'package:base':
##
## aperm, apply, rowsum
ddsMat <- DESeqDataSetFromMatrix(countData = countData,
colData = DataFrame(coldata),
design = ~ Group)
## Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
## design formula are characters, converting to factors
dds <- ddsMat
dds <- dds[ rowSums(counts(dds)) > 1, ]
dds <- DESeq(dds)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
## -- replacing outliers and refitting for 865 genes
## -- DESeq argument 'minReplicatesForReplace' = 7
## -- original counts are preserved in counts(dds)
## estimating dispersions
## fitting model and testing
res <- results(dds)
summary(res)
##
## out of 22546 with nonzero total read count
## adjusted p-value < 0.1
## LFC > 0 (up) : 2892, 13%
## LFC < 0 (down) : 5094, 23%
## outliers [1] : 0, 0%
## low counts [2] : 1749, 7.8%
## (mean count < 0)
## [1] see 'cooksCutoff' argument of ?results
## [2] see 'independentFiltering' argument of ?results
For a detailed RNASeq analysis see Mike Love’s RNASeq workflow
sessionInfo()
## R version 4.0.0 (2020-04-24)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.4 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.11-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.11-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] stats4 parallel stats graphics grDevices utils datasets
## [8] methods base
##
## other attached packages:
## [1] DESeq2_1.28.0 SummarizedExperiment_1.18.1
## [3] DelayedArray_0.14.0 matrixStats_0.56.0
## [5] GenomicRanges_1.40.0 GenomeInfoDb_1.24.0
## [7] IRanges_2.22.1 S4Vectors_0.26.0
## [9] GSE62944_1.16.0 GEOquery_2.56.0
## [11] Biobase_2.48.0 ExperimentHub_1.14.0
## [13] AnnotationHub_2.20.0 BiocFileCache_1.12.0
## [15] dbplyr_1.4.3 BiocGenerics_0.34.0
## [17] BiocStyle_2.16.0
##
## loaded via a namespace (and not attached):
## [1] httr_1.4.1 tidyr_1.0.2
## [3] splines_4.0.0 bit64_0.9-7
## [5] shiny_1.4.0.2 assertthat_0.2.1
## [7] interactiveDisplayBase_1.26.0 BiocManager_1.30.10
## [9] blob_1.2.1 GenomeInfoDbData_1.2.3
## [11] yaml_2.2.1 BiocVersion_3.11.1
## [13] pillar_1.4.4 RSQLite_2.2.0
## [15] lattice_0.20-41 glue_1.4.0
## [17] limma_3.44.1 digest_0.6.25
## [19] RColorBrewer_1.1-2 promises_1.1.0
## [21] XVector_0.28.0 colorspace_1.4-1
## [23] htmltools_0.4.0 httpuv_1.5.2
## [25] Matrix_1.2-18 XML_3.99-0.3
## [27] pkgconfig_2.0.3 genefilter_1.70.0
## [29] bookdown_0.18 zlibbioc_1.34.0
## [31] purrr_0.3.4 xtable_1.8-4
## [33] scales_1.1.0 later_1.0.0
## [35] BiocParallel_1.22.0 tibble_3.0.1
## [37] annotate_1.66.0 ggplot2_3.3.0
## [39] ellipsis_0.3.0 survival_3.1-12
## [41] magrittr_1.5 crayon_1.3.4
## [43] mime_0.9 memoise_1.1.0
## [45] evaluate_0.14 xml2_1.3.2
## [47] tools_4.0.0 hms_0.5.3
## [49] lifecycle_0.2.0 stringr_1.4.0
## [51] locfit_1.5-9.4 munsell_0.5.0
## [53] AnnotationDbi_1.50.0 compiler_4.0.0
## [55] rlang_0.4.6 grid_4.0.0
## [57] RCurl_1.98-1.2 rappdirs_0.3.1
## [59] bitops_1.0-6 rmarkdown_2.1
## [61] gtable_0.3.0 DBI_1.1.0
## [63] curl_4.3 R6_2.4.1
## [65] knitr_1.28 dplyr_0.8.5
## [67] fastmap_1.0.1 bit_1.1-15.2
## [69] readr_1.3.1 stringi_1.4.6
## [71] Rcpp_1.0.4.6 geneplotter_1.66.0
## [73] vctrs_0.2.4 tidyselect_1.0.0
## [75] xfun_0.13