Skip to content

Commit

Permalink
igraphFromSummary includes no-edge vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
cmfield committed May 16, 2019
1 parent 9ba27bc commit 8b0a514
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/summary_functions.r
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ igraphFromSummary <- function(fcMatrix,pvMatrix,cutoff,type="removal"){
edge_attr(network,attr) <- edgeAttrList[,attr]
}

# Add vertices for experiments that had no effect
for(missing in colnames(fcMatrix)[!colnames(fcMatrix)%in%V(network)$name]){
network <- add_vertices(network,1,name=missing)
}

vertex_attr(network,type) <- vertex_attr(network,"name")%in%colnames(fcMatrix)
vertex_attr(network,"color") <- leafTaxonomy[vertex_attr(network,"name"),"Color"]
vertex_attr(network,"name") <- leafTaxonomy[vertex_attr(network,"name"),"Name"]
Expand Down

0 comments on commit 8b0a514

Please sign in to comment.