We use swig to interface Python and C++ code. The C++ file is compiled into a shared library, which can be imported as a mudule in your Python code just like any other modules you normally use. In this way you can have the ease of flow control and text parsing with Python, leaving the heavy computation to the the much faster C++ code.
Download the gzip file. What you need to do is
first uncompress the file to get a new
directory MI_suite, then
modify the -I option in the last line of the Makefile to the
python installation directory on your own system. Finally, type
make on the command line under the same directory and if
everything goes right, it's done. You can test the module in the
python interactive shell by typing import MI_suite, and try using the
mut_info function by inputting two strings
like MI_suite.mut_info('ACCCP', 'DAADF'). Then the
funtion will return the mutual information.
Tips:
Only the one-letter amino acid code, the letter "X" (standing for abnormal amino acids), and dashes ("-" standing for gaps) are legal. Illegal characters will yield -1 as the result. You can modify the alphabet by editting the macro ALPHBET in MI_suite.cpp, and regenerate the shared library.
The entropy of a string is obtained by evaluating the mutual information with itself.