Skip to content

Repository files navigation

Direct Coupling Analysis for Python

mfDCA implementation, adapted from MATLAB version (http://dca.rice.edu/portal/dca/)

Direct Coupling Analysis was developed using MATLAB. This is a python port.

Unit testing Readme and script details output differences from original MATLAB script.

Installation

The simplest way to install is:

pip install git+https://github.com/utdal/py-mfdca.git

Or clone the repository:

git clone https://github.com/utdal/py-mfdca.git
pip install .

This installs all core functionality and unit tests.

Note for Windows users:

By default, the package includes Unix-specific tools using pyhmmer, which are not supported on Windows. These will be automatically excluded during installation on Windows.

If you are on Linux, macOS, or WSL, no special action is needed.

If you’re on Windows and wish to force-install Unix tools (e.g., using WSL), you can run:

pip install .[unix]

Example Usage:

fromdca.dca_classimportdcaprotein_family=dca('sequence_file')
protein_family.mean_field()
protein_family.DI# contains DI scores for each pairprotein_family.couplings# NxNxqxq matrix of couplings (eij)protein_family.localfields# Nxq matrix of localfields (h)protein_family.compute_Hamiltonian('sequence_file') # returns (Hamiltonians,sequence_headers) for input sequences

Runtimes, Random MSA Average of 2 (M1 Pro, 16GB RAM):

Sequence Length# of sequencesRuntime (s)
1001,0002.2
3001,0005.4
5001,00021
10010,0000.7
30010,0006.7
50010,00024.1
100100,00098.5
300100,000266.8
500100,000391

Optional: HMMER Tools (Unix Only)

This package includes a Unix-specific module dca.hmm_tools for sequence analysis using pyhmmer.

This module is:

  • Enabled by default on Unix systems (Linux/macOS)
  • Disabled on Windows
  • Can be imported as from dca import hmm_tools

Attempting to import or use this module on Windows will raise an ImportError.

About

Simple Python Implementation of mean-field Direct Coupling Analysis

Resources

Stars

8 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages