3 # BioPerl module for Bio::SeqIO::flybase_chadoxml
5 # Peili Zhang <peili@morgan.harvard.edu>
7 # You may distribute this module under the same terms as perl itself
9 # POD documentation - main docs before the code
13 Bio::SeqIO::flybase_chadoxml - FlyBase variant of chadoxml with sequence output stream
17 It is probably best not to use this object directly, but
18 rather go through the SeqIO handler system:
20 $writer = Bio::SeqIO->new(-file => ">chado.xml",
21 -format => 'flybase_chadoxml');
23 # assume you already have Sequence or SeqFeature objects
24 $writer->write_seq($seq_obj);
26 #after writing all seqs
27 $writer->close_chadoxml();
32 This is a simple subclass of L<Bio::SeqIO::chadoxml>; please see
33 its documentation for details.
39 User feedback is an integral part of the evolution of this and other
40 Bioperl modules. Send your comments and suggestions preferably to one
41 of the Bioperl mailing lists. Your participation is much appreciated.
43 bioperl-l@bioperl.org - General discussion
44 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
48 Please direct usage questions or support issues to the mailing list:
50 I<bioperl-l@bioperl.org>
52 rather than to the module maintainer directly. Many experienced and
53 reponsive experts will be able look at the problem and quickly
54 address it. Please include a thorough description of the problem
55 with code and data examples if at all possible.
59 Report bugs to the Bioperl bug tracking system to help us keep track
60 the bugs and their resolution.
61 Bug reports can be submitted via the web:
63 http://bugzilla.bioperl.org
65 =head1 AUTHOR - Peili Zhang
67 Email peili@morgan.harvard.edu
71 The rest of the documentation details each of the object
72 methods. Internal methods are usually preceded with a _
76 package Bio
::SeqIO
::flybase_chadoxml
;
79 use base
'Bio::SeqIO::chadoxml';
83 $self->SUPER::_initialize
(%args);
85 #default for standard chado is polypeptide
86 $Bio::SeqIO
::chadoxml
::feattype_args2so
{'CDS'} = 'protein';
87 $Bio::SeqIO
::chadoxml
::cv_name
{'sequence'} = 'SO';
88 $Bio::SeqIO
::chadoxml
::cv_name
{'relationship'} = 'relationship type';
89 $Bio::SeqIO
::chadoxml
::cv_name
{'feature_property'} = 'property type';
95 =head2 return_ftype_hash
101 $obj->return_ftype_hash()
105 A simple hash where returning it has be factored out of the main
106 code to allow subclasses to override it.
110 A hash that indicates what the name of the SO term is and what
111 the name of the Sequence Ontology is in the cv table.
115 The string that represents the SO term.
121 sub return_ftype_hash
{
124 my %ftype_hash = ( "name" => $ftype,
125 "cv_id" => {"name" => $Bio::SeqIO
::chadoxml
::cv_name
{'sequence'} });
129 =head2 return_reltypename
135 $obj->return_reltypename()
139 Return the appropriate relationship type name depending on the
140 feature type (typically partof, but producedby for proteins).
144 A relationship type name.
154 sub return_reltypename
{
159 if ($sftype eq 'protein' || $sftype eq 'polypeptide') {
160 $reltypename = 'producedby';
162 $reltypename = 'partof';
178 Overrides Bio::SeqIO::chadoxml's write_seq method just
179 to add an internal close_chadoxml (mimics original use
191 my ($self, @argv) = @_;
193 $self->SUPER::write_seq
(@argv);
195 $self->close_chadoxml;