You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple app comparing the expression of genes between Tumor and Normal tissue.
This is an example Shiny app featuring some basic analysis of Ovarian Cancer gene expression data collected on the Affymetrix U133A platform. We filter the available genes and samples down to a much smaller matrix to make reproducibility simpler for a broader audience. The R code involved in sampling the data is available in this Gist as an R-Markdown file, and the sampled data are available in this Gist as Rds files.
To run the application, install shiny (install.packages("shiny")) then run the following command:
library(shiny)
runGist(5924147)
The relevant citation for the original data is available below:
Benjamin Frederick Ganzfried, Markus Riester, Benjamin Haibe-Kains, Thomas
Risch, Svitlana Tyekucheva, Ina Jazic, Xin Victoria Wang, Mahnaz Ahmadifar,
Michael Birrer, Giovanni Parmigiani, Curtis Huttenhower, Levi Waldron.
curatedOvarianData: Clinically Annotated Data for the Ovarian Cancer
Transcriptome, Database 2013: bat013 doi:10.1093/database/bat013 published
online April 2, 2013.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now we'll load the package and load in one of the datasets.
library(curatedOvarianData)
data(TCGA_eset)
Let's write out the clinical data so we have it for later. We'll trim out the "uncurated" metadata column to save some space and make the printing a bit easier.
We won't want to store all of the tumor samples available in the dataset, so let's grab 20 tumor samples at random and keep all of the normal samples.
# Get all normal phenotypic datanormalClinical<-clinical
pData(normalClinical) <- pData(clinical)[pData(clinical)$sample_type=="adjacentnormal",
]
# Sample 20 samples from the tumor phenotypic datatumorIndices<- sample(which(pData(clinical)$sample_type=="tumor"), 20)
tumorClinical<-clinical
pData(tumorClinical) <- pData(clinical)[tumorIndices, ]
Filtering
For the sake of demonstration, we'll want to keep the dataset fairly small. So let's filter the data to the few dozen samples we selected above and only 8 genes.
# Provide the HGNC symbols of 8 genesgeneList<- c("EGFR", "KLF6", "FOXO1", "KRAS", "JAK2", "BRCA1", "BRCA2", "PPM1D")
# Extract the relevant probeset to gene mappingsfeatureList<- fData(TCGA_eset)
featureList<-featureList[featureList$gene%in%geneList, ]
featureList<-featureList[match(geneList, rownames(featureList)), ] #orderfeatureList<- AnnotatedDataFrame(featureList)
# Filter the tumor expression data to only relevant genes and samplestumor<- exprs(TCGA_eset[, tumorIndices])
tumor<-tumor[match(geneList, rownames(tumor)), ]
tumor<- ExpressionSet(tumor, tumorClinical, featureList, experimentData(TCGA_eset))
saveRDS(tumor, "tumorExpr.Rds")
And grab all of the normal tissue samples:
# Filter the normal expression data to only relevant genes and samplesnormal<- exprs(TCGA_eset[, TCGA_eset@phenoData@data$sample_type=="adjacentnormal"])
normal<-normal[match(geneList, rownames(normal)), ]
normal<- ExpressionSet(normal, normalClinical, featureList, experimentData(TCGA_eset))
saveRDS(normal, "normalExpr.Rds")
Now we should be able to use this sampled data from our apps!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We'll first want to install the `curatedOvarianData` package from Bioconductor. Note that this package is a few hundred MB.
```{r, cache=TRUE, results='hide', message=FALSE}
source("http://bioconductor.org/biocLite.R")
biocLite("curatedOvarianData")
```
Now we'll load the package and load in one of the datasets.
```{r, results='hide', message=FALSE}
library(curatedOvarianData)
data(TCGA_eset)
```
Let's write out the clinical data so we have it for later. We'll trim out the "uncurated" metadata column to save some space and make the printing a bit easier.
For the sake of demonstration, we'll want to keep the dataset fairly small. So let's filter the data to the few dozen samples we selected above and only 8 genes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters