Other Parsers
This page covers ionique’s specialized parsers. Each is briefly described with its parameters and a usage example.
FilterDerivativeSegmenter
Detects segment boundaries using the derivative of a lowpass-filtered signal. Sharp transitions produce large derivative values that cross a threshold.
Parameter |
Default |
Description |
|---|---|---|
|
|
Lower derivative threshold for transition detection. |
|
|
Upper derivative threshold. |
|
|
Lowpass cutoff (Hz) applied before derivative computation. |
|
|
Sampling frequency (Hz). |
from ionique.parsers import FilterDerivativeSegmenter
parser = FilterDerivativeSegmenter(
low_threshold=1.5,
high_threshold=3.0,
cutoff_freq=2000,
sampling_freq=100000,
)
trace.parse(parser, newrank="event", at_child_rank="vstep")
NoiseFilterParser
Classifies signal regions as clean or noisy based on local variance. Useful for excluding unstable portions of a trace before event detection.
Parameter |
Default |
Description |
|---|---|---|
|
|
Variance threshold for noise classification. |
|
|
If |
from ionique.parsers import NoiseFilterParser
# Keep only clean regions
parser = NoiseFilterParser(noise_threshold=60, detect_noise=False)
trace.parse(parser, newrank="clean", at_child_rank="vstep")
# Then parse events in clean regions only
trace.parse(event_parser, newrank="event", at_child_rank="clean")
snakebase_parser
Segments the signal based on peak-to-peak amplitude changes. Detects regions where the local amplitude exceeds a threshold.
Parameter |
Default |
Description |
|---|---|---|
|
|
Amplitude threshold for segmentation. |
from ionique.parsers import snakebase_parser
parser = snakebase_parser(threshold=1.5)
trace.parse(parser, newrank="event", at_child_rank="vstep")
ExclusionParser
Excludes specified time regions from analysis. The remaining (non-excluded) portions become child segments.
Parameter |
Default |
Description |
|---|---|---|
|
(required) |
List of |
from ionique.parsers import ExclusionParser
# Exclude two noisy time windows
parser = ExclusionParser(regions=[
(0.2, 0.4), # exclude 0.2–0.4 seconds
(1.2, 1.4), # exclude 1.2–1.4 seconds
])
trace.parse(parser, newrank="clean", at_child_rank="vstep")
lambda_event_parser
A rule-based parser that detects events using a simple threshold and optional filtering rules.
Parameter |
Default |
Description |
|---|---|---|
|
|
Current threshold for event detection (as percentage of baseline). |
|
|
List of callable rules for post-filtering. |
from ionique.parsers import lambda_event_parser
parser = lambda_event_parser(threshold=85)
trace.parse(parser, newrank="event", at_child_rank="vstep")
IVCurveParser and IVCurveAnalyzer
These two classes work together to extract current–voltage (IV) relationships from multi-voltage-step recordings.
IVCurveParser identifies the voltage protocol pattern:
from ionique.parsers import IVCurveParser
parser = IVCurveParser(voltage_array)
patterns = parser.parse()
# Returns matched voltage patterns for IV analysis
IVCurveAnalyzer computes mean current at each voltage level:
from ionique.parsers import IVCurveAnalyzer
analyzer = IVCurveAnalyzer(
current=current_array,
parent_segment=vstep,
sampling_frequency=100000,
method="simple",
)
iv_data = analyzer.analyze()
# Returns {voltage_value: (mean_current, std_current), ...}
MemoryParse
Reconstructs segments from precomputed boundaries. Useful for loading previously saved analysis results.
from ionique.parsers import MemoryParse
parser = MemoryParse(
starts=[1000, 3000, 7000],
ends=[1500, 3800, 7200],
)
trace.parse(parser, newrank="event", at_child_rank="vstep")