2 # BioPerl module for Bio::OntologyIO::goflat
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Christian M. Zmasek <czmasek-at-burnham.org> or <cmzmasek@yahoo.com>
8 # (c) Christian M. Zmasek, czmasek-at-burnham.org, 2002.
9 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
11 # You may distribute this module under the same terms as perl itself.
12 # Refer to the Perl Artistic License (see the license accompanying this
13 # software package, or see http://www.perl.com/language/misc/Artistic.html)
14 # for the terms under which you may use, modify, and redistribute this module.
16 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 # You may distribute this module under the same terms as perl itself
22 # POD documentation - main docs before the code
26 Bio::OntologyIO::goflat - a parser for the Gene Ontology flat-file format
32 # do not use directly -- use via Bio::OntologyIO
33 my $parser = Bio::OntologyIO->new
35 -defs_file => "/home/czmasek/GO/GO.defs",
36 -files => ["/home/czmasek/GO/component.ontology",
37 "/home/czmasek/GO/function.ontology",
38 "/home/czmasek/GO/process.ontology"] );
40 my $go_ontology = $parser->next_ontology();
42 my $IS_A = Bio::Ontology::RelationshipType->get_instance( "IS_A" );
43 my $PART_OF = Bio::Ontology::RelationshipType->get_instance( "PART_OF" );
47 Needs Graph.pm from CPAN.
49 This is essentially a very thin derivation of the dagflat parser.
55 User feedback is an integral part of the evolution of this and other
56 Bioperl modules. Send your comments and suggestions preferably to the
57 Bioperl mailing lists Your participation is much appreciated.
59 bioperl-l@bioperl.org - General discussion
60 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
64 Please direct usage questions or support issues to the mailing list:
66 I<bioperl-l@bioperl.org>
68 rather than to the module maintainer directly. Many experienced and
69 reponsive experts will be able look at the problem and quickly
70 address it. Please include a thorough description of the problem
71 with code and data examples if at all possible.
75 Report bugs to the Bioperl bug tracking system to help us keep track
76 the bugs and their resolution. Bug reports can be submitted via the
79 https://github.com/bioperl/bioperl-live/issues
85 Email: czmasek-at-burnham.org or cmzmasek@yahoo.com
87 WWW: http://monochrome-effect.net/
91 Genomics Institute of the Novartis Research Foundation
92 10675 John Jay Hopkins Drive
97 Hilmar Lapp, hlapp at gmx.net
101 The rest of the documentation details each of the object
102 methods. Internal methods are usually preceded with a _
107 # Let the code begin...
110 package Bio
::OntologyIO
::goflat
;
114 use Bio
::Ontology
::TermFactory
;
116 use constant TRUE
=> 1;
117 use constant FALSE
=> 0;
120 use base
qw(Bio::OntologyIO::dagflat);
126 Usage : $parser = Bio::OntologyIO->new(
128 -defs_file => "/path/to/GO.defs",
129 -files => ["/path/to/component.ontology",
130 "/path/to/function.ontology",
131 "/path/to/process.ontology"] );
132 Function: Creates a new goflat parser.
133 Returns : A new goflat parser object, implementing Bio::OntologyIO.
134 Args : -defs_file => the name of the file holding the term
136 -files => a single ontology flat file holding the
137 term relationships, or an array ref holding
138 the file names (for GO, there will usually be
139 3 files: component.ontology, function.ontology,
141 -file => if there is only a single flat file, it may
142 also be specified via the -file parameter
143 -ontology_name => the name of the ontology; if not specified the
144 parser will auto-discover it by using the term
145 that starts with a $, and converting underscores
147 -engine => the Bio::Ontology::OntologyEngineI object
148 to be reused (will be created otherwise); note
149 that every Bio::Ontology::OntologyI will
150 qualify as well since that one inherits from the
153 See L<Bio::OntologyIO>.
157 # in reality, we let OntologyIO::new do the instantiation, and override
158 # _initialize for all initialization work
160 my ($self, @args) = @_;
162 $self->SUPER::_initialize
( @args );
164 # default term object factory
165 $self->term_factory(Bio
::Ontology
::TermFactory
->new(
166 -type
=> "Bio::Ontology::GOterm"))
167 unless $self->term_factory();