Data Integrator (Python API)
Public Member Functions | Static Public Attributes | List of all members
cls.GOGraphNetworkX.CGOGraphNetworkX Class Reference
Inheritance diagram for cls.GOGraphNetworkX.CGOGraphNetworkX:
Inheritance graph
[legend]
Collaboration diagram for cls.GOGraphNetworkX.CGOGraphNetworkX:
Collaboration graph
[legend]

Public Member Functions

def GetRoot (s)
 Get the root data node. More...
 
def GetAllNodes (s)
 Get all data nodes. More...
 
def GetAncestors (s, goID, include=True)
 Get ancestor nodes for a certain node. More...
 
def GetAllAncestors (s, include=True)
 Get ancestor nodes for all nodes in the graph. More...
 
def GetChildren (s, goID, include=True)
 Get child nodes for a certain node. More...
 
def IgnoreRelationships (s, is_a=False, regulates=False, part_of=False, positively_regulates=False, negatively_regulates=False)
 Do not take into account certain relationships. More...
 
def SetCountsFromAC (s, ac)
 Populate graph with counts from an annotation corpus. More...
 
def UpdateAllNodes (s)
 Transfer content of all data nodes to the internal graph. More...
 
def ReadGraphML (s, ffn)
 Read a graphml-formatted gene ontology from a file. More...
 
def WriteGraphML (s, ffn)
 Write the graph to a file. More...
 
def ReadOBO (s, ffn, ac)
 
def GetDistance (s, source, target)
 Get the shortest distance between two nodes. More...
 
- Public Member Functions inherited from cls.GOGraphBase.CGOGraphBase
def __init__ (s)
 Initialize the internal graph implementation. More...
 
def UpdateNode (s, goID)
 Transfer content of data node to the internal graph. More...
 
def ReadOBO (s, ffn)
 Read an OBO-formatted gene ontology from file. More...
 
def IsPopulated (s)
 Has the graph been populated? More...
 

Static Public Attributes

string gfn = "/home/antonia/Desktop/Test_files/treetest.graphml";
 
string goaffn = "/home/antonia/Desktop/Test_files/treetest.goa.tsv";
 
 g = CGOGraphNetworkX();
 
 acMF = CAnnotationCorpus("molecular_function");
 
 acBP = CAnnotationCorpus("biological_process");
 
 acCC = CAnnotationCorpus("cellular_component");
 
 gaf = CGAFReader();
 

Member Function Documentation

◆ GetAllAncestors()

def cls.GOGraphNetworkX.CGOGraphNetworkX.GetAllAncestors (   s,
  include = True 
)

Get ancestor nodes for all nodes in the graph.

    @param include (@c Bool) Indicates whether to include the start data
     node (@c True) or not (@c False).
    @return A @c Dictionary. Key is the GO ID, and its value is a @c list
    of references to @ref cls.GOGraphNode.CGOGraphNode

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ GetAllNodes()

def cls.GOGraphNetworkX.CGOGraphNetworkX.GetAllNodes (   s)

Get all data nodes.

    @return A @c List of references to @ref cls.GOGraphNode.CGOGraphNode
    instances. By this way, data can be accessed and modified and remains
    attached to the graph.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ GetAncestors()

def cls.GOGraphNetworkX.CGOGraphNetworkX.GetAncestors (   s,
  goID,
  include = True 
)

Get ancestor nodes for a certain node.

    @param goID  (@c String) GO ID, eg. 'GO:0006865'.
    @param include (@c Bool) Indicates whether to include the start data
     node (@c True) or not (@c False).
    @return A @c List of references to @ref cls.GOGraphNode.CGOGraphNode.
     This list is empty if @c goID was not found.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ GetChildren()

def cls.GOGraphNetworkX.CGOGraphNetworkX.GetChildren (   s,
  goID,
  include = True 
)

Get child nodes for a certain node.

    @param goID  (@c String) GO ID, eg. 'GO:0006915'.
    @param include (@c Bool) Indicates whether to include the start data
     node (@c True) or not (@c False).
    @return A @c List of references to @ref cls.GOGraphNode.CGOGraphNode
     This list is empty if @c goID was not found.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ GetDistance()

def cls.GOGraphNetworkX.CGOGraphNetworkX.GetDistance (   s,
  srcGOID,
  dstGOID 
)

