Bio-Polloc

 view release on metacpan or  search on metacpan

lib/Bio/Polloc/Locus/repeat.pm  view on Meta::CPAN

=head1 NAME

Bio::Polloc::Locus::repeat - A repetitive locus

=head1 DESCRIPTION

A repeatitive locus.  Implements L<Bio::Polloc::LocusI>.

=head1 AUTHOR - Luis M. Rodriguez-R

Email lmrodriguezr at gmail dot com

=cut

package Bio::Polloc::Locus::repeat;
use base qw(Bio::Polloc::LocusI);
use strict;
our $VERSION = 1.0503; # [a-version] from Bio::Polloc::Polloc::Version


=head1 APPENDIX

Methods provided by the package

=head2 new

Creates a B<Bio::Polloc::Locus::repeat> object.

=head3 Arguments

=over

=item -period I<float>

The period of the repeat (units length).

=item -exponent I<float>

The exponent (No of units).

=item -error I<float>

Mismatches percentage.

=item -repeats I<str>

Repetitive sequences, repeats space-separated.

=item -consensus I<str>

Repeats consensus.

=back

=head3 Returns

A L<Bio::Polloc::Locus::repeat> object.

=cut

sub new {
   my($caller,@args) = @_;
   my $self = $caller->SUPER::new(@args);
   $self->_initialize(@args);
   return $self;
}


=head2 period

Gets/sets the period of the repeat.  I<I.e.>, the size of each repeat.

=head3 Arguments

The period (int, optional).

=head3 Returns

The period (int or undef)

=cut

sub period {
   my($self,$value) = @_;
   $self->{'_period'} = $value+0 if defined $value;
   return $self->{'_period'};
}


=head2 exponent

Gets/sets the exponent of the repeat.  I<I.e.>, the number of times the repeat
is repeated.

=head3 Arguments

The exponent (int, optional).

=head3 Returns

The exponent (int or undef).

=cut

sub exponent {
   my($self,$value) = @_;
   $self->{'_exponent'} = $value if defined $value;
   return $self->{'_exponent'};
}


=head2 repeats

Sets/gets the repetitive sequence (each repeat separated by spaces).

=head3 Arguments

The repetitive sequence (str, optional).

=head3 Returns

The repetitive sequence (str or undef).

=cut

sub repeats {
   my($self,$value) = @_;
   $self->{'_repeats'} = $value if defined $value;
   return $self->{'_repeats'};
}


=head2 consensus

Sets/gets the consensus repeat.

=head3 Arguments

The consensus sequence (str, optional).

=head3 Returns

The consensus sequence (str or undef).

=cut

sub consensus {
   my($self,$value) = @_;
   $self->{'_consensus'} = $value if defined $value;
   return $self->{'_consensus'};
}

=head2 error

Gets/sets the error rate of the repeat.  I<I.e.>, the percentage of mismatches.

=head3 Arguments

The error (float).

=head3 Returns

The error (float or undef).

=cut

sub error {
   my($self,$value) = @_;
   $self->{'_error'} = $value+0 if defined $value;
   return $self->{'_error'};
}


=head2 score

Gets/sets the score

=head3 Arguments

The score (float, optional).

=head3 Returns

The score (float or undef).

=cut

sub score {
   my($self,$value) = @_;
   $self->{'_score'} = $value+0 if defined $value;
   return $self->{'_score'};
}

=head2 distance

Returns the difference in length with the given locus.

=head3 Arguments

=over

=item -locus I<Bio::Polloc::LocusI object>

The locus to compare with.

=item -locusref I<Bio::Polloc::LocusI object>

The reference locus.  If set, replaces the current loaded object.

=item -units I<bool (int)>

If true, returns the difference in the number of repeat units, not
in base pairs.  This flag requires the loci to be
L<Bio::Polloc::Locus::repeat> objects.



( run in 2.665 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )