Bio::EnsEMBL::Pipeline::SeqFetcher
FileIndex
Toolbar
Summary
Bio::EnsEMBL::Pipeline::SeqFetcher::Pfetch
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $obj = Bio::EnsEMBL::Pipeline::SeqFetcher::Pfetch->new(
-executable => $exe
);
my $seq = $obj->get_Seq_by_acc($acc);
Description
Object to retrieve sequences as Bio::Seq, using pfetch.
Methods
Methods description
Title : get_Seq_by_acc Usage : $self->get_eq_by_acc($accession); Function: Does the sequence retrieval Returns : Bio::Seq Args : |
Methods code
sub get_Seq_by_acc
{ my ($self, $acc) = @_;
if (!defined($acc)) {
$self->throw("No accession input");
}
if (defined($self->{_seqhash}{$acc})) {
return $self->{_seqhash}{$acc};
} else {
$self->throw("Could not fetch sequence for [$acc]\n");
} } |
sub list_all_ids
{ my ($self) = @_;
my @ids = keys %{$self->{_seqhash}};
return\@ ids;
}
1; } |
sub new
{ my ($class, @args) = @_;
my $self = bless {}, $class;
my ($seqfile) = $self->_rearrange(['SEQFILE'], @args);
if (defined($seqfile)) {
$self->seqfile($seqfile);
} else {
$self->throw("Need a sequence file");
}
return $self;
} |
sub seqfile
{ my ($self,$file) = @_;
if (defined($file)) {
open (INDEX,"<$file") || $self->throw("Can't open $file");
my $seqio = new Bio::SeqIO(-fh =>\* INDEX, -format => 'fasta');
while (my $seq = $seqio->next_seq) {
$self->{_seqhash}{$seq->id} = $seq;
}
close(INDEX);
} else {
$self->throw("Must supply a seqfile to Bio:EnsEMBL::Pipeline::SeqFetcher::FileIndex");
} } |
General documentation
Describe contact details here
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _