1 package Bio
::SeqIO
::sgn_genomic
;
6 # Object preamble - inherits from Bio::Root::Object
9 use Bio
::Seq
::SeqFactory
;
10 use Bio
::Seq
::SeqFastaSpeedFactory
;
11 use base
'Bio::SeqIO';
14 use Class
::MethodMaker
15 [ scalar => [+{-type
=>'CXGN::Genomic::Search::GSS::Query'}, 'query',
16 +{-type
=>'CXGN::Genomic::Search::GSS::Result'}, 'result',
17 +{-type
=>'CXGN::Genomic::Search::GSS'}, 'search',
25 my %a = @args; #bind em to a hash
27 $a{-query
} or croak
"Must provide search query via -query ($a{-query})";
28 $a{-dbconn
} && UNIVERSAL
::isa
($a{-dbconn
},'CXGN::DB::Connection')
29 or croak
'Must provide CXGN::DB::Connection object via -dbconn';
31 $self->query($a{-query
});
32 $self->search( CXGN
::Genomic
::Search
::GSS
->new($self->query) );
34 $self->SUPER::_initialize
(@args);
35 unless ( defined $self->sequence_factory ) {
36 $self->sequence_factory( Bio
::Seq
::SeqFactory
->new( -type
=> 'Bio::Seq::CXGNGenomic' ) );
39 #set the results object to autopage through the results
40 $self->query->order_by(gss_id
=> 'asc');
41 $self->result($self->search->new_result);
42 $self->result->autopage($self->query,$self->search);
48 Usage : $seq = $stream->next_seq()
49 Function: returns the next sequence in the stream
50 Returns : Bio::Seq object or undef if no more sequences
59 #note: initialize above put the result in autopage mode
60 my $gss = $self->result->next_result
63 ### at this point, $gss _must_ contain our new gss object ###
64 $gss->isa('CXGN::Genomic::GSS')
65 or die 'there is something wrong with this code';
67 # print 'try gss '.$gss->gss_id." ($gss)\n";
70 $gss->to_bio_seq( -factory
=> $self->sequence_factory );
71 # }; if($EVAL_ERROR) {
76 # print "got seq $seq\n";
77 # print "got gss ".$seq->gss_object."\n";
78 # return sequences$seq;
84 Usage : this method is not implemented. writing to the
85 genomic database is not allowed through this interface
90 croak
'write_seq not implemented. Writing to the genomic database is not allowed through this interface';
95 Accessor for this seqIO GSS results object
99 Accessor for this seqIO GSS results object
103 Accessor for this seqIO GSS results object