[Bioperl-l] new/unannounced methods

Michael Kiwala mkiwala at watson.wustl.edu
Fri Mar 9 17:37:47 UTC 2007


Phillip San Miguel wrote:
> Chris Fields wrote:
>   
>> On Mar 8, 2007, at 10:38 AM, Nathan Haigh wrote:
>>
>>   
>>     
>>> I've come across a couple of methods that are commented as being
>>> new/unannounced e.g.:
>>> Bio::Location::Atomic::trunc
>>>     
>>>       
>> See:
>>
>> http://bugzilla.open-bio.org/show_bug.cgi?id=1572
>>
>>   
>>     
>>> As it's not been documented with POD it reduces the POD coverage  
>>> metric.
>>> I wondered if it makes sense to have these types of methods initially
>>> made private with the use of a leading underscore until it's  
>>> unveiling?
>>> This way, programmers know not to touch the method from outside the
>>> module and the POD coverage doesn't see it as being missed.
>>>
>>> Any thoughts?
>>>
>>> Nath
>>>     
>>>       
>> That would be cheating, wouldn't it? ; >
>>
>> I think if a method is intended for public consumption it should be  
>> vetted via Devel::Cover.  If it is obviously meant to be a private  
>> method then it should get the underscore and be passed over.
>>
>> trunc(), judging from the bug report, doesn't seem to be a private  
>> method (i.e. the idea was that one could obtain a truncated location  
>> using this method).  If anything it needs tests and documentation,  
>> but apparently it doesn't work as intended (or does it?).
>>
>> chris
>>     
> Not sure if this constitutes a namespace collision but Bio::PrimarySeqI 
> has a method trunc(). It is like subseq() but returns an object, rather 
> than a string.
>
> Phillip
>   
Actually, I think it's polymorphism. What I imagine is that eventually 
you should be able to call trunc() on any PrimarySeqI implementing 
object and it will trunc() itself and any children it has that also 
can('trunc'). So if the sequence you are trying to trunc() implements 
FeatureHolderI like SeqI does then (one day, once this is all coded) the 
sequence object will also do the Right Thing with the features it holds 
(currently, it does not). Similarly, revcom(), cat(), and excise()* 
should work the same way.

Is anyone out there currently working on this? If not I am volunteering. 
I'd like to move Bio::SeqUtils::trunc_with_features() and friends to 
Bio::SeqI::trunc(), etc.

*excise() is a method I'd like to add that would allow one to remove a 
section out of the middle of a sequence, such as a transposable element 
that you don't want to submit to GenBank.




More information about the Bioperl-l mailing list