Commit 7af3a9d4 authored by Carine Rey's avatar Carine Rey
Browse files

reduce stringency + fix error if no transition at a leaf

parent 04865e0d
......@@ -171,7 +171,10 @@ for n in leaves_trans_node_ids:
'AA' : AA})
)
df_leaves = pd.concat(df_leaves_l)
if df_leaves_l:
df_leaves = pd.concat(df_leaves_l)
else:
df_leaves = pd.DataFrame()
#===================================================================================================
# Read proba per site table
......@@ -210,7 +213,7 @@ proba_df_melt_filtered = proba_df_melt.groupby(['Sites', 'node']).apply(lambda x
logger.info("Proba file (%s) ok after checking", ProbaFile.name)
df_prob_ok = pd.concat([proba_df_melt_filtered, df_leaves])
df_prob_ok = pd.concat([ df for df in [proba_df_melt_filtered, df_leaves] if not df.empty])
df_prob_ok.sort_values(by='Sites', inplace=True)
df_prob_ok.reset_index(drop=True,inplace=True)
......@@ -238,14 +241,12 @@ for n_T in t.search_nodes(Transition = "1"):
logger.debug(df_up_child)
df_T_l.append(df_up_child)
df_T = pd.concat(df_T_l)
df_T.sort_values(by='Sites', inplace=True)
df_T.reset_index(drop=True,inplace=True)
df_T_conv = df_T[df_T["AA_up"] != df_T["AA_child"]]
df_T_conv_filtered = df_T_conv[df_T_conv["prob"] > 0.5]
df_T_conv_filtered = df_T_conv[df_T_conv["prob"] > 0.1]
logger.info(df_T_conv_filtered)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment