[Biopython-dev] Biopython wrappers' behavior

Wibowo Arindrarto w.arindrarto at gmail.com
Tue May 15 20:32:08 UTC 2012


>> As per your second point, I can imagine three general ways to do this
>> (on top of my head):
>>
>> 1. Implement a method to override one parameter setting with its
>> opposing parameter in AbstractCommandline. This is perhaps similar to
>> Bio.Blast.Application's _validate_incompatibilities method, only
>> instead of raising an exception it deletes one of the parameters.
>>
>> 2. Implement a new _AbstractParameter subclass that can handle two
>> different incompatible parameters (this is perhaps too complicated)
>>
>> 3. Implement an incompatibility checking mechanism in
>> AbstractCommandline.__str__, to define parameters that can override
>> its pair (e.g. foo and nofoo). This will keep the opposing parameters
>> stored as the object attribute (so a __repr__ will reveal them both),
>> but it won't get passed on to the console as the __call__ method
>> relies on __str__.
>>
>
> Here's a fourth to consider, similar to your #1 (not to disagree with any of
> your suggestions): add an "_AntiSwitch" class to Bio.Applications, which
> includes a reference or string name of the attribute/parameter it nullifies.
> Would that be easier to specify when writing the application wrapper?
>

That seems doable :). I can't imagine it being too hard to implement
technically, as this will only be used for options that can be grouped
under one name (i.e. opposing boolean parameters).



More information about the Biopython-dev mailing list