3 # BioPerl module for Bio::OntologyIO::soflat
5 # Cared for by Christian M. Zmasek <czmasek@gnf.org> or <cmzmasek@yahoo.com>
7 # (c) Christian M. Zmasek, czmasek@gnf.org, 2002.
8 # (c) Hilmar Lapp, hlapp at gnf.org, 2003.
9 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002-3.
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::soflat - a parser for the Sequence Ontology flat-file format
32 # do not use directly -- use via Bio::OntologyIO
33 my $parser = Bio::OntologyIO->new
34 ( -format => "so", # or soflat
35 -defs_file => "/home/czmasek/SO/SO.defs",
36 -file => "/home/czmasek/SO/sofa.ontology" );
38 my $sofa_ontology = $parser->next_ontology();
40 my $IS_A = Bio::Ontology::RelationshipType->get_instance( "IS_A" );
41 my $PART_OF = Bio::Ontology::RelationshipType->get_instance( "PART_OF" );
45 Needs Graph.pm from CPAN.
47 This is essentially a very thin derivation of the dagflat base-parser.
53 User feedback is an integral part of the evolution of this and other
54 Bioperl modules. Send your comments and suggestions preferably to the
55 Bioperl mailing lists Your participation is much appreciated.
57 bioperl-l@bioperl.org - General discussion
58 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
62 Report bugs to the Bioperl bug tracking system to help us keep track
63 the bugs and their resolution. Bug reports can be submitted via the
66 http://bugzilla.open-bio.org/
72 Email: czmasek@gnf.org or cmzmasek@yahoo.com
74 WWW: http://www.genetics.wustl.edu/eddy/people/zmasek/
78 Genomics Institute of the Novartis Research Foundation
79 10675 John Jay Hopkins Drive
84 Hilmar Lapp, hlapp at gmx.net
88 The rest of the documentation details each of the object
89 methods. Internal methods are usually preceded with a _
94 # Let the code begin...
97 package Bio
::OntologyIO
::soflat
;
101 use Bio
::Ontology
::TermFactory
;
103 use constant TRUE
=> 1;
104 use constant FALSE
=> 0;
107 use base
qw(Bio::OntologyIO::dagflat);
113 Usage : $parser = Bio::OntologyIO->new(
115 -files => ["/path/to/sofa.ontology"] );
116 Function: Creates a new soflat parser.
117 Returns : A new soflat parser object, implementing Bio::OntologyIO.
118 Args : -defs_file => the name of the file holding the term
120 -files => a single ontology flat file holding the
121 term relationships, or an array ref holding
123 -file => if there is only a single flat file, it may
124 also be specified via the -file parameter
125 -ontology_name => the name of the ontology; if not specified the
126 parser will auto-discover it by using the term
127 that starts with a $, and converting underscores
129 -engine => the Bio::Ontology::OntologyEngineI object
130 to be reused (will be created otherwise); note
131 that every Bio::Ontology::OntologyI will
132 qualify as well since that one inherits from the
135 See L<Bio::Ontology::OntologyI>.
139 # in reality, we let OntologyIO::new do the instantiation, and override
140 # _initialize for all initialization work
142 my ($self, @args) = @_;
144 $self->SUPER::_initialize
( @args );
146 # default term object factory
147 $self->term_factory(Bio
::Ontology
::TermFactory
->new(
148 -type
=> "Bio::Ontology::GOterm"))
149 unless $self->term_factory();