def motif3funct(cmatrix, weighted): """ Counts occurrences of three-node functional motifs Parameters ---------- cmatrix : connection/adjacency matrix (For weighted graph W(all weights [0,1]) ) weighted : {False, True} Returns ------- weighted == True: I : Returns intensity and (optionally) coherence and motif counts. Weighted functional motif metrics. References: Onnela et al. 2005, Phys Rev E 71:065103; Sporns and Kotter, PLoS Biology 2004, 2:e369 Mika Rubinov, UNSW, 2007 (last modified July 2008) weighted == False: F : binary motif count per vertex F Counts functional motif occurence Reference: Sporns and Kotter, PLoS Biology 2004, 2:e369 Mika Rubinov, UNSW, 2008 """ if weighted: m = bct.to_gslm(cmatrix.tolist()) str = bct.motif3funct_wei(m) strnp = bct.from_gsl(str) bct.gsl_free(m) bct.gsl_free(str) return np.asarray(strnp) else: m = bct.to_gslm(cmatrix.tolist()) str = bct.motif3funct_bin(m) strnp = bct.from_gsl(str) bct.gsl_free(m) bct.gsl_free(str) return np.asarray(strnp)
def motif3funct_wei(*args): return _bct.motif3funct_wei(*args)
def motif3funct_wei(*args): """motif3funct_wei(gsl_matrix W) -> gsl_matrix""" return _bct.motif3funct_wei(*args)