python/cell_cycle_gating/dead_cell_filter.py
def plot_ldr_gating(ldrtxt, x_ldr=None, ldr_gates=None,
                    ldr_lims=None, ax=None):
    """Summary plot of gating based on gating based on LDR intensities

    Parameters
    ----------
    ldrtxt : 1d array
       ldr txt feature across all cells in a well
    x_ldr : 1d array
       uniformly distributed 1d grid based on expected
       range of ldr txt
    ldr_gates : list of floats
       min and max gating based on ldr txt
    ldr_lims : list of floats
       outer bouns of ldr txt to set as x_lim for pltos
    ax : plot obj
       provides positional reference for master plot

    Returns
    -------
    """
    if x_ldr is None:
        mx = np.max(ldrtxt.tolist())+0.01
        x_ldr = np.arange(-0.01, mx, 0.0002)
    f_ldr = get_kde(ldrtxt, x_ldr)
    if not ldr_gates:
        ldr_gates = get_ldrgates(ldrtxt, x_ldr)
    if not ldr_lims:
        ldr_lims = get_ldrlims(ldrtxt, x_ldr)
    log_frac = np.log10(f_ldr+np.max(f_ldr)/100) - np.log10(np.max(f_ldr)/100)

    if ax is None:
        ax = plt.figure()
    ax.plot(x_ldr, log_frac)
    x_vals = [ldr_gates[1],
              np.max([ldr_gates[0], np.min(x_ldr)]),
              np.max([ldr_gates[0], np.min(x_ldr)]),
              ldr_gates[1], ldr_gates[1]]
    #y_vals = [np.log10(np.max(f_ldr)) * y for y in [0, 0, 0.5, 0.5, 0]]
    y_vals = [0, 0, max(log_frac), max(log_frac), 0]
    ax.plot(x_vals, y_vals, 'r', alpha=0.5)
    ax.set_xlim(ldr_lims)
    f_ldr_max = np.log10(np.max(f_ldr)) - np.log10(np.max(f_ldr)/100) + 0.1
    ax.set_ylim([0, f_ldr_max])
    ax.set_xlabel('LDRtxt intensity')
    ax.set_ylabel('kernel density estimate')
    return ldr_gates, ldr_lims
Summary plot of gating based on gating based on LDR intensities

    Parameters
    ----------
    ldrtxt : 1d array
       ldr txt feature across all cells in a well
    x_ldr : 1d array
       uniformly distributed 1d grid based on expected
       range of ldr txt
    ldr_gates : list of floats
       min and max gating based on ldr txt
    ldr_lims : list of floats
       outer bouns of ldr txt to set as x_lim for pltos
    ax : plot obj
       provides positional reference for master plot

    Returns
    -------
    
Summary plot of gating based on gating based on LDR intensities
Parameters



Returns
Summary plot of gating based on gating based on LDR intensities Parameters Returns
def plot_ldr_gating(ldrtxt, x_ldr=None, ldr_gates=None,
                    ldr_lims=None, ax=None):
    if x_ldr is None:
        mx = np.max(ldrtxt.tolist())+0.01
        x_ldr = np.arange(-0.01, mx, 0.0002)
    f_ldr = get_kde(ldrtxt, x_ldr)
    if not ldr_gates:
        ldr_gates = get_ldrgates(ldrtxt, x_ldr)
    if not ldr_lims:
        ldr_lims = get_ldrlims(ldrtxt, x_ldr)
    log_frac = np.log10(f_ldr+np.max(f_ldr)/100) - np.log10(np.max(f_ldr)/100)
    if ax is None:
        ax = plt.figure()
    ax.plot(x_ldr, log_frac)
    x_vals = [ldr_gates[1],
              np.max([ldr_gates[0], np.min(x_ldr)]),
              np.max([ldr_gates[0], np.min(x_ldr)]),
              ldr_gates[1], ldr_gates[1]]
    y_vals = [0, 0, max(log_frac), max(log_frac), 0]
    ax.plot(x_vals, y_vals, 'r', alpha=0.5)
    ax.set_xlim(ldr_lims)
    f_ldr_max = np.log10(np.max(f_ldr)) - np.log10(np.max(f_ldr)/100) + 0.1
    ax.set_ylim([0, f_ldr_max])
    ax.set_xlabel('LDRtxt intensity')
    ax.set_ylabel('kernel density estimate')
    return ldr_gates, ldr_lims
def plot_ldr_gating ( ldrtxt , x_ldr = None , ldr_gates = None , ldr_lims = None , ax = None ) : if x_ldr is None : mx = np . max ( ldrtxt . tolist ( ) ) + 0.01 x_ldr = np . arange ( - 0.01 , mx , 0.0002 ) f_ldr = get_kde ( ldrtxt , x_ldr ) if not ldr_gates : ldr_gates = get_ldrgates ( ldrtxt , x_ldr ) if not ldr_lims : ldr_lims = get_ldrlims ( ldrtxt , x_ldr ) log_frac = np . log10 ( f_ldr + np . max ( f_ldr ) / 100 ) - np . log10 ( np . max ( f_ldr ) / 100 ) if ax is None : ax = plt . figure ( ) ax . plot ( x_ldr , log_frac ) x_vals = [ ldr_gates [ 1 ] , np . max ( [ ldr_gates [ 0 ] , np . min ( x_ldr ) ] ) , np . max ( [ ldr_gates [ 0 ] , np . min ( x_ldr ) ] ) , ldr_gates [ 1 ] , ldr_gates [ 1 ] ] y_vals = [ 0 , 0 , max ( log_frac ) , max ( log_frac ) , 0 ] ax . plot ( x_vals , y_vals , 'r' , alpha = 0.5 ) ax . set_xlim ( ldr_lims ) f_ldr_max = np . log10 ( np . max ( f_ldr ) ) - np . log10 ( np . max ( f_ldr ) / 100 ) + 0.1 ax . set_ylim ( [ 0 , f_ldr_max ] ) ax . set_xlabel ( 'LDRtxt intensity' ) ax . set_ylabel ( 'kernel density estimate' ) return ldr_gates , ldr_lims
Summary plot of gating based on gating based on LDR intensities
Parameters
Summary plot of gating based on gating based on LDR intensities Parameters
"""Summary plot of gating based on gating based on LDR intensities

    Parameters
    ----------
    ldrtxt : 1d array
       ldr txt feature across all cells in a well
    x_ldr : 1d array
       uniformly distributed 1d grid based on expected
       range of ldr txt
    ldr_gates : list of floats
       min and max gating based on ldr txt
    ldr_lims : list of floats
       outer bouns of ldr txt to set as x_lim for pltos
    ax : plot obj
       provides positional reference for master plot

    Returns
    -------
    """ #y_vals = [np.log10(np.max(f_ldr)) * y for y in [0, 0, 0.5, 0.5, 0]]
ldrtxt
x_ldr
ldr_gates
ldr_lims
ax