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

Heikki Lehvaslaiho heikki@ebi.ac.uk
Thu, 13 Jun 2002 10:44:23 +0100


Eckhard,

This beginning to look like the the problem we wrote Bio::LiveSeq for...
If you find one more complication in generating the mutated sequence, I 
suggest you have look how to use those modueles to do what you want.

	-Heikki

Eckhard Lehmann wrote:
> Heikki,
> 
> Sorry for this late answer, I was on holiday until today...
> 
> 
>>I've cleaned your code a bit (and fixed one one-off error) and put it into
>>SeqDiff.pm in CVS HEAD (it changes the behaviour of the method so bug fix
>>release 1.01 will not have it). It will not calculate the mutated DNA
>>sequence if is has been already set. Is that OK?
> 
> 
> Yes, of course it is OK ;-).
> But as I have seen short before, one problem is left there with my code:
> If the sequence gets shorter or longer (as the result of an insertion or 
> deletion or ins/del), the positions of any Variation _after_ the insertion, 
> deletion ins/del is no longer true.
> 
> E.g., if a Variation in the SeqDiff describes the deletion of three bases at 
> position 100 and the next Variation describes an 150A>T, after the deletion 
> has been performed, the 150A>T must become an "147A>T" , because the sequence 
> is three bases shorter.
> 
> I think we can catch that behavior with some code like this:
> 
> sub _set_dnamut {
> 
>    [...]
> 
>    foreach ($self->each_Variant) {
>      next unless $_->isa('Bio::Variation::DNAMutation');
>      next unless $_->isMutation;
>  
>      my ($s, $la, $le);
> 
>      [...]
>       
>      #is the mutation an insertion, deletion or ins/del?
>      #we calculate the difference of the allele sequences to find out that...
>      my $delta_seq=length($_->allele_mut->seq) - length($_->allele_ori->seq);
>      if ($delta_seq) { #if it is an ins, del ins/del
>         foreach my $variant ($self->each_Variant) {
>             #add $delta_seq to the start position if the variant
>             #is behind this variant.
>             #do this even if $delta_seq is negative...
>             next unless $_->start > $variant->start;
>             $variant->start($variant->start + $delta_seq);
>          }
> 
>      [...]
>    }
> }
> 
> Again the code is not tested, I will do that in the near future...
> 
> Eckhard


-- 
______ _/      _/_____________________________________________________
       _/      _/                      http://www.ebi.ac.uk/mutations/
      _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
     _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
    _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
   _/  _/  _/  Cambs. CB10 1SD, United Kingdom
      _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________