indOver: Overlay gene list onto mapping.

Usage Arguments Examples

View source: R/Clustering_Sinha.R

Usage

1
indOver(set, overlay)

Arguments

set
overlay

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (set, overlay) 
{
    cluster = overlay
    ind.genes = set
    cluster$genes = rownames(cluster)
    cluster$genes = substr(cluster$genes, 1, 14)
    names = colnames(ind.genes[2:ncol(ind.genes)])
    colnames(ind.genes) = c("itag", names)
    ind.genes$itag = substr(ind.genes$itag, 1, 14)
    cluster.color = cluster
    cluster.color.number = as.data.frame(cluster.color[which(cluster.color$genes %in% 
        ind.genes$itag), ])
    cluster.color$colors = NA
    cluster.color.number$colors = "red"
    cluster.color$colors[is.na(cluster.color$colors)] = "grey"
    cluster.grey = cluster.color[cluster.color$colors == "grey", 
        ]
    cluster.red = cluster.color.number
    p = ggplot(cluster.grey, aes(x, y)) + theme_bw() + geom_point(size = 1.5, 
        colour = cluster.grey$colors) + geom_point(data = cluster.red, 
        fill = cluster.red$colors, pch = 21, size = 5) + theme(panel.grid.major = element_blank(), 
        panel.grid.minor = element_blank(), panel.background = element_blank()) + 
        theme(legend.position = "none") + theme(legend.position = "none") + 
        theme(axis.text.x = element_blank(), axis.text.y = element_blank()) + 
        xlab("") + ylab("")
    print(p)
  }

sdrowland/RSMod documentation built on July 17, 2021, 7:16 p.m.