On Sep 1, 2012, at 10:20 PM, Sancar Adali wrote: worm includes two (weighted) graphs Achem , Agap -- N=279 . The names of the neurons are listed in "Neuron_ordered" in the same ordering as the two matrices. I can't remember if the last one is from Joshua or I imported it to MATLAB, myself. require(R.matlab) dat <- readMat(url("http://www.cis.jhu.edu/~parky/SGM/graph_data/elegansGraph.mat")) summary(dat) Length Class Mode Neuron.ordered 279 -none- list Achem 77841 dgCMatrix S4 Agap 77841 dgCMatrix S4 dim(dat$Achem) [1] 279 279 dim(dat$Agap) [1] 279 279 279^2 [1] 77841 sum( dat$Achem == t(dat$Achem) ) [1] 74035 # Achem is NOT symmetric sum( dat$Agap == t(dat$Agap) ) [1] 77841 # Agap is symmetric sum(apply( dat$Achem+t(dat$Achem) , 1 , sum ) == 0) [1] 0 # Achem has 0 isolates sum(apply( dat$Agap+t(dat$Agap) , 1 , sum ) == 0) [1] 26 # Agap has 26 isolates sum(diag(dat$Achem)) [1] 0 # Achem has no loops sum(diag(dat$Agap)) [1] 3 # Agap has YES loops ========================================================================= On Nov 27, 2012, at 2:16 AM, Sancar Adali wrote: here is the male version of worm (only 170 neurons for Achem and 167 for Agap) datM <- readMat(url("http://www.cis.jhu.edu/~parky/SGM/graph_data/elegansGraph_male.mat")) summary(datM) Length Class Mode Achem 28900 -none- numeric Agap 27889 -none- numeric Agap.names 167 -none- list Achem.names 170 -none- list dim(datM$Agap) # 167x167 isSymmetric(datM$Agap) #[1] TRUE sum(apply( datM$Agap+t(datM$Agap) , 1 , sum ) == 0) # 2 isolates sum(diag(datM$Agap)) # 37 loops dim(datM$Achem) # 170x170 isSymmetric(datM$Achem) #[1] FALSE sum(apply(datM$Achem,1,sum)==0) # 2 isolates sum(apply( datM$Achem+t(datM$Achem) , 1 , sum ) == 0) # 2 isolates sum(diag(datM$Achem)) # 355 loops