[Bioperl-l] GO parser

Hilmar Lapp hlapp@gnf.org
Sat, 16 Nov 2002 01:32:19 -0800


I changed the case of simpleGOengine to better adhere to our 
conventions. Also, I moved the parser to a newly created 
Bio::OntologyIO namespace.

We've got an InterPro parser in the queue. After that is released we 
may have a better idea  what parameters an OntologyIO.pm could 
require.

Beware that especially the Relationship modules and OntologyEngineI 
are only sparsely documented yet.

	-hilmar

On Thursday, November 14, 2002, at 04:22 PM, Chris Zmasek wrote:

> All:
>
> I just submitted all the necessary classes for my "simpleGOparser" 
> (this parser returns a "simpleGOengine").
> In particular, these are:
> - Ontology/OntologyEngineI.pm (by Peter Dimitrov)
> - Ontology/Relationship.pm
> - Ontology/RelationshipI.pm (by Peter Dimitrov)
> - Ontology/RelationshipType.pm
> - Ontology/simpleGOengine.pm
> - Ontology/simpleGOparser.pm
>
> Tests and data:
> - t/simpleGOparser.t
> - t/data/component.ontology.test
> - t/data/GO.defs.test
>
> Example script:
> - examples/ontology/simpleGOparser_example.pl
>
>
> Please note that this parser (or to be more precise, 
> "simpleGOengine") requires the Graph.pm module from CPAN.
>
> Christian [czmasek@gnf.org]
>
> PS:
> Here's an example on how to use the parser:
>
> use Bio::Ontology::simpleGOparser;
>
>
> my $parser = Bio::Ontology::simpleGOparser->new
> ( -go_defs_file_name    => "GO.defs",
>                                                  
> -components_file_name => "component.ontology",
>                                                  
> -functions_file_name  => "function.ontology",
>                                                  
> -processes_file_name  => "process.ontology" );
>
> my $engine = $parser->parse();
>
> my $IS_A    = $engine->is_a_relationship();
> my $PART_OF = $engine->part_of_relationship();
>
>
> # root terms
> # ----------
>
> print scalar( $engine->get_root_terms() ), "\n";
>
> print( ( $engine->get_root_terms() )[ 0 ]->to_string(), "\n" );
>
> print "\n\n";
>
>
> # parent terms
> # ------------
>
> my @parents1 = $engine->get_parent_terms( "GO:0045474", $IS_A );
>
> my @parents2 = $engine->get_parent_terms( $parents1[ 0 ] );
>
> foreach my $p ( @parents2 ) {
>     print $p->to_string(), "\n";
> }
>
> print "\n\n";
>
>
>
> # child terms
> # -----------
>
>
> my @child0 = $engine->get_child_terms( ( $engine->get_root_terms() )
> [ 0 ] );
>
> foreach my $c ( @child0 ) {
>     print $c->to_string(), "\n";
> }
>
> print "\n\n";
>
> my @child1 = $engine->get_child_terms( "GO:0008044", $IS_A );
>
> foreach my $cc ( @child1 ) {
>     print $cc->to_string(), "\n";
> }
>
> print "\n\n";
>
>
> # ancestor terms
> # --------------
>
> my @ancestor1 = $engine->get_ancestor_terms( "GO:0007323", $PART_OF );
>
>
>
> # descendant terms
> # ----------------
>
> my @descendant1 = $engine->get_descendant_terms( "GO:0007323", 
> $PART_OF );
>
>
>
> # relationships
> # -------------
>
> my @rel1 = $engine->get_relationships( "GO:0007323", $PART_OF, $IS_A );
>
>
> # leaf terms
> # ----------
>
> my @l1 = $engine->get_leaf_terms();
>
>
> # get term with id
> # ----------------
>
> my $term = $engine->get_term( "GO:0001661" );
>
>
> # all terms
> # ---------
>
> my @terms = $engine->each_term();
>
>
> exit( 1 );
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>
--
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------