1
# $Id: Atomic.pm,v 1.10 2003/12/18 13:15:20 jason Exp $
1
# $Id: Atomic.pm,v 1.16.4.1 2006/10/02 23:10:21 sendu Exp $
3
3
# BioPerl module for Bio::Location::Atomic
4
4
# Cared for by Jason Stajich <jason@bioperl.org>
36
36
Bioperl modules. Send your comments and suggestions preferably to one
37
37
of the Bioperl mailing lists. Your participation is much appreciated.
39
bioperl-l@bioperl.org - General discussion
40
http://bio.perl.org/MailList.html - About the mailing lists
39
bioperl-l@bioperl.org - General discussion
40
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
42
42
=head2 Reporting Bugs
44
44
Report bugs to the Bioperl bug tracking system to help us keep track
45
the bugs and their resolution. Bug reports can be submitted via email
45
the bugs and their resolution. Bug reports can be submitted via the
48
bioperl-bugs@bio.perl.org
49
http://bugzilla.bioperl.org/
48
http://bugzilla.open-bio.org/
51
50
=head1 AUTHOR - Jason Stajich
53
Email jason@bioperl.org
52
Email jason-at-bioperl-dot-org
65
64
package Bio::Location::Atomic;
72
@ISA = qw(Bio::Root::Root Bio::LocationI);
67
use Bio::Location::WidestCoordPolicy;
69
use base qw(Bio::Root::Root Bio::LocationI);
71
our $coord_policy = Bio::Location::WidestCoordPolicy->new();
75
74
my ($class, @args) = @_;
181
180
#return $self->{'_strand'} || 0;
186
Usage : $location->flip_strand();
187
Function: Flip-flop a strand to the opposite
196
$self->strand($self->strand * -1);
203
Usage : my $seqid = $location->seq_id();
204
Function: Get/Set seq_id that location refers to
205
Returns : seq_id (a string)
206
Args : [optional] seq_id value to set
212
my ($self, $seqid) = @_;
213
if( defined $seqid ) {
214
$self->{'_seqid'} = $seqid;
216
return $self->{'_seqid'};
315
350
Title : location_type
316
351
Usage : my $location_type = $location->location_type();
317
352
Function: Get location type encoded as text
318
Returns : string ('EXACT', 'WITHIN', 'BETWEEN')
353
Returns : string ('EXACT', 'WITHIN', 'IN-BETWEEN')
426
=head2 coordinate_policy
428
Title : coordinate_policy
429
Usage : $policy = $location->coordinate_policy();
430
$location->coordinate_policy($mypolicy); # set may not be possible
431
Function: Get the coordinate computing policy employed by this object.
433
See L<Bio::Location::CoordinatePolicyI> for documentation
434
about the policy object and its use.
436
The interface *does not* require implementing classes to
437
accept setting of a different policy. The implementation
438
provided here does, however, allow to do so.
440
Implementors of this interface are expected to initialize
441
every new instance with a
442
L<Bio::Location::CoordinatePolicyI> object. The
443
implementation provided here will return a default policy
444
object if none has been set yet. To change this default
445
policy object call this method as a class method with an
446
appropriate argument. Note that in this case only
447
subsequently created Location objects will be affected.
449
Returns : A L<Bio::Location::CoordinatePolicyI> implementing object.
450
Args : On set, a L<Bio::Location::CoordinatePolicyI> implementing object.
452
See L<Bio::Location::CoordinatePolicyI> for more information
457
sub coordinate_policy {
458
my ($self, $policy) = @_;
460
if(defined($policy)) {
461
if(! $policy->isa('Bio::Location::CoordinatePolicyI')) {
462
$self->throw("Object of class ".ref($policy)." does not implement".
463
" Bio::Location::CoordinatePolicyI");
466
$self->{'_coordpolicy'} = $policy;
468
# called as class method
469
$coord_policy = $policy;
472
return (ref($self) && exists($self->{'_coordpolicy'}) ?
473
$self->{'_coordpolicy'} : $coord_policy);
390
477
# comments, not function added by jason
392
479
# trunc is untested, and as of now unannounced method for truncating a