Re: [Rdkit-discuss] setting valence of choice to S and P atoms in rdkit

2017-06-21 Thread Janusz Petkowski
0777-6977> From: Ling Chan [lingtrek...@gmail.com] Sent: Tuesday, June 20, 2017 9:51 PM To: Janusz Petkowski Cc: rdkit-discuss@lists.sourceforge.net Subject: Re: [Rdkit-discuss] setting valence of choice to S and P atoms in rdkit Hello Janusz, Perhaps you have answered your own question? Y

Re: [Rdkit-discuss] setting valence of choice to S and P atoms in rdkit

2017-06-21 Thread Paolo Tosco
(CC'ing the list as I hadn't in my original reply) Dear Janusz, this is what I would do: >>> from rdkit import Chem >>> mol = Chem.MolFromSmiles('SSC') >>> print Chem.MolToSmiles(mol) CSS >>> print Chem.MolToSmiles(mol, allHsExplicit=True) [CH3][S][SH] >>> a = mol.GetAtomWithIdx(1) >>> print

Re: [Rdkit-discuss] setting valence of choice to S and P atoms in rdkit

2017-06-20 Thread Ling Chan
Hello Janusz, Perhaps you have answered your own question? You can start with Smiles like "[H][SH3](C)[SH5]". Otherwise you could use the SetNumExplicitHs() function. For example, m = Chem.MolFromSmiles('CS') m.GetAtomWithIdx(1).SetNumExplicitHs(5) AllChem.SanitizeMol(m) print