Bio::EnsEMBL::Utils::Converter
ens_bio
Toolbar
Summary
Bio::EnsEMBL::Utils::Converter::ens_bio
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
No synopsis!
Description
This is a helper module to assist Bio::EnsEMBL::Utils::Converter find
which converter instance should be used, based on the -in and -out
parameters.
Methods
Methods description
Please see Bio::EnsEMBL::Utils::Converter::new |
Methods code
_guess_module | description | prev | next | Top |
sub _guess_module
{ my ($self, $in, $out) = @_;
my $tail;
if($in eq 'Bio::EnsEMBL::SeqFeature'){
$tail = 'ens_bio_seqFeature';
}elsif($in eq 'Bio::Ens::EMBL::FeaturePair'){
$tail = 'ens_bio_featurePair';
}else{
$self->throw("[$in] to [$out], not supported");
}
return "Bio::EnsEMBL::Utils::Converter::$tail";
}
1; } |
sub new
{ my ($caller, @args) = @_;
my $class = ref($caller) || $caller;
if($class eq 'Bio::EnsEMBL::Utils::Converter::ens_bio'){
my %params = @args;
@params{map{lc $_} keys %params} = values %params;
my $module = $class->_guess_module($params{-in}, $params{-out});
return undef unless ($class->_load_module($module));
return "$module"->new(@args);
}else{
my $self = $class->SUPER::new(@args);
return $self;
}
}
} |
General documentation
Copyright (c) 1999-2009 The European Bioinformatics Institute and
Genome Research Limited. All rights reserved.
This software is distributed under a modified Apache license.
For license details, please see
/info/about/code_licence.html
You are not supposed to use this module directly. Please read
Bio::EnsEMBL::Utils::Converter