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, xtabs
## The following objects are masked from 'package:base':
##
## Filter, Find, Map, Position, Reduce, anyDuplicated, append,
## as.data.frame, cbind, colnames, do.call, duplicated, eval,
## evalq, get, grep, grepl, intersect, is.unsorted, lapply,
## lengths, 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
eh = ExperimentHub()
## snapshotDate(): 2016-08-08
query(eh , "GSE62944")
## ExperimentHub with 3 records
## # snapshotDate(): 2016-08-08
## # $dataprovider: GEO
## # $species: Homo sapiens
## # $rdataclass: SummarizedExperiment, ExpressionSet
## # additional mcols(): taxonomyid, genome, description,
## # coordinate_1_based, maintainer, rdatadateadded, preparerclass,
## # tags, sourceurl, sourcetype
## # retrieve records with, e.g., 'object[["EH1"]]'
##
## title
## EH1 | RNA-Sequencing and clinical data for 7706 tumor samples fro...
## EH164 | RNA-Sequencing and clinical data for 9246 tumor samples fro...
## EH165 | RNA-Sequencing and clinical data for 741 normal samples fro...
One can then extract the data for this using
tcga_data <- eh[["EH1"]]
## see ?GSE62944 and browseVignettes('GSE62944') for documentation
## loading from cache '/home/biocbuild//.ExperimentHub/1'
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 ... 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 objects are masked from 'package:base':
##
## colMeans, colSums, expand.grid, rowMeans, rowSums
## Loading required package: IRanges
## Loading required package: GenomicRanges
## Loading required package: GenomeInfoDb
## Loading required package: SummarizedExperiment
ddsMat <- DESeqDataSetFromMatrix(countData = countData,
colData = DataFrame(coldata),
design = ~ Group)
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 1110 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) : 2906, 13%
## LFC < 0 (down) : 5041, 22%
## 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 3.3.1 (2016-06-21)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 16.04.1 LTS
##
## 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.14.0 SummarizedExperiment_1.4.0
## [3] GenomicRanges_1.26.0 GenomeInfoDb_1.10.0
## [5] IRanges_2.8.0 S4Vectors_0.12.0
## [7] GSE62944_1.2.0 GEOquery_2.40.0
## [9] Biobase_2.34.0 ExperimentHub_1.0.0
## [11] AnnotationHub_2.6.0 BiocGenerics_0.20.0
## [13] BiocStyle_2.2.0
##
## loaded via a namespace (and not attached):
## [1] locfit_1.5-9.1 Rcpp_0.12.7
## [3] lattice_0.20-34 assertthat_0.1
## [5] digest_0.6.10 mime_0.5
## [7] R6_2.2.0 plyr_1.8.4
## [9] chron_2.3-47 acepack_1.3-3.3
## [11] RSQLite_1.0.0 evaluate_0.10
## [13] httr_1.2.1 ggplot2_2.1.0
## [15] BiocInstaller_1.24.0 zlibbioc_1.20.0
## [17] curl_2.1 annotate_1.52.0
## [19] data.table_1.9.6 rpart_4.1-10
## [21] Matrix_1.2-7.1 rmarkdown_1.1
## [23] splines_3.3.1 BiocParallel_1.8.0
## [25] geneplotter_1.52.0 stringr_1.1.0
## [27] foreign_0.8-67 RCurl_1.95-4.8
## [29] munsell_0.4.3 shiny_0.14.1
## [31] httpuv_1.3.3 htmltools_0.3.5
## [33] nnet_7.3-12 tibble_1.2
## [35] gridExtra_2.2.1 interactiveDisplayBase_1.12.0
## [37] Hmisc_3.17-4 XML_3.98-1.4
## [39] bitops_1.0-6 grid_3.3.1
## [41] xtable_1.8-2 gtable_0.2.0
## [43] DBI_0.5-1 magrittr_1.5
## [45] formatR_1.4 scales_0.4.0
## [47] stringi_1.1.2 XVector_0.14.0
## [49] genefilter_1.56.0 latticeExtra_0.6-28
## [51] Formula_1.2-1 RColorBrewer_1.1-2
## [53] tools_3.3.1 survival_2.39-5
## [55] yaml_2.1.13 AnnotationDbi_1.36.0
## [57] colorspace_1.2-7 cluster_2.0.5
## [59] knitr_1.14