This is a set of tools for clustering structures of biomolecules built around [Affinity Propagation][1] clustering algorithm. Inspired by python implementation from scikit-learn[2] package.
Before installing affbio with pip install prerequisites. For Ubuntu LTS you can use following commands:
apt-get install build-essential python-pip python-dev libopenmpi-dev libhdf5-dev
Affbio also depends on Numpy, it can be installed with apt-get install python-numpy
or pip install numpy
Visualization will also require [GROMACS][3] and imagemagick. Usually they can also can be installed from repositories:
apt-get install gromacs pymol imagemagick
AffBio is available in PyPi and can be install with pip install affbio
AffBio supports parallel execution with OpenMPI. To be able to use this features you will need mpi enabled version of [h5py][4] package.
Obtain a set of identical PDB structures or generate trajectory snapshots:
mkdir snapshots
trjconv -f md.trr -s md.tpr -o snapshots/frame.pdb -conect -skip 5 -sep
cd snapshots
The most typical usage would be:
affbio -m aff_matrix.hdf5 -t cluster -f *.pdb --verbose
This run will generate a set of output files: aff_centers.out, aff_labels.out and aff_stat.out which contain all the necessary information about the resulting clusters.
To create pictures with exemplars and (optionally) with clustering stats execute following command:
affbio -m aff_matrix.hdf5 -t render --draw_nums --merged_labels --bcolor -o clusters.png
[1][http://www.psi.toronto.edu/index.php?q=affinity%20propagation]
[2][http://scikit-learn.org/stable/modules/generated/sklearn.cluster.AffinityPropagation.html]