[Biopython-dev] pypaml

Eric Talevich eric.talevich at gmail.com
Fri Jul 1 16:03:40 UTC 2011


I think the style of Bio.Applications should be the guide here. Check out
these examples:
http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc74

To make this work, you'll need to accept **kwargs somewhere and use the
kwargs dictionary (with some validation) for the options dict. Validation
can happen either before setting the options dict, or just before writing
out the config file -- I think Bio.Applications checks the args just before
running the application.

A complication is that you have two sets of options -- for generating the
config file, and for running the program on the command line. You could
require these to be set separately, to avoid some confusion in the code, and
still use **kwargs for each.

Also worth considering:

(i) Use Bio.Phylo.PAML to generate the config file
(ii) Under the hood, call out to Bio.Phylo.Applications._PamlCommandline to
actually run the program with a given config file (already written)
(iii) Use Bio.Phylo.PAML again to parse the output.

The API of Bio.Phylo.PAML would stay basically the same, but this could help
keep the options separate and maybe decouple the three phases of running the
programs. (I can help with this over the weekend if you'd like.)

Cheers,
Eric


On Fri, Jul 1, 2011 at 6:28 AM, Brandon Invergo <b.invergo at gmail.com> wrote:

>  Since the options are stored in a dict() object keyed by strings, I think
> it would be easiest to have the arguments passed as ("option", value) tuples
> or to have a dict() passed in with "option":value pairs.
>
> Alternatively, the set_option & get_option methods can be dropped
> altogether and we can just let the user have full access to the options
> dict. The write_ctl_file method can be used then to check the validity of
> each option, to prevent erroneous option names from being used. Perhaps
> that's better, despite being slightly more work to implement.
>
> What do you think?
>
>
> Cheers,
> Brandon
>
> On 07/01/2011 04:17 AM, Eric Talevich wrote:
>
> Hi Brandon,
>
> Looks good, thanks! It's just enough to get the point across, and the wiki
> is a fine place for extended examples.
>
> Reading this, I notice that the cml.set_option(key, value) gets kind of
> tedious when a lot of options need to be set. It would be nice to be able to
> set them all in one go, as keyword arguments:
>
> cml.set_options(
>         seqtype=1,
>         verbose=0,
>         noisy=0,
>         RateAncestor=0,
>         model=0,
>         NSsites=[0, 1, 2],
>         CodonFreq=2,
>         cleandata=1,
>         fix_alpha=1,
>         kappa=4.54006,
>         )
>
> What do you think? Worth implementing?
>
> Cheers,
> Eric
>
>
> On Wed, Jun 29, 2011 at 11:27 AM, Brandon Invergo <b.invergo at gmail.com>wrote:
>
>> Well, it's not much, but how's this?
>> https://github.com/brandoninvergo/biopython/tree/doc-branch
>> Do you want me to go more into detail about the options available like
>> in the wikior is this sufficient as a tutorial? Just let me know...
>>
>> Cheers,
>> Brandon
>>
>> On Mon, Jun 27, 2011 at 5:26 PM, Brandon Invergo <b.invergo at gmail.com>
>> wrote:
>> > Hi Eric,
>> > No problem, I'll start writing something up now.
>> > Cheers,
>> > -brandon
>> >
>> > On Sun, Jun 26, 2011 at 7:32 PM, Eric Talevich <eric.talevich at gmail.com>
>> wrote:
>> >> Hi Brandon,
>> >>
>> >> I just added a stub for Bio.Phylo.PAML to the main Tutorial:
>> >>
>> https://github.com/biopython/biopython/commit/190a85c5bde9c079fa5cee4ab9f8ee3362538cb8
>> >>
>> >> Do you think you could add some more to that section, maybe pulling a
>> chunk
>> >> of content from the wiki page you just wrote? If you're not comfortable
>> with
>> >> LaTeX you can just point me to some text and I'll add it.
>> >>
>> >> Thanks,
>> >> Eric
>> >>
>> >> On Thu, Jun 16, 2011 at 11:34 AM, Brandon Invergo <b.invergo at gmail.com
>> >
>> >> wrote:
>> >>>
>> >>> Ok, the documentation is finished:
>> >>> http://biopython.org/wiki/PAML
>> >>>
>> >>> Cheers,
>> >>> Brandon
>> >>>
>> >>> On Wed, Jun 15, 2011 at 1:54 PM, Brad Chapman <chapmanb at 50mail.com>
>> wrote:
>> >>> > Brandon;
>> >>> >
>> >>> >> Ok I've just sent the email to the main list.
>> >>> >
>> >>> > Awesome, thanks for this. Hope this convinces some other folks to
>> >>> > take a look.
>> >>> >
>> >>> >> I can write up some documentation this week. What is the official
>> >>> >> procedure for adding documentation to the wiki, if any? Or can I
>> just
>> >>> >> create an account and start writing?
>> >>> >
>> >>> > Create an account and start writing. Nothing official except that
>> >>> > documentation is good.
>> >>> >
>> >>> >> Also, just to double-check, are my docstrings all sufficient or
>> should
>> >>> >> I expand those?
>> >>> >
>> >>> > Your code comments looked great to me. The end user documentation
>> >>> > seems to be the main thing at this point: describing how someone can
>> >>> > pick up and get started with the code.
>> >>> >
>> >>> > Thanks again for all the work,
>> >>> > Brad
>> >>> > _______________________________________________
>> >>> > Biopython-dev mailing list
>> >>> > Biopython-dev at lists.open-bio.org
>> >>> > http://lists.open-bio.org/mailman/listinfo/biopython-dev
>> >>> >
>> >>> _______________________________________________
>> >>> Biopython-dev mailing list
>> >>> Biopython-dev at lists.open-bio.org
>> >>> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>> >>
>> >>
>> >
>>
>
>
>



More information about the Biopython-dev mailing list