ionique.datatypes
The datatypes module provides high-level data containers that build on the
segment tree from core.
TraceFile— wraps a loaded nanopore recording (current, voltage, metadata) as a tree node at rank"file". Automatically creates voltage- step children when voltage boundaries are provided.SessionFileManager— singleton root node that manages all loaded files in a session.
See Data Input for usage examples.
Data structure definitions and session file management for analysis.
- class ionique.datatypes.SessionFileManager(*args, **kwargs)
Bases:
MetaSegmentSingleton-based session manager for hierarchical data.
This class inherits from
MetaSegmentand uses theSingletonmetaclass to ensure only one instance exists during a given session. It serves as the root segment for a data analysis session and is responsible for managing metadata and registered “affectors” (i.e., objects that modify or interact with the session).- affector_table
Registry mapping UUID strings to metadata entries for each registered affector (class name, string representation, and timestamp).
- Type:
- __init__() None
Initialize the session manager.
Sets the session start time and prepares the affector log structure.
- add_child(child: AnySegment) None
Add a single child segment to the session’s hierarchy.
- Parameters:
child (AnySegment) – The segment to be added as a child.
- add_children(children: list[AnySegment]) None
Add multiple child segments to the session.
- Parameters:
children (list of AnySegment) – A list of segments to be added as children.
- register_affector(affector)
Register an affector object that influences the session data.
Records metadata including class name, string representation, and timestamp, and logs the event with a unique identifier.
- unique_features
- class ionique.datatypes.TraceFile(current: ndarray, voltage=None, rank='file', parent=None, unique_features: dict = {}, metadata: dict = {})
Bases:
SegmentData structure for representing a single trace file with current and optional voltage information.
This class inherits from
Segmentand encapsulates current and voltage data. It sets up segment metadata, defines parent-child hierarchy, and optionally initializes child segments based on voltage steps. If voltage steps are provided, corresponding child segments of rank"vstep"are created automatically.- Parameters:
current (numpy.ndarray) – Array of ionic current values.
voltage (list of tuple or None, optional) – List of
((start, end), voltage_value)tuples used to create child segments for each voltage step. Defaults to None.rank (str, optional) – Segment rank label. Defaults to
"file".parent (Segment or None, optional) – Parent segment to which this trace belongs. Defaults to None.
unique_features (dict, optional) – Dictionary of metadata such as sampling frequency. Defaults to an empty dict.
metadata (dict, optional) – Additional metadata. Defaults to an empty dict.
- __init__(current: ndarray, voltage=None, rank='file', parent=None, unique_features: dict = {}, metadata: dict = {})
Initialize the TraceFile and optionally create voltage-step child segments.
- delete()
Delete the current object, removing it from its parent
- plot(rank, axes, downsample_per_rank, color_per_rank)
Plot the trace data at a specified rank with per-rank styling options.
- Parameters:
Notes
Not yet implemented.