python/cell_cycle_gating/cellcycle_phases.py
def histc(X, bins):
    """Reproduced MATLAB histc function that returns counts per bin and
    bin index for each data point
    
    Parameters
    ----------
    X : 1D array
       DNA content or EdU intensity across all cells in a well
    bins : 1D array
       1D-grid based on expected range of DNA content or EdU intensity

    Returns
    -------
    [r, map_to_bins] : tuple
        r is the counts per bin. It should have the same length as bins
        map_to_bins is the bin index for each data point. It should have
        the same length as X
    """
    map_to_bins = np.digitize(X, bins)
    r = np.zeros(bins.shape)
    for i in map_to_bins:
        r[i-1] += 1
    return [r, map_to_bins]
Reproduced MATLAB histc function that returns counts per bin and
    bin index for each data point
    
    Parameters
    ----------
    X : 1D array
       DNA content or EdU intensity across all cells in a well
    bins : 1D array
       1D-grid based on expected range of DNA content or EdU intensity

    Returns
    -------
    [r, map_to_bins] : tuple
        r is the counts per bin. It should have the same length as bins
        map_to_bins is the bin index for each data point. It should have
        the same length as X
    
Reproduced MATLAB histc function that returns counts per bin and
bin index for each data point

Parameters

X : 1D array
DNA content or EdU intensity across all cells in a well
bins : 1D array
1D-grid based on expected range of DNA content or EdU intensity

Returns

[r, map_to_bins] : tuple
r is the counts per bin. It should have the same length as bins
map_to_bins is the bin index for each data point. It should have
the same length as X
Reproduced MATLAB histc function that returns counts per bin and bin index for each data point Parameters X : 1D array DNA content or EdU intensity across all cells in a well bins : 1D array 1D - grid based on expected range of DNA content or EdU intensity Returns [ r map_to_bins ] : tuple r is the counts per bin . It should have the same length as bins map_to_bins is the bin index for each data point . It should have the same length as X
def histc(X, bins):
    map_to_bins = np.digitize(X, bins)
    r = np.zeros(bins.shape)
    for i in map_to_bins:
        r[i-1] += 1
    return [r, map_to_bins]
def histc ( X , bins ) : map_to_bins = np . digitize ( X , bins ) r = np . zeros ( bins . shape ) for i in map_to_bins : r [ i - 1 ] += 1 return [ r , map_to_bins ]
Reproduced MATLAB histc function that returns counts per bin and
bin index for each data point
Reproduced MATLAB histc function that returns counts per bin and bin index for each data point
"""Reproduced MATLAB histc function that returns counts per bin and
    bin index for each data point
    
    Parameters
    ----------
    X : 1D array
       DNA content or EdU intensity across all cells in a well
    bins : 1D array
       1D-grid based on expected range of DNA content or EdU intensity

    Returns
    -------
    [r, map_to_bins] : tuple
        r is the counts per bin. It should have the same length as bins
        map_to_bins is the bin index for each data point. It should have
        the same length as X
    """
X
bins