Bio::EnsEMBL::Compara::Production DnaCollection
SummaryPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Compara::Production::DnaCollection
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Compara::Production::DnaFragChunk
Bio::EnsEMBL::Compara::Production::DnaFragChunkSet
Bio::EnsEMBL::Utils::Argument
Bio::EnsEMBL::Utils::Exception
Time::HiRes qw ( time gettimeofday tv_interval )
Synopsis
Description
DnaColelction is an object to hold a super-set of DnaFragChunk, and/or DnaFragChunkSet
objects. Used in production to encapsulate particular genome/region/chunk/group DNA set
from the others. To allow system to blast against self, and isolate different
chunk/group sets of the same genome from each other.
Methods
adaptorDescriptionCode
add_dna_object
No description
Code
countDescriptionCode
dbIDDescriptionCode
descriptionDescriptionCode
dump_locDescriptionCode
get_all_dna_objectsDescriptionCode
get_all_dnafrag_idsDescriptionCode
new
No description
Code
Methods description
adaptorcode    nextTop
 Title   : adaptor
Usage :
Function: getter/setter of the adaptor for this object
Example :
Returns :
Args :
countcodeprevnextTop
  Example    : $count = $chunkSet->count;
Description: returns count of DnaFragChunks in this set
Returntype : int
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 :
get_all_dna_objectscodeprevnextTop
  Example    : @dna = @{$dnaCOllection->get_all_dna_objects};
Description: returns array reference to all the DnaFragChunkand DnaFragChunkSet objects in this set
Returntype : reference to array of Bio::EnsEMBL::Compara::Production::DnaFragChunk(DnaFragChunkSet) objects
Exceptions :
Caller :
get_all_dnafrag_idscodeprevnextTop
  Example    : @dnafrag_ids = @{$dnaCOllection->get_all_dnafrag_ids};
Description: returns array reference to all the dnafrag_ids in this set
Returntype : reference to array of integers
Exceptions :
Caller :
Methods code
adaptordescriptionprevnextTop
sub adaptor {
  my $self = shift;
  $self->{'_adaptor'} = shift if(@_);
  return $self->{'_adaptor'};
}
add_dna_objectdescriptionprevnextTop
sub add_dna_object {
  my ($self, $object) = @_;
  
  return unless(defined($object));
  unless($object->isa('Bio::EnsEMBL::Compara::Production::DnaFragChunk') or
         $object->isa('Bio::EnsEMBL::Compara::Production::DnaFragChunkSet'))
  {
    $self->throw(
      "arg must be a [Bio::EnsEMBL::Compara::Production::DnaFragChunk] ".
      "or [Bio::EnsEMBL::Compara::Production::DnaFragChunk] not a [$object]");
  }
  if ($object->isa('Bio::EnsEMBL::Compara::Production::DnaFragChunk')) {
    unless ($self->{'_dnafrag_id_hash'}->{$object->dnafrag_id}) {
      push @{$self->{'_dnafrag_id_list'}}, $object->dnafrag_id;
      $self->{'_dnafrag_id_hash'}->{$object->dnafrag_id} = 1;
    }
  }
  if ($object->isa('Bio::EnsEMBL::Compara::Production::DnaFragChunkSet')) {
    foreach my $dc (@{$object->get_all_DnaFragChunks}) {
      unless ($self->{'_dnafrag_id_hash'}->{$dc->dnafrag_id}) {
        push @{$self->{'_dnafrag_id_list'}}, $dc->dnafrag_id;
        $self->{'_dnafrag_id_hash'}->{$dc->dnafrag_id} = 1;
      }
    }
  }

  push @{$self->{'_object_list'}}, $object;
}
countdescriptionprevnextTop
sub count {
  my $self = shift;
  return scalar(@{$self->{'_object_list'}});
}
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'};
}
get_all_dna_objectsdescriptionprevnextTop
sub get_all_dna_objects {
  my $self = shift;
  return $self->{'_object_list'};
}
get_all_dnafrag_idsdescriptionprevnextTop
sub get_all_dnafrag_ids {
  my $self = shift;
  return $self->{'_dnafrag_id_list'};
}

1;
}
newdescriptionprevnextTop
sub new {
  my ($class, @args) = @_;

  my $self = {};
  bless $self,$class;

  $self->{'_object_list'} = [];
  $self->{'_dnafrag_id_list'} = [];
  $self->{'_dnafrag_id_hash'} = {};

  if (scalar @args) {
    #do this explicitly.
my ($dbid, $description, $adaptor) = rearrange([qw(DBID DESCRIPTION ADAPTOR)], @args); $self->dbID($dbid) if($dbid); $self->description($description) if($description); $self->adaptor($adaptor) if($adaptor); } return $self;
}
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 _