Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
def motif3funct_bin(*args):
  return _bct.motif3funct_bin(*args)
Ejemplo n.º 4
0
def motif3funct_bin(*args):
    return _bct.motif3funct_bin(*args)
Ejemplo n.º 5
0
def motif3funct_bin(*args):
  """motif3funct_bin(gsl_matrix W) -> gsl_vector"""
  return _bct.motif3funct_bin(*args)
Ejemplo n.º 6
0
def motif3funct_bin(*args):
    """motif3funct_bin(gsl_matrix W) -> gsl_vector"""
    return _bct.motif3funct_bin(*args)