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

Drop unwanted molecules #72

Open
velocirraptor23 opened this issue Jul 2, 2024 · 3 comments
Open

Drop unwanted molecules #72

velocirraptor23 opened this issue Jul 2, 2024 · 3 comments
Assignees

Comments

@velocirraptor23
Copy link

Hi,

I was wondering if there is a way to drop unwanted molecules after the toxicity prediction. Just to filter before to perfomr the conformer generation or the optimization. Might reduce the time of run.

Best wishes,

Cesar

@bieniekmateusz bieniekmateusz self-assigned this Jul 2, 2024
@bieniekmateusz
Copy link
Collaborator

This sounds like a useful feature.

ChemSpace has an attribute .df which is a pandas dataframe. That is basically its database. I think you should be able to overwrite it with:

cs.df = cs.df without all the toxicity

This could be a nice addition to the tutorial to show how to subtract the indices from the .toxicity(). Please let me know if you need help there, I should have a few minutes in the evening!

@velocirraptor23
Copy link
Author

I will try this. I will let you know if it worked.

Cesar

@velocirraptor23
Copy link
Author

velocirraptor23 commented Jul 9, 2024

I have tried this to drop bad molecules:

dft = pd.DataFrame(cs.toxicity())
list1 = dft.index[dft['has_unwanted_subs']==True].tolist()
list2 = dft.index[dft['has_pains']==True].tolist()
list3 = dft.index[dft['has_prob_fgs']==True].tolist()
list4 = dft.index[dft['synthetic_accessibility']< 6.5].tolist()
merged_list = list(set(list1+list2+list3+list4))
cs.df=cs.df.drop(merged_list, errors='ignore')

Seems to work at the moment.

Best wishes,

Cesar

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