Re: [Rdkit-discuss] RD Kit PostgreSQL in a container

2019-12-12 Thread Tim Dudgeon

you might want to look at these that we're been using for several years:
https://hub.docker.com/r/informaticsmatters/rdkit-cartridge-debian/tags

This the GitHub repo for this and several other flavours of RDKit 
container images:

https://github.com/InformaticsMatters/docker-rdkit

Tim

On 04/12/2019 18:36, Webster Homer wrote:


I’m looking at running  RD Kit Postgresql cartridge in a docker 
container. Has anyone done this? There are PostgreSQL containers 
available on line at https://hub.docker.com/_/postgres if there is an 
existing dockerfile with the RDKit extension, that would be great.


If not has anyone built one? Ideally I’d start from one of the 
existing dockerfiles.


RDKit Postgresql in the current distribution is version 11.2, the 
dockerfiles on the hub include an 11 and an 11.6 version. Any idea as 
to which one to use?


I’m new to dockerfiles, I’d appreciate any suggestions

Regards,

Webster Homer

This message and any attachment are confidential and may be privileged 
or otherwise protected from disclosure. If you are not the intended 
recipient, you must not copy this message or attachment or disclose 
the contents to any other person. If you have received this 
transmission in error, please notify the sender immediately and delete 
the message and any attachment from your system. Merck KGaA, 
Darmstadt, Germany and any of its subsidiaries do not accept liability 
for any omissions or errors in this message which may arise as a 
result of E-Mail-transmission or for damages resulting from any 
unauthorized changes of the content of this message and any attachment 
thereto. Merck KGaA, Darmstadt, Germany and any of its subsidiaries do 
not guarantee that this message is free of viruses and does not accept 
liability for any damages caused by any virus transmitted therewith. 
Click http://www.merckgroup.com/disclaimer to access the German, 
French, Spanish and Portuguese versions of this disclaimer.



___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Clearing isotope info

2019-12-12 Thread Andrew Dalke
On Dec 12, 2019, at 17:39, Rafal Roszak  wrote:
> I also had situation when I need to generate smiles with either
> isotopes or stereochemistry but not both. Maybe it is worth to add two
> options to ChemMolToSmiles function:
> 
> dontIncludeStereochemistry=True/False
> dontIncludeIsotopes=True/False
> 
> Right now it is not straightforward to generate smiles w/o isotopes
> (but with stereochemistry) - one need to remove isotope, export to
> smiles and restore isotopes.

Bear in mind a few complications. I believe the following correctly implements 
what you describe:

from rdkit import Chem

def MolWithoutIsotopesToSmiles(mol):
  atom_data = [(atom, atom.GetIsotope()) for atom in mol.GetAtoms()]
  for atom, isotope in atom_data:
  if isotope:
  atom.SetIsotope(0)
  smiles = Chem.MolToSmiles(mol)
  for atom, isotope in atom_data:
  if isotope:
  atom.SetIsotope(isotope)
  return smiles


>>> mol = Chem.MolFromSmiles("[19F][13C@H]([16OH])[35Cl]")
>>> MolWithoutIsotopesToSmiles(mol)
'O[C@@H](F)Cl'

Testing reveals two problems with my implementation:

1) isotopic hydrogens 

Consider the same structure with tritium instead of fluorine:

>>> mol = Chem.MolFromSmiles("[3H][13C@H]([16OH])[35Cl]")
>>> MolWithoutIsotopesToSmiles(mol)
'[H][C@H](O)Cl'

That output should be 'OCCl'.

2) stereochemistry assignment needs to be recalculated after the isotopes have 
been removed:

>>> mol = Chem.MolFromSmiles("C[C@H]([13CH3])CI")
>>> MolWithoutIsotopesToSmiles(mol)
'C[C@@H](C)CI'
>>> Chem.CanonSmiles("C[C@H]([CH3])CI")
'CC(C)CI'

2b) This includes directional bonds

>>> mol = Chem.MolFromSmiles("C/C(=C/CO)/[11CH3]")
>>> MolWithoutIsotopesToSmiles(mol)
'C/C(C)=C/CO'
>>> Chem.CanonSmiles("C/C(=C/CO)/[CH3]")
'CC(C)=CCO'



Andrew
da...@dalkescientific.com




___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] RMSD between embedded conformers and input 3D structure

2019-12-12 Thread topgunhaides .
Hi guys,

I am trying to get RMSD between embedded conformers and reference 3D
structure (no Hs) in the input file. Please see example below:


from rdkit import Chem
from rdkit.Chem import AllChem

suppl = Chem.SDMolSupplier("mol.sdf")

for mol in suppl:
# Adding Hs
mh = Chem.AddHs(mol, addCoords=True)
# embedding
AllChem.EmbedMultipleConfs(mh, numConfs=100, numThreads=0)
cids = [conf.GetId() for conf in mh.GetConformers()]
# optimization
for cid in cids:
mp = AllChem.MMFFGetMoleculeProperties(mh, mmffVariant='MMFF94s')
ff = AllChem.MMFFGetMoleculeForceField(mh, mp, confId=cid)
ff.Initialize()
ff.Minimize(maxIts=1000)
# rms to reference structure in input file
m = Chem.RemoveHs(mh)
bestRmsList = []
for i in range(len(cids)):
bestRmsList.append(AllChem.GetBestRMS(m, mol, prbId=cids[i]))
print(min(bestRmsList))


As you can see, Hs are added for embedding and optimization, and then
removed for RMSD calculation (only compare heavy atoms). I pick "m" as
"probe" and "mol" as "reference" (not quite sure about this part).
Is this the right or proper way to do it? Any suggestions? I am still
learning RDKit. Many thanks!

Best,
Leon
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Clearing isotope info

2019-12-12 Thread Tim Dudgeon
Well, the there is already the isomericSmiles option in 
Chem.MolToSmiles() that handles stereo.

But it's true that there isn't one for isotopes.

An alternative might be to use the standardizer (rdMolStandardize 
package) as my process is already using part of this and does seem to 
have some stuff there for isotopes, but I couldn't figure out how to use 
this.


On 12/12/2019 16:39, Rafal Roszak wrote:

On Wed, 11 Dec 2019 10:53:47 +
Tim Dudgeon  wrote:


I'm wanting to write isomeric smiles that does not include isotope
information.

I also had sytuation when I need to generate smiles with either
isotopes or stereochemistry but not both. Maybe it is worth to add two
options to ChemMolToSmiles function:

dontIncludeStereochemistry=True/False
dontIncludeIsotopes=True/False

Right now it is not straightforward to generate smiles w/o isotopes
(but with stereochemistry) - one need to remove isotope, export to
smiles and restore isotopes.

Best,

Rafał


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss



___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Clearing isotope info

2019-12-12 Thread Rafal Roszak
On Wed, 11 Dec 2019 10:53:47 +
Tim Dudgeon  wrote:

> I'm wanting to write isomeric smiles that does not include isotope 
> information.

I also had sytuation when I need to generate smiles with either
isotopes or stereochemistry but not both. Maybe it is worth to add two
options to ChemMolToSmiles function:

dontIncludeStereochemistry=True/False
dontIncludeIsotopes=True/False

Right now it is not straightforward to generate smiles w/o isotopes
(but with stereochemistry) - one need to remove isotope, export to
smiles and restore isotopes.

Best,

Rafał


___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss