NAME
Catalyst::View::Bio::SeqIO - use BioPerl's Bio::SeqIO as a Catalyst view
SYNOPSIS
## subclassing to making your view
package
MyApp::View::SeqIO;
use
Moose;
__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'
);
}
CONFIGURABLE ATTRIBUTES
Like all Catalyst components, the values for these can be set in a package config statement or in your myapp.conf file.
sequences_stash_key
Stash key to use for arrayref of sequences to print out. Default 'sequences'.
format_stash_key
Stash key to use for the sequence format. Default 'seqio_format'.
object_stash_key
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.
default_seqio_args
Hashref of default arguments to pass to constructed SeqIO objects. Defaults to empty.
content_type_map
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
Default content type to use when a format is not found in the content_type_map. Defaults to 'text/plain'.
AUTHOR
Robert Buels <rbuels@cpan.org>
COPYRIGHT AND LICENSE
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.