connorcoley / rdchiral

Wrapper for RDKit's RunReactants to improve stereochemistry handling
MIT License
151 stars 50 forks source link

extract_from_reaction error #37

Open milktea-lab opened 2 years ago

milktea-lab commented 2 years ago

When i extract template from my reaction: single product and single reactant, but i got a template with more than one products and reactants. input: 'reactants': '[N:1]#[C:2][CH2:3][N:4]1[CH2:5][CH2:6]CH:7[CH2:10][CH2:11][O:12][c:13]1[cH:14][cH:15][cH:16][cH:17][c:18]1[F:19]', 'products': '[NH2:1][CH2:2][CH2:3][N:4]1[CH2:5][CH2:6]CH:7[CH2:10][CH2:11][O:12][c:13]1[cH:14][cH:15]c:16[F:19]'

the template i got:

there has "." in both sides of the template.

and when i apply the template on the initial product: [NH2:1][CH2:2][CH2:3][N:4]1[CH2:5][CH2:6]CH:7[CH2:10][CH2:11][O:12][c:13]1[cH:14][cH:15]c:16[F:19] the error i got: ValueError: ChemicalParserException: Number of reactants provided does not match number of reactant templates.

connorcoley commented 2 years ago

Your reactants and products aren't valid SMILES strings, so I'm not sure how to help you debug this.

But, I will say that the templates that RDChiral applies are treated as pseudo-unimolecular regardless of how many fragments appear in the input side. Your template probably has multiple fragments because your presumably-unimolecular reaction has multiple subgraphs that change but are disconnected.

milktea-lab commented 2 years ago

I get it! Thanks for your help!