connorcoley / rdchiral

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

Explicit hydrogens #32

Open kjelljorner opened 2 years ago

kjelljorner commented 2 years ago

We've encountered a case where we want to run a reaction with explicit hydrogens. From what I can see, the default behavior of rdchiral is to strip them at the stage of creating the reactants. Would it be possible to do just change that line to allow explicit hydrogens, or would that break things further along in the code?

https://github.com/connorcoley/rdchiral/blob/01cca8c7f5b0946187f47928738730040de06b16/rdchiral/initialization.py#L180

A possible change would be:

params = Chem.SmilesParserParams()
params.removeHs = False
reactants = Chem.MolFromSmiles(reactant_smiles, params)
kjelljorner commented 2 years ago

I made a fork with this change that we will test out: https://github.com/kjelljorner/rdchiral. Can open a pull request if needed.