Coverage for /home/kale/research/software/libraries/fcmcmp/fcmcmp/processing.py : 94%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#!/usr/bin/env python3
keyword in experiment['label'] or \ keyword == condition or \ keyword == well.label:
previous_wells = set() for experiment, condition, well in yield_wells(experiments, keyword): if well not in previous_wells: previous_wells.add(well) yield experiment, condition, well
global _all_processing_steps
""" A modular transformation that can be applied to flow cytometry data.
The purpose of this class is primarily to abstract the process of iterating through the data structure created by load_experiments(). Each experiment can contain a number of flow cytometry data frames. Iterating through all of them to apply a common transformation is common enough that it was worth supporting with a bit of a framework, and that's what this class is. """
""" Keep track of all the processing steps that get instantiated. This functionality is required by run_all_processing_steps(). """ # Implement __new__() instead of __init__() because it's less likely # that subclasses will overwrite __new__() and forget to call this # method.
""" Apply this processing step to all of the given experiments.
The actual processing is delegated to process_experiment(), which can be overwritten by subclasses. The default process_experiment() calls process_well() on each well, which nicely abstracts the process of iterating through the experiment data structure. """
""" Iterate over all the wells in the given experiment.
The processing of each well is delegated to process_well(), which is an abstract method. If process_well() returns a data frame, it replaces the existing well data. If process_well() returns None, it is assumed that the well data was modified in place. """
""" Process the data from an individual well in any way.
This method can either return a new data frame, which will replace the existing one for the given well, or it can just modify the given well in place. """ raise NotImplementedError(self.__class__.__name__)
""" Discard any channels that aren't explicitly listed.
This is just useful for making processing a little faster and output a little cleaner if you collected data for more channels than you needed to, for whatever reason. """
raise NotImplementedError
|