[BioPython] Translation method for Seq object

Leighton Pritchard lpritc at scri.ac.uk
Mon Oct 20 05:09:51 EDT 2008


On 19/10/2008 19:52, "Peter" <biopython at maubp.freeserve.co.uk> wrote:

> I'm still a tiny bit uneasy about the name clash myself... anyone else
> what to join in the debate?

The problem domain for biological sequences implies a natural definition for
the application of 'translate' to a DNA/RNA sequence that is the translation
into protein sequence.  The string.translate() method is not consistent with
this natural use of the language of the problem domain.

I take Martin's point that there are valid uses for the string.translate()
method in bioinformatics and elsewhere, but I think that overloading
translate() is as valid here as overloading __mul__ would be for an
implementation of matrix algebra, or complex numbers.  For biological
sequences as much as for number types, I think the problem domain and
expected behaviour of the object being represented in code should take
precedence over emulation of an object type that was never intended to
provide the functionality required for a biological sequence.

I think also that if the string.translate() method is required, an explicit
call to string.translate() implies: "translate this biological sequence as
if it were a string, and not a biological sequence".  The converse
application of a Bio.translate() method would to me imply "translate this
biological sequence as if it were a biological sequence, and not a string";
which seems to me to defeat part of the purpose of representing the
biological sequence with its own object.

L.

-- 
Dr Leighton Pritchard MRSC
D131, Plant Pathology Programme, SCRI
Errol Road, Invergowrie, Perth and Kinross, Scotland, DD2 5DA
e:lpritc at scri.ac.uk       w:http://www.scri.ac.uk/staff/leightonpritchard
gpg/pgp: 0xFEFC205C       tel:+44(0)1382 562731 x2405


______________________________________________________________________
SCRI, Invergowrie, Dundee, DD2 5DA.  
The Scottish Crop Research Institute is a charitable company limited by
guarantee. 
Registered in Scotland No: SC 29367.
Recognised by the Inland Revenue as a Scottish Charity No: SC 006662.


DISCLAIMER:

This email is from the Scottish Crop Research Institute, but the views 
expressed by the sender are not necessarily the views of SCRI and its 
subsidiaries.  This email and any files transmitted with it are
confidential

to the intended recipient at the e-mail address to which it has been 
addressed.  It may not be disclosed or used by any other than that
addressee.
If you are not the intended recipient you are requested to preserve this

confidentiality and you must not use, disclose, copy, print or rely on
this 
e-mail in any way. Please notify postmaster at scri.ac.uk quoting the 
name of the sender and delete the email from your system.

Although SCRI has taken reasonable precautions to ensure no viruses are 
present in this email, neither the Institute nor the sender accepts any 
responsibility for any viruses, and it is your responsibility to scan
the email and the attachments (if any).
______________________________________________________________________


More information about the BioPython mailing list