knitr::opts_chunk$set(echo = TRUE, fig.width=7,fig.height=5,echo=TRUE)
In this vignette, we describe how to use the NewmanOmics Paired and Banked tests to analyze gene expression data from a single sample.
As usual, we start by loading the package:
The package contains paired tumor and normal samples from patients with head and neck cancer. these came from a study that was submitted to the Gene Expression Omnibus.
data(GSE6631) dim(GSE6631) GSE6631[1:5, 1:4]
As we can see, this consists of (normalized) Affymetrix microarray data. The odd numbered columns are derived from normal mucosa, and the even numbered columns are derived from paired tumor samples.
Before proceeding, we are going to log-transform the data.
HN <- log2(1 + GSE6631) boxplot(HN, col=c("forestgreen", "dodgerblue"))
The figure suggests that the the data have been reasonably normalized, and that it is unlikely to be overwhelmed by artifacts.
To illustrate the Newman Paired test, we are going to use only one sample.
HN1 <- HN[, 1:2] result1 <- pairedStat(HN1, pairing = c(-1,1)) summary(firstname.lastname@example.org) summary(email@example.com)
We can create a histogram of the per-gene (empirical) p-values
We can also produce an "M-versus-A" plot of the data.
The pairedStat function has flexible inputs, allowing you to store the data in various ways. Here we run the algorithm for three pairs, with an explicit pairing vector.
result2 <- pairedStat(HN[, 1:6], pairing=c(-1, 1, -2, 2, -3, 3)) summary(firstname.lastname@example.org) summary(email@example.com)
We can also input the same data as a pair of matrices.
normals <- HN[, c(1,3,5)] tumors <- HN[, c(2,4,6)] result3 <- pairedStat(normals, tumors) summary(firstname.lastname@example.org) summary(email@example.com)
Or we can input the same data as a list of paired samples.
listOfPairs <- list(HN[,1:2], HN[,3:4], HN[,5:6]) result4 <- pairedStat(listOfPairs) summary(firstname.lastname@example.org) summary(email@example.com)
A completely different approach to personalized transcriptomics is to compare individual samples to a "bank" of known normals.
normals <- HN[, seq(1, ncol(HN), 2)] # odds are normal tumors <- HN[, seq(2, ncol(HN), 2)] # evens are tumor bank <- createBank(normals) result5 <- bankStat(bank, tumors[,1,drop=FALSE]) summary(result5$nu.statistics) summary(result5$p.values) hist(result5$p.values, breaks=101)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.