[Bioperl-l] Bio::Variation::SeqDiff, Bio::Variation::VariantI

Eckhard Lehmann ecky@e-lehmann.de
28 May 2002 22:32:53 +0200


Hi,

as I know, I can create a Bio::Variation::DNAMutation and add alleles
and other things to it, e.g. an "upStreamSeq" or a "dnStreamSeq".
Then I can add the Bio::Variation::DNAMutation to a
Bio::Variation::SeqDiff container and besides that I can set a sequence
as dna_ori respectively dna_mut to the Bio::Variation::SeqDiff
container.

OK, that's fine ;-). But I wonder why I don't get the dna_mut sequence
automatically when all DNAMutation objects and the dna_ori sequence are
set correctly?
Has there anything been done into this direction since bioperl-1.0? When
not, I'd like to implement such a method:

#------------------------------
sub dna_mut {
  my ($self, $sq) = @_;
  
  return $self->{'dna_mut'} unless ($sq && $self->{'dna_mut'});

  if (!$sq && $self->{'dna_ori'}) {
    my $sq
    foreach ($self->each_Variant) {
      next unless $_->isMutation;
      
      my $sub_ori = $_->dnStreamSeq . $_->allele_ori . $_->upStreamSeq;
      my $sub_mut = $_->dnStreamSeq . $_->allele_mut . $_->upStreamSeq;
      ($sq = $self->{'dna_ori'}) =~ s/$sub_ori/$sub_mut/;
    }   
  }
  $self->{'dna_mut'} = $sq;
}
#------------------------------

or like this...
It is not tested and I don't know whether it would work...

Is it a good idea to change the dna_mut method that way in the public
BioPerl?

Thank you for suggestions and answers

Eckhard