~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to Bio/Seq/LargeLocatableSeq.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
1
# BioPerl module for Bio::Seq::LargeLocatableSeq
3
2
#
4
3
# Cared for by Albert Vilella
24
23
 
25
24
  # normal primary seq usage
26
25
    use Bio::Seq::LargeLocatableSeq;
27
 
    my $seq = new Bio::Seq::LargeLocatableSeq(-seq => "CAGT-GGT",
 
26
    my $seq = Bio::Seq::LargeLocatableSeq->new(-seq => "CAGT-GGT",
28
27
                                              -id  => "seq1",
29
28
                                              -start => 1,
30
29
                                              -end   => 7);
91
90
=head2 new
92
91
 
93
92
 Title   : new
94
 
 Usage   : my $obj = new Bio::Seq::LargeLocatableSeq();
 
93
 Usage   : my $obj = Bio::Seq::LargeLocatableSeq->new();
95
94
 Function: Builds a new Bio::Seq::LargeLocatableSeq object
96
95
 Returns : an instance of Bio::Seq::LargeLocatableSeq
97
96
 Args    :
111
110
        delete $params{'-SEQ'};
112
111
    }
113
112
    my $self = $class->SUPER::new(%params);
 
113
    my $mapping = exists $params{'-mapping'} ? $params{'-mapping'} : [1,1];
 
114
    $self->mapping($mapping);
114
115
    $self->_initialize_io(%params);
115
116
    my $tempdir = $self->tempdir( CLEANUP => 1);
116
117
    my ($tfh,$file) = $self->tempfile( DIR => $tempdir );
317
318
 
318
319
}
319
320
 
320
 
 
321
 
=head2 end
322
 
 
323
 
 Title   : end
324
 
 Usage   : $obj->end($newval)
325
 
 Function:
326
 
 Returns : value of end
327
 
 Args    : newvalue (optional)
328
 
 
329
 
=cut
330
 
 
331
 
sub end {
332
 
   my $self = shift;
333
 
   if( @_ ) {
334
 
      my $value = shift;
335
 
      my $string = $self->seq;
336
 
      if ($self->seq) {
337
 
          my $len = $self->_ungapped_len;
338
 
          my $id = $self->id;
339
 
          $self->warn("In sequence $id residue count gives end value $len.
340
 
Overriding value [$value] with value $len for Bio::LargeLocatableSeq::end().")
341
 
              and $value = $len if $len != $value and $self->verbose > 0;
342
 
      }
343
 
 
344
 
      $self->{'end'} = $value;
345
 
    }
346
 
 
347
 
   return $self->{'end'} || $self->_ungapped_len;
348
 
}
349
 
 
350
 
 
351
321
sub DESTROY {
352
322
    my $self = shift;
353
323
    my $fh = $self->_fh();