#!/usr/bin/env Rscript
## ---- inputs
part_file = "surprise_partition"
colors_file <- gsub("_partition","_colors", part_file)
root = getrd()
devtools::load_all(root)
## ---- imports
suppressPackageStartupMessages({
library(geneLists)
library(dplyr)
library(data.table)
})
## ---- load the data
data(list=part_file) # e.g. modularity_partition == partition
data(list=colors_file) # e.g. surprise_colors == module_colors
data(ipsd_gene_map) # gene_map
## ---- create noa table for cytoscape
df <- data.table(prot=names(partition), membership = partition)
df <- df %>% mutate(entrez=mapIDs(prot,"uniprot","entrez",gene_map))
df <- df %>% mutate(new = module_colors[paste0("M",membership)])
fwrite(df,"noa-color.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.