mv init analysis tracking
@@ -1,31 +0,0 @@
|
||||
name actvFraction maxFraction minFraction meanFraction sdFraction meanActvFraction sdActvFraction actvFrames actvTimeFraction nonActvFrames nonActvTimeFraction
|
||||
cortex.L 0.94462 0.11391 0 0.011953 0.018076 0.021933 0.019512 1635 0.545 1365 0.455
|
||||
cortex.R 0.98936 0.1788 0 0.011325 0.019276 0.02026 0.021993 1677 0.559 1323 0.441
|
||||
V1.L 0.91092 0.49268 0 0.01166 0.048811 0.085525 0.10573 409 0.13633 2591 0.86367
|
||||
V1.R 1 0.49303 0 0.01563 0.049954 0.082406 0.087538 569 0.18967 2431 0.81033
|
||||
V2M.R 1 0.53362 0 0.010531 0.047479 0.10746 0.11235 294 0.098 2706 0.902
|
||||
V2M.L 0.99889 0.72727 0 0.015069 0.070498 0.15535 0.17184 291 0.097 2709 0.903
|
||||
V2L.R 0.99979 0.83261 0 0.0093884 0.051119 0.10279 0.13809 274 0.091333 2726 0.90867
|
||||
V2L.L 0.89476 0.47959 0 0.011748 0.048174 0.10396 0.10477 339 0.113 2661 0.887
|
||||
A1.L 0.94332 0.81434 0 0.0056521 0.038994 0.14745 0.13751 115 0.038333 2885 0.96167
|
||||
A1.R 0.89896 0.51003 0 0.0032766 0.029558 0.12287 0.13523 80 0.026667 2920 0.97333
|
||||
barrel.L 1 0.48431 0 0.014222 0.051387 0.10432 0.099942 409 0.13633 2591 0.86367
|
||||
barrel.R 1 0.48833 0 0.014424 0.050157 0.10278 0.094128 421 0.14033 2579 0.85967
|
||||
AS.L 1 0.61732 0 0.017578 0.063066 0.13626 0.12119 387 0.129 2613 0.871
|
||||
AS.R 1 0.72344 0 0.016043 0.064496 0.14073 0.13779 342 0.114 2658 0.886
|
||||
PPC.L 1 0.52809 0 0.013443 0.050858 0.11425 0.10241 353 0.11767 2647 0.88233
|
||||
PPC.R 0.99316 0.51777 0 0.0085395 0.043173 0.11698 0.11357 219 0.073 2781 0.927
|
||||
LS.L 1 0.73378 0 0.011153 0.061789 0.18904 0.17674 177 0.059 2823 0.941
|
||||
LS.R 1 0.88002 0 0.0092979 0.060153 0.19371 0.19978 144 0.048 2856 0.952
|
||||
FL.L 1 0.83896 0 0.013279 0.073959 0.21888 0.21303 182 0.060667 2818 0.93933
|
||||
FL.R 1 0.70978 0 0.013078 0.059922 0.16766 0.14208 234 0.078 2766 0.922
|
||||
HL.L 1 1 0 0.02413 0.10457 0.28726 0.23402 252 0.084 2748 0.916
|
||||
HL.R 1 0.96645 0 0.019074 0.098036 0.26614 0.26196 215 0.071667 2785 0.92833
|
||||
T.L 1 0.7411 0 0.017038 0.070106 0.15825 0.15284 323 0.10767 2677 0.89233
|
||||
T.R 1 0.47762 0 0.0091402 0.042031 0.10587 0.10127 259 0.086333 2741 0.91367
|
||||
RSA.L 0.99984 0.85963 0 0.021561 0.083406 0.18272 0.17196 354 0.118 2646 0.882
|
||||
RSA.R 1 0.52748 0 0.01318 0.053458 0.10572 0.11474 374 0.12467 2626 0.87533
|
||||
M1.L 0.99877 0.30664 0 0.012884 0.037771 0.071976 0.061002 537 0.179 2463 0.821
|
||||
M1.R 0.99979 0.38526 0 0.013534 0.039764 0.063539 0.065195 639 0.213 2361 0.787
|
||||
M2.L 0.90863 0.3212 0 0.0067742 0.026208 0.050934 0.054044 399 0.133 2601 0.867
|
||||
M2.R 0.99698 0.293 0 0.011429 0.035556 0.070262 0.060359 488 0.16267 2512 0.83733
|
||||
|
Before Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 186 KiB |
|
Before Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 154 KiB |
|
Before Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 147 KiB |
@@ -1,292 +0,0 @@
|
||||
require(igraph)
|
||||
|
||||
edgelist<-read.delim('/Users/ackman/Documents/MATLAB/dCorrpairs-20131105-125023.txt')
|
||||
|
||||
edgelist2<-subset(edgelist,rvalue > 0.1)
|
||||
|
||||
|
||||
g <- graph.data.frame(edgelist2, directed=FALSE)
|
||||
#V(g)$label <- V(g)$name #gets the actual vertice labels
|
||||
plot(g,layout=layout.lgl,vertex.size=5)
|
||||
title('layoutLgl, vertex size5')
|
||||
|
||||
quartz();
|
||||
plot(g, layout=layout.fruchterman.reingold, vertex.size=3)
|
||||
title('layoutFR, vertex size3')
|
||||
|
||||
quartz();
|
||||
com <- spinglass.community(g, spins=5) #finds communities
|
||||
V(g)$color <- com$membership+1
|
||||
plot(g, layout=layout.fruchterman.reingold)
|
||||
title('spinglass, layoutFR, default vertex size')
|
||||
|
||||
|
||||
walktrapCom<-walktrap.community(g)
|
||||
V(g)$color <- walktrapCom$membership+1
|
||||
|
||||
quartz();
|
||||
palette(rainbow(max(V(g)$color),alpha=0.5))
|
||||
plot(g, layout=layout.fruchterman.reingold)
|
||||
palette("default")
|
||||
title('walktrap, layoutFR, default vertex size,alpha0.5')
|
||||
|
||||
|
||||
quartz();
|
||||
palette(rainbow(max(V(g)$color),alpha=0.5))
|
||||
plot(g, layout=layout.lgl)
|
||||
palette("default")
|
||||
title('walktrap, layoutLgl, default vertex size,alpha0.5')
|
||||
|
||||
|
||||
quartz();
|
||||
palette(rainbow(max(V(g)$color),alpha=0.5))
|
||||
plot(g, layout=layout.kamada.kawai)
|
||||
palette("default")
|
||||
title('walktrap, layout.kamada.kawai, default vertex size,alpha0.5')
|
||||
|
||||
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.kamada.kawai)
|
||||
palette("default")
|
||||
title('fastgreedy, layout.kamada.kawai, default vertex size,alpha0.5')
|
||||
|
||||
|
||||
|
||||
|
||||
edgelist2<-subset(edgelist,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('fastgreedy, layout.fruchterman.reingold, default vertex size,alpha0.5')
|
||||
|
||||
|
||||
|
||||
|
||||
# Edgelist > 0.2
|
||||
|
||||
edgelist2<-subset(edgelist,rvalue > 0.2)
|
||||
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('fastgreedy, layout.fruchterman.reingold, rvalue >0.2')
|
||||
|
||||
|
||||
degree(g)
|
||||
degree.distribution(g)
|
||||
degree.distribution(g,cumulative = TRUE)
|
||||
|
||||
|
||||
|
||||
|
||||
#------Histogram of degree distribution-------------------------------------------------------------
|
||||
df <- data.frame(degree(g))
|
||||
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')
|
||||
|
||||
rthresh <- 0.2
|
||||
fnm <- '120518_07'
|
||||
fnm2 <- paste(fnm,".tif",sep="")
|
||||
lo <- 'layout.fruchterman.reingold'
|
||||
# lo <- 'layout.kamada.kawai'
|
||||
# lo <- 'layout.lgl'
|
||||
d3 <- subset(edgelist,filename==fnm2)
|
||||
d4 <- with(d3,data.frame(node1,node2,rvalue))
|
||||
edgelist2<-subset(d4,rvalue > rthresh)
|
||||
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
|
||||
# quartz();
|
||||
# palette(rainbow(max(V(g)$color),alpha=0.5))
|
||||
mypalette <- adjustcolor(brewer.pal(max(V(g)$color),"Set1"),0.6)
|
||||
palette(mypalette)
|
||||
plot(g, layout=eval(parse(text=lo)), edge.width=E(g)$width, edge.color="black", vertex.label.color="black")
|
||||
# palette("default")
|
||||
title(paste(fnm,', fastgreedy default, ', lo, 'r>', rthresh))
|
||||
dateStr=format(Sys.time(),"%y%m%d-%H%M%S")
|
||||
quartz.save(file=paste(dateStr, "-", fnm, ".png",sep=""), type = "png", dpi=150)
|
||||
quartz.save(file=paste(dateStr, "-", fnm, ".pdf",sep=""), type = "pdf")
|
||||
|
||||
|
||||
|
||||
# 131208
|
||||
|
||||
|
||||
edgelist<-read.delim('/Users/ackman/Data/2photon/131208/2014-01-07-003602/dCorr.txt')
|
||||
edgelist<-read.delim('/Users/ackman/Data/2photon/120518i/2014-01-03-231550/dCorr.txt')
|
||||
|
||||
for(j in c(0.1,0.15,0.2)) {
|
||||
for(i in c('131208_01','131208_03','131208_04','131208_05')) {
|
||||
# for(i in c('120518_06','120518_07','120518_08','120518_09')) {
|
||||
rthresh <- j
|
||||
fnm <- i
|
||||
fnm2 <- paste(fnm,".tif",sep="")
|
||||
lo <- 'layout.fruchterman.reingold'
|
||||
# lo <- 'layout.kamada.kawai'
|
||||
# lo <- 'layout.lgl'
|
||||
d3 <- subset(edgelist,filename==fnm2)
|
||||
d4 <- with(d3,data.frame(node1,node2,rvalue))
|
||||
edgelist2<-subset(d4,rvalue > rthresh)
|
||||
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
|
||||
# quartz();
|
||||
# palette(rainbow(max(V(g)$color),alpha=0.5))
|
||||
mypalette <- adjustcolor(brewer.pal(max(V(g)$color),"Set1"),0.6)
|
||||
palette(mypalette)
|
||||
# plot(g, layout=eval(parse(text=lo)), edge.width=E(g)$width, edge.color="black", vertex.label.color="black")
|
||||
# title(paste(fnm,', fastgreedy default, ', lo, 'r>', rthresh))
|
||||
# dateStr=format(Sys.time(),"%y%m%d-%H%M%S")
|
||||
# # quartz.save(file=paste(dateStr, "-", fnm, ".png",sep=""), type = "png", dpi=150)
|
||||
# quartz.save(file=paste(dateStr, "-", fnm, ".pdf",sep=""), type = "pdf")
|
||||
print(transitivity(g))
|
||||
}
|
||||
}
|
||||
|
||||
# 2014-01-14 14:59:18 Make mean summary graphs for P3 and P8
|
||||
|
||||
edgelist<-read.delim('/Users/ackman/Data/2photon/131208/2014-01-07-003602/dCorr.txt')
|
||||
edgelist<-read.delim('/Users/ackman/Data/2photon/120518i/2014-01-03-231550/dCorr.txt')
|
||||
|
||||
|
||||
library(plyr)
|
||||
library(igraph)
|
||||
library(RColorBrewer)
|
||||
|
||||
d2 <- ddply(edgelist, c("node1","node2"), summarize,
|
||||
rvalue.mean = mean(rvalue),
|
||||
rvalue.sd = sd(rvalue),
|
||||
N = length(rvalue),
|
||||
rvalue.sem = rvalue.sd/sqrt(N))
|
||||
colnames(d2)[colnames(d2) == 'rvalue.mean'] <- 'rvalue'
|
||||
|
||||
rthresh <- 0.15
|
||||
fnm <- '131208'
|
||||
# fnm2 <- paste(fnm,".tif",sep="")
|
||||
lo <- 'layout.fruchterman.reingold'
|
||||
# lo <- 'layout.kamada.kawai'
|
||||
# lo <- 'layout.lgl'
|
||||
# d3 <- subset(edgelist,filename==fnm2)
|
||||
# d4 <- with(d3,data.frame(node1,node2,rvalue))
|
||||
edgelist2<-subset(d2,rvalue > rthresh)
|
||||
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
|
||||
quartz();
|
||||
# palette(rainbow(max(V(g)$color),alpha=0.5))
|
||||
mypalette <- adjustcolor(brewer.pal(max(V(g)$color),"Set1"),0.6)
|
||||
palette(mypalette)
|
||||
plot(g, layout=eval(parse(text=lo)), edge.width=E(g)$width, edge.color="black", vertex.label.color="black")
|
||||
# palette("default")
|
||||
title(paste(fnm,', fastgreedy default, ', lo, 'r>', rthresh))
|
||||
dateStr=format(Sys.time(),"%y%m%d-%H%M%S")
|
||||
quartz.save(file=paste(dateStr, "-", fnm, ".png",sep=""), type = "png", dpi=150)
|
||||
quartz.save(file=paste(dateStr, "-", fnm, ".pdf",sep=""), type = "pdf")
|
||||
|
||||
|
||||
print(fastgreedyCom)
|
||||
degree(g)
|
||||
degree.distribution(g)
|
||||
degree.distribution(g,cumulative = TRUE)
|
||||
average.path.length(g)
|
||||
diameter(g)
|
||||
hub.score(g)$vector
|
||||
mean(degree(g))
|
||||
transitivity(g)
|
||||
centralization.degree(g)
|
||||
is.connected(g)
|
||||
no.clusters(g)
|
||||
clusters(g)
|
||||
|
||||
|
||||
#------Histogram of degree distribution-------------------------------------------------------------
|
||||
df <- data.frame(degree(g))
|
||||
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
|
||||
dateStr=format(Sys.time(),"%y%m%d-%H%M%S")
|
||||
ggsave(file=paste(dateStr, "-degreeDist-", fnm, ".pdf",sep=""))
|
||||
|
||||
|
||||
# This should approximately yield the correct exponent 3
|
||||
# g <- barabasi.game(1000) # increase this number to have a better estimate
|
||||
# d <- degree(g, mode="in")
|
||||
d <- degree(g)
|
||||
fit1 <- power.law.fit(d,3)
|
||||
fit2 <- power.law.fit(d,3, implementation="R.mle")
|
||||
|
||||
fit1$alpha
|
||||
coef(fit2)
|
||||
fit1$logLik
|
||||
logLik(fit2)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Sample power law dynamics
|
||||
|
||||
# This should approximately yield the correct exponent 3
|
||||
g <- barabasi.game(1000) # increase this number to have a better estimate
|
||||
d <- degree(g, mode="in")
|
||||
fit1 <- power.law.fit(d+1, 10)
|
||||
fit2 <- power.law.fit(d+1, 10, implementation="R.mle")
|
||||
|
||||
fit1$alpha
|
||||
coef(fit2)
|
||||
fit1$logLik
|
||||
logLik(fit2)
|
||||
|
||||
df <- data.frame(degree(g))
|
||||
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
|
||||
dateStr=format(Sys.time(),"%y%m%d-%H%M%S")
|
||||
title("barabasi.game(33), powerlaw")
|
||||
ggsave(file=paste(dateStr, "-degreeDist-", "barabasiGame-powerlaw", ".pdf",sep=""))
|
||||
|
||||
|
||||
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")
|
||||
|
||||
|
||||