Skip to content

community finding in a graph and heatplot

5 messages · Aziz, Muhammad Fayez, Gábor Csárdi

2 days later
#
On Tue, May 29, 2012 at 1:16 AM, Aziz, Muhammad Fayez
<aziz4 at illinois.edu> wrote:
No, they are different. To plot fast-greedy results as a dendrogram,
see this and the follow-ups:
http://lists.gnu.org/archive/html/igraph-help/2010-11/msg00059.html

Gabor

  
    
#
Thank you so much Gabor for your reply. I had spotted your post earlier and it worked like a charm. Interestingly I have just ran into a trouble with the stament dend <- igraph:::as.dendrogram.igraph.walktrap(fc). Apparently the members are empty as when I print(dend) it says 'dendrogram' with 2 branches and  members total, at height 93" while the error with using dend with dendrapply remians to be

Error in `[[.dendrogram`(X, 2L) : attempt to set an attribute on NULL

Any ideas?

My code looks like this

		File2Open = paste(FilePath, "NetworkFiles\\net\\", NetPrefix, " ", TPPostfix, ".net", sep = "")
		g <- read.graph(File2Open, format="pajek")
		
		g <- delete.isolates(g)
		g <- simplify(g)
			
		fgc <- fastgreedy.community(g, modularity=TRUE, weights = E(g)$weight)
		ModularityIndexfgc <- max(fgc$modularity) # fgc modularity
		ModularityIndexng <- modularity(g, membership, weights = E(g)$weight) # newman-girvan modularity
		dend <- igraph:::as.dendrogram.igraph.walktrap(fgc)
		
		png(filename = paste(FilePath, "Analysis\\Graphs\\EColiStressModuleHeatMap", NetPrefixAbbr, TPPostfix, ".png", sep = ""), width = 800, height = 800) # heat map is square

		adjMatrix = get.adjacency(g, attr="weight")
		DendNodeCounter <- 0 # counter for ColorGroupsOrdered
		ColorGroupsOrdered <- rep("red", vcount(g))
		dendrapply(dend, colLab) # modifies ColorGroupsOrdered
#
On Thu, May 31, 2012 at 12:08 PM, Aziz, Muhammad Fayez
<aziz4 at illinois.edu> wrote:
I would need to see fgc for this. Can you send it to me in private? Or
send some self-contained example that generates the same error?

Gabor

  
    
#
Thank you so much Gabor for taking this on. Please find attached a sample scenario with the problem of malfunctioning dendogram by fgc. I hope this helps you narrow down to the solution.

Best,
Fayez