[Rdkit-discuss] Initialize RDKit Wrapper in Visual Basic
Hi, I want to use RDKit within a Visual Basic program I have written. A bit of searching showed that a .NET wrapper for RDKit is available through the VisualBasic NuGet package manager. I was able to use NuGet to add the RDKit2DotNet package to my project. In the code I add the following and get a successful compile: Imports GraphMolWrap ... RDKit.Initialize()'Line 1 myMol = RDKFuncs.MolBlockToMol(myString) 'Line 2 However, when run, I get a "NullObject" runtime error at Line 1 with no other descriptive message. If I comment out Line 1 and run again, I get a "dll could not be loaded runtime error at line 2. Seems like I am missing a step somewhere. Am I supposed to download and register any other .dlls to use these wrappers? Thank you. ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] SMILES validation question
This one is tricky and I bumped into something similar not too long ago. What happened is that by default: [2] mol = Chem.MolFromSmiles("O=C(CC1SCCC1)c1c1N") automatically has sanitize set to True. One of the steps is aromaticity sanitization. Since I don't think the mol satisfies 4n+2, sanitization removed aromaticity from the ring. You can verify this with: print([a.GetIsAromatic() for a in mol.GetAtoms()]) [3] smi = Chem.MolToSmiles(mol) Then generates: 'NO1OOOC=C1C(=O)CC1CCCS1', which results in a neutral oxygen with 3 explicit valences. Unfortunately AFAIK, RDKit can only catchErrors when a certain sanitization step failed but not if it succeeded (as in this case). Maybe Greg or Brian has a better solution? ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] SMILES validation question
Hi all, I ran into a case that I found confusing. If convert this SMILES to an RDKit molecule, I get a valid molecule. In [2]: mol = Chem.MolFromSmiles("O=C(CC1SCCC1)c1c1N") In [3]: mol Out[3]: However, if I convert the molecule to SMILES then covert it back to a molecule, it is no longer valid. In [4]: smi = Chem.MolToSmiles(mol) In [5]: new_mol = Chem.MolFromSmiles(smi) [20:35:06] Explicit valence for atom # 1 O, 3, is greater than permitted RDKit ERROR: [20:35:06] Explicit valence for atom # 1 O, 3, is greater than permitted In [6]: new_mol In [7]: new_mol is None Out[7]: True I'd like to be able to catch invalid molecules like this in one step rather than two. What am I doing wrong? Thanks, Pat ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] atomic contributions to molecular polarizability
Greg, Thank you for your response and for your GitHub site where you are generouslyproviding snippets of code to help others. I agree that the atomic number to polarizabilityapproach is crude. However, experimental polarizabilities for small organics are available in the CRC Handbook and other sources. Hence, the error of this approach can be readily estimated. Thanks again for your help - greatly appreciated. Regards, Jim Metz -Original Message- From: Greg Landrum To: James T. Metz Cc: RDKit Discuss Sent: Fri, Jan 11, 2019 1:51 am Subject: Re: [Rdkit-discuss] atomic contributions to molecular polarizability Hi Jim, On Thu, Jan 10, 2019 at 11:59 PM James T. Metz via Rdkit-discuss wrote: I would like to calculate and be able to visualize the atomic contributionsto the total molecular polarizability of small organic molecules. Apparentlythere is a molecular descriptor, apol, that is the sum total from the atomiccontributions to polarizability available in some programs e.g., CDK. The CDK documentation doesn't include a citation for this (aside from a link to a web page that no longer exists), but since the code is there and this descriptor is super simple, it's easy to re-implement:https://gist.github.com/greglandrum/7936fcf631bfdae0041e298421554bec Does anyone have code that will compute and write out the atomic contributions to molecular polarizability to either the b factor column orperhaps the charge column of PDB or MOL2 files, respectively? I couldthen use other programs to visualize the structures with those numbers.Thank you. The gist linked above shows how to store values in the temperature factors that end up in PDB output. It's worth pointing out that this descriptor is pretty crude: the atomic contribution is determined solely by the atomic number, not by atom environment.The RDKit includes a more complicated (presumably more accurate?) polarizability descriptor: the Molar Refractivity (MR) values. The gist also shows how to get the atomic contributions to this. I hope this helps,-greg ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss