[Bioperl-l] Re: translation using Bioperl

Heikki Lehvaslaiho heikki@ebi.ac.uk
Wed, 26 Jul 2000 22:38:35 +0100


Nice ideas, Hilmar. Thanks.


I talked about this with Ewan and I agreed to add two more arguments
to the function call for the time being. 

The attibute list for translate is now:
	$stop, $unknown, $frame, $tableid, $fullCDS, $throw


Sixth argument is boolean $fullCDS and last boolean $throw. If not
$throw an exception then $self->warn is called.


So, to ask for translation of biological CDS using default values in
other arguments, you have to write as follows:


$seq->seq('TTGGTGGCGTCAACTTAA');
$aa = $seq->translate();

print $aa	=> 'LVAST*'

$aa = $seq->translate(undef, undef, undef, undef, 1);
print $aa	=> 'MVAST'


This is only halfway where I'd like this code to be, but I
unfortunately (8-)) have to leave for holidays. I'll try to follow the
discussion occasionally, but Ewan has promised to overseer the
discussion from now one.

The code is committed only to live CVS. Feel free to experiment.

	-Heikki



hilmar.lapp@pharma.Novartis.com wrote:
> 
> Add one more optional, boolean argument, $fullCDS, to method
> translate.
> If it is true:
> 
> 1. Check and replace the initial amino acid.
> 
> 2. Remove the trailing stop character
>    Note that this is the default behaviour now. In my opinion ,
>    the trailing stops should be left there by default.
> 
> 3. Warn if a) first codon is not a valid initiator
>            b) last codon is not a stop
> 
> Comments anyone?
> 
>      -Heikki
> 
>    At first glance, sounds okay except for the last point. My comments are
>    1) If you can put up rules having certain consequences, that is, if
>    there is a contract, and the rules are not met, this is an exception.
>    So, don't warn, but throw an exception. I wonder how you want to catch a
>    warning programmatically and react upon it properly.
>    2) The conditions you are mentioning in 3) sound like a validation. So,
>    one (the user) might like to validate whether a given sequence could be
>    a full CDS. If a sequence does not pass this validation, translate()
>    with $fullCDS == 1 should throw an exception. The validation may be even
>    a method offered by a module other than PrimarySeqI, maybe even
>    CodonTable, but that's just a first guess.
> 
>       Hilmar

-- 
______ _/      _/_____________________________________________________
      _/      _/                      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
___ _/_/_/_/_/________________________________________________________