Ontology¶
The Ontology class provides Gene Ontology (GO) utilities: fetching gene sets from GO accessions and mapping phenotypic categories to network nodes.
Import¶
Quick example¶
from neko._annotations.gene_ontology import Ontology
onto = Ontology()
# Fetch all genes annotated to a specific GO term
genes = onto.fetch_genes_from_go_id("GO:0007165") # signal transduction
# Map nodes in a network to tissue expression data
onto.add_tissue_expression(net, tissue="liver")
Helper function¶
fetch_nodes_from_url ¶
fetch the nodes in a list from the given geneontology url
Source code in neko/_annotations/gene_ontology.py
Class reference¶
Ontology ¶
class that stores some functionalities to connect phenotypes to nodes and to associate information for each node at tissue level
Source code in neko/_annotations/gene_ontology.py
Functions¶
modify_url_ontology ¶
Modifies a given URL by replacing a GO code and a descriptive string in very specific locations identified by prefixes.
Parameters: - url (str): The original URL to be modified. - new_go_code (str): The new GO code to insert into the URL. - new_description (str): The new descriptive string to insert into the URL.
Returns: - str: The modified URL.
Source code in neko/_annotations/gene_ontology.py
check_tissue_annotations ¶
Check if tissue annotations for each gene symbol contain the specified tissue.
Args: genes_df (DataFrame): DataFrame containing gene symbols. tissue (str): Tissue to check for in annotations.
Returns: DataFrame: DataFrame with results indicating whether each gene symbol has tissue annotations containing the specified tissue.