GoClusteringSimilarityFunction
index
../../../../piana/code/Clustering/GoClustering/GoClusteringSimilarityFunction.py

File        : GoClusteringSimilarityFunction.py
Author      : Pablo Boixeda & Ramon Aragues
Creation    : 6.2005
Contents    : Similarity function that determines similarity between clusters with go terms
Called from : 
 
=======================================================================================================

 
Modules
       
LinearAlgebra
PianaGlobals
copy
fgraph
getopt
numarray
piana_configuration_parameters
re
readline
sys

 
Classes
       
ClusteringSimilarityFunction.ClusteringSimilarityFunction(__builtin__.object)
GoClusteringSimilarityFunction

 
class GoClusteringSimilarityFunction(ClusteringSimilarityFunction.ClusteringSimilarityFunction)
    Similarity function that determines similarity between clusters with go terms
 
 
Method resolution order:
GoClusteringSimilarityFunction
ClusteringSimilarityFunction.ClusteringSimilarityFunction
__builtin__.object

Methods defined here:
__init__(self, piana_access=None, term_type=None, mode=None, path_length_threshold=None)
"dbaccess" is a database accession object used to access information from a database, in case the similarity function needs information
that is not contained in the node itself. If not being used, just set to None
 
"term_type" specifies which kind of GO terms we will use for the clustering.
 
  valid values are:
     - molecular_function
     - biological_process
     - cellular_component
 
"mode" defines how to evaluate the distance between two clusters:
  - random takes a random element from each cluster and evaluates similarity between them
  - min takes the minimal distance between elements of each cluster
  - max takes the maximal distance between elements of each cluster
  - average takes the average distance between all elements of each cluster
 
 
"path_length_threshold": Maximum distance between two clusters to be joined
calculate_formula(self, term1=None, term2=None)
Method that calculates the formula using two specific elements inside
a cluster:
 
"term1": Go term id of the first element
 
"term2": Go term id of the second element
calculate_similarity(self, list_node_attributes1, list_node_attributes2)
Method that returns similarity score from two lists of attributes of nodes that are being clustered
 
"list_node_attributes1" is a list of node attributes that belong to the same cluster
 
"list_node_attributes2" is a list of node attributes that belong to the same cluster
 
This method calculates how similar this two clusters are
get_highest_depth(self)
returns highest detph found
 
used by the go clustering stop condition to stop the clustering
get_proteinPianas_list(self, list_node_attribute=None)
Method that returns a protein piana list, from an attributes list given
 
"list_node_attribute": list of attributes into a cluster. Each attribute is a protein pianaID
get_terms_depth(self, list_of_terms_ids=None, search_mode=None)
Method that searches the go term with maximum or minimum depth in a cluster
 
"list_of_terms_ids": the list of term ids in the cluster
 
"search_mode": determines which of the terms will be returned:
 
   - min: returns the term id that has the lowest depth
   - max: returns the term id that has the highest depth
 
returns the term id matching the search criteria
print_go_graph_dot_file(self, filter_mode='all', output_target=None, use_alternative_id='no', representative_term='min')
Generates .dot file output of the clustered graph of go
It can be fed directly into the GraphViz program neato. This produces very nice network images...
 
filter_mode can be:
- "all": prints all edges in the graph
- "hidden": prints hidden edges of the graph
- "unhidden": prints unhidden edges of the graph
 
"use_alternative_id" can be
    - "yes" --> uses alternative id for printing graph
    - "no"  --> uses internal id for printing graph
 
"representative_term" sets which of the go terms in the cluster will be shown on the cluster box
   - min takes the term with the minimal depth (more general term)
   - max takes the term with the maximal depth (more specific term)

Methods inherited from ClusteringSimilarityFunction.ClusteringSimilarityFunction:
get_index_to_node_id(self)
Method that returns the correspondence between
matrix indexes and GraphNode ids
get_max_value(self)
method that returns max  value from
the similarity matrix
get_node_id_by_index(self, number)
Method that returns the correnspondendence betrween a given index to a node_id
get_similarity_matrix(self, cluster_graph, dbaccess=None)
Method that returns similarity matrix from a given cluster graph "cluster_graph"
 
each position in the matrix indicates how similar two clusters are.

Data and other attributes inherited from ClusteringSimilarityFunction.ClusteringSimilarityFunction:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'ClusteringSimilarityFunction' objects>
list of weak references to the object (if defined)

 
Data
        root_nodes = {}
verbose = 0
verbose_add_edge_detailed = 0
verbose_add_edge_shallow = 0
verbose_expansion_detailed = 0
verbose_expansion_minimal = 1
verbose_expansion_shallow = 0
verbose_get_edge = 0
verbose_get_node = 0
verbose_has_edge = 0
verbose_join = 0
verbose_process = 1
verbose_propagate = 0
verbose_propagate_print = 0