• RE: Providing input to a Mercury called script

    There is a good overview in general of the link between Mercury and the CSD Python API within the Mercury documentation that you can access online here:

    Mercury documentation (CSD Python API section)

    I would probably suggest looking at one of the existing scripts that comes with Mercury though. The "chemical_name_search.py" which you can find under the CSD Python API > Searches menu contains a useful illustration of this type of interaction. That chemical name searching script uses a little Tkinter user prompt to gather input from the user. You can probably just cut-and-paste a section of the Python for your application.

    Hope that helps!

    Pete

  • Version 1.3 released!

    The CSD 2017 Release includes the new, substantially improved, CSD Python API version 1.3. Alongside a range of new features, this release of the CSD includes a self-contained Python environment with the CSD Python API installed with all of its prerequisites. This version can be used with no additional installation steps required after installing the CSDS 2017 software.

    Major new features added since version 1.0 include:

    • New docking module (for CSD-Discovery & CSD-Enterprise users)
    • New ligand screening module (for CSD-Discovery & CSD-Enterprise users)
    • The ability to calculate partial charges for organic molecules
    • The ability to access the asymmetric unit for a crystal
    • The ability to analyse intermolecular contacts within a crystal
    • The ability to calculate graph sets for a crystal structure
    • The ability to extract Miller indices for a crystal structure
    • New classes to access information on a journal and the list of journals
    • Support for 64-bit Python on Windows

    For advanced Python users the CSD Python API can be installed into your own Python installation via the pip or conda packages detailed below (use your CSDS 2017 site number and confirmation code as username and password to download):

    CSD Python API 1.3 Windows 32-bit pip Installer
    CSD Python API 1.3 Windows 32-bit conda Installer
    CSD Python API 1.3 Windows 64-bit pip Installer
    CSD Python API 1.3 Windows 64-bit conda Installer
    CSD Python API 1.3 Linux 32-bit pip Installer
    CSD Python API 1.3 Linux 32-bit conda Installer
    CSD Python API 1.3 Linux 64-bit pip Installer
    CSD Python API 1.3 Linux 64-bit conda Installer
    CSD Python API 1.3 MacOS 64-bit pip Installer
    CSD Python API 1.3 MacOS 64-bit conda Installer
    CSD Python API 1.3 Linux 64-bit UCS2 pip Installer

    Full installation instructions for these packages can be found in the CSD Python API documentation.

    If you do not yet have access to the 2017 release of the CSDS, but do have access to the 2016 version, then version 1.0 of the CSD Python API is still available to you and can be downloaded via the links sent to you from our CSDS Download request page.

  • Version 1.0 released!

    As part of the CSD 2016 Release, the CSD Python API is an integral component and this release marks its full official launch. The API has now reached the level of sophistication & stability required for fully supported use in both research and methods development.

    The 1.0 release of the CSD Python API includes a number of significant improvements compared to earlier releases including:

    • Improved Apple OSX support
    • Support for the Anaconda Python distribution
    • Significant extension to the descriptors module (incl. molecular & geometric descriptors)
    • Additional search filtering options (matching desktop interfaces)
    • Functions to identify and assign chiral centres (R or S)
    • New conformer generation module (for CSD-Materials, CSD-Discovery & CSD-Enterprise users)
    • New crystal packing similarity class (for CSD-Materials & CSD-Enterprise users)

    Please upgrade to the latest version now! We encourage your feedback as well as posting your scripts using the new functionality on this forum.

  • RE: Void space in crystal structures

    Just an extra comment to say that we've reviewed the CSD disorder comments field and observed that 103 out of 318 Fm-3m structures explicitly state that they have used PLATON/SQUEEZE. The proportion of structures exhibiting disorder in this space group is also found to be 67.3% - a significant increase over the CSD average of 23.2%.

    Pete

  • RE: Void space in crystal structures

    Thanks Richard.

    It's quite amazing to note, for example, that the space group Fm-3m has an average of over 50% void space in the unit cell. This presumably is mostly due to solvent or guest molecules that are so disordered that they couldn't be observed or well modelled - many may have had the PLATON/SQUEEZE method applied to them.

    Pete

  • Void space in crystal structures

    If you are familiar with the various crystal forms of carbamazepine in the CSD, you will know that one particular form of carbamazepine (CSD refcode: CBMZPN03) is in the trigonal space group R-3 and exhibits noticeable channels running down the unique axis. These channels result in void space of roughly 6.6% of the unit cell volume (or 375 Å per unit cell) and appear to either contain trace amounts of solvent or at least are templated by solvent.

    I suspect that the space group R-3 is predisposed to forming these kinds of channel crystal structures containing void space. I think this is true in particular for CSD structures where few systems will have the inherent molecular or polymeric symmetry to reside on the actual symmetry element and instead will arrange themselves around the -3 axis.

    To test this theory, I've written the attached script which loops over the entries in the CSD in space group R-3 and then determines an average void percentage. The outcome is 5.81%, but how does that match up to the average void percentage across the whole CSD?

  • Script to run many substructure searches & collate results

    I had a large folder of ConQuest CON files that I wanted to run substructure searches for and then collate the results together in some kind of summary for review in Excel afterwards.

    This script takes as input the path to the folder of files and outputs both refcode list files (GCDs) for each of the searches as well as a CSV file containing the summary of the searches (numbers of hits), one line per search file. Various search filters are set by default, but these can be turned off using command-line arguments (see the script comments for details). Note that you could edit the script to carry out the same kind of analysis using a set of SDF, MOL or MOL2 files for example to run searches.

  • RE: What code editors do you use for writing Python scripts?

    I started out using Notepad++ for script writing and editing as this is very straightforward to use and provides decent syntax highlighting for Python. I'm slowly coming around to PyCharm though for more complex scripts.

  • Welcome to the CSD Python API Forum

    Welcome to the user community dedicated to the CSD Python API.

    The CSD Python API has been developed to make CSD data and functionality accessible in a programmatic fashion. The aim is to facilitate construction & combination of CSD search and analysis functions into highly tailored workflows. In addition, the CSD Python API can be used to perform integration with in-house work-flows as well as 3rd party applications. It is a platform for innovation.

    We encourage you to post your comments, suggestions, success stories and requests for help here.

    You are also encouraged to read the community FAQ and our terms & conditions.

    We hope you enjoy using the CSD Python API as well as this forum.