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
(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
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
Dear RDKit Community,
I have a quick question regarding a possibility of setting valence of an atom
in rdkit.
Let's say that I have a molecule like this (smiles notation): PPC or SSC and I
would like to change the valence of one or more S or P atoms from default II
for S or III for P to let's
4 matches
Mail list logo