[Bioperl-l] bug in location->to_FTstring

Philip Lijnzaad p.lijnzaad@med.uu.nl
Wed, 04 Dec 2002 17:23:12 +0100


On Wed, 04 Dec 2002 15:41:48 +0100, 
"me" == Philip Lijnzaad <p.lijnzaad@med.uu.nl> wrote:

me> OK. Incentally, it does appear that your out-commented code _is_ needed, at
me> least sometimes: if I uncomment your comments (like I needed to in yesterday's
me> exercise) and then use SeqIO to do a read and write as

me>   my $in  = Bio::SeqIO->newFh(-fh => \*STDIN , '-format' => 'EMBL');
me>   my $out = Bio::SeqIO->newFh(-fh=> \*STDOUT, '-format' => 'EMBL');
me>   print $out $_ while <$in>;

me> I get differences like:

me> < FT   CDS             join(complement(173191..173432), ...

me> > FT   CDS             complement(join(complement(173191..173432), ... 

*sigh* ... I can't reproduce this now anymore; for now I assume that
uncommenting is right after all. The version I use now is:

  sub to_FTstring {
      # PL version used in embl2gene-coords and anaoli
      my ($self) = @_;
      my @strs;
      foreach my $loc ( $self->sub_Location() ) {	
          my $str = $loc->to_FTstring();
          if( defined $self->seq_id && 
              defined $loc->seq_id && 
              $loc->seq_id ne $self->seq_id ) {
              $str = sprintf("%s:%s", $loc->seq_id, $str);
          } 
          push @strs, $str;
      }    
         
      my $str = sprintf("%s(%s)",lc $self->splittype, join(",", @strs));
  # for bug #1074 -- still investigating if this is ever needed
  # --jason
  # PL: uncommented again
     if( $self->strand == -1 ) {
        $str = sprintf("complement(%s)",$str);
     }
      return $str;
  }

which works OK. Sorry for all the confusion ... 

                                                                      Philip
-- 
Philip Lijnzaad
Genomics Laboratory
Dept. of Biomedical Genetics
University Medical Center (UMC), Utrecht
Stratenum, STR 3.223
room 3.126 (not in on Thursdays)
P.O. Box 85060, 3508 AB Utrecht
(Universiteitsweg 100, 3584 CG Utrecht)
The Netherlands
tel: +31 (0)30 253 8464
fax: +31 (0)30 253 9035