[Biojava-dev] Local binary execution
Michael Barton
michael.barton1 at ncl.ac.uk
Tue Jun 14 14:26:45 EDT 2005
I had a look at the post you were refering to. In terms of the ant
support for local binary execution I think it is very similar to the
newly implemented ProcessBuilder in Java 1.5.
This class has a similar way way of adding command line arguments to
that of ant <exec>.
The classes I'm suggesting have an enum of arguments specific to the
application which may convienient for suppling different switch/argument
pairs, as it it means that only arguments for which the binary allows
can be supplied.
Any errors should therefore come from incorrent argument values rather
than incorrect arguments. If that makes sense.
In addition the class throws an exception if the essential arguments
required to run the search are not supplied.
This means however that the classes are written in Java 1.5. Would this
be a problem?
On Thu, 2005-06-09 at 11:54 -0400, Michael Heuer wrote:
> Hello Michael,
>
> Personally I think this kind of code might be better suited in a more
> general library, say in an Apache Jakarta Commons project for example.
>
> In fact, there was just a proposal to pull the exec code out of ant into a
> separate self-contained library to the commonds-dev mailing list a couple
> of days ago:
>
> > http://tinyurl.com/9culs
>
> That said, this comes up quite frequently here, so perhaps we should just
> bite the bullet and do it up right.
>
> michael
>
>
> On Thu, 9 Jun 2005, Michael Barton wrote:
>
> >
> > Hi,
> >
> > I'm Bioinformatics MRes student at Newcastle. I've been messing around
> > with some java code to execute bioinformatics binaries. It was
> > originally intended for blast but has also been extended for genewise.
> > It takes the hassle out of using process / process builder a little bit.
> >
> > Use goes along the lines of something like this
> >
> > //Search factory for creating searches
> > SearchFactory<BlastSearch, BlastSearchFactory.Parameter> bsf;
> > bsf = new BlastSearchFactory();
> >
> > //Paramterise with search specific variables
> > bsf.setSearchBinaryLocation(test_data + "/blast/binary");
> > bsf.setSearchParameter(BlastSearchFactory.Parameter.blastType,"blastn");
> > bsf.setSearchParameter(BlastSearchFactory.Parameter.database,
> > test_data + "/blast/db/sargasso");
> >
> > //Create immutable search object which can be used to run mutiple
> > searches on the same database
> > Search<BlastSearchResult> blastSearch = bsf.getSearch();
> >
> > Simple search result object which returns inputstream
> > SearchResult sr = blastSearch.execute(new File(test_data +
> > "/blast/query/query"));
> >
> > InputStream is = sr.getResultStream();
> >
> > It's seems to work okay on linux, I haven't tested it on windows.
> >
> > There's a little bit of JavaDoc I started work on but it's a little bit
> > messed up from where I've been changing things around.
> >
> > The source/jar/doc are all here. There's test cases too.
> >
> > http://www.students.ncl.ac.uk/michael.barton1/
> >
> > Mike
> >
> > _______________________________________________
> > biojava-dev mailing list
> > biojava-dev at biojava.org
> > http://biojava.org/mailman/listinfo/biojava-dev
> >
>
More information about the biojava-dev
mailing list