[Biojava-l] external processes

Martin Szugat Martin.Szugat at GMX.net
Wed May 17 23:41:26 UTC 2006


Do you have tried the ExternalProcess class?
(http://cvs.biojava.org/cgi-bin/viewcvs/viewcvs.cgi/biojava-live/src/org/bio
java/utils/process/?cvsroot=biojava)

As far as I understand the problem the ExternalProcess class isn't affected
by it. In addition, because it uses multiple threads from a thread pool,
it's more robust against locks, which e.g. can happen, if the called program
writes out data faster than the data is read in the calling program. This is
a common problem but which does only happen sporadically. So it's very hard
to locate and debug.

Best regards

Martin

> -----Original Message-----
> From: biojava-l-bounces at lists.open-bio.org 
> [mailto:biojava-l-bounces at lists.open-bio.org] On Behalf Of 
> mark.schreiber at novartis.com
> Sent: Wednesday, May 17, 2006 11:39 AM
> To: Andreas Dräger
> Cc: mark.schreiber at novartis.com; biojava-l at biojava.org
> Subject: Re: [Biojava-l] external processes
> 
> Sounds reasonable,
> 
> Do you have CVS access? If so please submit this addition. 
> Can you also put javadoc comments giving the example of why 
> you might need to use a string[] as a parameter.
> 
> Can you also add a @since 1.5 javadoc tag to the method and 
> add yourself as an author to the class (javadoc doesn't allow 
> for @author comments at the method level).
> 
> Thanks,
> 
> - Mark
> 
> 
> 
> 
> 
> Andreas Dräger <andreas.draeger at uni-tuebingen.de>
> 05/17/2006 05:27 PM
> 
>  
>         To:     mark.schreiber at novartis.com
>         cc:     biojava-l at biojava.org
>         Subject:        Re: [Biojava-l] external processes
> 
> 
> 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
> ==================================
> 
> 
> 
> 
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
> 
> 





More information about the Biojava-l mailing list