go-perl(3pm)
π go-perl π
okay bestie, so this is the manual page for go-perl (it lives in the 3pm manual, aka User Contributed Perl Documentation) and it is literally a whole collection of perl modules for working with ontologies and data β especially the Gene Ontology and other Open Bio-Ontologies. Buckle up, she's a big one π
β¨ SYNOPSIS β¨
# ** FETCHING GRAPH OBJECTS FROM AN ONTOLOGY FILE **
use GO::Parser;
my $parser = new GO::Parser({handler=>'obj'}); # create parser object
$parser->parse("gene_ontology.obo"); # parse file -> objects
my $graph = $parser->handler->graph; # get L<GO::Model::Graph> object
my $term = $graph->get_term("GO:0001303"); # fetch a term by ID
printf "Got term: %s %s\n", $term->acc, $term->name;
my $ancestor_terms =
$graph->get_recursive_parent_terms($term->acc);
foreach my $anc_term (@$ancestor_terms) {
printf " Ancestor term: %s %s\n", $anc_term->acc, $anc_term->name;
}
# ** FROM THE COMMAND LINE ** (requires go-dev/xml)
go2xml gene_ontology.obo | xsltproc $GO_ROOT/xml/xsl/my-transform.xsl -
πΈ DESCRIPTION πΈ
go-perl is part of the go-dev code distribution. She's also available as a separate library in her own right β main character energy either way π
go-perl is a collection of perl modules for working with ontologies and data, in particular the Gene Ontology and other Open Bio-Ontologies. For background on these projects, see
http://www.geneontology.org
http://obo.sourceforge.net
go-perl provides the following functionality:
π parsers
Biological ontologies and associated data come in assorted formats. See:
GO::Parser
βοΈ handlers/writers
All parsers are XML event based β they emit Obo-XML, which can be caught by different handlers. Some of these handlers effectively transform the parsed file into a different format or summary.
If you are not interested in generating XML, you can use an object handler, which will give you objects for traversing an ontology; see below π
πΈοΈ a graph-based object model
Biological ontologies typically have graph-based structures (DAGs). go-perl provides a perl object model representing ontologies and associations to ontologies. Classes include:
GO::Model::Term-- a node/term within an ontologyGO::Model::Graph-- collection of terms and the relationships between themGO::Model::Relationship-- a typed relationship between two termsGO::Model::Xref-- a database xref, for a term or any other objectGO::Model::Association-- an association between a term and a gene productGO::Model::GeneProduct-- a gene or product of a gene or similar annotated entityGO::Model::Evidence-- supporting evidence for an associationGO::Model::Seq-- a biological sequence of residues for a gene product
π«Ά SIMPLE PROGRAMMERS INTERFACE
GO::Basicβ simple procedural access to GO files β¨
π SCRIPTS π
These scripts come as part of the go-perl distribution:
map2slimβ Given a GO slim file, and a current ontology (in one or more files), this script will map a gene association file (containing annotations to the full GO) to the terms in the GO slim. The script can be used to either create a new gene association file, containing the most pertinent GO slim accessions, or in count-mode, in which case it will give distinct gene product counts for each slim term.
for full instructions, see map2slim
go-dag-summary.plβ Generates a summary of the DAG structure of an ontology file.
A row will be generated for every ontology in the file, with the following data columns:
input filename
total no of terms
total no of relationships
total no of paths
avg no of paths per term (p/t)
maximum no of paths for any term
ID of term with maximum no of paths
for full instructions, see go-dag-summary.pl
go-show-paths-to-root.plβ Will show all possible paths from a term to the root/top in the ontology.
for full instructions, see go-show-paths-to-root.pl
go-apply-xsltβ Will apply a GO XSL transform (by name) on an OBO-XML file.
For a full list of XSLs available, see <http://www.godatabase.org/xml/xsl>
go-export-graph.plβ Writes an obo file out as an ascii-tree, a graphviz PNG or other format.
for full instructions, see go-export-graph.pl
go-show-assocs-by-node.plβ given a GO ontology file and an association file and a term ID, will list all products associated to that ID.
for full instructions, see go-show-assocs-by-node.pl
go-filter-subset.plβ Exports a subset of an ontology from a file. The subset can be based on a specified set of IDs, a preset "subset" filter in the ontology file (eg a GO "slim" or subset), or a user-defined filter.
The subset can be exported in any format, including a graphical image πΈ
for full instructions, see go-filter-subset.pl
go2fmt.plβ generic file converter. This will convert any go/obo formatted file such as ontology files and association files and write output in some other format or report. See the full list of convenience scripts below.
for full instructions, see go2fmt.pl
go2chadoxmlβ converts a file in any valid go/obo format to chadoxml. See alsogo2fmt.plgo2godb_prestoreβ converts a file in any valid go/obo format to an xml format that is isomorphic to the GO MySQL Db schema, and can be loaded withDBIx::DBStag. See alsogo2fmt.plgo2error_reportβ converts a file in any valid go/obo format to error_report. See alsogo2fmt.plgo2obo_test(alias:go2obo) β converts a file in any valid go/obo format to obo. See alsogo2fmt.plgo2obo_htmlβ converts a file in any valid go/obo format to obo_html. See alsogo2fmt.plgo2obo_xml(alias:go2xml) β converts a file in any valid go/obo format to obo_xml. See alsogo2fmt.plgo2owlβ converts a file in any valid go/obo format to owl. See alsogo2fmt.plgo2pathlistβ converts a file in any valid go/obo format to pathlist. See alsogo2fmt.plgo2prologβ converts a file in any valid go/obo format to prolog. See alsogo2fmt.plgo2rdfxmlβ converts a file in any valid go/obo format to rdfxml. See alsogo2fmt.plgo2summaryβ converts a file in any valid go/obo format to summary. See alsogo2fmt.plgo2sxprβ converts a file in any valid go/obo format to sxpr. See alsogo2fmt.plgo2tblβ converts a file in any valid go/obo format to tbl. See alsogo2fmt.plgo2text_htmlβ converts a file in any valid go/obo format to text_html. See alsogo2fmt.pl
π RELATED PACKAGES π
Download the full go-dev distribution for access to more functionality. go-perl is a subset of go-dev π
go-dev includes the following:
go-perlβ This package
http://www.godatabase.org/dev/go-perl/doc/go-perl-doc.html
go-db-perlβ Database API for use in conjunction withgo-perl.
Allows for loading of GO databases and fetching graph objects from the database.
http://www.godatabase.org/dev/go-db-perl/doc/go-db-perl-doc.html
GO::AppHandle
amigoβ Ontology browser, written in perl.
Requires installation of both go-perl and go-db-perl
javaβ The DAG-Edit curation tool
http://www.godatabase.org/dev
xmlβ DTDs for the Obo-XML format, and XSL stylesheets for converting to and from Obo-XML format
http://www.godatabase.org/dev/xml/doc/xml-doc.html
sqlβ Schema and SQL code for the GO database
http://www.godatabase.org/dev/sql/doc/godb-sql-doc.html
π AUTHORS π
(C) Chris Mungall 2000-2006
This module is free software. You may distribute under the same terms as perl itself.
k that's the whole page bestie, hope it slays for you π¦ and just so you have the receipts: this was documented for perl v5.36.0, dated 2023-12-18, under the go-perl(3pm) manual. periodt π
β¨
π¦ where this page comes from
- debian trixie: libgo-perl 0.15-10 Β· Perl
- ubuntu noble: libgo-perl 0.15-10 Β· Perl
- ubuntu resolute: libgo-perl 0.15-10 Β· Perl
- ubuntu stonking: libgo-perl 0.15-10 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms