Skip to content

Commit

Permalink
further refined plots and added azoles plot
Browse files Browse the repository at this point in the history
  • Loading branch information
hechth committed Nov 14, 2023
1 parent ad6abcc commit b574e52
Show file tree
Hide file tree
Showing 24 changed files with 1,880 additions and 484 deletions.
Binary file modified analysis/Python_scripts/boxplot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Benzenoids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Organic nitrogen compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Organic oxygen compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Organohalogen compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Organoheterocyclic compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Organophosphorus compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/boxplot_Organosulfur compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added analysis/Python_scripts/boxplot_superclass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions analysis/Python_scripts/chemical_composition_boxplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@
"mdf_N_p1 = split_and_add_rows(mdf_N, 'true_names', split_by=', ')\n",
"mdf_N_p1 = mdf_N_p1.sort_values(by=['true_names'])\n",
"\n",
"create_plot(mdf_N_p1, '../Python_scripts/chemical_composition_boxplot_N.png', \"true_names\")\n",
"create_plot(mdf_N_p1, '../Python_scripts/chemical_composition_boxplot_N.png', \"true_names\", \"Chemical composition\")\n",
"\n",
"# without Nitrogen plot 1\n",
"mdf_p1 = split_and_add_rows(mdf, 'true_names', split_by=', ')\n",
"mdf_p1 = mdf_p1.sort_values(by=['true_names'])\n",
"mdf_p1['true_names'].replace(to_replace=\"C,O,N,H\", value=\"C,O,H\", inplace=True)\n",
"\n",
"create_plot(mdf_p1, '../Python_scripts/chemical_composition_boxplot.png', \"true_names\")"
"create_plot(mdf_p1, '../Python_scripts/chemical_composition_boxplot.png', \"true_names\", \"Chemical composition\")"
]
},
{
Expand Down Expand Up @@ -229,13 +229,13 @@
"mdf_p2 = generate_combinations(mdf, 'true_names')\n",
"mdf_p2 = mdf_p2.sort_values(by=['true_names'])\n",
"\n",
"create_plot(mdf_p2, '../Python_scripts/chemical_composition_boxplot2.png', \"true_names\")\n",
"create_plot(mdf_p2, '../Python_scripts/chemical_composition_boxplot2.png', \"true_names\", \"Chemical composition\")\n",
"\n",
"# with Nitrogen plot 2\n",
"mdf_N_p2 = generate_combinations(mdf_N, 'true_names')\n",
"mdf_N_p2 = mdf_N_p2.sort_values(by=['true_names'])\n",
"\n",
"create_plot(mdf_N_p2, '../Python_scripts/chemical_composition_boxplot2_N.png', \"true_names\")"
"create_plot(mdf_N_p2, '../Python_scripts/chemical_composition_boxplot2_N.png', \"true_names\", \"Chemical composition\")"
]
}
],
Expand Down
60 changes: 22 additions & 38 deletions analysis/Python_scripts/classes_boxplot.ipynb

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions analysis/Python_scripts/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def plot_histogram(x, xaxis_title='', title=''):
# Display the plot
fig.show()

def create_plot(df, path, grouping_column):
def create_plot(df, path, grouping_column, xlabel):
sns.set_style(style='white')
plt.figure(figsize=(17, 5))

Expand All @@ -107,7 +107,8 @@ def create_plot(df, path, grouping_column):
# ax.set_ylim([0, 5]) # Set y-axis limits
# ax.yaxis.set_major_locator(plt.MultipleLocator(1)) # Set major tick marks
ax.set_ylabel('Match values', fontsize=20) # Set y-axis label
ax.set_xlabel('Chemical composition', fontsize=20) # Set x-axis label and font size
if xlabel:
ax.set_xlabel(xlabel, fontsize=20) # Set x-axis label and font size
ax.tick_params(axis='x', labelsize=13) # Set font size of x-axis tick labels
# ax.tick_params(axis='y', labelsize=13) # Set font size of y-axis tick labels
# ax.yaxis.labelpad = 10
Expand Down Expand Up @@ -140,15 +141,17 @@ def create_plot(df, path, grouping_column):


def scatterplot_matplotlib(df):
plt.figure(figsize=(18, 8))
fig = plt.figure(figsize=(18, 6))
scatter = plt.scatter(
df['CosineHungarian_0.01_0.0_1.0_scores'],
df['CosineHungarian_0.01_0.0_1.0_matches'],
s=df['FractionQuery'] * 200, # Adjust the size scaling factor as needed
c=df['FractionReference'],
cmap='viridis', # change the colorscale as needed
alpha=0.5
)
df['CosineHungarian_0.01_0.0_1.0_scores'],
df['CosineHungarian_0.01_0.0_1.0_matches'],
s=df['FractionQuery'] * 200, # Adjust the size scaling factor as needed
c=df['FractionReference'] * 100,
cmap='viridis', # change the colorscale as needed
alpha=0.5,
vmin=0,
vmax=100
)
plt.colorbar(scatter).set_label('Reference Matched %')
plt.xlabel('Score')
plt.ylabel('Matches')
Expand All @@ -158,5 +161,4 @@ def scatterplot_matplotlib(df):
for size in sizes:
plt.scatter([], [], c='c', alpha=0.5, s=size * 2 , label=str(size))
plt.legend(scatterpoints=1, title='Query Matched %', labelspacing=1, loc='upper left')

plt.show()
return fig
2,270 changes: 1,840 additions & 430 deletions analysis/Python_scripts/scatterplot.ipynb

Large diffs are not rendered by default.

Binary file modified analysis/Python_scripts/scatterplot_Benzenoids.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified analysis/Python_scripts/scatterplot_Organohalogen compounds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added analysis/Python_scripts/scatterplot_all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added analysis/Python_scripts/scatterplot_azoles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b574e52

Please sign in to comment.