## ----setup, include = FALSE--------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ## ---- eval=FALSE-------------------------------------------------------------- # library('AnnotationHub') # # create an AnnotationHub connection # ah <- AnnotationHub() # # # search for all geneplast resources # meta <- query(ah, "geneplast") # # head(meta) ## ---- eval=FALSE-------------------------------------------------------------- # # load the objects from STRING database v11.0 # load(meta[["AH83116"]]) ## ---- eval=FALSE-------------------------------------------------------------- # library(geneplast) # ogr <- groot.preprocess(cogdata=cogdata, phyloTree=phyloTree, spid="9606") ## ---- eval=FALSE-------------------------------------------------------------- # ogr <- groot(ogr, nPermutations=100, verbose=TRUE) ## ---- eval=FALSE-------------------------------------------------------------- # library(RedeR) # library(igraph) # library(RColorBrewer) # data(ppi.gs) ## ---- eval=FALSE-------------------------------------------------------------- # g <- ogr2igraph(ogr, cogdata, ppi.gs, idkey = "ENTREZ") ## ---- eval=FALSE-------------------------------------------------------------- # pal <- brewer.pal(9, "RdYlBu") # color_col <- colorRampPalette(pal)(37) #set a color for each root! # g <- att.setv(g=g, from="Root", to="nodeColor", cols=color_col, na.col = "grey80", breaks = seq(1,37)) ## ---- eval=FALSE-------------------------------------------------------------- # g <- att.setv(g = g, from = "SYMBOL", to = "nodeAlias") # E(g)$edgeColor <- "grey80" # V(g)$nodeLineColor <- "grey80" ## ---- eval=FALSE-------------------------------------------------------------- # rdp <- RedPort() # calld(rdp) # resetd(rdp) # addGraph(rdp, g) # addLegend.color(rdp, colvec=g$legNodeColor$scale, size=15, labvec=g$legNodeColor$legend, title="Roots represented in Fig1") ## ---- eval=FALSE-------------------------------------------------------------- # g1 <- induced_subgraph(g=g, V(g)$name[V(g)$Apoptosis==1]) # g2 <- induced_subgraph(g=g, V(g)$name[V(g)$GenomeStability==1]) ## ---- eval=FALSE-------------------------------------------------------------- # myTheme <- list(nestFontSize=25, zoom=80, isNest=TRUE, gscale=65, theme=2) # addGraph(rdp, g1, gcoord=c(25, 50), theme = c(myTheme, nestAlias="Apoptosis")) # addGraph(rdp, g2, gcoord=c(75, 50), theme = c(myTheme, nestAlias="Genome Stability")) # relax(rdp, p1=50, p2=50, p3=50, p4=50, p5= 50, ps = TRUE) ## ---- eval=FALSE-------------------------------------------------------------- # load(meta[["AH83117"]]) # cogdata$cog_id <- paste0("OMA", cogdata$cog_id) # cogids$cog_id <- paste0("OMA", cogids$cog_id) # # human_entrez_2_oma_Aug2020 <- read_delim("processed_human.entrez_2_OMA.Aug2020.tsv", # delim = "\t", escape_double = FALSE, # col_names = FALSE, trim_ws = TRUE) # names(human_entrez_2_oma_Aug2020) <- c("protein_id", "gene_id") # cogdata <- cogdata %>% left_join(human_entrez_2_oma_Aug2020) # ogr <- groot.preprocess(cogdata=cogdata, phyloTree=phyloTree, spid="9606") # ogr <- groot(ogr, nPermutations=100, verbose=TRUE) # # g <- ogr2igraph(ogr, cogdata, ppi.gs, idkey = "ENTREZ") # pal <- brewer.pal(9, "RdYlBu") # color_col <- colorRampPalette(pal)(37) #set a color for each root! # g <- att.setv(g=g, from="Root", to="nodeColor", cols=color_col, na.col = "grey80", breaks = seq(1,37)) # g <- att.setv(g = g, from = "SYMBOL", to = "nodeAlias") # E(g)$edgeColor <- "grey80" # V(g)$nodeLineColor <- "grey80" # # rdp <- RedPort() # # calld(rdp) # resetd(rdp) # addGraph(rdp, g) # addLegend.color(rdp, colvec=g$legNodeColor$scale, size=15, labvec=g$legNodeColor$legend, title="Roots represented in Fig2") # g1 <- induced_subgraph(g=g, V(g)$name[V(g)$Apoptosis==1]) # g2 <- induced_subgraph(g=g, V(g)$name[V(g)$GenomeStability==1]) # myTheme <- list(nestFontSize=25, zoom=80, isNest=TRUE, gscale=65, theme=2) # addGraph(rdp, g1, gcoord=c(25, 50), theme = c(myTheme, nestAlias="Apoptosis")) # addGraph(rdp, g2, gcoord=c(75, 50), theme = c(myTheme, nestAlias="Genome Stability")) # relax(rdp, p1=50, p2=50, p3=50, p4=50, p5= 50, ps = TRUE) ## ---- eval=FALSE-------------------------------------------------------------- # load(meta[["AH83118"]]) # cogdata$cog_id <- paste0("ODB", cogdata$cog_id) # cogids$cog_id <- paste0("ODB", cogids$cog_id) # # human_entrez_2_odb <- read_delim("odb10v1_genes-human-entrez.tsv", # delim = "\t", escape_double = FALSE, # col_names = FALSE, trim_ws = TRUE) # names(human_entrez_2_odb) <- c("protein_id", "gene_id") # cogdata <- cogdata %>% left_join(human_entrez_2_odb) # ogr <- groot.preprocess(cogdata=cogdata, phyloTree=phyloTree, spid="9606") # ogr <- groot(ogr, nPermutations=100, verbose=TRUE) # # g <- ogr2igraph(ogr, cogdata, ppi.gs, idkey = "ENTREZ") # pal <- brewer.pal(9, "RdYlBu") # color_col <- colorRampPalette(pal)(37) #set a color for each root! # g <- att.setv(g=g, from="Root", to="nodeColor", cols=color_col, na.col = "grey80", breaks = seq(1,37)) # g <- att.setv(g = g, from = "SYMBOL", to = "nodeAlias") # E(g)$edgeColor <- "grey80" # V(g)$nodeLineColor <- "grey80" # rdp <- RedPort() # calld(rdp) # resetd(rdp) # addGraph(rdp, g) # addLegend.color(rdp, colvec=g$legNodeColor$scale, size=15, labvec=g$legNodeColor$legend, title="Roots represented in Fig3") # g1 <- induced_subgraph(g=g, V(g)$name[V(g)$Apoptosis==1]) # g2 <- induced_subgraph(g=g, V(g)$name[V(g)$GenomeStability==1]) # myTheme <- list(nestFontSize=25, zoom=80, isNest=TRUE, gscale=65, theme=2) # addGraph(rdp, g1, gcoord=c(25, 50), theme = c(myTheme, nestAlias="Apoptosis")) # addGraph(rdp, g2, gcoord=c(75, 50), theme = c(myTheme, nestAlias="Genome Stability")) # relax(rdp, p1=50, p2=50, p3=50, p4=50, p5= 50, ps = TRUE) ## ----------------------------------------------------------------------------- sessionInfo()