Catalyst::View::Bio::SeqIO - use BioPerl's Bio::SeqIO as a Catalyst view
## subclassing to making your view package MyApp::View::SeqIO; use Moose; extends 'Catalyst::View::Bio::SeqIO'; __PACKAGE__->config( default_seqio_args => { -width => 80, }, default_format => 'fasta', default_content_type => 'text/plain', content_type_map => { fasta => 'application/x-fasta', }, ); ## using in a controller sub foo :Path('/foo') { my ( $self, $c ) = @_; # get an array of Bio::SeqI-compliant objects. my @sequences = get_sequences_somehow(); # set the sequences and the format in the stash, and forward # to your subclassed view $c->stash->{sequences} = \@sequences; $c->stash->{seqio_format} = 'genbank'; $c->forward( 'View::SeqIO' ); }
Like all Catalyst components, the values for these can be set in a package config statement or in your myapp.conf file.
Stash key to use for arrayref of sequences to print out. Default 'sequences'.
Stash key to use for the sequence format. Default 'seqio_format'.
Stash key under which to look for a custom-constructed Bio::SeqIO-compliant object to use for rendering sequences. Default 'seqio_object'.
If a SeqIO object is provided in the stash under this key, this view will use that for rendering the sequences, instead of constructing its own SeqIO object.
Hashref of default arguments to pass to constructed SeqIO objects. Defaults to empty.
Hashref giving the mapping of SeqIO formats to content types. Currently defaults to just
{ fasta => 'application/x-fasta' }
Do you know proper MIME types for other formats? Please tell me and I'll add them.
Default content type to use when a format is not found in the content_type_map. Defaults to 'text/plain'.
Robert Buels <rbuels@cpan.org>
This software is copyright (c) 2011 by Robert Buels.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Catalyst::View::Bio::SeqIO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::Bio::SeqIO
CPAN shell
perl -MCPAN -e shell install Catalyst::View::Bio::SeqIO
For more information on module installation, please visit the detailed CPAN module installation guide.