Skip to content

Commit

Permalink
Remove seaborn code
Browse files Browse the repository at this point in the history
  • Loading branch information
nandsra21 authored and huddlej committed Mar 20, 2024
1 parent 5f911cc commit 10959a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
install_requires=['numpy',
'pandas',
"biopython",
'seaborn',
'scikit-learn >=1.3,<1.5',
'umap-learn ==0.5.*',
# Pin Numba at maximum supported version for the pinned umap-learn version.
Expand Down
26 changes: 12 additions & 14 deletions src/pathogen_embed/pathogen_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import pandas as pd
import re
from scipy.spatial.distance import squareform, pdist
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE, MDS
import sys
Expand Down Expand Up @@ -337,12 +336,9 @@ def embed(args):
}

plot_df = pd.DataFrame(plot_data)
ax = sns.scatterplot(
data=plot_df,
x="x",
y="y",
alpha=0.5,
)
plt.scatter(plot_df["x"], plot_df["y"], alpha=0.5)
plt.xlabel("x")
plt.ylabel("y")
plt.savefig(args.output_figure)
plt.close()

Expand Down Expand Up @@ -371,13 +367,15 @@ def cluster(args):
plot_data["cluster"] = clusterer.labels_.astype(str)

plot_df = pd.DataFrame(plot_data)
ax = sns.scatterplot(
data=plot_df,
x="x",
y="y",
hue="cluster",
alpha=0.5,
)
clusters = plot_df['cluster'].unique()
colors = plt.cm.tab10.colors[:len(clusters)]
for i, cluster in enumerate(clusters):
cluster_data = plot_df[plot_df['cluster'] == cluster]
plt.scatter(cluster_data["x"], cluster_data["y"], color=colors[i], label=f'Cluster {cluster}', alpha=0.5)

plt.xlabel("x")
plt.ylabel("y")
plt.legend()
plt.savefig(args.output_figure)
plt.close()

Expand Down

0 comments on commit 10959a5

Please sign in to comment.