DeepGraphLearning / torchdrug

A powerful and flexible machine learning platform for drug discovery
https://torchdrug.ai/
Apache License 2.0
1.42k stars 198 forks source link

Retrosynthesis Example #86

Open vthost opened 2 years ago

vthost commented 2 years ago

Thank you for providing this nice library! We have tried for quite some time to get the retrosynthesis example to work with a simple SMILES string but have failed terribly. Could you maybe help out by listing the changes we have to make in the code and in the steps described in the tutorial in order to make the library applicable beyond USPTO50k?

shichence commented 2 years ago

Hi, Could you please share the codes you use to generate predictions for simple SMILES?

vthost commented 2 years ago

We basically used the tutorial and then:

        mol = data.PackedMolecule.from_smiles([mol_smiles])
        mol.num_relation = 4
        predictions, num_prediction = self.task.predict(
            {'graph': [None, mol],
             'reaction': torch.tensor([100], device='cpu'),
             'sample id': torch.tensor([30], device="cpu")})
shichence commented 2 years ago

Hi, Can you please check the following tutorial written in Colab? You may need to run the tutorial on your own machine. Please make sure the batch you provided is consistent with the batch provided in the last session in the tutorial. https://colab.research.google.com/drive/1IH1hk7K3MaxAEe5m6CFY7Eyej3RuiEL1?usp=sharing

vthost commented 2 years ago

Thank you! I think this is the code I have and this runs. But it's using the reaction_valid data. We would like to run the model on other molecules which are not in USPTO50k, but there are several issues (and we do not know how to resolve some) when we try this with the tutorial code.

zqsaudience commented 10 months ago

@shichence Hi! I have the same issue. When i want to run the model on other molecules,such as smiles='N#Cc1ccc(-n2ccc3ccccc32)cc1C#N',i do not know how to load the data.