tvbgo

ontology.semanticweb.tvbgo

TVB-GO Module

This module provides utilities for working with TVB and the Gene Ontology.

.. moduleauthor:: Leon K. Martin

Functions

Name Description
add_node Add a node to a given graph.
get_annotated_parameters Retrieve parameters that have been annotated.
get_go Retrieve the Gene Ontology DAG (Directed Acyclic Graph) from the online repository.
get_term This function retrieves the definition of a given Gene Ontology term,
go_term2id Convert a Gene Ontology term to its corresponding ID.
graph_from_table Generate a graph based on a given table.
rename2clust Rename a keyword based on predefined clusters.
retrieve_go_id Search for a Gene Ontology term and retrieve its ID.
rmv_extrachars Remove special characters from a term.

add_node

ontology.semanticweb.tvbgo.add_node(n, g, type=None, **kwargs)

Add a node to a given graph.

Parameters

n : node The node to be added. g : NetworkX graph The graph to which the node will be added. type : str, optional Type of the node. **kwargs Additional keyword arguments.

get_annotated_parameters

ontology.semanticweb.tvbgo.get_annotated_parameters()

Retrieve parameters that have been annotated.

Returns

list List of annotated parameters.

get_go

ontology.semanticweb.tvbgo.get_go()

Retrieve the Gene Ontology DAG (Directed Acyclic Graph) from the online repository.

Returns

go : GODag object The Gene Ontology DAG.

get_term

ontology.semanticweb.tvbgo.get_term(go_id)

This function retrieves the definition of a given Gene Ontology term, using EMBL-EBI’s QuickGO browser. Input: go_id - a valid Gene Ontology ID, e.g. GO:0048527.

Parameters

go_id : str A valid Gene Ontology ID, e.g., GO:0048527.

Returns

dict Term information.

Raises

ValueError If information from QuickGO is not retrievable.

go_term2id

ontology.semanticweb.tvbgo.go_term2id(term)

Convert a Gene Ontology term to its corresponding ID.

Parameters

term : str The Gene Ontology term to convert.

Returns

str or None The corresponding GO ID or None if not found.

graph_from_table

ontology.semanticweb.tvbgo.graph_from_table(df_tvbgo=df_tvbgo)

Generate a graph based on a given table.

Parameters

df_tvbgo : DataFrame, optional Data table used to generate the graph. Defaults to the module-level df_tvbgo.

Returns

NetworkX graph Generated graph.

rename2clust

ontology.semanticweb.tvbgo.rename2clust(kw)

Rename a keyword based on predefined clusters.

Parameters

kw : str Keyword to rename.

Returns

str Renamed keyword.

retrieve_go_id

ontology.semanticweb.tvbgo.retrieve_go_id(term)

Search for a Gene Ontology term and retrieve its ID.

Parameters

term : str The Gene Ontology term to search.

Returns

str or None The corresponding GO ID or None if not found.

rmv_extrachars

ontology.semanticweb.tvbgo.rmv_extrachars(term)

Remove special characters from a term.

Parameters

term : str The term from which special characters should be removed.

Returns

str Term without special characters.