python/cell_cycle_gating/ph3_filter.py
def compute_log_ph3(ph3, x_ph3=None):
    """Compute log of pH3 intensities

    Parameters
    ----------
    ph3 : 1d array
       ph3 intensities across all cells in a well
    x_ph3 : 1d array
       uniformly distributed 1d grid based on expected range of pH3 intensities
    
    Returns
    -------
    log_ph3 : 1d array
       log pf pH3 intensities across all cells in a well
    """
    if ph3.min() <= 0:
        ph3 += np.abs(ph3.min())
    if x_ph3 is None:
        #x_ph3 = np.arange(2.5, 8, 0.02)
        ph3_min = np.max((0, np.log10(ph3.min()+0.1) - 0.1))
        ph3_max = np.log10(ph3.max()) + 0.1
        x_ph3 = np.arange(ph3_min, ph3_max, 0.02)
    ph3_upper_bound = 10 ** x_ph3[-3]
    ph3_lower_bound = 10 ** x_ph3[2]
    ph3_upper_bounded = [d if d < ph3_upper_bound else ph3_upper_bound
                         for d in ph3]
    ph3_bounded = [d if d > ph3_lower_bound else ph3_lower_bound
                   for d in ph3_upper_bounded]
    log_ph3 = np.array([np.log10(d) for d in ph3_bounded])
    return log_ph3
Compute log of pH3 intensities

    Parameters
    ----------
    ph3 : 1d array
       ph3 intensities across all cells in a well
    x_ph3 : 1d array
       uniformly distributed 1d grid based on expected range of pH3 intensities
    
    Returns
    -------
    log_ph3 : 1d array
       log pf pH3 intensities across all cells in a well
    
Compute log of pH3 intensities
Parameters

ph3 : 1d array
ph3 intensities across all cells in a well
x_ph3 : 1d array
uniformly distributed 1d grid based on expected range of pH3 intensities

Returns

log_ph3 : 1d array
log pf pH3 intensities across all cells in a well
Compute log of pH3 intensities Parameters ph3 : 1d array ph3 intensities across all cells in a well x_ph3 : 1d array uniformly distributed 1d grid based on expected range of pH3 intensities Returns log_ph3 : 1d array log pf pH3 intensities across all cells in a well
def compute_log_ph3(ph3, x_ph3=None):
    if ph3.min() <= 0:
        ph3 += np.abs(ph3.min())
    if x_ph3 is None:
        ph3_min = np.max((0, np.log10(ph3.min()+0.1) - 0.1))
        ph3_max = np.log10(ph3.max()) + 0.1
        x_ph3 = np.arange(ph3_min, ph3_max, 0.02)
    ph3_upper_bound = 10 ** x_ph3[-3]
    ph3_lower_bound = 10 ** x_ph3[2]
    ph3_upper_bounded = [d if d < ph3_upper_bound else ph3_upper_bound
                         for d in ph3]
    ph3_bounded = [d if d > ph3_lower_bound else ph3_lower_bound
                   for d in ph3_upper_bounded]
    log_ph3 = np.array([np.log10(d) for d in ph3_bounded])
    return log_ph3
def compute_log_ph3 ( ph3 , x_ph3 = None ) : if ph3 . min ( ) <= 0 : ph3 += np . abs ( ph3 . min ( ) ) if x_ph3 is None : ph3_min = np . max ( ( 0 , np . log10 ( ph3 . min ( ) + 0.1 ) - 0.1 ) ) ph3_max = np . log10 ( ph3 . max ( ) ) + 0.1 x_ph3 = np . arange ( ph3_min , ph3_max , 0.02 ) ph3_upper_bound = 10 ** x_ph3 [ - 3 ] ph3_lower_bound = 10 ** x_ph3 [ 2 ] ph3_upper_bounded = [ d if d < ph3_upper_bound else ph3_upper_bound for d in ph3 ] ph3_bounded = [ d if d > ph3_lower_bound else ph3_lower_bound for d in ph3_upper_bounded ] log_ph3 = np . array ( [ np . log10 ( d ) for d in ph3_bounded ] ) return log_ph3
Compute log of pH3 intensities
Parameters
Compute log of pH3 intensities Parameters
"""Compute log of pH3 intensities

    Parameters
    ----------
    ph3 : 1d array
       ph3 intensities across all cells in a well
    x_ph3 : 1d array
       uniformly distributed 1d grid based on expected range of pH3 intensities
    
    Returns
    -------
    log_ph3 : 1d array
       log pf pH3 intensities across all cells in a well
    """ #x_ph3 = np.arange(2.5, 8, 0.02)
ph3
x_ph3