2 # BioPerl module for Bio::SeqIO::flybase_chadoxml
4 # Peili Zhang <peili@morgan.harvard.edu>
6 # You may distribute this module under the same terms as perl itself
8 # POD documentation - main docs before the code
12 Bio::SeqIO::flybase_chadoxml - FlyBase variant of chadoxml with sequence output stream
16 It is probably best not to use this object directly, but
17 rather go through the SeqIO handler system:
19 $writer = Bio::SeqIO->new(-file => ">chado.xml",
20 -format => 'flybase_chadoxml');
22 # assume you already have Sequence or SeqFeature objects
23 $writer->write_seq($seq_obj);
25 #after writing all seqs
26 $writer->close_chadoxml();
31 This is a simple subclass of L<Bio::SeqIO::chadoxml>; please see
32 its documentation for details.
38 User feedback is an integral part of the evolution of this and other
39 Bioperl modules. Send your comments and suggestions preferably to one
40 of the Bioperl mailing lists. Your participation is much appreciated.
42 bioperl-l@bioperl.org - General discussion
43 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
47 Please direct usage questions or support issues to the mailing list:
49 I<bioperl-l@bioperl.org>
51 rather than to the module maintainer directly. Many experienced and
52 reponsive experts will be able look at the problem and quickly
53 address it. Please include a thorough description of the problem
54 with code and data examples if at all possible.
58 Report bugs to the Bioperl bug tracking system to help us keep track
59 the bugs and their resolution.
60 Bug reports can be submitted via the web:
62 https://github.com/bioperl/bioperl-live/issues
64 =head1 AUTHOR - Peili Zhang
66 Email peili@morgan.harvard.edu
70 The rest of the documentation details each of the object
71 methods. Internal methods are usually preceded with a _
75 package Bio
::SeqIO
::flybase_chadoxml
;
78 use base
'Bio::SeqIO::chadoxml';
82 $self->SUPER::_initialize
(%args);
84 #default for standard chado is polypeptide
85 $Bio::SeqIO
::chadoxml
::feattype_args2so
{'CDS'} = 'protein';
86 $Bio::SeqIO
::chadoxml
::cv_name
{'sequence'} = 'SO';
87 $Bio::SeqIO
::chadoxml
::cv_name
{'relationship'} = 'relationship type';
88 $Bio::SeqIO
::chadoxml
::cv_name
{'feature_property'} = 'property type';
93 =head2 return_ftype_hash
95 Title : return_ftype_hash
96 Usage : $obj->return_ftype_hash()
97 Function : A simple hash where returning it has be factored out of the main
98 code to allow subclasses to override it.
99 Returns : A hash that indicates what the name of the SO term is and what
100 the name of the Sequence Ontology is in the cv table.
101 Args : The string that represents the SO term.
106 sub return_ftype_hash
{
109 my %ftype_hash = ( "name" => $ftype,
110 "cv_id" => {"name" => $Bio::SeqIO
::chadoxml
::cv_name
{'sequence'} });
114 =head2 return_reltypename
116 Title : return_reltypename
117 Usage : $obj->return_reltypename
118 Function : Return the appropriate relationship type name depending on the
119 feature type (typically part_of, but derives_from for polypeptide).
120 Returns : A relationship type name.
121 Args : A SO type name.
126 sub return_reltypename
{
131 if ($sftype eq 'protein' || $sftype eq 'polypeptide') {
132 $reltypename = 'producedby';
134 $reltypename = 'partof';
143 Usage : $stream->write_seq(-seq=>$seq, -seq_so_type=>$seqSOtype,
144 -src_feature=>$srcfeature,
145 -src_feat_type=>$srcfeattype,
146 -nounflatten=>0 or 1,
147 -is_analysis=>'true' or 'false',
148 -data_source=>$datasource)
149 Function: writes the $seq object (must be seq) into chadoxml.
150 Returns : 1 for success and 0 for error
151 Args : A Bio::Seq object $seq, optional $seqSOtype, $srcfeature,
152 $srcfeattype, $nounflatten, $is_analysis and $data_source.
154 Overrides Bio::SeqIO::chadoxml's write_seq method just to add an internal
155 close_chadoxml (mimics original use by FlyBase).
160 my ($self, @argv) = @_;
162 $self->SUPER::write_seq
(@argv);
164 $self->close_chadoxml;