[Rdkit-discuss] Question about how 3D flag is set

2017-01-19 Thread Jose Manuel Gally
Dear all, I need to discriminate molecules with 2D or 3D coordinates. I have a question regarding how RDKit decides if a molecule read from SDF is 2D or 3D. I have a 2D molecule with, for reasons, the "software line" (2nd line in MolBlock) does not end with '2D' or '3D' but with '0D'. For te

[Rdkit-discuss] molecules returned as smiles instead of Mol objects in postgresql cartridge

2018-11-28 Thread Jose Manuel Gally
s not as Mol objects but as str (smiles). Is this the expected behavior? If so, how could I do to retrieve molecules as Mol objects instead of smiles? Thanks in advance for any hindsight on how to do this! Best regards, Jose Manuel Gally [1] rdkit/rdkitpostgresql: 2018.09.1.0, postgresql

Re: [Rdkit-discuss] molecules returned as smiles instead of Mol objects in postgresql cartridge

2018-11-28 Thread Jose Manuel Gally
Hello again, I actually found out, as written in the docs. By selecting mol_send(m) instead of m in posgresql, I can access the pickled molecule that I can restore with Chem.Mol(pkl.tobytes()) Cheers, Jose Manuel Gally On 11/28/18 12:56 PM, Jose Manuel Gally wrote: Hello everyone, I&#

[Rdkit-discuss] Is it possible to retrieve the substructure atom indices from a postgresql query?

2018-12-10 Thread Jose Manuel Gally
Hi all, I am using the RDKit postgresql cartridge to perform some substructure searches on a large number of molecules, as described here: https://www.rdkit.org/docs/Cartridge.html However, in addition to which row matched the query, I would also like to know what are the atom indices for ea

[Rdkit-discuss] transparency when highlighting atoms with defined colors

2018-12-20 Thread Jose Manuel Gally
Hi all, I am trying to highlight substructures found in a set of molecules. However, if I use a specific color in Draw.MolsToGridImage by defining the highlightAtomColors parameter, I lose the transparency effect, so some atoms can be hidden by the highlight. Is there a way to set the transp

Re: [Rdkit-discuss] transparency when highlighting atoms with defined colors

