Skip to content

Example scripts and use cases for the Python module of CORINA Classic

Notifications You must be signed in to change notification settings

mn-am/corina-classic-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CORINA Classic Goes Python

CORINA Header

CORINA Classic is a rule- and data-based, automatic, fast, and powerful 3D molecular model builder optimized for small to medium-sized, drug-like molecules and is the de facto industry standard for 3D structure generation in chemoinformatics and computational chemistry projects. Developed in C, CORINA Classic offers both standalone executables and a shared Python library. This repository showcases some example usages of the Python shared library.

For detailed information about CORINA Classic, visit the CORINA Classic home page.

Getting Started: Python & Jupyter Notebooks

To execute the examples in this repository, you must have a copy of the Python library of CORINA Classic. Note that all CORINA Classic products are commercial. To obtain an evaluation copy, please refer to the CORINA Classic home page.

System Requirements

  • Operating system: x86-64 Linux (RHEL7)
  • Python compatibility: Python 3.8 to 3.11
  • The library is as a shared object file that must be copied to the working directory as a file named "corina.so"

Using the Python library

  1. Check the Python version installed as follows.

    python3 --version
    # Output example: Python 3.10.7
  2. From the Python library distribution of CORINA Classic, copy the appropriate "corina.so" for your Python version to your working directory.

  3. Create a test Python script. Below is a simple example.

import corina

# Create an instance of CorinaBuffer
buffer = corina.CorinaBuffer()

# Example with "hard coded" SMILES string
smiles = "CCCCC"

# Specify that the inpout type is SMILES string anf that the output format is SDF V3000
buffer.command = "corina -i t=smiles -o t=sdf3"
buffer.input = smiles

buffer.proceed()


# print output
print(buffer.output)

The API mimics the command line syntax of the standalone version of CORINA Classic. All possible options for the command line are described in the CORINA Classic manual.

  1. Execute the Python script.
python3 test.py > mol.v3000.sdf

This command will output an SDF V3000 compatible file with 3D atom coordinates.

Creating a Jupyter Notebook

  1. Ensure the Python library of CORINA Classic is set up as described above.
  2. Install Jupyter Notebook (preferably within a virtual environment) as shown below.
mkdir jupyter
cd jupyter
virtualenv environment
source environment/bin/activate
pip install jupyter
  1. Launch Jupyter Notebook:
jupyter notebook
  1. Create a new notebook.

Screenshot from 2023-08-11 17-45-01.png Screenshot from 2023-08-11 17-50-14.png

  1. Run a simple example.

Screenshot from 2023-08-11 17-54-19.png

CORINA Classic API

The Python file python/corina_api.py shows all features of the API.

About

Example scripts and use cases for the Python module of CORINA Classic

Resources

Stars

Watchers

Forks