Skip to content

Commit

Permalink
updated comparison viz
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Aug 2, 2024
1 parent a776189 commit 4563e02
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 88 deletions.
32 changes: 14 additions & 18 deletions bio_check/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,31 +256,27 @@ def visualize_comparison(self, data: dict, simulators: list, comparison_type='pr
species_names = list(species_data_content.keys())
num_species = len(species_names)

fig, axes = plt.subplots(nrows=num_species, ncols=3, figsize=(20, 6 * num_species))
fig, axes = plt.subplots(nrows=num_species, figsize=(20, 6 * num_species))
true_color = '#228B22'
false_color = '#DC143C'

if num_species == 1:
axes = [axes]

for i, species_name in enumerate(species_names):
for j, simulator_name in enumerate(simulators):
ax = axes[i][j]
species_data = species_data_content[species_name]
comparison_data = [list(col.values()) for col in list(species_data[comparison_type].values())]
sns.heatmap(
data=comparison_data,
ax=ax,
xticklabels=simulators,
yticklabels=simulators,
cmap=[false_color, true_color],
linewidths=1,
vmin=0,
vmax=1

)

ax.set_title(f"{species_name} comparison matrix")
ax = axes[i]
species_data = species_data_content[species_name]
comparison_data = [list(col.values()) for col in list(species_data[comparison_type].values())]
sns.heatmap(
data=comparison_data,
ax=ax,
annot=True,
xticklabels=simulators,
yticklabels=simulators,
cmap=[false_color, true_color],
linewidths=1
)
ax.set_title(f"{species_name} comparison matrix")

plt.tight_layout()
plt.show()
Expand Down
140 changes: 70 additions & 70 deletions demos/bio_check_demo.ipynb

Large diffs are not rendered by default.

Binary file not shown.

0 comments on commit 4563e02

Please sign in to comment.