Bio::EnsEMBL::Pipeline::SeqFetcher
Efetch
Toolbar
Summary
Bio::EnsEMBL::Pipeline::SeqFetcher::Efetch
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $obj = Bio::EnsEMBL::Pipeline::SeqFetcher::Efetch->new(
'-executable' => $exe,
'-lib' => $lib,
);
my $seq = $obj->get_Seq_by_acc($acc);
Description
Object to retrieve sequences as Bio::Seq, using efetch.
Methods
Methods description
Title : executable Usage : $self->executable('/path/to/executable'); Function: Get/set for the path to the executable being used by the module. If not set, the executable is looked for in $PATH. Returns : string Args : string |
Title : get_Seq_by_acc Usage : $self->get_Seq_by_acc($accession); Function: Does the sequence retrieval via efetch Returns : Bio::Seq Args : |
Title : library Usage : $self->library('sw'); Function: Get/set for a library to search in - eg efetch wil not search swall without the prefix sw: Returns : string Args : string |
Methods code
sub executable
{ my ($self, $exe) = @_;
if ($exe)
{
$self->{'_exe'} = $exe;
}
return $self->{'_exe'}; } |
sub get_Seq_by_acc
{ my ($self, $acc) = @_;
if (!defined($acc)) {
$self->throw("No accession input");
}
my $lib = $self->library;
if (defined $lib && $lib ne ''){
$acc = $lib . ":" . $acc;
}
my $seqstr;
my $seq;
my $efetch = $self->executable;
open(IN,"$efetch -q $acc |") or $self->throw("Error running efetch for acc [$acc]: $efetch");
$seqstr = <IN>;
close IN;
if(defined $seqstr && $seqstr ne "no match") {
chomp($seqstr);
$seq = new Bio::Seq('-seq' => $seqstr,
'-accession_number' => $acc,
'-display_id' => $acc);
}
$self->throw("Could not efetch sequence for [$acc]\n") unless defined $seq;
return $seq;
}
1; } |
sub library
{ my ($self, $lib) = @_;
if ($lib) {
$self->{'_lib'} = $lib;
}
return $self->{'_lib'}; } |
sub new
{ my ($class, @args) = @_;
my $self = bless {}, $class;
my ($exe, $lib) = $self->_rearrange([
'EXECUTABLE',
'LIBRARY'], @args);
if (!defined $exe) {
$exe = 'efetch';
}
$self->executable($exe);
if (defined $lib) {
$self->library($lib);
}
return $self;
} |
General documentation
Describe contact details here
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _