File:Doubledip.png

From 太極
Jump to navigation Jump to search

Doubledip.png(800 × 450 pixels, file size: 57 KB, MIME type: image/png)

Summary

ng <- 1000 # number of genes
ns <- 100  # number of samples
k <- 2     # number of groups
alpha <- .001 # cutoff of selecting sig genes

set.seed(1)
x = matrix(rnorm(ng * ns), nr= ns) # samples x features
hc = hclust(dist(x))
plot(hc)
grp  = cutree(hc, k=k) # vector of group membership
ex <- t(x)
r1 <- genefilter::rowttests(ex, factor(grp))
sum(r1$p.value < alpha) # 2
hist(r1$p.value)
i <- which(r1$p.value < alpha)
i1 <- i[1] ; i2 <- i[2]
plot(x[, i1], x[, i2], col = grp, pch= 16, cex=1.5, main = "sig genes")
plot(x[, 1], x[, 2], col = grp, pch=16, cex=1.5, main="random genes")

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current14:19, 22 August 2022Thumbnail for version as of 14:19, 22 August 2022800 × 450 (57 KB)Brb (talk | contribs)<pre> ng <- 1000 # number of genes ns <- 100 # number of samples k <- 2 # number of groups alpha <- .001 # cutoff of selecting sig genes set.seed(1) x = matrix(rnorm(ng * ns), nr= ns) # samples x features hc = hclust(dist(x)) plot(hc) grp = cutree(hc, k=k) # vector of group membership ex <- t(x) r1 <- genefilter::rowttests(ex, factor(grp)) sum(r1$p.value < alpha) # 2 hist(r1$p.value) i <- which(r1$p.value < alpha) i1 <- i[1] ; i2 <- i[2] plot(x[, i1], x[, i2], col = grp, pch= 16, cex=1...

The following page uses this file: