Skip to content

SIA Workflows

High-level workflow methods for automated procedures.

SIA_API.methods.prepared_methods.PreparedSIMethods

PreparedSIMethods(chemstation_controller, syringe_device: SyringeController, valve_device: ValveSelector, config: Optional[SIConfig] = None)

High-level SI (Sequential Injection) workflows with real-time status feedback.

This class provides complete automation workflows for SI systems, handling complex sequences of operations including sample preparation, reagent mixing, cleaning procedures, and sample homogenization. All methods include comprehensive error checking and optional verbose feedback.

The class integrates three main components: 1. ChemStation controller for autosampler operations 2. SyringeController for precise fluid handling 3. ValveSelector for reagent/port switching

All operations can be customized through the SIConfig instance, allowing fine-tuning of volumes, speeds, timing, and other parameters.

Attributes:

Name Type Description
chemstation

ChemStation API controller instance

config

SIConfig instance with system parameters

syringe

SyringeController instance for fluid operations

valve

ValveSelector instance for port switching

syringe_size

Maximum volume capacity of the syringe (µL)

_interactive_terminal

Boolean indicating if running in interactive terminal

Initialize SI workflow system with hardware controllers and configuration.

Parameters:

Name Type Description Default
chemstation_controller

ChemStation API controller instance for autosampler

required
syringe_device SyringeController

Initialized SyringeController instance

required
valve_device ValveSelector

Initialized ValveSelector instance

required
config Optional[SIConfig]

SIConfig instance (uses DEFAULT_CONFIG if None)

None

Raises:

Type Description
ValidationError

If required vials are not present in the system

Example

workflow = PreparedSIMethods( ... chemstation_controller=my_controller, ... syringe_device=my_syringe, ... valve_device=my_valve, ... config=custom_config ... )

Functions

load_to_replenishment

load_to_replenishment(vial_number: int, verbose: Optional[bool] = None) -> None

Load specified vial to replenishment position in CE carousel.

The replenishment position is where the sample needle can access the vial contents for aspiration or dispensing operations.

Parameters:

Name Type Description Default
vial_number int

Vial position number (1-50 for typical autosamplers)

required
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None

Raises:

Type Description
ValueError

If vial_number is outside valid range

SystemError

If autosampler operation fails

Example

workflow.load_to_replenishment(vial_number=25) Loading vial 25 to replenishment position...

unload_from_replenishment

unload_from_replenishment(verbose: Optional[bool] = None) -> None

Unload vial from replenishment position back to carousel.

Returns the currently loaded vial back to its original position in the autosampler carousel.

Parameters:

Name Type Description Default
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None

Raises:

Type Description
SystemError

If autosampler operation fails

Example

workflow.unload_from_replenishment() Unloading vial from replenishment position...

clean_needle

clean_needle(volume_flush: float, wash_vial: Optional[int] = None, verbose: Optional[bool] = None) -> None

Clean the dispensing needle to prevent cross-contamination.

This procedure uses a wash vial containing cleaning solution to flush the needle exterior and interior, preventing sample carryover between different vials or operations.

Parameters:

Name Type Description Default
volume_flush float

Total volume for needle cleaning (µL)

required
wash_vial Optional[int]

Vial number containing wash solution (uses config default if None)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Note

The cleaning is split into two parts: half dispensed into the wash vial (for exterior cleaning) and half dispensed to waste (for interior cleaning).

Example

workflow.clean_needle(volume_flush=100, wash_vial=48) Cleaning needle with 100 µL in vial 48...

system_initialization_and_cleaning

system_initialization_and_cleaning(waste_vial: Optional[int] = None, bubble: int = 20, verbose: Optional[bool] = None) -> None

Perform complete system initialization and cleaning procedure.

This comprehensive procedure prepares the SI system for operation by: 1. Initializing the syringe pump 2. Flushing all lines with appropriate solvents 3. Creating separating bubbles 4. Priming transfer lines

This should be run at the beginning of each analytical session.

Parameters:

Name Type Description Default
waste_vial Optional[int]

Waste vial number (uses config default if None)

None
bubble int

Separating bubble volume in µL

20
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None

Raises:

Type Description
SystemError

If any initialization step fails

Example

workflow.system_initialization_and_cleaning() [SI] Loading vial 50 to replenishment position... [SI] Initializing syringe pump... [SI] Flushing syringe loop... [SI] Creating 20 µL air bubble in holding coil... [SI] Flushing system with methanol (250 µL)... [SI] Flushing with DI water... [SI] Flushing transfer line... [SI] System initialization completed successfully!

prepare_continuous_flow

prepare_continuous_flow(solvent_port: int, waste_vial: Optional[int] = None, bubble_volume: int = 10, solvent_holding_coil_volume: int = 10, transfer_coil_flush: int = 500, holding_coil_flush: Optional[int] = None, speed: Optional[int] = None, verbose: Optional[bool] = None) -> None

Prepare system for continuous flow filling operations.

Continuous flow mode maintains a continuous column of solvent from the reservoir through the holding coil to the transfer line. This mode is ideal for multiple fills with the same solvent, providing consistent flow rates and minimal air bubbles.

Parameters:

Name Type Description Default
solvent_port int

Port number connected to solvent reservoir

required
waste_vial Optional[int]

Waste vial number (uses config default if None)

None
bubble_volume int

Air bubble volume in µL for separation

10
solvent_holding_coil_volume int

Solvent volume at end of holding coil

10
transfer_coil_flush int

Volume for transfer coil flushing

500
holding_coil_flush Optional[int]

Volume for holding coil flushing (uses config default if None)

None
speed Optional[int]

Flow rate in µL/min (uses config.speed_slow if None)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Note

After this preparation, use continuous_fill() for sample dispensing. The system maintains solvent continuity between fills, making it efficient for processing multiple samples with the same solvent.

Example

workflow.prepare_continuous_flow( ... solvent_port=3, # DI water ... transfer_coil_flush=600 ... ) [SI] Loading vial 50 to replenishment position... [SI] Flushing holding coil with 500 µL solvent... [SI] Creating 10 µL air bubble in holding coil... [SI] System ready for continuous flow operations

prepare_batch_flow

prepare_batch_flow(solvent_port: int, waste_vial: Optional[int] = None, bubble_volume: int = 10, transfer_coil_volume: Optional[int] = None, coil_flush: int = 150, speed: Optional[int] = None, verbose: Optional[bool] = None) -> None

Prepare system for batch flow (discontinuous) filling operations.

Batch flow mode uses air-driven dispensing where the transfer line is filled with air rather than solvent. This mode is suitable for single fills or when changing solvents between operations, as it provides complete separation between different solutions.

Parameters:

Name Type Description Default
solvent_port int

Port number connected to solvent reservoir

required
waste_vial Optional[int]

Waste vial number (uses config default if None)

None
bubble_volume int

Air bubble volume in µL

10
transfer_coil_volume Optional[int]

Transfer line volume in µL (uses config default if None)

None
coil_flush int

Volume for coil flushing in µL

150
speed Optional[int]

Flow rate in µL/min (uses config.speed_slow if None)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Note

After this preparation, use batch_fill() methods for sample dispensing. Each fill operation is independent, with air separation preventing cross-contamination between different solvents or samples.

Example

workflow.prepare_batch_flow( ... solvent_port=3, # DI water port ... transfer_coil_volume=600 ... ) PREPARING BATCH FLOW (Solvent Port: 3) [SI] Loading vial 50 to replenishment position... [SI] Flushing transfer loop with 150 µL... [SI] Creating 10 µL air bubble in holding coil... [SI] Filling transfer line with 600 µL air... [SI] System ready for batch flow operations

continuous_fill

continuous_fill(vial: int, volume: int, solvent_port: int, flush_needle: Optional[int] = None, wash_vial: Optional[int] = None, speed: Optional[int] = None, verbose: Optional[bool] = None) -> None

Execute continuous flow filling operation.

Performs sample filling using continuous solvent flow from the reservoir through the holding coil to the target vial. This method is efficient for multiple fills with the same solvent and provides consistent flow characteristics.

Parameters:

Name Type Description Default
vial int

Target vial number (1-50)

required
volume int

Dispensing volume in µL

required
solvent_port int

Port number connected to solvent reservoir

required
flush_needle Optional[int]

Optional needle flush volume in µL (for cleaning)

None
wash_vial Optional[int]

Vial for needle washing (uses config default if None)

None
speed Optional[int]

Flow rate in µL/min (uses config.speed_normal if None)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Note

The system must first be prepared using prepare_continuous_flow(). Large volumes are automatically split into multiple syringe cycles.

Raises:

Type Description
ValueError

If volume is negative or vial number is invalid

Example

workflow.continuous_fill( ... vial=15, ... volume=750, ... solvent_port=3, ... flush_needle=50 ... ) [SI] Continuous fill: Vial 15, Volume 750 µL, Port 3 [SI] Loading vial 15 to replenishment position... [SI] Cycle 1/2: Aspirating 500 µL from port 3... [SI] Cycle 1/2: Dispensing 500 µL to vial 15... [SI] Cycle 2/2: Aspirating 300 µL from port 3... [SI] Cycle 2/2: Dispensing 250 µL, keeping 50 µL for flush... [SI] Cleaning needle with 50 µL in vial 48... [SI] Continuous fill of vial 15 completed (750 µL)

batch_fill

batch_fill(vial: int, volume: int, solvent_port: int, transfer_line_volume: Optional[int] = None, bubble_volume: int = 10, flush_needle: Optional[int] = None, speed: Optional[int] = None, unload: bool = True, wait: Optional[int] = None, verbose: Optional[bool] = None) -> None

Execute batch flow (discontinuous) filling operation.

Performs sample filling using batch (discontinuous) flow where solvent is first loaded into the holding coil with an air bubble, then pushed to the target vial using air pressure. This provides complete isolation between different solutions.

Parameters:

Name Type Description Default
vial int

Target vial number (1-50)

required
volume int

Dispensing volume in µL

required
solvent_port int

Port number connected to solvent reservoir

required
transfer_line_volume Optional[int]

Volume of transfer line (uses config default if None)

None
bubble_volume int

Air bubble volume for separation

10
flush_needle Optional[int]

Optional needle flush volume in µL

None
speed Optional[int]

Flow rate in µL/min (uses config.speed_normal if None)

None
unload bool

Whether to unload vial after filling

True
wait Optional[int]

Optional wait time after dispensing (seconds)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Note

The system must first be prepared using prepare_batch_flow(). Large volumes are automatically split into multiple cycles.

Example

workflow.batch_fill( ... vial=20, ... volume=400, ... solvent_port=5, # Methanol ... bubble_volume=15, ... wait=2 ... ) [SI] Batch fill: Vial 20, Volume 400 µL, Port 5 [SI] Loading vial 20 to replenishment position... [SI] Aspirating 15 µL air bubble... [SI] Cycle 1/1: Aspirating 400 µL from port 5... [SI] Cycle 1/1: Transferring to line... [SI] Dispensing air bubble... [SI] Pushing with 600 µL air at high speed... [SI] Dispensing to vial 20... [SI] Waiting 2 seconds... [SI] Batch fill of vial 20 completed (400 µL)

batch_fill_multiple_solvents

batch_fill_multiple_solvents(vial: int, solvent_ports: List[int], volumes: List[int], air_push_volume: int = 15, transfer_line_volume: Optional[int] = None, speed: Optional[int] = None, solvent_speeds: Optional[List[int]] = None, air_speed: Optional[int] = None, flush_needle: Optional[int] = None, wash_vial: Optional[int] = None, unload: bool = True, wait: Optional[int] = None, verbose: Optional[bool] = None) -> None

Execute batch filling with multiple solvents from different ports.

This advanced method allows sequential dispensing of different solvents into a single vial, with air bubble separation between each solvent. Useful for creating solvent mixtures or adding reagents in sequence.

Parameters:

Name Type Description Default
vial int

Target vial number (1-50)

required
solvent_ports List[int]

List of port numbers for different solvents

required
volumes List[int]

List of volumes corresponding to each port (µL)

required
air_push_volume int

Air bubble volume between solvents (µL)

15
transfer_line_volume Optional[int]

Volume for final air push (uses config default if None)

None
speed Optional[int]

Default flow rate for liquid handling (µL/min)

None
solvent_speeds Optional[List[int]]

Optional list of speeds for each solvent (µL/min)

None
air_speed Optional[int]

Flow rate for air aspiration (uses config.speed_air if None)

None
flush_needle Optional[int]

Optional needle flush volume (µL)

None
wash_vial Optional[int]

Vial for needle washing (uses config default if None)

None
unload bool

Whether to unload vial after filling

True
wait Optional[int]

Optional wait time after dispensing (seconds)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None

Raises:

Type Description
ValueError

If port and volume lists don't match, or volumes are invalid

Example

workflow.batch_fill_multiple_solvents( ... vial=25, ... solvent_ports=[3, 5, 6], # DI water, methanol, buffer ... volumes=[300, 150, 50], # Different volumes for each ... solvent_speeds=[2000, 1500, 1000] # Custom speeds ... ) [SI] Multi-solvent batch fill: Vial 25, Total volume 500 µL from 3 ports [SI] Loading vial 25 to replenishment position... [SI] Solvent 1/3: Aspirating 15 µL air bubble... [SI] Solvent 1/3: Aspirating 300 µL from port 3 at 2000 µL/min... [SI] Solvent 2/3: Aspirating 150 µL from port 5 at 1500 µL/min... [SI] Solvent 3/3: Aspirating 50 µL from port 6 at 1000 µL/min... [SI] Final air push: 600 µL at 5000 µL/min... [SI] Multi-solvent batch fill completed: 500 µL total in vial 25

prepare_for_liquid_homogenization

prepare_for_liquid_homogenization(waste_vial: Optional[int] = None, transfer_line_volume: Optional[int] = None, meoh_flush_volume: Optional[int] = 20, air_bubble: Optional[int] = None, verbose: Optional[bool] = None) -> None

Prepare system for liquid-based homogenization operations.

This procedure flushes the transfer line and creates a protective air bubble in the holding coil. Used before liquid homogenization to ensure a clean system and prevent contamination of the holding coil.

Parameters:

Name Type Description Default
waste_vial Optional[int]

Waste vial number (uses config default if None)

None
transfer_line_volume Optional[int]

Volume to flush from transfer line (µL)

None
meoh_flush_volume Optional[int]

Optional methanol flush volume (µL), None to skip

20
air_bubble Optional[int]

Air bubble volume in holding coil (µL)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Example

workflow.prepare_for_liquid_homogenization(verbose=True) [SI] Preparing for liquid homogenization... [SI] Loading vial 50 to replenishment position... [SI] Flushing transfer line (600 µL)... [SI] Adding methanol flush (20 µL)... [SI] Creating air bubble (30 µL) in holding coil... [SI] System ready for liquid homogenization

homogenize_by_liquid_mixing

homogenize_by_liquid_mixing(vial: int, volume_aspirate: Optional[int] = None, num_cycles: Optional[int] = None, aspirate_speed: Optional[int] = None, dispense_speed: Optional[int] = None, wait_after_aspirate: Optional[float] = None, wait_after_dispense: Optional[float] = None, air_flush: Optional[int] = 10, clean_after: Optional[bool] = None, cleaning_solution_volume: Optional[int] = None, verbose: Optional[bool] = None) -> None

Homogenize sample by liquid aspiration and dispensing.

This gentle homogenization method mixes samples by repeatedly aspirating and dispensing liquid. It's suitable for sensitive samples that might be damaged by vigorous air bubble mixing, and provides precise control over mixing intensity.

Parameters:

Name Type Description Default
vial int

Target vial number (1-50)

required
volume_aspirate Optional[int]

Volume to aspirate per cycle (µL)

None
num_cycles Optional[int]

Number of mixing cycles

None
aspirate_speed Optional[int]

Speed for aspiration (µL/min)

None
dispense_speed Optional[int]

Speed for dispensing (µL/min)

None
wait_after_aspirate Optional[float]

Wait time after aspiration (seconds)

None
wait_after_dispense Optional[float]

Wait time after dispensing (seconds)

None
air_flush Optional[int]

Air volume to flush at end (µL), None to skip

10
clean_after Optional[bool]

Whether to clean transfer line after

None
cleaning_solution_volume Optional[int]

Volume for cleaning (µL)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None

Raises:

Type Description
ValueError

If aspirate volume exceeds syringe capacity

Example

workflow.homogenize_by_liquid_mixing( ... vial=15, ... volume_aspirate=400, ... num_cycles=3, ... aspirate_speed=1500, ... dispense_speed=2000, ... verbose=True ... ) [SI] Loading vial 15 for liquid homogenization... [SI] Cycle 1/3: Aspirating 400 µL at 1500 µL/min... [SI] Cycle 1/3: Dispensing at 2000 µL/min... [SI] Cycle 2/3: Aspirating 400 µL at 1500 µL/min... [SI] Cycle 2/3: Dispensing at 2000 µL/min... [SI] Cycle 3/3: Aspirating 400 µL at 1500 µL/min... [SI] Cycle 3/3: Dispensing at 2000 µL/min... [SI] Flushing needle with 10 µL air... [SI] Liquid homogenization of vial 15 completed

homogenize_by_air_mixing

homogenize_by_air_mixing(vial: int, volume_aspirate: Optional[int] = None, num_cycles: Optional[int] = None, aspirate_speed: Optional[int] = None, dispense_speed: Optional[int] = None, air_bubble_volume: Optional[int] = None, wait_between_cycles: float = 3.0, wait_after: float = 0, verbose: Optional[bool] = None) -> None

Homogenize sample using air bubble mixing.

This vigorous homogenization method creates air bubbles in the liquid for aggressive mixing. The air bubbles create turbulence and shearing forces that are effective for viscous samples or when thorough mixing is required.

Parameters:

Name Type Description Default
vial int

Target vial number (1-50)

required
volume_aspirate Optional[int]

Liquid volume to aspirate per cycle (µL)

None
num_cycles Optional[int]

Number of mixing cycles

None
aspirate_speed Optional[int]

Speed for liquid aspiration (µL/min)

None
dispense_speed Optional[int]

Speed for dispensing (µL/min)

None
air_bubble_volume Optional[int]

Air volume per cycle (µL)

None
wait_between_cycles float

Wait time between cycles for bubble mixing (seconds)

3.0
wait_after float

Final wait time after homogenization (seconds)

0
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None

Raises:

Type Description
ValueError

If total volume exceeds syringe capacity

Example

workflow.homogenize_by_air_mixing( ... vial=22, ... volume_aspirate=300, ... air_bubble_volume=50, ... num_cycles=2, ... wait_between_cycles=8.0, ... verbose=True ... ) [SI] Loading vial 22 for air bubble homogenization... [SI] Cycle 1/2: Aspirating 50 µL air... [SI] Cycle 1/2: Aspirating 300 µL liquid at 1500 µL/min... [SI] Cycle 1/2: Waiting 8.0 seconds for bubble mixing... [SI] Cycle 1/2: Dispensing mixture at 1500 µL/min... [SI] Cycle 2/2: Aspirating 50 µL air... [SI] Cycle 2/2: Aspirating 300 µL liquid at 1500 µL/min... [SI] Cycle 2/2: Waiting 8.0 seconds for bubble mixing... [SI] Cycle 2/2: Dispensing mixture at 1500 µL/min... [SI] Air bubble homogenization of vial 22 completed

clean_transfer_line_after_homogenization

clean_transfer_line_after_homogenization(waste_vial: Optional[int] = None, flush_volume: Optional[int] = 70, air_bubble: Optional[int] = 50, cleaning_solution_volume: Optional[int] = None, cleaning_solution_vial: Optional[int] = None, verbose: Optional[bool] = None) -> None

Clean transfer line after homogenization operations.

This comprehensive cleaning procedure removes sample residues from the transfer line using optional chemical cleaning followed by thorough rinsing and air bubble creation for system protection.

Parameters:

Name Type Description Default
waste_vial Optional[int]

Waste vial number (uses config default if None)

None
flush_volume Optional[int]

Volume to flush from syringe (µL)

70
air_bubble Optional[int]

Air bubble volume for holding coil protection (µL)

50
cleaning_solution_volume Optional[int]

Volume of cleaning solution (µL), None to skip

None
cleaning_solution_vial Optional[int]

Vial with cleaning solution (uses config default if None)

None
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Example

workflow.clean_transfer_line_after_homogenization( ... cleaning_solution_volume=350, ... verbose=True ... ) [SI] Aspirating air bubble before cleaning... [SI] Loading cleaning solution vial 47... [SI] Cleaning with 350 µL solution... [SI] Waiting 3.0 seconds for cleaning reaction... [SI] Flushing 70 µL to waste... [SI] Creating 50 µL air bubble in holding coil... [SI] Transfer line cleaning completed

flush_transfer_line_to_waste

flush_transfer_line_to_waste(transfer_line_volume: Optional[int] = None, air_push: int = 30, verbose: Optional[bool] = None) -> None

Quick flush of transfer line contents to waste.

Simple utility method to empty the transfer line without chemical cleaning. Useful for quick changeovers between incompatible solvents or when removing samples before system shutdown.

Parameters:

Name Type Description Default
transfer_line_volume Optional[int]

Volume to flush (µL, uses config default if None)

None
air_push int

Initial air volume for pushing (µL)

30
verbose Optional[bool]

Show status messages (uses config.verbose if None)

None
Example

workflow.flush_transfer_line_to_waste(verbose=True) [SI] Flushing transfer line to waste (600 µL)... [SI] Transfer line flushed to waste

get_system_status

get_system_status() -> Dict[str, Any]

Get current system status and configuration.

Returns:

Type Description
Dict[str, Any]

Dictionary containing system configuration and status information

Example

status = workflow.get_system_status() print(f"Syringe size: {status['syringe_size']} µL") print(f"Current speed setting: {status['config']['speed_normal']} µL/min") print(f"Interactive terminal: {status['interactive_terminal']}")

update_config

update_config(**kwargs) -> None

Update configuration parameters.

Parameters:

Name Type Description Default
**kwargs

Configuration parameters to update

{}
Example

workflow.update_config( ... speed_normal=1800, ... verbose=False, ... homogenization_liquid_cycles=3 ... )