Re: [Rdkit-discuss] Fwd: sending warnings to stderr/stdout to files

2019-09-24 Thread mikem
Hi. Yes this works for me as per the RDKit docs.  But I need to pipe it to a file, any suggestions? Thanks. Mike Get Outlook for Android On Tue, Sep 24, 2019 at 10:28 PM +0100, "Lukas Pravda" wrote: Hi Mike,   The following code works for me:   import sys from i

Re: [Rdkit-discuss] Problems with SMILES using MolFromSmiles

2019-09-24 Thread Peter S. Shenkin
A carboxylate has to be represented as C(=O)[O-]. Use ...[OH] for an uncharged carboxyl. Similarly, a tetravalent aliphatic N has to be given a + charge. -P. On Tue, Sep 24, 2019 at 9:15 PM Scalfani, Vincent wrote: > Dear Navid, > > > > RDKit rejects tetravalent Nitrogen by default. This thread

Re: [Rdkit-discuss] Problems with SMILES using MolFromSmiles

2019-09-24 Thread Scalfani, Vincent
Dear Navid, RDKit rejects tetravalent Nitrogen by default. This thread below may help. It shows how to load the SMILES with sanitization off, then perform a partial sanitization. https://sourceforge.net/p/rdkit/mailman/message/32589379/ Vin From: Navid Shervani-Tabar Sent: Tuesday, Septemb

[Rdkit-discuss] Problems with SMILES using MolFromSmiles

2019-09-24 Thread Navid Shervani-Tabar
Hello, I have noticed that RDKit have some problems with some SMILES when trying to use MolFromSmiles. With further attention, I have noticed that all of these SMILES include nitrogen atoms. Some examples include: [NH3]CCC(=O)[O] NC(=[NH2])C(=O)[O] NC(=[NH2])[CH2].C(=O)=O CNC(=[NH2])C(=O)[O] CNC(

[Rdkit-discuss] Issue with Chirality

2019-09-24 Thread Guillaume GODIN
Dear All, One question why this is not working ? def mol3D(mol): tot = AllChem.EmbedMolecule(mol) try: X = AllChem.Get3DDistanceMatrix(mol) except: print('err') print(tot) n = mol.GetNumAtoms() X = np.zeros(n,n) return X mol = Chem.MolFromS

Re: [Rdkit-discuss] Fwd: sending warnings to stderr/stdout to files

2019-09-24 Thread Lukas Pravda
Hi Mike, The following code works for me: import sys from io import StringIO from rdkit import Chem saved_std_err = sys.stderr log = sys.stderr = StringIO() Chem.WrapLogs() # do whatever you want with rdkit whatever_used_to_be_printed_by_rdkit_in_console_as_str = log.getvalu

Re: [Rdkit-discuss] Fwd: errors with stereoisomers

2019-09-24 Thread Greg Landrum
Hi Mike, The usual incantation when working with suppliers, and this is shown in a lot of sample code, is to check to see if the molecule that is returned is None (which indicates a problem processing it). The simple way to do this, and to report the error molecules to stdout (you can change this)

[Rdkit-discuss] Fwd: errors with stereoisomers

2019-09-24 Thread mikem
Hello RDKit gurus,   I've found an interesting issue with V2000 SDF files which have a carbon marked as "Either or unmarked stereocentre", a 3 in the atom-block.   The enclosed molecule throws these errors – note also that the word “begining" is spelt wrong in the stderr.   Is there a way

[Rdkit-discuss] Fwd: sending warnings to stderr/stdout to files

2019-09-24 Thread mikem
Hi Rdkit forum,   Easy question, perhaps difficult to answer…    I’ve been reading a lot of support messages, many a very old about how to get warnings (only visible at the cmd line) to be send to files. I can get error messages sent, but not warnings.   The type I’m trying to capture ar