[Biojava-l] Running apps with Java

Thomas Down thomas at derkholm.net
Mon Aug 11 18:33:42 EDT 2003

Once upon a time, Patrick McConnell wrote:
> Or, even better would be some sort of Parameters class to encapsulate all
> those parameters, providing optional parameters.  Then, you could do
> something like this:
>    NCBIBlastParameters params = new NCBIBlastParameters();
>    params.addParameter("p", "blastn");
>    params.addParameter("d", "nt");
>    params.addParameter("m", "7");
>    StringBuffer outputXML = new StringBuffer();
>    int success = NCBIBlast.exec(
>      "c:\\blast\\blastall",
>      params,
>      inputFasta,
>      outputXML,
>      null
>    );
>    System.out.println(outputXML);
> I think this would be more convenient to people for developing
> applications.  If you wanted to get fancy, you could have the exec method
> throw an exception for missing or invalid parameters.  Perhaps a method to
> turn off this parameter checking would also be necessary.

Yes, I quite agree.  Although I think I'd prefer something more like:

   params.addParameter(NCBIBlast.PROGRAM_NAME, "blastn")

Have you looked at the AnnotationType class?  We could probably
use those to do the parameter set validation.

The other big win would be to do something at least vaguely
sane about finding executables.  Hardcoded paths aren't a problem
if you are running on your own machines, but if people want
to deploy BioJava-based applications widely, they really
need to be able find blast on their own...


More information about the Biojava-l mailing list