[Biopython-dev] Adjusting the xxMotif wrapper / Bio.Application plans

Peter Cock p.j.a.cock at googlemail.com
Tue Aug 6 22:51:22 UTC 2013


Hi Christian et al.,

I've just noticed something in the XXmotif wrapper which
I should have raised back in November 2012 when it was
committed. This is to do with the way the options were
define, e.g.

      _Option(["--negSet", "negSet", "negset", "NEGSET"],
                   "sequence set which has to be used as a reference set",
                   filename = True,
                   equate = False),

The first argument is a list of names, aliases which can
be used via the (legacy) set_parameter method. Of
these the first is what goes in the actual command
string, and the last must be a valid Python identifier
and becomes a property and a keyword argument
for the __init__ method (and ideally follow PEP8
guidelines).

Normally the _Option would just have TWO alias,
in this case ["--negSeq, "negset"] would seem best.

Clearly I'd not documented this well enough, but
I've tried to make this more explicit now:
https://github.com/biopython/biopython/commit/39a88714ab7ee7a8dc4ed2b7a7ea71569fdd4293

Was there a special reason for all these case variants
in the XXmotif options??

We could perhaps just change this now in the newer
Bio.motifs module, despite this being live in the
Biopython 1.61 release... since right now the nasty
all upper case aliases are being used as the property
names and keyword names. But that could break a
few scripts already using Bio.motifs.application's
XXmotif wrapper.

Looking ahead, other than set_parameter, all the other
legacy bits in Bio.Application have all been removed -
so we could take a fresh look at if we can transition to
a more explicit application definition, which I hope is
possible with the class files defining these properties
explicitly (perhaps with decorators for things like
validation methods) - rather than implicitly as now
via the __init__ method which doesn't suit things
like autogenerated API docs.

There may be a catch in how to best make the
parameter order explicit (currently done via the
parameters being in a list) which can be vital for
many command line tools.

Regards,

Peter



More information about the Biopython-dev mailing list