Skip to content

Commit

Permalink
add option to consider only high s values
Browse files Browse the repository at this point in the history
  • Loading branch information
eruijsena committed Sep 29, 2023
1 parent aa46845 commit 3b0f1fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions reeds/function_libs/analysis/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,16 @@ def sampling_analysis(ene_trajs: List[pd.DataFrame],

return final_results, out_path

def analyse_state_transitions(repdat: Repdat, normalize: bool = False, bidirectional: bool = False):
def analyse_state_transitions(repdat: Repdat, min_s: int = None, normalize: bool = False, bidirectional: bool = False):
"""
Count the number of times a transition occurs between pairs of states, based on the repdat info.
Parameters
----------
repdat: Repdat
Redat object containing the information regarding the replica exchange trials in the
RE-EDS simulation.
min_s: int, optional
Index of the lowest s_value to consider for the transitions. If None, consider all s values.
normalize: bool, optional
Normalize the transitions by the total number of outgoing transitions per state
bidirectional: bool, optional
Expand Down Expand Up @@ -390,7 +392,10 @@ def analyse_state_transitions(repdat: Repdat, normalize: bool = False, bidirecti
transition_counts = np.zeros((num_states, num_states))

for replica in range(1, num_replicas+1):
state_repdat = enhanced_repdat.query(f"coord_ID == {replica}")
if min_s:
state_repdat = enhanced_repdat.query(f"coord_ID == {replica} & ID <= {min_s}")
else:
state_repdat = enhanced_repdat.query(f"coord_ID == {replica}")

state_trajectory = state_repdat[["Vmin", "run"]].reset_index(drop=True)

Expand Down

0 comments on commit 3b0f1fa

Please sign in to comment.