[Biopython-dev] [Bug 2822] Bio.Application.AbstractCommandline - properties and kwargs

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Apr 29 10:00:14 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2822





------- Comment #1 from biopython-bugzilla at maubp.freeserve.co.uk  2009-04-29 06:00 EST -------
Created an attachment (id=1287)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=1287&action=view)
Adds keyword argument support to the __init__ method

This patch adds keyword argument support to the __init__ method, although for
the purposes of demonstration in this patch I have only updated the EMBOSS
wrappers to use it.  As an alternative to the earlier example you would be able
to do:

>>> from Bio.Emboss.Applications import WaterCommandline
>>> water_exe = r"C:\Progra~1\Emboss\water.exe"
>>> cline = WaterCommandline(cmd=water_exe, asequence="asis:ACCCGGGCGCGGT", bsequence="asis:ACCCGAGCGCGGT", gapopen="10", gapextend="0.5", outfile="temp_test.water")
>>> print cline
C:\Progra~1\Emboss\water.exe -asequence=asis:ACCCGGGCGCGGT
-bsequence=asis:ACCCGAGCGCGGT -gapopen=10 -gapextend=0.5
-outfile=temp_test.water

You can of course still use the set_parameter approach as well, for example to
change a setting:

>>> cline.set_parameter("gapopen", "20")
>>> print cline
C:\Progra~1\Emboss\water.exe -asequence=asis:ACCCGGGCGCGGT
-bsequence=asis:ACCCGAGCGCGGT -gapopen=20 -gapextend=0.5
-outfile=temp_test.water 

I think this is much nicer, and also more like some of the existing "helper
functions" we have for wrapping command line tools.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list