1 package Bio
::SeqIO
::xform
;
4 # Object preamble - inherits from Bio::Root::Object
7 use Bio
::Seq
::SeqFactory
;
8 use Bio
::Seq
::SeqFastaSpeedFactory
;
10 use base
'Bio::SeqIO';
16 my %a = @args; #bind em to a hash
19 $a{-enclose
} && isa
($a{-enclose
},'Bio::SeqIO')
20 or croak
"Must provide SeqIO to map via -enclose";
22 ref $a{-map_next
} eq 'CODE'
23 or croak
'-map_next must be a subroutine reference'
26 ref $a{-map_write
} eq 'CODE'
27 or croak
'-map_write must be a subroutine reference'
30 @
{$self}{qw
/_seqio _next _write /} =
31 @a{qw
/ -enclose -map_next -map_write/};
33 $self->SUPER::_initialize
(@args);
39 Ret : the enclosed SeqIO object, or undef if none set
45 UNIVERSAL
::isa
($this,__PACKAGE__
)
46 or croak
'improper use of enclosed(), which is a method of '.__PACKAGE__
;
52 # sub _params_nextpage {
54 # if ( defined $self->{_sgn_pagenum} ) {
55 # $self->{_sgn_pagenum}++;
57 # $self->{_sgn_pagenum} = 0;
59 # $self->params->page($self->{_sgn_pagenum});
66 Function: returns the next sequence in the stream
67 Returns : Bio::Seq object
76 my $nextseq = $self->{_seqio
}->next_seq;
77 return $nextseq unless $nextseq;
79 $self->{_next
} ?
$self->{_next
}->($nextseq) : $nextseq;
93 $self->{_seqio
}->write_seq(
95 $self->{_write
}->(@seqs) :