14.1.6. Event Processing¶
14.1.6.1. mosaic.process.adept2State module¶
digraph inheritance1604056825 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "adept2State.adept2State" [URL="#mosaic.process.adept2State.adept2State",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Analyze an event that is characteristic of PEG blockades. This method includes system "]; "metaEventProcessor.metaEventProcessor" -> "adept2State.adept2State" [arrowsize=0.5,style="setlinewidth(0.5)"]; "adept2State.datblock" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Smart data block that holds time-series data and keeps track"]; "metaEventProcessor.metaEventProcessor" [URL="mosaic.meta.html#mosaic.process.metaEventProcessor.metaEventProcessor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip=".. warning:: |metaclass|"]; }A class that extends metaEventProcessing to implement the step response algorithm from []
- Created:
4/18/2013
- Author:
Arvind Balijepalli <arvind.balijepalli@nist.gov>
- License:
See LICENSE.TXT
- ChangeLog:
- class mosaic.process.adept2State.adept2State(icurr, icurrU, Fs, **kwargs)[source]¶
Bases:
metaEventProcessor
Analyze an event that is characteristic of PEG blockades. This method includes system information in the analysis, specifically the filtering effects (throught the RC constant) of either amplifiers or the membrane/nanopore complex. The analysis generates several parameters that are stored as metadata including:
Blockade depth: the ratio of the open channel current to the blocked current
Residence time: the time the molecule spends inside the pore
Tau: the RC constant of the response to a step input (e.g. the entry or exit of the molecule into or out of the nanopore).
- Keyword Args:
- In addition to
metaEventProcessor
args, FitTol : Tolerance value for the least squares algorithm that controls the convergence of the fit (Default: 1e-7).
FitIters : Maximum number of iterations before terminating the fit (Default: 50000).
LinkRCConst : When True, the RC constants associated with each state in the fit function are varied together. (Default: True)
- In addition to
- Errors:
When an event cannot be analyzed, the blockade depth, residence time and rise time are set to -1.
14.1.6.2. mosaic.process.adept module¶
digraph inheritance9935b48c28 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "adept.InvalidEvent" [URL="#mosaic.process.adept.InvalidEvent",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "adept.adept" [URL="#mosaic.process.adept.adept",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Analyze a multi-step event that contains two or more states. This method includes system "]; "metaEventProcessor.metaEventProcessor" -> "adept.adept" [arrowsize=0.5,style="setlinewidth(0.5)"]; "metaEventProcessor.metaEventProcessor" [URL="mosaic.meta.html#mosaic.process.metaEventProcessor.metaEventProcessor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip=".. warning:: |metaclass|"]; }Analyze a multi-step event
- Created:
4/18/2013
- Author:
Arvind Balijepalli <arvind.balijepalli@nist.gov>
- License:
See LICENSE.TXT
- ChangeLog:
- class mosaic.process.adept.adept(icurr, icurrU, Fs, **kwargs)[source]¶
Bases:
metaEventProcessor
Analyze a multi-step event that contains two or more states. This method includes system information in the analysis, specifically the filtering effects (through the RC constant) of either amplifiers or the membrane/nanopore complex. The analysis generates several parameters that are stored as metadata including:
Blockade depth: the ratio of the open channel current to the blocked current
Residence time: the time the molecule spends inside the pore
Tau: the RC constant of the response to a step input (e.g. the entry or exit of the molecule into or out of the nanopore).
- Keyword Args:
- In addition to
metaEventProcessor
args, StepSize : The multiple of the standard deviations considered significant to dtecting an event (default: 3.0).
MinStateLength : minimum number of data points required to assign a state within an event (default: 4)
MaxEventLength : maximum length (in data points) of events that will be processed (default: 10000)
FitTol : fit tolerance for convergence (default: 1.e-7)
FitIters : maximum fit iterations (default: 5000)
LinkRCConst : When True, the RC constants associated with each state in the fit function are varied together. (Default: True)
- In addition to
- Errors:
When an event cannot be analyzed, all metadata are set to -1.
14.1.6.3. mosaic.process.cusumPlus module¶
digraph inheritance6c5c146ee6 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "cusumPlus.InvalidEvent" [URL="#mosaic.process.cusumPlus.InvalidEvent",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "cusumPlus.cusumPlus" [URL="#mosaic.process.cusumPlus.cusumPlus",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="CUSUM+ will detect jumps that are smaller than `StepSize`, but they will have to be sustained longer. Threshold can be thought of, very roughly, as proportional to the length of time a subevent must be sustained for it to be detected. The algorithm will adjust the actual threshold used on a per-event basis in order to minimize false positive detection of current jumps This algorithm is based on code used in OpenNanopore, which you can read about here: http://pubs.rsc.org/en/Content/ArticleLanding/2012/NR/c2nr30951c#!divAbstract"]; "metaEventProcessor.metaEventProcessor" -> "cusumPlus.cusumPlus" [arrowsize=0.5,style="setlinewidth(0.5)"]; "cusumPlus.datblock" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Smart data block that holds a time-series of data and keeps track"]; "metaEventProcessor.metaEventProcessor" [URL="mosaic.meta.html#mosaic.process.metaEventProcessor.metaEventProcessor",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip=".. warning:: |metaclass|"]; }Analyze a multi-step event with the CUSUM+ algorithm. Implements a modified version of the CUSUM algorithm (used by OpenNanopore for example) in MOSAIC. This approach sacrifices including system information in the analysis in favor of much faster fitting of single- and multi-level events.
- Created:
2/10/2015
- Author:
Kyle Briggs <kbrig035@uottawa.ca>
- License:
See LICENSE.TXT
- ChangeLog:
- class mosaic.process.cusumPlus.cusumPlus(icurr, icurrU, Fs, **kwargs)[source]¶
Bases:
metaEventProcessor
CUSUM+ will detect jumps that are smaller than StepSize, but they will have to be sustained longer. Threshold can be thought of, very roughly, as proportional to the length of time a subevent must be sustained for it to be detected. The algorithm will adjust the actual threshold used on a per-event basis in order to minimize false positive detection of current jumps This algorithm is based on code used in OpenNanopore, which you can read about here: http://pubs.rsc.org/en/Content/ArticleLanding/2012/NR/c2nr30951c#!divAbstract
Some known issues with CUSUM+:
If the duration of a sub-event is shorter than than the MinLength parameter, CUSUM+ will be unable to detect it. CUSUM+ will not detect events within MinLength of a previous event.
CUSUM assumes an instantaneous transition between current states. As a result, if the RC rise time of the system is large, CUSUM+ can trigger and detect intermediate states during the change time. This can be avoided by choosing a number of samples to skip equal to about 2-5RC.
As a consequence of using a statistical t-test, CUSUM can have false positives. The algorithm has an adaptive threshold that tries to minimize the chances of this happening while maintaining good sensitivity (expected number of false positives within an event is less than 1).
- Keyword Args:
- In addition to
metaEventProcessor
args, StepSize : The number of baseline standard deviations are considered significant (3 is usually a good starting point).
MinThreshold : One of two sensitivity parameters (lower is more sensitive). A good starting point is to set MinThreshold equal to StepSize.
MaxThreshold : One of two sensitivity parameters (lower is more sensitive). Set MaxThreshold about 3x higher than MinThreshold.
MinLength : The number of samples to skip after detecting a jump, in order to avoid triggering during the rise time and returning an artificially high number of states. This number of points is also skipped when averaging levels. About 4 times the RC constant of the system is a good starting value.
- In addition to
- Errors:
When an event cannot be analyzed, all metadata are set to -1.
To use it requires four settings:
"cusumPlus": { "StepSize": 3.0, "MinThreshold": 3.0, "MaxThreshold": 10.0, "MinLength" : 10, }