[Biopython] Sequence object "find" is still case specific?
hari jayaram
harijay at gmail.com
Sun Mar 3 23:50:38 UTC 2013
Hi All,
I agree that magic is bad and understand why the API is the way it is
for compatibility reasons.
I agree with what everyone says that the best behavior is to throw an
error during instantiation and minimize surprising results downstream.
The good thing about have a repo on git is that it is always possible
to make branched tweaks like this and see how things go.
Since I am new to Biopython, I will read more on the development
process and other things..but for now I am forcing all my sequences to
be in upper case and check for "alphabet" compliance prior to
instantiation.
Thanks for your help
Hari
On Sun, Mar 3, 2013 at 5:19 PM, Fields, Christopher J
<cjfields at illinois.edu> wrote:
> On Mar 3, 2013, at 2:39 PM, Peter Cock <p.j.a.cock at googlemail.com>
> wrote:
>
>> On Sun, Mar 3, 2013 at 7:13 PM, hari jayaram <harijay at gmail.com> wrote:
>> ...
>>> or
>>>
>>> It just silently converts it all to the case of the Unambiguous_DNA
>>> specification and then all "find" and "search" works regardless of case on
>>> this internal representation which is just "DNA".
>>
>> You mean if an all upper case alphabet is used, silently switch
>> the sequence to upper case? And vice verse for lower case?
>> That seems to0 magic/implicit, so I'd not support that.
>
> A note/warning: Peter's right, I've been bitten by such magic (on the Bioperl end :) a number of times. We're intending on removing such magic in v2. It's best to throw an exception and let someone know why it doesn't work than try 'helping' and end up misunderstanding the user's intent.
>
>>
>> Peter
>
>
> chris
>
More information about the Biopython
mailing list