packman.apps.dci module

The ‘DCI’ object host file. This is file information, not the class information. This information is only for the API developers. Please read the ‘DCI’ object documentation for details. Example:

from packman.apps import DCI
help( DCI )

Notes

  • Tutorial:
  • For more details about the parameters for compliance, or to site this, read the following paper:
Authors:
class packman.apps.dci.DCI(mol, cutoff=7.0, chain=None, n_com=None)

Bases: object

This class contains the code for DCI analysis.

Notes

  • Tutorial:
  • Webserver:
  • Publication:
Parameters:
  • mol (packman.molecule.Protein) – Structure in the ‘Protein’ object.
  • cutoff (float) – GNM distance cutoff. Default set to 7.5
  • chain (string) – Protein chain id. Default is set to using all chains.
  • n_com (int) – Number of communities to generate. Default the program will explore best possible cluster numbers for the given data.
calcualte_pymol_commands(output_file)

Write all the communities in py-mol importable format.

Parameters:output_file (file) – output file.
Returns:True if successful; None otherwise.
calculate_CH_plot()

Calculate CH plot for the cluster numbers.

File is saved as pdbid_CH_Score.png in the present working directory. Please check the filename for invalid characters if there are errors.

Returns:True if successful; None otherwise.
calculate_cluster(dist_mat, max_iter=21)

Calculates the best possible communities/clusters.

self.store_score calculated CH score for every clustering number. (Read the paper for more details)

Parameters:
  • dist_mat (numpy.array) – 1 - cross-correlation matrix.
  • max_iter (int) – Maximum number of iterations for cluster counts.
Returns:

True if successful; None otherwise.

calculate_crosscorrelation()

Calculate the cross-correlation. (Read the paper for more details)

Returns:True if successful; None otherwise.
calculate_decomposition()

Eigen decomposition calculation.

Access the eigen values and eigen vectors with self.eigen_values and self.eigen_vectors

Returns:True if successful; None otherwise.
calculate_kirchoff(gamma=1.0)

Calculate the Gaussian Network Model (GNM) Kirchoff Matrix.

The matrix is stored in the self.GNM_MAT variable.

Returns:True if successful; None otherwise.
calculate_windows(iterable)

Yield range of consecutive numbers.

Internal Function. (printing operation)

get_cluster_labels()

Get the cluster label of the ‘most optimal’ community (Read the paper for more details)

Returns:cluster label of the ‘most optimal’ community
Return type:best_community ([int])
get_communities()

Get all the communities generated using DCI.

Returns:List of communities with number of communities as a key.
Return type:store_comminities (dict)
get_crosscorrelation()

Get the cross-correlation.

Returns:Cross-correlation matrix.
Return type:C (numpy.array)
get_labels(community_obj)

Get the dictionary of individual cluster labels for each residue.

Parameters:community_obj ([int]) – Output from hierarchical clustering.
get_n_communities(dist_mat, n)

Get the number of communities

Parameters:
  • dist_mat (numpy.array) – Crosscorelation based euclidean distance.
  • n (int) – Number of desired community.
Returns:

Label assigned to each residue.

Return type:

label ([int])

get_range(iterable)

Get the consequent numbers in the list.

Parameters:iterable ([int]) – Array containing iterable.
Returns:First and Last element of the consequent numbers.
Return type:first, last (int,int)
packman.apps.dci.dci_cli(args, mol)