[Biopython-dev] Repeated options in command line interfaces

Brad Chapman chapmanb at 50mail.com
Thu May 21 12:29:27 UTC 2009


Hi Peter;

> Yes - its another thread about command line wrappers!

It seems like y'all are unearthing every single crazy command line
option choice out there. Great to have this fleshed out.

> One of the Roche 454 off instrument applications is runMapping,
> which in the most general situation allows you to map one or
> more SFF files onto one or more FASTA files, e.g.
> 
> runMapping -o ~/test -ref example1.fasta example2.fasta -read
> data1.sff data2.sff
[...]
> the --seed parameter in Mafft, which is used to specify one or more
> alignment files, e.g.
> 
> mafft ... --seed alignment1 --seed alignment2 --seed alignment3 ...
> 
> Notice that "--seed" is repeated before each value.
> 
> I was thinking it would be nice to treat this as a single
> property (seed) which takes a list of strings as its value:
> 
> from Bio.Align.Applications import MafftCommandline
> cline = MafftCommandline()
> cline.seed = ["alignment1", "alignment2", ...]
[...]
> #These modules don't exist (yet):
> from Bio.Sequencing.Applications import RunMappingCommandline
> cline = RunMappingCommandline()
> cline.ref = ["example1.fasta", "example2.fasta"]
> cline.read = ["data1.sff", "data2.sff"]

This makes good sense to me. It hides the actual nastiness a bit and
makes it clear in the code what is happening -- assigning multiple
parameters to a single option. It sounds like a great way to handle
it.

Brad



More information about the Biopython-dev mailing list