Get the shortest distance between two nodes.

    Notice that the graph is directed and that edges emerge from more
    specific nodes to less specific nodes. See the example GO IDs below.
    @param srcGOID (@c String) Source GO ID, eg. 'GO:0006860'.
    @param dstGOID (@c String) Destination GO ID, eg. 'GO:0008150'.
    @return The number of edges of the shortest path from the source to
     the destination node. This number equals -1, if any of the two GO
     IDs is not present in the graph.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ GetRoot()

def cls.GOGraphNetworkX.CGOGraphNetworkX.GetRoot (   s)

Get the root data node.

    The root node is the most general term and eventually each node ends
    up in the root node when traveling along the graph's edges.
    @return @ref cls.GOGraphNode.CGOGraphNode instance of the root.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ IgnoreRelationships()

def cls.GOGraphNetworkX.CGOGraphNetworkX.IgnoreRelationships (   s,
  is_a = False,
  regulates = False,
  part_of = False,
  positively_regulates = False,
  negatively_regulates = False 
)

Do not take into account certain relationships.

    @b Removes from the graph the edges marked with the relationships
    indicated by the parameters listed below. @b Attention: Then the
    graph is saved, these edges will be missing.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ ReadGraphML()

def cls.GOGraphNetworkX.CGOGraphNetworkX.ReadGraphML (   s,
  ffn 
)

Read a graphml-formatted gene ontology from a file.

    Loads a graphml-formatted file into this object. The graph represents
    the ontology and may have only nodes with @c id and @c name vertex
    attributes, but it can in addition be furnished with @c cnt and @c
    freq attributes. The latter is a shortcut to avoid reading an
    annotation corpus and populating the graph.
    @param ffn  Full path file name.
    @return (@c Bool) @c True, if the graph was read successfully. @c
     False, if the file could not be opened.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ ReadOBO()

def cls.GOGraphNetworkX.CGOGraphNetworkX.ReadOBO (   s,
  ffn,
  ac 
)

◆ SetCountsFromAC()

def cls.GOGraphNetworkX.CGOGraphNetworkX.SetCountsFromAC (   s,
  ac 
)

Populate graph with counts from an annotation corpus.

    The annotation corpus delivers information how many GO IDs are
    associated with proteins. For each GO ID, the number of associated
    proteins is added to each of the ancestor nodes. After completion,
    the graph is normalized by _Normalize and is ready for semantic
    similarity calculations.
    @param ac  @ref cls.AnnotationCorpus.CAnnotationCorpus instance.
    @return (@c Bool) @c False, if the annotation corpus name does not
     match the ontology's root name defined by the graph. An error message
     is written. @c True, if the graph has been populated successfully.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ UpdateAllNodes()

def cls.GOGraphNetworkX.CGOGraphNetworkX.UpdateAllNodes (   s)

Transfer content of all data nodes to the internal graph.

    See @ref UpdateNode.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

◆ WriteGraphML()

def cls.GOGraphNetworkX.CGOGraphNetworkX.WriteGraphML (   s,
  ffn 
)

Write the graph to a file.

    Writes the graph to a file using the internal node and edge
    attributes. Since data nodes may have changed after reading, a call to
    @ref UpdateAllNodes is performed here as an operation common to all
    subclasses. Currently, the exactly those attributes listed in @ref
    UpdateAllNodes are written to the graph file.
    @param ffn  Full path file name.
    @return (@c Bool) @c True, if the graph was read successfully. @c
     False, if the file could not be opened.

Reimplemented from cls.GOGraphBase.CGOGraphBase.

Member Data Documentation

◆ acBP

cls.GOGraphNetworkX.CGOGraphNetworkX.acBP = CAnnotationCorpus("biological_process");
static

◆ acCC

cls.GOGraphNetworkX.CGOGraphNetworkX.acCC = CAnnotationCorpus("cellular_component");
static

◆ acMF

cls.GOGraphNetworkX.CGOGraphNetworkX.acMF = CAnnotationCorpus("molecular_function");
static

◆ g

cls.GOGraphNetworkX.CGOGraphNetworkX.g = CGOGraphNetworkX();
static

◆ gaf

cls.GOGraphNetworkX.CGOGraphNetworkX.gaf = CGAFReader();
static

◆ gfn

string cls.GOGraphNetworkX.CGOGraphNetworkX.gfn = "/home/antonia/Desktop/Test_files/treetest.graphml";
static

◆ goaffn

string cls.GOGraphNetworkX.CGOGraphNetworkX.goaffn = "/home/antonia/Desktop/Test_files/treetest.goa.tsv";
static

The documentation for this class was generated from the following file: