haddock.libs.libfcc module

FCC related functions

NOTE: This functions were ported directly from https://github.com/haddocking/fcc!

class haddock.libs.libfcc.Cluster(name, center)[source]

Bases: object

Defines a Cluster. A Cluster is created with a name and a center (Element class)

add_member(element)[source]

Adds one single element to the cluster.

center
members
name
populate()[source]

Populates the Cluster member list through the neighbor list of its center.

class haddock.libs.libfcc.Element(name)[source]

Bases: object

Defines a ‘clusterable’ Element

add_neighbor(neighbor)[source]

Adds another element to the neighbor list

assign_cluster(clust_id)[source]

Assigns the Element to Cluster. 0 if unclustered

cluster
name
neighbors
haddock.libs.libfcc.calculate_fcc(list_a, list_b)[source]

Calculates the fraction of common elements between two lists taking into account chain IDs

haddock.libs.libfcc.calculate_fcc_nc(list_a, list_b)[source]

Calculates the fraction of common elements between two lists not taking into account chain IDs. Much Slower.

haddock.libs.libfcc.calculate_pairwise_matrix(contacts, ignore_chain)[source]

Calculates a matrix of pairwise fraction of common contacts (FCC). Outputs numeric indexes.

contacts: list_of_unique_pairs_of_residues [set/list]

Returns pairwise matrix as an iterator, each entry in the form: FCC(cplx_1/cplx_2) FCC(cplx_2/cplx_1)

haddock.libs.libfcc.cluster_elements(e_pool, threshold)[source]

Groups Elements within a given threshold together in the same cluster.

haddock.libs.libfcc.output_clusters(handle, cluster)[source]

Outputs the cluster name, center, and members.

haddock.libs.libfcc.parse_contact_file(f_list, ignore_chain)[source]

Parses a list of contact files.

haddock.libs.libfcc.read_matrix(path, cutoff_param, strictness)[source]

Reads in a four column matrix (1 2 0.123 0.456

)

and creates an dictionary of Elements.

The strictness factor is a <float> that multiplies by the cutoff to produce a new cutoff for the second half of the matrix. Used to allow some variability while keeping very small interfaces from clustering with anything remotely similar.