| | |
- GraphEdgeAttribute.GraphEdgeAttribute
-
- PianaGraphEdgeAttribute
class PianaGraphEdgeAttribute(GraphEdgeAttribute.GraphEdgeAttribute) |
| |
Class that implements attributes for Piana Edges: accessing edge values, setting edge values, ... |
| |
Methods defined here:
- __deepcopy__(self, memo)
- __init__(self, interactionPiana_value=None, mem_mode='onDemand', piana_access=None, confidence_interaction_value=0, propagated=None, extended=None)
- "interactionPiana_value" is the database identifier for this edge
"piana_access" is a PianaDBaccess object, used to retrieve information from the database
"mem_mode" can be:
--> "onDemand": values are retrieved from DB only when they are needed
--> "inMemory": values are retrieved from DB at initilisation
"propagated" is an object of class PropagatedEdge
"extended" is an object of class ExtendedEdge
Attention!!! Right now, not using extended for anything: I do not add edges to the graph by extension (extension meant that
edges from the database where added for nodes that were added to network during an expansion.
--> There will just be propagated edges
Attention!!! Currently, not using "confidence_interaction_value"
- __str__(self)
- implementation of conversion to string for PianaGraphEdgeAttribute
- add_sourceDB_methodID(self, sourceDBID=None, methodID=None)
- adds (checking that there is no redundancy) the sourceDB and methodID to the current edge (used for merging edges)
- distance(self)
- To do!!! Get distance that makes biological sense
Returns a distance like value.
Defaults to return 1
- get_db_edge_id(self)
- Overrides method get_db_edge_id() of superclass GraphEdgeAttribute
returns the interactionPiana identifier for this interaction
It is the same as get_interactionPiana, but in this case it is overridden a method that all XXGraphEdgeAttribute must have
This is the method that is called from Graph, since Graph doesn't know which kind of EdgeAttribute it is processing
- get_extensions(self)
- returns [] if it is not an edge coming from an extension
otherwise returns a list of objects ExtendedEdge
- get_interactionPiana(self)
- returns the interactionPiana identifier for this interaction
- get_list_method_id(self)
- returns a list with methods for this interaction
- get_list_source_db(self)
- returns a list with source databases for this interaction
- get_propagations(self)
- returns [] if it is not a edge coming from an propagation
otherwise returns a list of objects PropagatedEdge
- get_sourceDB_methodID(self)
- returns sourceDB_methodID attribute, which is a list of tuples [sourceDB, methodID]
- merge_attribute(self, new_edge_attribute, ignore_ids=0)
- merges the attribute of the object with the new edge attribute passed as argument
ignore_ids is used to avoid conflicts when unifying the network in PianaGraph
- set_extension(self, expansion_type=None, extended_from_node=None, extended_edge_object=None)
- Adds to the edge an object describing an extension ( database interactions added to the graph because one of the nodes involved
in the interaction was added to the graph as a result of an expansion)
if extended_edge_object is not None, adds that object (avoiding adding an object that already exists)
if not, creates a new object using expansion_type and extended_from_node
edge_extended_object is of class ExtendedEdge
- set_propagation(self, expansion_type=None, propagated_from_node=None, propagated_from_db_edge_id=None, propagated_from_edge_id=None, propagated_edge_object=None)
- Adds to the edge an object describing a propagation (interactions of another node are added to another node because both nodes share
a certain characteristic)
if propagated_edge_object is not None, adds that object (avoiding adding an object that already exists)
if not, creates a new object using expansion_type, propagated_from_node, propagated_from_db_edge_id and propagated_from_edge_id
The propagation is described in the object propagated_edge_object of class PianaNodeExpansion PropagatedEdge
Methods inherited from GraphEdgeAttribute.GraphEdgeAttribute:
- __eq__(self, other)
- When defining new Attribute classes, the equality operator MUST be overridden.
Otherwise, adding further attributes to existing nodes in the graph may cause
duplicated attributes.
- direction(self)
- To be overridden. Returns a direction like value.
Defaults to return 0 (i.e. bidirectional)
| |