Skip to content
Snippets Groups Projects
Commit 603951e9 authored by Andrey Aristov's avatar Andrey Aristov
Browse files

update n_max

parent c765d50d
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ def combine(table_day1_path, table_day2_path, table_output_path, swarmplot_outpu ...@@ -12,7 +12,7 @@ def combine(table_day1_path, table_day2_path, table_output_path, swarmplot_outpu
day1.loc[:,'final_state'] = day1.n_cells_final > threshold day1.loc[:,'final_state'] = day1.n_cells_final > threshold
day1.to_csv(table_output_path, index=None) day1.to_csv(table_output_path, index=None)
n_max = int(day1.n_cells.mean() * 3) n_max = int(day1.n_cells.mean()) * 3 + 1
plot_swarm_counts(day1, n_max=n_max, path=swarmplot_output_path) plot_swarm_counts(day1, n_max=n_max, path=swarmplot_output_path)
plot_swarm_intensity(day1, n_max=n_max, path=swarmplot_output_path.replace('.png', '_intensities.png')) plot_swarm_intensity(day1, n_max=n_max, path=swarmplot_output_path.replace('.png', '_intensities.png'))
plot_probs(day1, n_max=n_max,path=prob_plot_path) plot_probs(day1, n_max=n_max,path=prob_plot_path)
...@@ -20,23 +20,23 @@ def combine(table_day1_path, table_day2_path, table_output_path, swarmplot_outpu ...@@ -20,23 +20,23 @@ def combine(table_day1_path, table_day2_path, table_output_path, swarmplot_outpu
def plot_swarm_counts(table:pd.DataFrame, n_max:int=5, path=None): def plot_swarm_counts(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300) fig, ax = plt.subplots(dpi=300)
sns.swarmplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='n_cells_final', hue='n_cells', dodge=True, size=1 ) sns.swarmplot(ax=ax, data=table.query(f'n_cells <= {n_max}'), x='[AB]', y='n_cells_final', hue='n_cells', dodge=True, size=1 )
fig.savefig(path) fig.savefig(path)
def plot_swarm_intensity(table:pd.DataFrame, n_max:int=5, path=None): def plot_swarm_intensity(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300) fig, ax = plt.subplots(dpi=300)
sns.swarmplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='intensity_final', hue='n_cells', dodge=True, size=1 ) sns.swarmplot(ax=ax, data=table.query(f'n_cells <= {n_max}'), x='[AB]', y='intensity_final', hue='n_cells', dodge=True, size=1 )
fig.savefig(path) fig.savefig(path)
def plot_probs(table:pd.DataFrame, n_max:int=5, path=None): def plot_probs(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300) fig, ax = plt.subplots(dpi=300)
sns.lineplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='final_state', hue='n_cells') sns.lineplot(ax=ax, data=table.query(f'n_cells <= {n_max}'), x='[AB]', y='final_state', hue='n_cells')
fig.savefig(path) fig.savefig(path)
def plot_probs_log(table:pd.DataFrame, n_max:int=5, path=None): def plot_probs_log(table:pd.DataFrame, n_max:int=5, path=None):
fig, ax = plt.subplots(dpi=300) fig, ax = plt.subplots(dpi=300)
sns.lineplot(ax=ax, data=table.query(f'n_cells < {n_max}'), x='[AB]', y='final_state', hue='n_cells') sns.lineplot(ax=ax, data=table.query(f'n_cells <= {n_max}'), x='[AB]', y='final_state', hue='n_cells')
ax.set_xscale('log') ax.set_xscale('log')
fig.savefig(path) fig.savefig(path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment