Flow cytometer#

The FlowCyPy.flow_cytometer.FlowCytometer class is the main entry point for running a complete simulation.

It combines the fluidics, opto electronics, and digital processing subsystems into a single acquisition workflow and produces processed run outputs.

class FlowCytometer(**kwargs)[source]#

Bases: object

High level orchestrator for the flow cytometry simulation pipeline.

This class keeps only the persistent fluidic definition and the constant optical background level. All other configuration objects are passed explicitly to the methods that use them.

This design keeps the workflow fully visible to the caller and avoids any ambiguity about which opto electronic or signal processing configuration is active for a given computation.

Parameters:
  • fluidics (Fluidics) – Fluidic subsystem, including flow cell and population definitions.

  • background_power (pint.Quantity, optional) – Constant optical background added to every detector channel.

acquire(run_time, opto_electronics)[source]#

Run the acquisition pipeline up to the analog stage.

Parameters:
  • run_time (Time) – Acquisition duration.

  • opto_electronics (OptoElectronics) – Opto electronic configuration.

Returns:

Run record containing the event collection, analog voltage waveforms, and the opto electronic configuration used to produce them.

Return type:

RunRecord

compute_analog(run_time, event_collection, opto_electronics)[source]#

Compute the full analog detector waveforms from an event collection.

Parameters:
  • run_time (Time) – Acquisition duration.

  • event_collection (EventCollection) – Population event blocks with optical coupling already evaluated.

  • opto_electronics (OptoElectronics) – Opto electronic configuration.

Returns:

Analog voltage signal dictionary.

Return type:

dict

process_analog(run_time, event_collection, analog_dict, digital_processing, opto_electronics)[source]#

Process an existing analog acquisition through the downstream signal processing chain.

Parameters:
  • run_time (Time) – Acquisition duration.

  • event_collection (EventCollection) – Event collection associated with the analog signals.

  • analog_dict (dict) – Analog voltage signal dictionary.

  • digital_processing (DigitalProcessing) – Signal processing configuration.

  • opto_electronics (OptoElectronics) – Opto electronic configuration associated with the analog signal.

Returns:

Run record containing the analog acquisition and all downstream results that could be computed.

Return type:

RunRecord

process_run(run_record, digital_processing)[source]#

Process an existing acquired run through the downstream signal processing chain.

This method is intended for notebook workflows where the caller already has a RunRecord returned by acquire() and wants to apply downstream processing without passing the acquisition configuration again.

Parameters:
  • run_record (RunRecord) – Existing run record containing analog acquisition data and the opto electronic configuration used to produce it.

  • digital_processing (DigitalProcessing) – Signal processing configuration.

Returns:

Processed run record.

Return type:

RunRecord

Raises:
  • ValueError – If the input run record does not contain an opto_electronics configuration.

  • ValueError – If the input run record does not contain analog signal data.

run(run_time, opto_electronics, digital_processing=None)[source]#

Run the full simulation pipeline from event generation to peak extraction.

Parameters:
  • run_time (Time) – Acquisition duration.

  • opto_electronics (OptoElectronics) – Opto electronic configuration.

  • digital_processing (DigitalProcessing, optional) – Signal processing configuration. If None, no digital processing is applied.

Returns:

Full run record containing all available stages.

Return type:

RunRecord