Bio-Variation
view release on metacpan or search on metacpan
lib/Bio/Variation/IO.pm view on Meta::CPAN
=cut
sub new {
my ($class, %param) = @_;
my ($format);
@param{ map { lc $_ } keys %param } = values %param; # lowercase keys
$format = $param{'-format'}
|| $class->_guess_format( $param{-file} || $ARGV[0] )
|| 'flat';
$format = "\L$format"; # normalize capitalization to lower case
return unless $class->_load_format_module($format);
return "Bio::Variation::IO::$format"->new(%param);
}
=head2 format
lib/Bio/Variation/IO.pm view on Meta::CPAN
my ($self, $seq) = @_;
$self->throw("Sorry, you cannot write to a generic Bio::Variation::IO object.");
}
sub write_seq {
my ($self, $seq) = @_;
$self->warn("These are not sequence objects. Use method 'write' instead of 'write_seq'.");
$self->write($seq);
}
=head2 _guess_format
Title : _guess_format
Usage : $obj->_guess_format($filename)
Function:
Example :
Returns : guessed format of filename (lower case)
Args :
=cut
sub _guess_format {
my $class = shift;
return unless $_ = shift;
return 'flat' if /\.dat$/i;
return 'xml' if /\.xml$/i;
}
1;
( run in 0.951 second using v1.01-cache-2.11-cpan-748bfb374f4 )