Digital Interval Group
Overview
This transform groups nearby intervals in a digital interval series based on a specified maximum spacing, which is useful for consolidating fragmented temporal events.
Detailed Description
This transform merges digital intervals that are close to each other. If the gap between the end of one interval and the start of the next is less than or equal to the max_spacing
value, the two intervals are combined into a single, larger interval. This process is repeated until no more intervals can be grouped.
This is particularly useful for cleaning up data where a single continuous event might be recorded as multiple, closely-spaced but separate intervals due to noise or transient interruptions in signal detection.
Neuroscience Use Cases
In neuroscience, this transform can be applied to refine event data:
- Bout Analysis: When analyzing behaviors that occur in bouts (e.g., sniffing, grooming, vocalizations), this transform can merge closely spaced, individual instances into a single, continuous behavioral bout. For example, a series of short sniffs could be grouped into one “sniffing bout”.
Parameters
This transform has the following parameter:
max_spacing
: The maximum allowed gap between two consecutive intervals for them to be merged. The time unit should be consistent with the data’s time representation (e.g., seconds or frames). If the gap is greater than this value, the intervals remain separate.
Example Configuration
Here is a complete example of a JSON configuration file that could be used to run this transformation. This example groups intervals that are separated by 3.0 time units or less.
[
{
"transformations": {
"metadata": {
"name": "Interval Grouping Pipeline",
"description": "Test interval grouping on digital interval series",
"version": "1.0"
},
"steps": [
{
"step_id": "1",
"transform_name": "Group Intervals",
"phase": "analysis",
"input_key": "test_intervals",
"output_key": "grouped_intervals",
"parameters": {
"max_spacing": 3.0
}
}
]
}
}
]