2018-12-21 Thread Jose Manuel Gally
ew.drawOptions() option.padding=0.13 option.legendFontSize=18 view.DrawMolecules([tm], highlightAtoms=[highlight], highlightAtomColors=[color_2]) view.FinishDrawing() svg = view.GetDrawingText() with open('./example.svg', 'w') as f:     f.write(svg) SVG(svg.replace('svg:&#x

Re: [Rdkit-discuss] MolToSmiles(), atom indexes

2019-02-01 Thread Jose Manuel Gally
Dear Jean-Marc, I believe this can be achieved by using the Mol property "_smilesAtomOutputOrder", which is set only after using the function Chem.MolToSmiles. Please find attached a very simple example of how it can be extracted. Cheers, Jose Manuel On 01.02.19 13:03, Jean-Marc Nuzillard w

[Rdkit-discuss] warnings when exporting pandas tables with molecules to hdf

2019-02-15 Thread Jose Manuel Gally
Hi all, I am working on some molecules in a pandas DataFrame and have to export them to a hdf file. This works just fine but I get a warning about Performance due to mixed types. (1) Why are RDKIT Mol objects causing this warning in the first place? Am I doing something wrong? Please fin

Re: [Rdkit-discuss] warnings when exporting pandas tables with molecules to hdf

2019-02-15 Thread Jose Manuel Gally
ing you that it will have to use Python's `pickle` module to serialize it. On Fri, Feb 15, 2019 at 6:35 AM Jose Manuel Gally mailto:jose.manuel.ga...@gmail.com>> wrote: Hi all, I am working on some molecules in a pandas DataFrame and have to export them to a hdf file.

Re: [Rdkit-discuss] warnings when exporting pandas tables with molecules to hdf

2019-02-18 Thread Jose Manuel Gally
of hdf. Cheers, Jose Manuel Refs: [1] https://github.com/rdkit/UGM_2016/blob/master/Notebooks/Pahl_NotebookTools_Tutorial.ipynb [2] http://rdkit.blogspot.com/2016/09/avoiding-unnecessary-work-and.html On 15.02.19 22:21, Jose Manuel Gally wrote: Dear Peter, thank you for your reply. That

Re: [Rdkit-discuss] warnings when exporting pandas tables with molecules to hdf

2019-02-21 Thread Jose Manuel Gally
x: base64.b64encode(pickle.dumps(x)).decode()) should be: df['mol'] = df['mol'].map(lambda x: base64.b64encode(x.ToBinary()).decode()) You could also fix this by changing how you decode the column, but this approach is faster. -greg On Mon, Feb 18, 2019 at 11:28 AM

Re: [Rdkit-discuss] Atom coordinates from PDB-file

2019-02-26 Thread Jose Manuel Gally
Hi Illimar, if you are familiar with pandas DataFrames, then I would also recommend BioPandas for this: https://github.com/rasbt/biopandas Cheers, Jose Manuel On 26.02.19 00:05, Stéphane Téletchéa wrote: Hi all, Le 25/02/2019 à 12:38, Lukas Pravda a écrit : Hi Illimar, If you need to acc

[Rdkit-discuss] Which method to prefer for computing 2D coordinates

2019-04-09 Thread Jose Manuel Gally
Dear all, This might sound naive, but I want to compute 2D coordinates for a set of molecules. For now I am considering the 3 methods below [1]. I was wondering if there was any recommendation to use one method over another in some cases? For instance, very large rings are not displayed ro

Re: [Rdkit-discuss] Which method to prefer for computing 2D coordinates

2019-04-09 Thread Jose Manuel Gally
Lukas On 09/04/2019, 14:35, "Jose Manuel Gally" mailto:jose.manuel.ga...@gmail.com>> wrote:     Dear all,     This might sound naive, but I want to compute 2D coordinates for a set     of molecules.     For now I am considering the 3 methods below

Re: [Rdkit-discuss] Which method to prefer for computing 2D coordinates

2019-04-11 Thread Jose Manuel Gally
te angle between two bonds if they share common atom because of this http://www.ebi.ac.uk/pdbe-srv/pdbechem/chemicalCompound/show/CPT). Let me know if you would have any questions, or suggestions. Lukas *From: *Thomas Evangelidis *Date: *Tuesday, 9 April 2019 at 15:43 *To: *Lukas Pravda *Cc: *J

[Rdkit-discuss] problem when drawing a murcko scaffold

2019-08-28 Thread Jose-Manuel Gally
Dear all, I noticed a strange behavior when extracting murcko scaffolds from preprocessed molecules with an inhouse standardization protocol. I made a gist to illustrate the problem: https://gist.github.com/jose-manuel/04d69dd3ac52cca74449e73d614df42e This leaves me with several questions:

Re: [Rdkit-discuss] problem when drawing a murcko scaffold

2019-08-29 Thread Jose Manuel Gally
before sanitizing, your problem will disappear. Cheers, p. On 28/08/2019 13:22, Jose-Manuel Gally wrote: Dear all, I noticed a strange behavior when extracting murcko scaffolds from preprocessed molecules with an inhouse standardization protocol. I made a gist to illustrate the problem

[Rdkit-discuss] Representing a Murcko Scaffold Extraction

2020-02-28 Thread Jose Manuel Gally
Dear RDKitters, I would like to represent what Murcko Scaffolds are extracted from what molecules. I had the idea to look into the rdChemReactions module because it shows a nice arrow between reactants and products. In my case, I have only 1 reactant and 1 product to display. I played a bi

Re: [Rdkit-discuss] Representing a Murcko Scaffold Extraction

2020-02-28 Thread Jose-Manuel Gally
ctants and products no matter what at the moment. This is something we will try to get fixed. Best, -greg On Fri, Feb 28, 2020 at 10:19 AM Jose Manuel Gally mailto:jose.manuel.ga...@gmail.com>> wrote: Dear RDKitters, I would like to represent what Murcko Scaffolds are extract

[Rdkit-discuss] missing function for measuring angles

2014-10-13 Thread Jose Manuel Gally
Dear rdkitters, I cannot find the functions GetAngleDeg and GetAngleRad which should be in rdMolTransforms according to the docs: http://www.rdkit.org/Python_Docs/rdkit.Chem.rdMolTransforms-module.html Here are the modules listed in rdMolTransforms with dir command: ['CanonicalizeConformer', '

[Rdkit-discuss] how to retrieve force field angles and bond lengths values?

2014-10-21 Thread Jose Manuel Gally
Dear rdkitters, I found the parameters for bond lengths and angles for the UFF force field : http://sourceforge.net/p/rdkit/code/HEAD/tree/trunk/Code/ForceField/UFF/Params.cpp Is there a way to retrieve these values and use them in a python script? I could not find any hint in the docs : http:/

Re: [Rdkit-discuss] how to retrieve force field angles and bond lengths values?

2014-10-21 Thread Jose Manuel Gally
weekend, though... :-) The repository on SourceForge is very outdated; all source code has been moved to Github long ago: https://github.com/rdkit/rdkit/blob/master/Code/ForceField/MMFF/Params.cpp https://github.com/rdkit/rdkit/blob/master/Code/ForceField/UFF/Params.cpp Cheers, p. On 21/10/14 10:48, Jo

[Rdkit-discuss] detect unassigned cis/trans stereo

2015-03-23 Thread Jose Manuel Gally
CF') bonds = mol.GetBonds() for b in bonds: print b.GetStereo() gives me the following output... STEREONONE STEREONONE STEREONONE ...whereas I would like something like this : STEREONONE STEREOANY STEREONONE Thank you for your help! Cheers, Jo

[Rdkit-discuss] raw RMSD matrix of docking poses

2015-07-29 Thread Jose Manuel Gally
Dear RDKit communauty, I would like to compute the raw RMSD matrix (without alignment) between docking poses of the same ligand from a SDF. However, upon reading the SDF with a SDMolSupplier, poses are stored into different Molecule objects, each one with one conformer only, whereas the functi

[Rdkit-discuss] Fwd: Re: How to set one given Double Bond Stereo to "STEREOANY"?

2015-08-28 Thread Jose Manuel Gally
Thank you for your response Greg, unfortunately, it does not seem to work when converting the molecule to MolBlock: m = Chem.MolFromSmiles('C/C=C/CC/C=C/F') [1] print Chem.MolToSmiles(m, isomericSmiles=True) m.GetBondWithIdx(0).SetBondDir(Chem.BondDir.UNKNOWN) Chem.AssignStereochemistry(m,forc

[Rdkit-discuss] FindMolChiralCenters finding non chiral centers?

2015-09-22 Thread Jose Manuel Gally
Hi rdkitters, I wrote a very small python snippet to detect all chiral centers of a molecule, including unspecified ones: # from rdkit import Chem def getStereo(smiles): m = Chem.MolFromSmiles(smiles) Chem.AssignStereochemistry(m, cleanIt=True,flagPossibleStereoCenters=True, force=Tru

Re: [Rdkit-discuss] FindMolChiralCenters finding non chiral centers?

2015-09-24 Thread Jose Manuel Gally
Hi John and Greg, I now understand better what happens, thank you for your responses! However, in this precise case, I need to not consider these atoms as stereocenters, so I just remove them from the list returned by FindMolChiralCenters. When I generate conformations, I still get the differen

[Rdkit-discuss] detect dihedral angles in a conformation

2015-10-20 Thread Jose Manuel Gally
Hi RDKitters, I would like to consider parts of a conformation rigid (fixed dihedral angles) during minimization My end goal would be to generate only ring conformations starting with valid 3D molecules. I can already consider a specific dihedral angle as rigid: from rdkit import Chem from rdk

Re: [Rdkit-discuss] detect dihedral angles in a conformation

2015-10-20 Thread Jose Manuel Gally
Hi Paolo, Michal, thanks for your replies! I don't want to freeze only linkers between saturated rings, but also 'side chains' so I went with Paolo's snippet to get the maximum amount of torsions. Then I filtered the torsions having either: - at least 2 atoms in the same ring - at least 1 hyd

Re: [Rdkit-discuss] detect dihedral angles in a conformation

2015-10-20 Thread Jose Manuel Gally
imizer to converge. In general, constraints should be > kept to a minimum; you won't need constraints on aromatics, since they > are already kept rigid and planar by torsion and oop terms. > > Cheers, > p. > > On 20/10/2015 14:38, Jose Manuel Gally wrote: >> Hi Paolo, Micha

[Rdkit-discuss] how to write molecules using "standard" SDF format?

2016-01-04 Thread Jose Manuel Gally
Hi, currently when I generate conformations with RDKit and want to use them for docking experiments, I have to first rewrite them using the MolConverter node in Knime. I need to do this because some docking software read the information about charges in the atom block rather than in the molecul