• RE: Problem with kekulize() of AFUWEE

    Hi Richard,

    Thanks for looking into this.  The structure itself is not vitally important other than that it upset my script. I'm certainly happy with a system that gives rubbish for rubbish structures but I think that rather than produce a pentavalent carbon, as the kekulize function does in this case, it should produce an error.  Pentavalent carbons are quite unequivocally wrong, after all, and producing one is a clear sign that something's badly awry.

    Regards,

    Dave

     

  • Problem with kekulize() of AFUWEE

    Hi,

    I've had a problem with the structure AFUWEE, as shown in the attached script.  If I do standardise_aromatic_bonds(), standardise_delocalised_bonds(), kekulize(), I get a structure with a pentavalent carbon (atom 3), a C-H with 2 double bonds off it.  If I run the same three functions on _that_ molecule, I get aromatic (type 4) bonds for those two bonds, which is a bit odd for a kekulised structure.  Granted, the bonding for this molecule is a mess (possibly there should be a double bond to the phosporus?) but the inconsistent behaviour isn't great, either.  Mercury shows AFUWEE with a fully-aromatic 6,5 carbon system, which is also unexpected.

    This is the case in the latest production version (1.0.0) and the 2017 beta version.

     

    Regards,

    Dave

     

  • RE: Peculiar behaviour of remove_hydrogens

    Hi Richard,

    Sorry not to reply sooner, I've been on holiday. I'm happy to report that the script now runs using the beta version of the 1.3 API.  Thanks for squeezing it in so close to the wire.

    Dave

     

  • Peculiar behaviour of remove_hydrogens

    Hi,

     

    If I run the script below, with testmol.sdf as attached, the first remove_hydrogens() gives no complaint, the second gives the error

     

    File "test_ccdc_h.py", line 17, in <module>
    mol1.remove_hydrogens()
    File "/home/davidc/anaconda2/envs/TwoD2ThreeD/lib/python2.7/site-packages/ccdc/molecule.py", line 1454, in remove_hydrogens
    ChemistryLib.remove_hydrogens(self._molecule)

    TypeError: in method 'remove_hydrogens', argument 1 of type 'EditableMolecule &'

     

    I can't find any documentation about editable or non-editable molecules. Can someone please help me understand what the difference is between the two cases and how I go about removing hydrogens from a molecule read from a string? My real use case is with SDF records POSTed to a webservice, so I don't want to have to go through a file.

     

    Thanks,

    Dave

    -------------------------------------------------------------------------------------------------

    Script:

     

    #!/usr/bin/env python

    from ccdc import io
    from ccdc.molecule import Molecule

    mol_reader = io.MoleculeReader( 'testmol.sdf' )
    mol = mol_reader[0]
    mol.remove_hydrogens() #  works fine

    f = open( 'testmol.sdf' , 'r' )
    fc = f.read()
    mol1 = Molecule.from_string( fc , 'sdf' )
    mol1.remove_hydrogens() # generates error

  • RE: Differing results between mogul and API

    Hi Ilenia,

    Thanks for the reply. I had stumbled upon the standardise_aromatic_bonds() bit some time after posting, but not the delocalised_bonds() equivalent. I'll amend my script accordingly. If this step isn't in the documentation examples, can I suggest it's added?  It seems to be quite important!

    Thanks for the tip about the databases, I'll add that, too, though clearly in this case it was a secondary effect.

     

    Cheers,

    Dave

     

  • Differing results between mogul and API

     Hi,

    I'm getting odd results with the attached structure.  It seems I can only attach one file, so I've attached the structure.  The script I'm running is at the bottom.  When I run it, I get:

    Num atoms in Test Mol : 36

    Unusual bonds : 1
    [u'C17', u'N16'] [16, 15] 1.35176561208 1.30825121262 1.30575835705 3.46603009836 False 17

     

    When I analyse the structure in Mogul, the z score is 0.628 for that bond, based on 7599 hits, whereas here it's 3.466 and 17 respectively. It's very odd, too, that it only complains about 1 of the C-N bonds in the pyridine, not the other!

     

    Any hints as to what I'm going on will be gratefully received!

     

    Thanks,

    Dave

    PS the indentation in the script is obviously mangled by this text box.

    ----------------------------------------------------------------------------------------------------------------------------

    #!/usr/bin/env python

    from ccdc import io
    from ccdc.conformer import GeometryAnalyser
    from ccdc.molecule import Molecule

    import sys

    engine = GeometryAnalyser()

    mol_reader = io.MoleculeReader( sys.argv[1] )
    mol = mol_reader[0]
    print 'Num atoms in %s : %d' % ( mol.identifier , len( mol.atoms ) )

    mol_checked = engine.analyse_molecule( mol )

    print 'Unusual bonds : %d' % len([b for b in mol_checked.analysed_bonds if b.unusual])
    for b in mol_checked.analysed_bonds :
    if b.unusual :
    print b.atom_labels , b.atom_indices , b.value , b.mean , b.median , b.z_score , b.generalised , b.nhits

  • RE: Ubuntu 16.04 installation

    After some more persistence and patience, I seem to have it running ok on Ubuntu 16.04.  I installed it into a fresh anaconda environment using

    conda install ~/Downloads/csd-python-api-1.0.0-linux-64-py2.7-conda.tar.bz2

    and some simple things work.  My initial thought that it wasn't working was because 

    mol_checked = engine.analyse_molecule( mol )

    seemed to hang - that's where the patience came in.  It just takes quite a bit longer than I thought it would.

    My experience is that using pip install and setting LD_LIBRARY_PATH as suggested in the installation instructions is a mistake. On my machine, at any rate, this left me with incompatible libraries in my the search path, which had been built with an older glibc than the system libraries, so I got a lot of shared library errors. Installing with anaconda didn't show this effect, for reasons that I can't fathom.

     

  • Ubuntu 16.04 installation

    Hi,

    I'm attempting to install the API on Ubuntu 16.04.  The run_test.sh script gives the attached output:

    I have tried using anaconda for the installation, and pip. Attached is the output from the pip installation, the anaconda was the same although the installation tarball for the latter didn't seem to have the tests directory in it, so I had to unpack the pip tarball anyway!

    The output from the tests looks a bit worrying to me.  Why are some tests skipped?  The Segmentation faults look particularly iffy.  Is there any way of knowing which tests were failing? It may be that these are for things we're not licensed for or won't be using (we have licenses for CSD-System only).

    I realise that ubuntu isn't on your list of known successes.  That seems a bit odd, given its popularity.  I can probably switch to Suse if needed, though that would be disappointing.

    Thanks,

    Dave