Hello,

I'm having a bit of trouble understanding an error that I'm getting (the script with minor modifications was originally written by Ilenia and I have attached it here). The api was installed on Redhat 6 and all the tests ran fine.

 

  File "./test.py", line 109, in <module>

    main()

  File "./test.py", line 102, in main

    ccdc_mol = csd_reader.molecule(h[1])

  File "/nfs/grid/software/pharmsci/apps/Linux-x86_64-RHEL6/csdPythonApi/0.7/python2.7.10/lib/python2.7/site-packages/ccdc/io.py", line 709, in molecule

    return self.entry(id).molecule

  File "/nfs/grid/software/pharmsci/apps/Linux-x86_64-RHEL6/csdPythonApi/0.7/python2.7.10/lib/python2.7/site-packages/ccdc/io.py", line 691, in entry

    e = self._db.entry(UtilitiesLib.DatabaseEntryIdentifier(id))

  File "/nfs/grid/software/pharmsci/apps/Linux-x86_64-RHEL6/csdPythonApi/0.7/python2.7.10/lib/python2.7/site-packages/ccdc/_lib/UtilitiesLib.py", line 487, in __init__

    this = _UtilitiesLib.new_DatabaseEntryIdentifier(*args)

RuntimeError: DatabaseEntryIdentifier::DatabaseEntryIdentifier: Invalid DatabaseEntryIdentifier (wrong size):AHEPUY|AMUBAM|COKCEL|COTYOA02|COTYOA03|COTZAN02|COTZAN03|COTZAN04|HUMJEE|HXACAN|HXACAN01|HXACAN04|HXACAN06|HXACAN07|HXACAN08|HXACAN09|HXACAN10|HXACAN11|HXACAN12|HXACAN13|HXACAN14|HXACAN15|HXACAN16|HXACAN17|HXACAN18|HXACAN19|HXACAN21|HXACAN22|HXACAN23|HXACAN24|HXACAN25|HXACAN26|HXACAN27|HXACAN28|HXACAN29|HXACAN30|HXACAN31|HXACAN32|HXACAN33|HXACAN34|KETYUF|KETZAM|KETZEQ|KETZIU|KIGLUI|KIGLUI01|LUJSIT|LUJSOZ|LUJTAM|MUPPES|MUPPES01|MUPPES02|MUPPIW|MUPPOC|MUPPUI|MUPQAP|MUPQET|NIDPIB|NIDPOH|NIDPUN|OMISIM|SUTVAF|WAFNAT|WIGBUL|WIGCAS|WIGCEW|XAYGOV|XOMWOL

Hi Geoff,

 

The issue here is that you need to pass csd_reader.molecule on line 102 of your script a single refcode - you're actually passing it many recodes with '|' as a separator, hence the error message.

 

You could, for example, use split to get a list of all the recodes in that string: https://docs.python.org/2/library/stdtypes.html#str.split

Or you could look at constructing your list appropriately in the screen_substructure function so that you have single identifiers ready to pass in to csd_reader.molecule.

 

Dave

Thanks Dave.  No free lunch I have to sit down and read the documentation.

You must be signed in to post in this forum.