Ejemplo n.º 1
0
    def clustercentroids(self, clusterid=None, method='a', transpose=0):
        """Calculate the cluster centroids and return a tuple (cdata, cmask).

The centroid is defined as either the mean or the median over all elements
for each dimension.

  - data     : nrows x ncolumns array containing the expression data
  - mask     : nrows x ncolumns array of integers, showing which data are
    missing. If mask[i][j]==0, then data[i][j] is missing.
  - transpose: if equal to 0, gene (row) clusters are considered;
    if equal to 1, microarray (column) clusters are considered.
  - clusterid: array containing the cluster number for each gene or
    microarray. The cluster number should be non-negative.
  - method   : specifies how the centroid is calculated:
    method=='a': arithmetic mean over each dimension. (default)
    method=='m': median over each dimension.

Return values:
  - cdata    : 2D array containing the cluster centroids. If transpose==0,
    then the dimensions of cdata are nclusters x ncolumns. If
    transpose==1, then the dimensions of cdata are
    nrows x nclusters.
  - cmask    : 2D array of integers describing which elements in cdata,
    if any, are missing.

"""
        return clustercentroids(self.data, self.mask, clusterid, method,
                                transpose)
Ejemplo n.º 2
0
    def clustercentroids(self, clusterid=None, method='a', transpose=0):
        """Calculate the cluster centroids and return a tuple (cdata, cmask).

        The centroid is defined as either the mean or the median over all
        elements for each dimension.

        Arguments:
         - data     : nrows x ncolumns array containing the expression data
         - mask     : nrows x ncolumns array of integers, showing which data
           are missing. If mask[i][j]==0, then data[i][j] is missing.
         - transpose: if equal to 0, gene (row) clusters are considered;
           if equal to 1, microarray (column) clusters are considered.
         - clusterid: array containing the cluster number for each gene or
           microarray. The cluster number should be non-negative.
         - method   : specifies how the centroid is calculated:

           - method=='a': arithmetic mean over each dimension. (default)
           - method=='m': median over each dimension.

        Return values:
         - cdata    : 2D array containing the cluster centroids. If transpose==0,
           then the dimensions of cdata are nclusters x ncolumns. If
           transpose==1, then the dimensions of cdata are nrows x nclusters.
         - cmask    : 2D array of integers describing which elements in cdata,
           if any, are missing.

        """
        return clustercentroids(self.data, self.mask, clusterid, method,
                                transpose)