First steps

How to install

For the installation, firstly you will need to install UCSF Chimera. Download the latest vesion and install it with the next command:

$ chmod +x chimera-*.bin && sudo ./chimera-*.bin

Install compare_equal via the package installer pip for Python 2.7:

$ pip install -i https://test.pypi.org/simple/ compare-equal

After the installation you need to add the path where the package is installed ($PATH_TO_LIB) into the Chimera third-party plugin location library in Preferences. With these commands you can obtain the path and save it in Chimera Preferences:

$ PATH_TO_LIB=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
$ chimera --nogui --script <(echo "import chimera; chimera.extension.manager.addDirectory(\"${PATH_TO_LIB}\",True); chimera.preferences.makeCurrentSaved(\"Tools\"); chimera.preferences.save();")

Now you can use the functions for your Python scripts for Chimera.

How to use it

Compare Equal package is intended to be used in Python scripts that are going to be run inside of Chimera or in the command line with the chimera --nogui command.

The functions are stored in the module compare inside of the compare_equal package. However, you can call these functions importing only the package without the module:

>>> import chimera
>>> test_1 = chimera.openModels.open("4uft",type="PDB")[0]
>>> test_2 = chimera.openModels.open("4uft",type="PDB")[0]

# Without importing the module explicitly
>>> import compare_equal
>>> compare_equal.CompareMol(test_1, test_2)
True

# Importing the module inside the package explicitly
>>> from compare_equal import compare
>>> compare.CompareMol(test_1, test_2)
True

# Additionally, you can import only the function that you want
>>> from compare_equal.compare import CompareMol
>>> CompareMol(test_1, test_2)
True

You can use it also interactively within the Interpreter of PyChimera.