Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualize_chemspace is missing #13

Open
suneelbvs opened this issue Apr 12, 2024 · 1 comment
Open

visualize_chemspace is missing #13

suneelbvs opened this issue Apr 12, 2024 · 1 comment

Comments

@suneelbvs
Copy link

Hi,

I have been trying to plot scaffold split using visualize_chemspace (as mentioned in the tutorial). visualize_chemspace code is not there in utili.py. Is it changed?

@cwognum
Copy link
Contributor

cwognum commented Apr 12, 2024

Hi @suneelbvs ! It is not part of the official Splito code-base, but rather a utility function that is defined specifically for the tutorials.

See:

def visualize_chemspace(data: pd.DataFrame, split_names: List[str], mol_col: str = "smiles", size_col=None):
figs = plt.figure(num=3)
features = [dm.to_fp(mol) for mol in data[mol_col]]
embedding = umap.UMAP().fit_transform(features)
data["UMAP_0"], data["UMAP_1"] = embedding[:, 0], embedding[:, 1]
for split_name in split_names:
plt.figure()
fig = sns.scatterplot(data=data, x="UMAP_0", y="UMAP_1", style=size_col, hue=split_name, alpha=0.7)
fig.set_title(f"UMAP Embedding of compounds for {split_name}")
return figs

I don't think this function should be part of the official Splito code base since it is not directly relevant to splitting, but if you feel otherwise I would be happy to discuss this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants