Bio::EnsEMBL::Compara
Subset
Toolbar
Summary
Subset - DESCRIPTION of Object
Package variables
No package variables defined.
Included modules
Synopsis
Description
Methods
Methods description
Title : adaptor Usage : Function: give the adaptor if known Example : Returns : Args : |
Arg [1] : $member_id Example : Description: Returntype : Exceptions : Caller : |
Arg [1] : int $dbID (optional) Example : Description: Returntype : Exceptions : Caller : |
Arg [1] : string $description (optional) Example : Description: Returntype : string Exceptions : Caller : |
Arg [1] : string $dump_loc (optional) Example : Description: Returntype : string Exceptions : Caller : |
Arg [1] : Example : Description: Returntype : reference to array of Bio::EnsEMBL::Compara::Member objects Exceptions : Caller : |
Arg [1] : hash reference $hashref Example : none Description: This is an ultra fast constructor which requires knowledge of the objects internals to be used. Returntype : Exceptions : none Caller : |
Methods code
sub adaptor
{ my ($self, $value) = @_;
if (defined $value) {
$self->{'_adaptor'} = $value;
}
return $self->{'_adaptor'}; } |
sub add_member
{ my ($self, $member) = @_;
unless(defined($member) and $member->isa('Bio::EnsEMBL::Compara::Member')) {
throw(
"gene arg must be a [Bio::EnsEMBL::Compara::Member] ".
"not a [$member]");
}
my $count = $self->add_member_id($member->dbID);
push @{$self->{'_cached_member_list'}}, $member;
return $count; } |
sub add_member_id
{ my $self = shift;
my $count=0;
if(@_) {
my $member_id = shift;
$count = push @{$self->{'_member_id_list'}}, $member_id;
if(defined($self->adaptor)) {
$self->adaptor->store_link($self, $member_id);
}
}
return $count } |
sub count
{ my $self = shift;
return $#{$self->member_id_list()} + 1;
} |
sub dbID
{ my $self = shift;
$self->{'_dbID'} = shift if(@_);
return $self->{'_dbID'}; } |
sub description
{ my $self = shift;
$self->{'_description'} = shift if(@_);
return $self->{'_description'}; } |
sub dump_loc
{ my $self = shift;
$self->{'_dump_loc'} = shift if(@_);
return $self->{'_dump_loc'}; } |
sub member_id_list
{ my $self = shift;
return $self->{'_member_id_list'}; } |
sub member_list
{ my $self = shift;
return $self->{'_cached_member_list'}; } |
sub new
{ my ($class, @args) = @_;
my $self = {};
bless $self,$class;
if (scalar @args) {
my ($dbid, $description, $adaptor) = rearrange([qw(DBID NAME ADAPTOR)], @args);
$self->dbID($dbid) if($dbid);
$self->description($description) if($description);
$self->adaptor($adaptor) if($adaptor);
$self->{'_member_id_list'} = [];
$self->{'_cached_member_list'} = [];
}
return $self; } |
sub new_fast
{ my ($class, $hashref) = @_;
return bless $hashref, $class; } |
output_to_fasta | description | prev | next | Top |
sub output_to_fasta
{ my ($self, $fastaPath, $prefix) = @_;
if(defined($fastaPath)) {
if($fastaPath ne "stdout") {
open FASTA_FP,">$fastaPath";
} else {
open FASTA_FP,">-";
}
}
foreach my $member (@{member_list()}) {
my $seq_string = $member->sequence;
$seq_string =~ s/(.{72})/$1\n/g;
print FASTA_FP ">$prefix" .
$member->stable_id . " " .
$member->description . "\n" .
$seq_string . "\n";
}
close(FASTA_FP);
}
1; } |
General documentation
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _