GO::AppHandle is a Gene Ontology Data API handler.
SYNOPSIS
use GO::AppHandle;
my $dbname = "go";
# connect to a database on a specific host
$apph = GO::AppHandle->connect(-dbname=>$dbname, -dbhost=>$mysqlhost);
# EXAMPLE 1
# fetching a GO term from the datasource
$term = $apph->get_term({acc=>"GO:0003677"});
printf
"GO term; name=%s GO ID=%sn",
$term->name(), $term->public_acc();
# EXAMPLE 2
# fetching a list of associations to the ER
# (and all the GO terms that are subtypes of the ER, or
# located within the ER)
# for which there is reasonably good evidence
# (traceable author / direct assay)
$assocs = $apph->get_associations({name=>"endoplasmic reticulum"},
{evcodes=>["TAS", "IDA"]});
foreach my $assoc (@$assocs) {
printf
"Gene: %s evidence for association: %s %s",
$assoc->gene_product->symbol,
$assoc->evidence->code(),
$assoc->evidence->xref->xref_key();
}
# EXAMPLE 3
# fetching a subgraph of GO
$graph = $apph->get_graph(-acc=>3677, -depth=>3);
foreach my $term (@ {$graph->get_all_nodes}) {
printf
"GO term; name=%s GO ID=%sn",
$term->name(), $term->public_acc();
}
# EXAMPLE 4
# fetching a subgraph of GO,
# and using a graph iterator to
# display the graph
$graph = $apph->get_graph_by_search("DNA helicase*");
$it = $graph->create_iterator;
while (my $ni = $it->next_node_instance) {
$depth = $ni->depth;
$term = $ni->term;
printf
"%s Term = %s (%s) // n_assocs=%s // depth=%dn",
"----" x $depth,
$term->name,
$term->public_acc,
$term->n_associations || 0,
$depth;
}
# EXAMPLE 5
# fetching a subgraph of GO,
# constraining by gene products
# get all terms that were used to annotate these two SGD genes
$terms = $apph->get_terms({products=>["Eip63F-1", "Krt1-13"]});
# build a graph all the way to the leaf nodes
# from the above terms
$graph = $apph->get_graph_by_terms($terms, -1);
# create an iterator on the graph
$it = $graph->create_iterator;
# iterate through every node in graph
while (my $ni = $it->next_node_instance) {
$depth = $ni->depth;
$term = $ni->term;
printf
"%s Term = %s (%s) // ASSOCS=%sn",
"----" x $depth,
$term->name,
$term->public_acc,
join("; ",
map {$_->gene_product->acc} @{$term->association_list});
}
Product's homepage
Requirements:
· Perl