[Biojava-l] external processes

Andreas Dräger andreas.draeger at uni-tuebingen.de
Wed May 17 09:27:00 UTC 2006


Hello,

I just tried the ExecRunner class with a compliation of a Matlab skript. 
My parameters are Matlab matrices and vectors like
[1 2 3; 4 5 6]
and so on. In the ExecRunner class this 2x3 matrix will be destroyed by 
the StringTokenizer and my Matlab skript will be started with the arguments
[1, 2, 3;, 4, 5, 6]
which doesn't make any sense. I would like to suggest to add a method 
where one can pass the aruments as a String[]-vector. In my case I could 
pass every single Matlab matrix and every Matlab vector as a single 
String. I just tried this out with the following code:

  public static String execute(String command[]) throws IOException {
    String out = null, temp;
    Process exe = Runtime.getRuntime().exec(command);
    BufferedReader in = new BufferedReader(
      new InputStreamReader(exe.getInputStream()));
    for (out = ""; (temp = in.readLine()) != null; out += temp + "\n");
    return out; 
  }

It works fine. I would add something similar to the class ExecRunner 
mentioned above, but adapted so that the other features of this class 
will also be maintained.

Andreas Dräger

mark.schreiber at novartis.com wrote:

>Hi all -
>
>I noticed that someone has posted a tutorial to the wiki page 
>(http://biojava.org/wiki/BioJava:Tutorial:MultiAlignClustalW) showing how 
>to launch ClustalW from biojava which is very much appreciated. The 
>tutorial makes use of the standard Java Runtime and Process classes. 
>Developers may also be interested in the ExecRunner class that is in the 
>utils package of biojava1.4.
>
>There is also an entire API for handelling external processes in the CVS 
>version of biojava (org.biojava.utils.process) which makes handling of 
>external processes much simpler.
>
>- Mark
>
>Mark Schreiber
>Research Investigator (Bioinformatics)
>
>Novartis Institute for Tropical Diseases (NITD)
>10 Biopolis Road
>#05-01 Chromos
>Singapore 138670
>www.nitd.novartis.com
>
>phone +65 6722 2973
>fax  +65 6722 2910
>
>_______________________________________________
>Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
>http://lists.open-bio.org/mailman/listinfo/biojava-l
>
>
>
>  
>


-- 
==================================
Andreas Dräger
PhD student
Eberhard Karls University Tübingen
Center for Bioinformatics (ZBIT)
Phone: +49-7071-29-70436
==================================




More information about the Biojava-l mailing list