Merged autosaved graph test code

This commit is contained in:
ackman678
2014-01-13 10:44:22 -05:00
parent 25619f5169
commit f410676469
2 changed files with 99 additions and 196 deletions

View File

@@ -95,3 +95,102 @@ colnames(df) <- c("degree")
p <- ggplot(df, aes(x=degree)) + xlab("degree") + theme_bw()
p + geom_histogram(binwidth = 2) + scale_colour_brewer(palette="Set1") + opts(aspect.ratio=1) #raw counts
ggsave(file=paste("120518_07-degreeDist", format(Sys.time(),"%y%m%d-%H%M%S"), ".pdf",sep=""))
# 2014-01-07 09:07:59
edgelist<-read.delim('/Users/ackman/Data/2photon/120518i/2014-01-03-231550/dCorr.txt')
d2 <- subset(edgelist,filename!='120518_09.tif')
d3 <- subset(d2,filename=='120518_06.tif')
d4 <- with(d3,data.frame(node1,node2,rvalue))
edgelist2<-subset(d4,rvalue > 0.1)
g <- graph.data.frame(edgelist2, directed=FALSE)
E(g)$weight <- E(g)$rvalue
E(g)$width <- 1
E(g)[ weight >= 0.3 ]$width <- 3
E(g)[ weight >= 0.5 ]$width <- 5
fastgreedyCom<-fastgreedy.community(g,weights=E(g)$weight)
V(g)$color <- fastgreedyCom$membership+1
quartz();
palette(rainbow(max(V(g)$color),alpha=0.5))
plot(g, layout=layout.fruchterman.reingold, edge.width=E(g)$width, edge.color="black")
palette("default")
title('120518_06, fastgreedy, layout.fruchterman.reingold, default vertex size,alpha0.5')
d3 <- subset(d2,filename=='120518_07.tif')
d4 <- with(d3,data.frame(node1,node2,rvalue))
edgelist2<-subset(d4,rvalue > 0.1)
g <- graph.data.frame(edgelist2, directed=FALSE)
E(g)$weight <- E(g)$rvalue
E(g)$width <- 1
E(g)[ weight >= 0.3 ]$width <- 3
E(g)[ weight >= 0.5 ]$width <- 5
fastgreedyCom<-fastgreedy.community(g,weights=E(g)$weight)
V(g)$color <- fastgreedyCom$membership+1
quartz();
palette(rainbow(max(V(g)$color),alpha=0.5))
plot(g, layout=layout.fruchterman.reingold, edge.width=E(g)$width, edge.color="black")
palette("default")
title('120518_07, fastgreedy, layout.fruchterman.reingold, default vertex size,alpha0.5')
d3 <- subset(d2,filename=='120518_08.tif')
d4 <- with(d3,data.frame(node1,node2,rvalue))
edgelist2<-subset(d4,rvalue > 0.1)
g <- graph.data.frame(edgelist2, directed=FALSE)
fastgreedyCom<-fastgreedy.community(g)
V(g)$color <- fastgreedyCom$membership+1
quartz();
palette(rainbow(max(V(g)$color),alpha=0.5))
plot(g, layout=layout.fruchterman.reingold)
palette("default")
title('120518_08, fastgreedy, layout.fruchterman.reingold, default vertex size,alpha0.5')
# 131208
edgelist<-read.delim('/Users/ackman/Data/2photon/131208/2014-01-07-003602/dCorr.txt')
d3 <- subset(edgelist,filename=='131208_08.tif')
d4 <- with(d3,data.frame(node1,node2,rvalue))
edgelist2<-subset(d4,rvalue > 0.1)
g <- graph.data.frame(edgelist2, directed=FALSE)
fastgreedyCom<-fastgreedy.community(g)
V(g)$color <- fastgreedyCom$membership+1
E(g)$weight <- runif(ecount(g))
E(g)$width <- 1
# E(g)[ weight >= 0.3 ]$width <- 2
E(g)[ weight >= 0.5 ]$width <- 3
quartz();
palette(rainbow(max(V(g)$color),alpha=0.5))
plot(g, layout=layout.fruchterman.reingold, edge.width=E(g)$width, edge.color="black")
palette("default")
title('131208_08, fastgreedy, layout.fruchterman.reingold, default vertex size,alpha0.5')
g <- graph.ring(10)
E(g)$weight <- runif(ecount(g))
E(g)$width <- 1
E(g)[ weight >= 0.5 ]$width <- 3
plot(g, layout=layout.circle, edge.width=E(g)$width, edge.color="black")