SOAPify.transitions.tracker
This submodule contains the function to build and work with the ‘state trackers’: a state tracker is a list of 4-element arrays whose components represent an ‘event’: [previous state ID, current state ID, next state ID, the duration of the event]
In the module there is some logic to help to the user to understand if the event is a ‘first one’ or a ‘last one’ (aka the first/las seen in the simulation for each atom): a first one will have previous state ID = current state ID and a last one will have next state ID = current state ID
Module Attributes
the index of the component of the statetracker with the previous state |
|
the index of the component of the statetracker with the current state |
|
the index of the component of the statetracker with the next state |
|
the index of the component of the statetracker with the duration of the state, in frames |
Functions
Calculates the resindence times from the events. |
|
|
Merge all of the list of stateTracker into a single lists, by removing the information of what atom did a given event. |
|
Creates an ordered list of events for each atom in the classified trajectory |
Generates the unnormalized matrix of the transitions |
Classes
|
A contained for the state trackers |
- class SOAPify.transitions.tracker.StateTracker(nat, window, stride)[source]
Bases:
objectA contained for the state trackers
- SOAPify.transitions.tracker.TRACK_CURSTATE = 1
the index of the component of the statetracker with the current state
- SOAPify.transitions.tracker.TRACK_ENDSTATE = 2
the index of the component of the statetracker with the next state
- SOAPify.transitions.tracker.TRACK_EVENTTIME = 3
the index of the component of the statetracker with the duration of the state, in frames
- SOAPify.transitions.tracker.TRACK_PREVSTATE = 0
the index of the component of the statetracker with the previous state
- SOAPify.transitions.tracker.getResidenceTimesFromStateTracker(statesTracker, legend)[source]
Calculates the resindence times from the events.
Given a state tracker and the list of the states returns the list of residence times per state
- Parameters
- Returns
an ordered list of the residence times for each state
- Return type
- SOAPify.transitions.tracker.removeAtomIdentityFromEventTracker(statesTracker)[source]
Merge all of the list of stateTracker into a single lists, by removing the information of what atom did a given event.
- Parameters
statesTracker (list) – a list of list of state trackers, organized by atoms
statesTracker – a list of list of state trackers, organized by atoms
- Returns
a state tracker
- Return type
- SOAPify.transitions.tracker.trackStates(classification, window=1, stride=None)[source]
Creates an ordered list of events for each atom in the classified trajectory
each tracker is composed of events, each events is and array of foir components: [start state, state, end state,time]:
if PREVSTATE == CURSTATE is the first event for the atom
if ENDSTATE == CURSTATE is the last event for the atom
- Parameters
classification (SOAPclassification) – the classified trajectory
stride (int) – the stride in frames between each window. Defaults to 1.
- Returns
ordered list of events for each atom in the classified trajectory
- Return type
- SOAPify.transitions.tracker.transitionMatrixFromStateTracker(statesTracker, legend)[source]
Generates the unnormalized matrix of the transitions
see
calculateTransitionMatrix()for a detailed description of an unnormalized transition matrix- Parameters
statesTracker (StateTracker) – a StateTracker
legend (list) – the list of the name of the states
- Returns
the unnormalized matrix of the transitions
- Return type