| 1 | ############################################################################# | ||||||||||
| 2 | # $Author: markus $ | ||||||||||
| 3 | # $Date: 2009-11-12 12:42:02 +0100 (Thu, 12 Nov 2009) $ | ||||||||||
| 4 | # $Revision: 1842 $ | ||||||||||
| 5 | ############################################################################# | ||||||||||
| 6 | |||||||||||
| 7 | package Bio::Grep; | ||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 2 | require UNIVERSAL::require; | |||||||||
| 13 | |||||||||||
| 14 | 2 | ▶ | use base 'Bio::Root::Root'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 2 | ▶ | use version; our $VERSION = qv('0.10.6'); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 19 | 0 | my ( $class, $backendname ) = @_; | |||||||||
| 20 | 0 | my $self = $class->SUPER::new(); | |||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | if ( !defined $backendname ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | $backendname = 'Vmatch'; | |||||||||
| 24 | } | ||||||||||
| 25 | 0 | my %known_backends = ( | |||||||||
| 26 | Agrep => 1, | ||||||||||
| 27 | Vmatch => 1, | ||||||||||
| 28 | GUUGle => 1, | ||||||||||
| 29 | RE => 1, | ||||||||||
| 30 | ); | ||||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | if ( !defined $known_backends{$backendname} ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 0 | $self->throw( | |||||||||
| 34 | -class => 'Bio::Root::BadParameter', | ||||||||||
| 35 | -text => 'Unknown back-end.', | ||||||||||
| 36 | -value => $backendname . ' not supported.' | ||||||||||
| 37 | ); | ||||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 0 | my $module = "Bio::Grep::Backend::$backendname"; | |||||||||
| 41 | 0 | $module->require; | |||||||||
| 42 | |||||||||||
| 43 | 0 | my $backend = $module->new(); | |||||||||
| 44 | 0 | $backend->settings->tmppath( File::Spec->tmpdir() ); | |||||||||
| 45 | 0 | return $backend; | |||||||||
| 46 | } | ||||||||||
| 47 | 2 | 1; # Magic true value required at end of module | |||||||||
| 48 | __END__ | ||||||||||