Bio::EnsEMBL::Funcgen
ResultFeature
Toolbar
Summary
Bio::EnsEMBL::Funcgen::ResultFeature - A module to represent a lightweight ResultFeature object
Package variables
No package variables defined.
Inherit
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
Methods description
Example : my $start = $rf->end(); Description: Getter of the end attribute for ResultFeature objects. Returntype : int Exceptions : None Caller : General Status : At Risk |
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 |
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 |
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. |
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 |
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
sub length
{ my $self = shift;
return $self->end - $self->start + 1; } |
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; } |
sub new_fast
{ my ($class, @args) = @_;
bless\@ args, $class; } |
sub result_set_id
{ $_[0]->[5]; } |
sub strand
{ $_[0]->[2]; } |
sub window_size
{ $_[0]->[6]; } |
General documentation
This module was written by Nathan Johnson.