Open komodovaran opened 4 years ago
I thought of this during #18 , should we have it all in TransitionDensityPlot but have plots look different based on whether the hmm fit is global? And then make it look like this?
Dropping this here. Would be nice to have something like this too.
Right now we predict to the TraceContainer something like this (in the PG branch)
_X = trace.fret[
: trace.first_bleach
] # TODO This needs to change to choose DA vs E
tf = pd.DataFrame()
tf["e_obs"] = trace.fret[: trace.first_bleach]
tf["state"] = np.array(self.hmmModel.predict(_X)).astype(int)
tf["e_pred_global"] = (
tf["state"]
.astype(str)
.replace(
{k: v[0] for (k, v) in zip(state_dict.keys(), state_dict.values())},
inplace=False,
)
)
tf["e_pred_local"] = tf.groupby(["state"], as_index=False)[
"e_obs"
].transform("mean")
tf["time"] = tf["e_pred_local"].index + 1
trace.hmm_state = tf["state"].values
trace.hmm_local_fret = tf["e_pred_local"].values
trace.hmm_global_fret = tf["e_pred_global"].values
trace.hmm_idx = tf["time"].values
trace.calculate_transitions()
Should we start work on this to include proper TDPs with individualized idealizations as well? I know it goes against the logic of the HMM, but seeing as that is the going standard of the community, I think it might be a discussion worth having, if there is demand...
I was in a hurry, so I cannibalized the transition density plot feature for a global HMM fit, which should be the new key feature.
This needs better integration overall, and I'm thinking a plot of the transition matrix using
networkx
in a separate TransitionMatrixWindow?