kaist-amsg / LocalRetro

Retrosynthesis prediction for organic molecules with LocalRetro
81 stars 24 forks source link

How to extract template and retrosynthesis from scratch #14

Closed sitanshubhunia closed 1 year ago

sitanshubhunia commented 1 year ago

Respected Sir, Thanks for this valuable repo. Requesting you to guide how I start from scratch for a given set of reaction smiles ->extract template -> retrosynthesis. If possible please guide me with steps. I am not from a chemistry background just simple a technical guy.

Regards, Sitanshu

shuan4638 commented 1 year ago

Going through the demo noteboook should be helpful to understand how to use it. Let me know if you need further help.

sitanshubhunia commented 1 year ago

Thanks Sir for your reply. Trying to create virtual environment on windows 10, but stuck on "conda install -c conda-forge rdkit -y" For ref. I have attached screen shot.

Stuck

shuan4638 commented 1 year ago

Did you try pip install rdkit?

sitanshubhunia commented 1 year ago

Again thanks Sir. Now virtual env. is created.

Working

Let me try to other steps

sitanshubhunia commented 1 year ago

Sorry to disturb you again and again. I admitted that due to lack of my knowledge I am getting this error. If possible please help me for further steps.

issue

shuan4638 commented 1 year ago

Did you install dgl package in the same envinroment?

sitanshubhunia commented 1 year ago

Yes sir. FYI I have attached screen shots. Obviously I am doing something wrong. But not figure it out where .......

dgl


dgl

dgllife

dgllife

ipynb

ipyhton-run

The list of commands

conda create -c conda-forge -n rdenvNew python=3.7 -y conda activate rdenvNew conda install pytorch cudatoolkit=10.2 -c pytorch -y pip install rdkit [ as per your advice and successfully installed] pip install dgl pip install dgllife

shuan4638 commented 1 year ago

Can you make sure the Jupiter notebook you are running is using the same virtual environment you install those packages?

sitanshubhunia commented 1 year ago

Thanks Sir. I have to add two more pip install

  1. pip install jupyter
  2. pip install torch

jupyter is now running from same env.

yes

### After that I am getting following

error

After change device = torch.device('cpu')

I am getting following error cuda

My Environment is Windows 11 Pro

Directory structure

dirstructure

shuan4638 commented 1 year ago

@sitanshubhunia Did you solve the problem?

sitanshubhunia commented 1 year ago

No @shuan4638 Sir. I am unable to solve it.

I am also stuck in step 3 [3] Train LocalRetro model

train

### Stuck in this step. Nothing is saved in model folder.

stuck

shuan4638 commented 1 year ago

@sitanshubhunia The training process takes time, you may see the model file after the first epoch. You'll be able to use the python notebook once you obtain the model file.

sitanshubhunia commented 1 year ago

@shuan4638 Sir thanks for reply. Yes it's running. Still now .... image

I hope, I can run this after all steps done...

sitanshubhunia commented 1 year ago

@shuan4638 Sir, Finally I have successfully run Retrosynthesis.ipynb.

Requesting you to give the steps how to proceed, if I have only reaction smiles then how I able to use this model extract templates , generate other files and retrosynthesis.

I understand that this type of questions may be annoying to you.

This is not an issue. Just questions🙏

Thanks for your valuable works.

shuan4638 commented 1 year ago

LocalRetro is not the model to generate reaction template. Reaction template can be directly generated by the extract_from_reaction function defined here. Playing with this function should be helpful.