python/cell_cycle_gating/ph3_filter.py
def evaluate_Mphase(log_ph3, ph3_cutoff, cell_identity, ax=None):
    """Reassigns membership of each cell based on M phase identified by pH3

    Parameters
    ----------
    log_ph3 : 1d array
        log of ph3 intensities across all cells in a well
    ph3_cutoff : 1d array
        pH3 gating on kernel density minima
    cell_identity : 1d array
        membership of each cell in cell cycle phase (1=G1, 2=S, 3=G2)
    ax : subplot object
        relative positional reference of subplot in master summary plot

    Returns
    -------
    fractions : dict
       keys are cell cycle phases (G1, G2, S, M) and
       values are fractions of cells in each phase
    """
    midx = (log_ph3 >= ph3_cutoff)
    ph3_cell_identity = cell_identity.copy()
    ph3_cell_identity[midx] = 4 + ph3_cell_identity[midx]/10
    ph3_cell_identity[midx] = np.floor(ph3_cell_identity[midx])
    fractions = {}
    for state, val in zip(['subG1', 'G1', 'S', 'S_dropout', 'G2', 'M', 'beyondG2'],
                          [0.5, 1, 2, 2.1, 3, 4, 3.1]):
        fractions[state] = np.mean(ph3_cell_identity == (val % 5))
    if ax is not None:
        ax.pie(fractions.values(), labels=fractions.keys(),  autopct='%1.1f%%')
        ax.axis('equal')
    return fractions, ph3_cell_identity
Reassigns membership of each cell based on M phase identified by pH3

    Parameters
    ----------
    log_ph3 : 1d array
        log of ph3 intensities across all cells in a well
    ph3_cutoff : 1d array
        pH3 gating on kernel density minima
    cell_identity : 1d array
        membership of each cell in cell cycle phase (1=G1, 2=S, 3=G2)
    ax : subplot object
        relative positional reference of subplot in master summary plot

    Returns
    -------
    fractions : dict
       keys are cell cycle phases (G1, G2, S, M) and
       values are fractions of cells in each phase
    
Reassigns membership of each cell based on M phase identified by pH3
Parameters

log_ph3 : 1d array
log of ph3 intensities across all cells in a well
ph3_cutoff : 1d array
pH3 gating on kernel density minima
cell_identity : 1d array
membership of each cell in cell cycle phase (1=G1, 2=S, 3=G2)
ax : subplot object
relative positional reference of subplot in master summary plot

Returns

fractions : dict
keys are cell cycle phases (G1, G2, S, M) and
values are fractions of cells in each phase
Reassigns membership of each cell based on M phase identified by pH3 Parameters log_ph3 : 1d array log of ph3 intensities across all cells in a well ph3_cutoff : 1d array pH3 gating on kernel density minima cell_identity : 1d array membership of each cell in cell cycle phase ( 1 = G1 2 = S 3 = G2 ) ax : subplot object relative positional reference of subplot in master summary plot Returns fractions : dict keys are cell cycle phases ( G1 G2 S M ) and values are fractions of cells in each phase
def evaluate_Mphase(log_ph3, ph3_cutoff, cell_identity, ax=None):
    midx = (log_ph3 >= ph3_cutoff)
    ph3_cell_identity = cell_identity.copy()
    ph3_cell_identity[midx] = 4 + ph3_cell_identity[midx]/10
    ph3_cell_identity[midx] = np.floor(ph3_cell_identity[midx])
    fractions = {}
    for state, val in zip(['subG1', 'G1', 'S', 'S_dropout', 'G2', 'M', 'beyondG2'],
                          [0.5, 1, 2, 2.1, 3, 4, 3.1]):
        fractions[state] = np.mean(ph3_cell_identity == (val % 5))
    if ax is not None:
        ax.pie(fractions.values(), labels=fractions.keys(),  autopct='%1.1f%%')
        ax.axis('equal')
    return fractions, ph3_cell_identity
def evaluate_Mphase ( log_ph3 , ph3_cutoff , cell_identity , ax = None ) : midx = ( log_ph3 >= ph3_cutoff ) ph3_cell_identity = cell_identity . copy ( ) ph3_cell_identity [ midx ] = 4 + ph3_cell_identity [ midx ] / 10 ph3_cell_identity [ midx ] = np . floor ( ph3_cell_identity [ midx ] ) fractions = { } for state , val in zip ( [ 'subG1' , 'G1' , 'S' , 'S_dropout' , 'G2' , 'M' , 'beyondG2' ] , [ 0.5 , 1 , 2 , 2.1 , 3 , 4 , 3.1 ] ) : fractions [ state ] = np . mean ( ph3_cell_identity == ( val % 5 ) ) if ax is not None : ax . pie ( fractions . values ( ) , labels = fractions . keys ( ) , autopct = '%1.1f%%' ) ax . axis ( 'equal' ) return fractions , ph3_cell_identity
Reassigns membership of each cell based on M phase identified by pH3
Parameters
Reassigns membership of each cell based on M phase identified by pH3 Parameters
"""Reassigns membership of each cell based on M phase identified by pH3

    Parameters
    ----------
    log_ph3 : 1d array
        log of ph3 intensities across all cells in a well
    ph3_cutoff : 1d array
        pH3 gating on kernel density minima
    cell_identity : 1d array
        membership of each cell in cell cycle phase (1=G1, 2=S, 3=G2)
    ax : subplot object
        relative positional reference of subplot in master summary plot

    Returns
    -------
    fractions : dict
       keys are cell cycle phases (G1, G2, S, M) and
       values are fractions of cells in each phase
    """
log_ph3
ph3_cutoff
cell_identity
ax