epitome.functions.indices_for_weighted_resample

epitome.functions.indices_for_weighted_resample(data, n, matrix, cellmap, assaymap, weights=None)

Selects n rows from data that have the greatest number of labels (can be weighted) Returns indices to these rows.

Parameters
  • data (numpy.matrix) – data matrix with shape (factors, records)

  • n (int) – number or rows to sample

  • matrix (numpy.matrix) – cell type by assay position matrix

  • cellmap (dict) – dict of cells and row positions in matrix

  • assaymap (dict) – dict of assays and column positions in matrix

  • weights (numpy.array) – Optional vector of weights whos length = # factors (1 weight for each factor). The greater the weight, the more the positives for this factor matters.

Returns

numpy matrix of indices

Return type

numpy.matrix