def generate_poisson_data(centers, n_cells, cluster_probs=None):
genes, clusters = centers.shape<EOL>output = np.zeros((genes, n_cells))<EOL>if cluster_probs is None:<EOL><INDENT>cluster_probs = np.ones(clusters)/clusters<EOL><DEDENT>labels = []<EOL>for i in range(n_cells):<EOL><INDENT>c = np.random.choice(range(clusters), p=cluster_probs)<EOL>labels.append(c)<EOL>output[:,i] = np.random.poisson(centers[:,c])<EOL><DEDENT>return output, np.array(labels)<EOL>
Generates poisson-distributed data, given a set of means for each cluster.

Args:
    centers (array): genes x clusters matrix
    n_cells (int): number of output cells
    cluster_probs (array): prior probability for each cluster.
        Default: uniform.

Returns:
    output - array with shape genes x n_cells
    labels - array of cluster labels