NewmanOmics: Tools for Personalized Transcriptomics"

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.

Getting Started

As usual, we start by loading the package:

library(NewmanOmics)

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.

Paired Statistic

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(result1@nu.statistics)
summary(result1@p.values)

We can create a histogram of the per-gene (empirical) p-values

hist(result1)

We can also produce an "M-versus-A" plot of the data.

plot(result1)

Alternate Inputs

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(result2@nu.statistics)
summary(result2@p.values)
plot(result2)
hist(result2)

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(result3@nu.statistics)
summary(result3@p.values)

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(result4@nu.statistics)
summary(result4@p.values)

Banked Statistic

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)


Try the NewmanOmics package in your browser

Any scripts or data that you put into this service are public.

NewmanOmics documentation built on Feb. 19, 2020, 3:02 p.m.