FAST
view release on metacpan or search on metacpan
lib/FAST/Bio/Location/Split.pm view on Meta::CPAN
sub min_start {
my ($self, $value) = @_;
if( defined $value ) {
$self->throw("Trying to set the minimum starting point of a split ".
"location, that is not possible, try manipulating the sub Locations");
}
my @locs = $self->sub_Location(1);
return $locs[0]->min_start() if @locs;
return;
}
=head2 max_start
Title : max_start
Usage : my $maxstart = $location->max_start();
Function: Get maximum starting location of feature startpoint
Returns : integer or undef if no maximum starting point.
Args : none
=cut
sub max_start {
my ($self,$value) = @_;
if( defined $value ) {
$self->throw("Trying to set the maximum starting point of a split ".
"location, that is not possible, try manipulating the sub Locations");
}
my @locs = $self->sub_Location(1);
return $locs[0]->max_start() if @locs;
return;
}
=head2 start_pos_type
Title : start_pos_type
Usage : my $start_pos_type = $location->start_pos_type();
Function: Get start position type (ie <,>, ^)
Returns : type of position coded as text
('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN')
Args : none
=cut
sub start_pos_type {
my ($self,$value) = @_;
if( defined $value ) {
$self->throw("Trying to set the start_pos_type of a split location, ".
"that is not possible, try manipulating the sub Locations");
}
my @locs = $self->sub_Location();
return ( @locs ) ? $locs[0]->start_pos_type() : undef;
}
=head2 min_end
Title : min_end
Usage : my $minend = $location->min_end();
Function: Get minimum ending location of feature endpoint
Returns : integer or undef if no minimum ending point.
Args : none
=cut
sub min_end {
my ($self,$value) = @_;
if( defined $value ) {
$self->throw("Trying to set the minimum end point of a split location, ".
"that is not possible, try manipulating the sub Locations");
}
# reverse sort locations by largest ending to smallest ending
my @locs = $self->sub_Location(-1);
return $locs[0]->min_end() if @locs;
return;
}
=head2 max_end
Title : max_end
Usage : my $maxend = $location->max_end();
Function: Get maximum ending location of feature endpoint
Returns : integer or undef if no maximum ending point.
Args : none
=cut
sub max_end {
my ($self,$value) = @_;
if( defined $value ) {
$self->throw("Trying to set the maximum end point of a split location, ".
"that is not possible, try manipulating the sub Locations");
}
# reverse sort locations by largest ending to smallest ending
my @locs = $self->sub_Location(-1);
return $locs[0]->max_end() if @locs;
return;
}
=head2 end_pos_type
Title : end_pos_type
Usage : my $end_pos_type = $location->end_pos_type();
Function: Get end position type (ie <,>, ^)
Returns : type of position coded as text
('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN')
Args : none
=cut
sub end_pos_type {
my ($self,$value) = @_;
if( defined $value ) {
$self->throw("Trying to set end_pos_type of a split location, ".
"that is not possible, try manipulating the sub Locations");
}
my @locs = $self->sub_Location();
return ( @locs ) ? $locs[0]->end_pos_type() : undef;
}
=head2 seq_id
Title : seq_id
Usage : my $seqid = $location->seq_id();
Function: Get/Set seq_id that location refers to
We override this here in order to propagate to all sublocations
which are not remote (provided this root is not remote either)
Returns : seq_id
Args : [optional] seq_id value to set
=cut
sub seq_id {
my $self = shift;
if(@_ && !$self->is_remote()) {
foreach my $subloc ($self->sub_Location(0)) {
( run in 0.825 second using v1.01-cache-2.11-cpan-5837b0d9d2c )