* seq_inds is not defined for Model-based HSPs
[bioperl-live.git] / Bio / OntologyIO / soflat.pm
blobf5fc36686c7826136fc71bf2620c66d4e7f6904a
1 # $Id$
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
24 =head1 NAME
26 Bio::OntologyIO::soflat - a parser for the Sequence Ontology flat-file format
28 =head1 SYNOPSIS
30 use Bio::OntologyIO;
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" );
43 =head1 DESCRIPTION
45 Needs Graph.pm from CPAN.
47 This is essentially a very thin derivation of the dagflat base-parser.
49 =head1 FEEDBACK
51 =head2 Mailing Lists
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
60 =head2 Reporting Bugs
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
64 web:
66 http://bugzilla.open-bio.org/
68 =head1 AUTHOR
70 Christian M. Zmasek
72 Email: czmasek@gnf.org or cmzmasek@yahoo.com
74 WWW: http://www.genetics.wustl.edu/eddy/people/zmasek/
76 Address:
78 Genomics Institute of the Novartis Research Foundation
79 10675 John Jay Hopkins Drive
80 San Diego, CA 92121
82 =head2 CONTRIBUTOR
84 Hilmar Lapp, hlapp at gmx.net
86 =head1 APPENDIX
88 The rest of the documentation details each of the object
89 methods. Internal methods are usually preceded with a _
91 =cut
94 # Let the code begin...
97 package Bio::OntologyIO::soflat;
99 use strict;
101 use Bio::Ontology::TermFactory;
103 use constant TRUE => 1;
104 use constant FALSE => 0;
107 use base qw(Bio::OntologyIO::dagflat);
110 =head2 new
112 Title : new
113 Usage : $parser = Bio::OntologyIO->new(
114 -format => "soflat",
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
119 definitions
120 -files => a single ontology flat file holding the
121 term relationships, or an array ref holding
122 the file names
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
128 to spaces
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
133 former.
135 See L<Bio::Ontology::OntologyI>.
137 =cut
139 # in reality, we let OntologyIO::new do the instantiation, and override
140 # _initialize for all initialization work
141 sub _initialize {
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();
151 } # _initialize