## ----knitrSetup, include=FALSE------------------------------------------------ library(knitr) opts_chunk$set(out.extra='style="display:block; margin: auto"', fig.align="center", fig.width=12, fig.height=12, tidy=TRUE) ## ----style, include=FALSE, echo=FALSE, results='asis'------------------------- BiocStyle::markdown() ## ----installNetBoxr, eval=FALSE----------------------------------------------- # BiocManager::install("netboxr") ## ----loadLibrary, message=FALSE, warning=FALSE-------------------------------- library(netboxr) ## ----searchHelp, eval=FALSE, tidy=FALSE--------------------------------------- # help(package="netboxr") ## ----showHelp, eval=FALSE, tidy=FALSE----------------------------------------- # help(geneConnector) # ?geneConnector ## ----netboxrExampleNetwork---------------------------------------------------- data(netbox2010) sifNetwork <- netbox2010$network graphReduced <- networkSimplify(sifNetwork,directed = FALSE) ## ----netboxrExampleGene------------------------------------------------------- geneList <- as.character(netbox2010$geneList) length(geneList) ## ----netboxrExampleGeneConnector, fig.width=12, fig.height=12----------------- ## Use Benjamini-Hochberg method to do multiple hypothesis ## correction for linker candidates. ## Use edge-betweeness method to detect community structure in the network. threshold <- 0.05 results <- geneConnector(geneList=geneList, networkGraph=graphReduced, directed=FALSE, pValueAdj="BH", pValueCutoff=threshold, communityMethod="ebc", keepIsolatedNodes=FALSE) # Add edge annotations library(RColorBrewer) edges <- results$netboxOutput interactionType<-unique(edges[,2]) interactionTypeColor<-brewer.pal(length(interactionType),name="Spectral") edgeColors<-data.frame(interactionType,interactionTypeColor,stringsAsFactors = FALSE) colnames(edgeColors)<-c("INTERACTION_TYPE","COLOR") netboxGraphAnnotated <- annotateGraph(netboxResults = results, edgeColors = edgeColors, directed = FALSE, linker = TRUE) # Check the p-value of the selected linker linkerDF <- results$neighborData linkerDF[linkerDF$pValueFDR 0.1] ## ----sessionInfo-------------------------------------------------------------- sessionInfo()