torchdrug icon indicating copy to clipboard operation
torchdrug copied to clipboard

Retrosynthesis Example

Open vthost opened this issue 2 years ago • 5 comments

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?

vthost avatar Apr 03 '22 13:04 vthost

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

shichence avatar Apr 03 '22 15:04 shichence

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")})

vthost avatar Apr 03 '22 15:04 vthost

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

shichence avatar Apr 03 '22 16:04 shichence

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.

vthost avatar Apr 03 '22 17:04 vthost

@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.

zqsaudience avatar Sep 22 '23 06:09 zqsaudience