[Biojava-l] Running apps with Java

Patrick McConnell MCCon012 at mc.duke.edu
Mon Aug 11 14:36:14 EDT 2003






I agree - parameters like that would be better to work with
programatically.  But, I would like to see the everything done as flexibly
as possible, so that you could pass in an arbitrary parameter.  Also, you
should be able to get binary data from stdout/err.  Perhaps a ByteBuffer
class should be created, or we could use ByteArrayOutputStream.  Also,
passing files in would be useful in the case that stdout/err will not fit
in memory.

As to finding the path dynamically, it may be useful to have some sort
initialization file for BioJava that contains these sort of useful things.
The parameter file can be dynamically loaded at runtime by looking for the
file in the biojava jar file, in the path that the biojava jar file
resides, in the users home directory, and finally in a java initialization
parameter.  I think this sort of application-level support would be
indespensible, especially when biojava enters the distributed computing
world (such as with web services).  What do you think?

-Patrick





Thomas Down <thomas at derkholm.net>@biojava.org on 08/11/2003 12:33:42 PM

Sent by:    biojava-l-bounces at biojava.org


To:    Patrick McConnell <MCCon012 at mc.duke.edu>
cc:    biojava-l at biojava.org

Subject:    Re: [Biojava-l] Running apps with Java

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...

    Thomas.
_______________________________________________
Biojava-l mailing list  -  Biojava-l at biojava.org
http://biojava.org/mailman/listinfo/biojava-l






More information about the Biojava-l mailing list