Bio::EnsEMBL::Pipeline::SeqFetcher
Getz
Toolbar
Summary
Bio::EnsEMBL::Pipeline::SeqFetcher::Getz
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $obj = Bio::EnsEMBL::Pipeline::SeqFetcher::Getz->new(
'-executable' => $exe,
'-library' => $lib,
);
my $seq = $obj->get_Seq_by_acc($acc);
Description
Object to retrieve sequences as Bio::Seq, using getz.
Methods
Methods description
Title : batch_fetch Usage : $self->batch_fetch(@accs); Function: Retrieves batches of sequences Returns : listref of Bio::Seq Args : |
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 getz Returns : Bio::Seq Args : |
Title : get_Seq_by_id Usage : $self->get_Seq_by_id($id); Function: Does the sequence retrieval via getz Returns : Bio::Seq Args : |
Title : library Usage : $self->library('embl'); Function: Get/set for a library/libraries to search in Returns : string Args : string |
Methods code
sub batch_fetch
{ my ($self, @accs) = @_;
my @seqs;
while (@accs){
push @seqs, $self->get_Seq_by_acc(shift @accs);
}
return\@ seqs
}
1; } |
sub executable
{ my ($self, $exe) = @_;
if ($exe)
{
$self->{'_exe'} = $exe;
}
return $self->{'_exe'}; } |
sub get_Seq_by_acc
{ my ($self, $acc) = @_;
my $libs = $self->library;
if (!defined($acc)) {
$self->throw("No id input");
}
if (!defined($libs)) {
$self->throw("No search libs specified");
}
my $seqstr;
my $seq;
my $getz = $self->executable;
open(IN, "$getz -d -sf fasta '[libs={$libs}-AccNumber:$acc]' |")
or $self->throw("Error running getz for id [$acc]: $getz");
my $format = 'fasta';
my $fh = Bio::SeqIO->new(-fh =>\* IN, "-format"=>$format);
$seq = $fh->next_seq();
close IN;
$self->throw("Could not getz sequence for [$acc]\n") unless defined $seq;
$seq->display_id($acc);
$seq->accession_number($acc);
return $seq; } |
sub get_Seq_by_id
{ my ($self, $id) = @_;
my $libs = $self->library;
if (!defined($id)) {
$self->throw("No id input");
}
if (!defined($libs)) {
$self->throw("No search libs specified");
}
my $seqstr;
my $seq;
my $getz = $self->executable;
open(IN, "$getz -d -sf fasta '[libs={$libs}-ID:$id]' |")
or $self->throw("Error running getz for id [$id]: $getz");
my $format = 'fasta';
my $fh = Bio::SeqIO->new(-fh =>\* IN, "-format"=>$format);
$seq = $fh->next_seq();
close IN;
$self->throw("Could not getz sequence for [$id]\n") unless defined $seq;
$seq->display_id($id);
$seq->accession_number($id);
return $seq; } |
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 = 'getz';
}
$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 _