Bio::EnsEMBL::Compara Subset
SummaryPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Subset - DESCRIPTION of Object
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Utils::Argument
Bio::EnsEMBL::Utils::Exception
Bio::Species
Synopsis
Description
Methods
adaptorDescriptionCode
add_member
No description
Code
add_member_idDescriptionCode
count
No description
Code
dbIDDescriptionCode
descriptionDescriptionCode
dump_locDescriptionCode
member_id_list
No description
Code
member_listDescriptionCode
new
No description
Code
new_fastDescriptionCode
output_to_fasta
No description
Code
Methods description
adaptorcode    nextTop
 Title   : adaptor
Usage :
Function: give the adaptor if known
Example :
Returns :
Args :
add_member_idcodeprevnextTop
  Arg [1]    : $member_id
Example :
Description:
Returntype :
Exceptions :
Caller :
dbIDcodeprevnextTop
  Arg [1]    : int $dbID (optional)
Example :
Description:
Returntype :
Exceptions :
Caller :
descriptioncodeprevnextTop
  Arg [1]    : string $description (optional)
Example :
Description:
Returntype : string
Exceptions :
Caller :
dump_loccodeprevnextTop
  Arg [1]    : string $dump_loc (optional)
Example :
Description:
Returntype : string
Exceptions :
Caller :
member_listcodeprevnextTop
  Arg [1]    : 
Example :
Description:
Returntype : reference to array of Bio::EnsEMBL::Compara::Member objects
Exceptions :
Caller :
new_fastcodeprevnextTop
  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
adaptordescriptionprevnextTop
sub adaptor {
   my ($self, $value) = @_;

   if (defined $value) {
      $self->{'_adaptor'} = $value;
   }

   return $self->{'_adaptor'};
}
add_memberdescriptionprevnextTop
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;
}
add_member_iddescriptionprevnextTop
sub add_member_id {
  my $self = shift;
  my $count=0;

  if(@_) {
    my $member_id = shift;
    $count = push @{$self->{'_member_id_list'}}, $member_id;
    #print("added $count element to list\n");
if(defined($self->adaptor)) { $self->adaptor->store_link($self, $member_id); } } return $count
}
countdescriptionprevnextTop
sub count {
  my $self = shift;

  return $#{$self->member_id_list()} + 1;
  #return $#{$self->member_list()} + 1;
#my @idList = @{$self->member_id_list()};
#my $count = $#idList;
#return $count;
}
dbIDdescriptionprevnextTop
sub dbID {
  my $self = shift;
  $self->{'_dbID'} = shift if(@_);
  return $self->{'_dbID'};
}
descriptiondescriptionprevnextTop
sub description {
  my $self = shift;
  $self->{'_description'} = shift if(@_);
  return $self->{'_description'};
}
dump_locdescriptionprevnextTop
sub dump_loc {
  my $self = shift;
  $self->{'_dump_loc'} = shift if(@_);
  return $self->{'_dump_loc'};
}
member_id_listdescriptionprevnextTop
sub member_id_list {
  my $self = shift;

  return $self->{'_member_id_list'};
}
member_listdescriptionprevnextTop
sub member_list {
  my $self = shift;

  return $self->{'_cached_member_list'};
}
newdescriptionprevnextTop
sub new {
  my ($class, @args) = @_;
  my $self = {};

  bless $self,$class;

  if (scalar @args) {
    #do this explicitly.
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;
}
new_fastdescriptionprevnextTop
sub new_fast {
  my ($class, $hashref) = @_;

  return bless $hashref, $class;
}
output_to_fastadescriptionprevnextTop
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
CONTACTTop
 Jessica Severin <jessica@ebi.ac.uk>
APPENDIXTop
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _