Bio::EnsEMBL::Funcgen ResultFeature
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Funcgen::ResultFeature - A module to represent a lightweight ResultFeature object
Package variables
No package variables defined.
Inherit
Bio::EnsEMBL::Feature
Synopsis
use Bio::EnsEMBL::Funcgen::ResultFeature;
my $rfeature = Bio::EnsEMBL::Funcgen::ResultFeature->new_fast([$start, $end, $score ]);
my @rfeatures = @{$rset->get_displayable_ResultFeature_by_Slice($slice)};
foreach my $rfeature (@rfeatures){
my $score = $rfeature->score();
my $rf_start = $rfeature->start();
my $rf_end = $rfeature->end();
}
Description
This is a very sparse class designed to be as lightweight as possible to enable fast rendering in the web browser.
As such only the information absolutely required is contained. Any a piori information is omitted e.g. seq_region_id,
this will already be known as ResultFeatures are retrieved via a Slice method in ResultSet via the ResultSetAdaptor,
likewise with analysis and experimental_chip information. ResultFeatures are transient objects, in that they are not
stored in the DB, but are a very small subset of information from the result and oligo_feature tables. ResultFeatures
should only be generated by the ResultSetAdaptorast here is no parameter checking in place.
Methods
endDescriptionCode
length
No description
Code
moveDescriptionCode
new_fastDescriptionCode
probeDescriptionCode
result_set_id
No description
Code
scoreDescriptionCode
slice
No description
Code
startDescriptionCode
strand
No description
Code
window_size
No description
Code
Methods description
endcode    nextTop
  Example    : my $start = $rf->end();
Description: Getter of the end attribute for ResultFeature
objects.
Returntype : int
Exceptions : None
Caller : General
Status : At Risk
movecodeprevnextTop
  Arg [1]    : int start
Arg [2] : int end
Arg [3] : (optional) int strand
Example : None
Description: Sets the start, end and strand in one call rather than in
3 seperate calls to the start(), end() and strand() methods.
This is for convenience and for speed when this needs to be
done within a tight loop.
Returntype : none
Exceptions : Thrown is invalid arguments are provided
Caller : general
Status : Stable
new_fastcodeprevnextTop
  Args       : Array with attributes start, end, strand, score, probe, result_set_id, winow_size  IN THAT ORDER.
WARNING: None of these are validated, hence can omit some where not needed
Example : none
Description: Fast and list version of new. Only works if the code is very disciplined.
Returntype : Bio::EnsEMBL::Funcgen::ResultFeature
Exceptions : None
Caller : ResultSetAdaptor
Status : At Risk
probecodeprevnextTop
  Example    : my $probe = $rf->probe();
Description: Getter of the probe attribute for ResultFeature
objects
Returntype : Bio::EnsEMBL::Funcgen::Probe
Exceptions : None
Caller : General
Status : At Risk - This can only be used for Features with window 0.
scorecodeprevnextTop
  Example    : my $score = $rf->score();
Description: Getter of the score attribute for ResultFeature
objects
Returntype : string/float/double?
Exceptions : None
Caller : General
Status : At Risk
startcodeprevnextTop
  Example    : my $start = $rf->start();
Description: Getter of the start attribute for ResultFeature
objects.
Returntype : int
Exceptions : None
Caller : General
Status : At Risk
Methods code
enddescriptionprevnextTop
sub end {
  $_[0]->[1];
}
lengthdescriptionprevnextTop
sub length {
  my $self = shift;
  return $self->end - $self->start + 1;
}
movedescriptionprevnextTop
sub move {
  my $self = shift;

  throw('start and end arguments are required') if(@_ < 2);

  my $start  = shift;
  my $end    = shift;
  my $strand = shift;

  if(defined($start) && defined($end) && $end < $start) {
    throw('start must be less than or equal to end');
  }
  if(defined($strand) && $strand != 0 && $strand != -1 && $strand != 1) {
    throw('strand must be 0, -1 or 1');
  }

  $self->[0] = $start;
  $self->[1] = $end;
  $self->[2] = $strand if(defined($strand));
}


1;
}
new_fastdescriptionprevnextTop
sub new_fast {
  my ($class, @args)  = @_;
  #return bless ($arrayref, $class);
#Passing arrayref here may cause problems with changing vars after obj creation
#warn "in new fast with @args";
bless\@ args, $class;
}
probedescriptionprevnextTop
sub probe {
  $_[0]->[4];
}
result_set_iddescriptionprevnextTop
sub result_set_id {
  $_[0]->[5];
}
scoredescriptionprevnextTop
sub score {
  $_[0]->[3];
}
slicedescriptionprevnextTop
sub slice {
  $_[0]->[7];
}
startdescriptionprevnextTop
sub start {
  $_[0]->[0];
}
stranddescriptionprevnextTop
sub strand {
  $_[0]->[2];
}
window_sizedescriptionprevnextTop
sub window_size {
  $_[0]->[6];
}
General documentation
AUTHORTop
This module was written by Nathan Johnson.
CONTACTTop
Post comments or questions to the Ensembl development list: ensembl-dev@ebi.ac.uk