Question: samr: understanding scoring line not parallel to diagonal; reproduce example C
0
SamGG190 wrote:

Hi,

As I want to understand why a scoring line on the so-called SAM plot could be not parallel to the diagonal I go back to the doc. There is a similar example, example C p 21.

http://statweb.stanford.edu/~tibs/SAM/sam.pdf

I tried to reproduce it using the given formula (p 19-20), but I don't a similar plot.

I will appreciate any help to understand such a plot or to correct the simulation formula.

Best.

library(samr)
set.seed(0)
nr = 1000
ns = 4
edat = matrix(rnorm(nr*ns*2), nrow = nr)
exC = edat + matrix(c(rep(0, nr*ns), rnorm(nr*ns, mean = 0, sd = 8)), nrow = nr)
heatmap(exC, Rowv = NA, Colv = NA)
exC.sam = samr(list(x = exC[,c(1:3,5,4,6:8)], y = c(rep(1, ns), rep(2, ns)), logged2 = TRUE), resp.type = "Two class unpaired", assay.type = "array")
samr.plot(exC.sam, 0.5)

samr • 590 views  modified 4.2 years ago • written 4.2 years ago by SamGG190
Answer: samr: understanding scoring line not parallel to diagonal; reproduce example C
1
SamGG190 wrote:

Finally, I understood that I overlooked an index in the formula. The simulation aims to add an offset to every row/gene of the second condition, so that every gene is expressed differentially.

exC = edat
exC[,ns+seq(ns)] = exC[,ns+seq(ns)] + rnorm(nr, mean = 0, sd = 4)

Such an effect is still present after row and column centering.

HTH