Ontology

ancestors(go_id)

Returns the list of all ancestors in the ontology for the given GO Term.

# Arguments

  • go_id - GO term ID.

# Returns

List of IDs of all the ancestors in the ontology (List of String)

batch_similarity(list1, list2, method, counter)

Compute pairwise semantic similarity in batch using a selected method.

Parameters:
  • list1 (List[str]) – First list of GO term IDs.

  • list2 (List[str]) – Second list of GO term IDs.

  • method (str) – Name of the similarity method. Options: β€œresnik”, β€œlin”.

  • counter (TermCounter) – Precomputed IC values.

Returns:

List of similarity scores.

Return type:

List[float]

Raises:

ValueError – If input lists differ in length or method is unknown.

common_ancestor(go_id1, go_id2)

Returns the list of all the common ancestors in the ontology for the given GO Terms.

# Arguments

  • go_id1 - GO term ID 1.

  • go_id2 - GO term ID 2.

# Returns

List of IDs of all the common ancestors in the ontology (List of String)

deepest_common_ancestor(go_id1, go_id2)

Returns the deepest common ancestor in the ontology for the given GO Terms.

# Arguments

  • go_id1 - GO term ID 1.

  • go_id2 - GO term ID 2.

# Returns

ID of the deepest common ancestor in the ontology. (String)

get_term_by_id(go_id)

Gets the PyGoTerm object for the given GO Term ID.

# Arguments

  • go_id - GO term ID.

# Returns

PyGOTerm associated with the ID. (PyGOTerm)

semantic_similarity(id1, id2, method, counter)

Compute semantic similarity between two GO terms using a selected method.

Parameters:
  • id1 (str) – First GO term ID.

  • id2 (str) – Second GO term ID.

  • method (str) – Name of the similarity method. Options: β€œresnik”, β€œlin”.

  • counter (TermCounter) – Precomputed IC values.

Returns:

Similarity score.

Return type:

float

Raises:

ValueError – If the method is unknown.

term_ic(go_id, counter)

Compute the Information Content (IC) of a GO term. Returns the Information Content (IC) value of a given GO term.

Parameters:
  • go_id (str) – GO term identifier.

  • counter (TermCounter) – Precomputed term counter with IC values.

Returns:

The IC of the GO term.

Return type:

float