[BioRuby] Bio::Sequence forces a DNA sequence to lowercase?

Pjotr Prins pjotr2008 at thebird.nl
Sat Feb 2 10:47:41 UTC 2008


On Sat, Feb 02, 2008 at 01:22:31AM +0900, Toshiaki Katayama wrote:
> 
> In the current implementation of the Bio::Sequence class,
> some methods like 'translate', 'complement', 'molecular_weight', 'names' ...
> depends on the case of the sequence. If we re-implement all these methods
> to normalize the sequence (internally) before they do the job,
> we may conserve the original cases.
> 
> Regards,
> Toshiaki Katayama

As case contains (external) information to the Sequence class I would
favour 'translate' and 'complement' would conserve case after their
job. I think that is the correct thing to do.

Not normalizing in the constructor also gains performance.

Only thing is that changing this will break existing software, so it
may be better to have a switch in the constructor for enforcing old
behaviour (tolower=false).




More information about the BioRuby mailing list