From g.etherington at imb.uq.edu.au Wed Nov 1 03:39:24 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Wed, 1 Nov 2006 18:39:24 +1000 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: <008901c6fd91$3c415e40$36776682@IMBPC.AD> Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham From mark.schreiber at novartis.com Wed Nov 1 04:53:33 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Wed, 1 Nov 2006 17:53:33 +0800 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From ayates at ebi.ac.uk Wed Nov 1 05:00:23 2006 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 01 Nov 2006 10:00:23 +0000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: <008901c6fd91$3c415e40$36776682@IMBPC.AD> References: <008901c6fd91$3c415e40$36776682@IMBPC.AD> Message-ID: <45487037.1090205@ebi.ac.uk> Hi Graham, Your problem is probably that you're running this via sh which windows does not have. Even if you are running this via cygwin as far as I'm aware the JVM will use a normal windows shell/cmd. My advice would be to drop the sh and just try running the command as normal and see how that goes. Failing that BioJava has org.biojava.utils.ExecRunner which is quite good and takes into account a few lessons learned from this article on using runtime: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Hope that helps, Andy Yates Graham Etherington wrote: > Hi, > I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST > searches on a local BLAST database. Even though I'm not using BioJava > (intend to use it to parse the results), I thought this formum would be the > best place to ask for help. > Even when I hard code a good BLAST search I keep getting the same error when > I run my search, namely: > " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache > Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i > test.fas -o blast.out" error=2 " > > The pertinent bits of code I'm using are... > > String cmd = "C:/Program Files/Apache Software Foundation/Tomcat > 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; > > ............ > > > Runtime r = Runtime.getRuntime (); > Process runBlast = r.exec (new String[] {"sh","-c",cmd}); > > runBlast.waitFor (); > out.println ("Waiting for result"); > > //Write the results > BufferedReader br = new BufferedReader (new FileReader (output)); > String line = null; > String results = ""; > while ( (line = br.readLine ()) != null ) > results = results.concat ("/n" + line); > > ............. > > I'm not sure why it give me an IOException. I've checked that the file input > file exists and that all the paths are correct. > Any ideas? > > Many thanks, > Graham > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l From Peter.Ng at bccdc.ca Wed Nov 1 14:40:53 2006 From: Peter.Ng at bccdc.ca (Ng, Peter) Date: Wed, 1 Nov 2006 11:40:53 -0800 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From g.etherington at imb.uq.edu.au Wed Nov 1 16:21:53 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Thu, 2 Nov 2006 07:21:53 +1000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: Message-ID: <000301c6fdfb$c0c82a80$36776682@IMBPC.AD> Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From Peter.Ng at bccdc.ca Wed Nov 1 16:52:42 2006 From: Peter.Ng at bccdc.ca (Ng, Peter) Date: Wed, 1 Nov 2006 13:52:42 -0800 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: Graham, thanks for the info! I have two instances of Runtime.getRuntime().exec going, should I be putting these into two threads? also, when does java see the process actually being finished? how does java know when blastn is done at the unix or window level? thanks, peter -----Original Message----- From: Graham Etherington [mailto:g.etherington at imb.uq.edu.au] Sent: November 1, 2006 1:22 PM To: Ng, Peter; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From g.etherington at imb.uq.edu.au Wed Nov 1 17:16:38 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Thu, 2 Nov 2006 08:16:38 +1000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: Message-ID: <001a01c6fe03$6688b4b0$36776682@IMBPC.AD> Peter, The method is explained quite well at: http://java.sun.com/j2se/1.3/docs/api/java/lang/Process.html#waitFor() Not sure about your threading question, but I'm presuming that the Process produces and exit value. By convention, 0 indicates normal termination. Hope this helps a little. Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 7:53 AM To: Graham Etherington; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Graham, thanks for the info! I have two instances of Runtime.getRuntime().exec going, should I be putting these into two threads? also, when does java see the process actually being finished? how does java know when blastn is done at the unix or window level? thanks, peter -----Original Message----- From: Graham Etherington [mailto:g.etherington at imb.uq.edu.au] Sent: November 1, 2006 1:22 PM To: Ng, Peter; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From michael.tran at acpfg.com.au Thu Nov 2 00:43:09 2006 From: michael.tran at acpfg.com.au (Michael Tran) Date: Thu, 2 Nov 2006 16:13:09 +1030 Subject: [Biojava-l] Can BioJava do Multiple Alignments? References: Message-ID: Hi, I know that BioJava 1.5 can do pairwise alignments using algorithms like SmithWaterman and NeedlemanWunch. But can BioJava do multiple alignments like the algorthm used for ClustalW? I have also checked the HMM classes, but they appear to only do pairwise alignments. Michael ________________________________ From: biojava-l-bounces at lists.open-bio.org on behalf of biojava-l-request at lists.open-bio.org Sent: Wed 1/11/2006 8:09 PM To: biojava-l at lists.open-bio.org Subject: Biojava-l Digest, Vol 47, Issue 1 Send Biojava-l mailing list submissions to biojava-l at lists.open-bio.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.open-bio.org/mailman/listinfo/biojava-l or, via email, send a message with subject or body 'help' to biojava-l-request at lists.open-bio.org You can reach the person managing the list at biojava-l-owner at lists.open-bio.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Biojava-l digest..." Today's Topics: 1. Re: can BioJava do alignment ? (Ramon Medrado) 2. Re: can BioJava do alignment ? (mark.schreiber at novartis.com) 3. More extensive Bioperl-run 1.5.2RC2 tests (Nathan S. Haigh) 4. Re: More extensive Bioperl-run 1.5.2RC2 tests (Nathan Haigh) 5. fasta description line (ThorstenInAnger) 6. pK values (Gerster Sarah) 7. Re: fasta description line (Mark Schreiber) 8. Re: pK values (Mark Schreiber) 9. Re: pK values (David Huen) 10. Using Java to create BLAST searches (Graham Etherington) ---------------------------------------------------------------------- Message: 1 Date: Thu, 19 Oct 2006 14:45:24 -0300 From: "Ramon Medrado" Subject: Re: [Biojava-l] can BioJava do alignment ? To: biojava Message-ID: <37ba4b050610191045q30a6282bjce052e31e1463cea at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 2 Date: Fri, 20 Oct 2006 09:57:09 +0800 From: mark.schreiber at novartis.com Subject: Re: [Biojava-l] can BioJava do alignment ? To: "Ramon Medrado" , CARMELK at il.ibm.com Cc: biojava Message-ID: Content-Type: text/plain; charset="us-ascii" Hi - You can also perform an alignment using HMMs in biojava 1.3 and 1.4. See the example at (http://biojava.org/wiki/BioJava:CookBook:DP:PairWise). This is actually the most flexible way to do it. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Ramon Medrado" Sent by: biojava-l-bounces at lists.open-bio.org 10/20/2006 01:45 AM To: biojava cc: (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-l] can BioJava do alignment ? Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l ------------------------------ Message: 3 Date: Wed, 25 Oct 2006 13:54:26 +0000 From: "Nathan S. Haigh" Subject: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <453F6C92.6020207 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 I have recently installed some more software for which there are bioperl-run tests and run the test suite with several versions of the software I could find. I've added info to http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any fails in any of the versions I tested I've noted them together with versions that were ok (if any). There maybe another 6 or so programs I'm trying to get hold of to run further tests - I'll update when I get them. Nath ------------------------------ Message: 4 Date: Thu, 26 Oct 2006 09:46:13 +0100 From: Nathan Haigh Subject: Re: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <454075D5.2030005 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 Nathan S. Haigh wrote: > I have recently installed some more software for which there are > bioperl-run tests and run the test suite with several versions of the > software I could find. I've added info to > http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any > fails in any of the versions I tested I've noted them together with > versions that were ok (if any). > > There maybe another 6 or so programs I'm trying to get hold of to run > further tests - I'll update when I get them. > Nath > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > My aplogies, this should have gone to the Bioperl mailing list! :o) ------------------------------ Message: 5 Date: Mon, 23 Oct 2006 02:57:14 -0700 (PDT) From: ThorstenInAnger Subject: [Biojava-l] fasta description line To: biojava-l at lists.open-bio.org Message-ID: <6950970.post at talk.nabble.com> Content-Type: text/plain; charset=us-ascii Hi, I want to do something very simple: - get id and sequence from a database - create a sequence object - write it out as fasta format file (with a defined description line) this is my code: rs = stmt.executeQuery(query); Feature.Template templ = new Feature.Template(); //fill in the template Annotation an = new SimpleAnnotation(); templ.location = Location.empty; while (rs.next()) { mepdId = rs.getInt(1); mepdName = rs.getString(2); seq = rs.getString(3); seqObj = DNATools.createDNASequence(seq, mepdName); an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description here"); templ.annotation = an; seqObj.createFeature(templ); SeqIOTools.writeFasta(fastaFos, seqObj); //db.addSequence(seqObj); } It works fine, but there is no description line in the resulting file! How can I change the fasta description line? Also I am using deprecated methods, but could not find out what to use instead: FastaFormat.PROPERTY_DESCRIPTIONLINE SeqIOTools.writeFasta All tutorials I found are using the deprecated. Cheers, Thorsten -- View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 Sent from the BioJava mailing list archive at Nabble.com. ------------------------------ Message: 6 Date: Tue, 31 Oct 2006 09:04:33 +0100 From: "Gerster Sarah" Subject: [Biojava-l] pK values To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi! I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? Cheers Sarah ------------------------------ Message: 7 Date: Tue, 31 Oct 2006 17:37:24 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] fasta description line To: ThorstenInAnger Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310137u68700b06se364f99da69feb47 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - If you are using biojava 1.5 beta (recommended) you should use RichSequence.IOTools to write the fasta (strongly recommended). With the new org.biojavax.bio.seq.io.FastaFormat object the description line is constructed from: richSequence.getIdentifier() richSequence.getNamespace().getName(); richSequence.getAccession() richSequence.getVersion() richSequence.getName() richSequence.getDescription() - Mark On 10/23/06, ThorstenInAnger wrote: > > Hi, > > I want to do something very simple: > > - get id and sequence from a database > - create a sequence object > - write it out as fasta format file (with a defined description line) > > this is my code: > rs = stmt.executeQuery(query); > Feature.Template templ = new Feature.Template(); > > //fill in the template > Annotation an = new SimpleAnnotation(); > templ.location = Location.empty; > > while (rs.next()) { > mepdId = rs.getInt(1); > mepdName = rs.getString(2); > seq = rs.getString(3); > seqObj = DNATools.createDNASequence(seq, mepdName); > an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description > here"); > templ.annotation = an; > seqObj.createFeature(templ); > SeqIOTools.writeFasta(fastaFos, seqObj); > //db.addSequence(seqObj); > } > > It works fine, but there is no description line in the resulting file! > How can I change the fasta description line? > > Also I am using deprecated methods, but could not find out what to use > instead: > FastaFormat.PROPERTY_DESCRIPTIONLINE > SeqIOTools.writeFasta > All tutorials I found are using the deprecated. > > Cheers, > > Thorsten > > -- > View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 > Sent from the BioJava mailing list archive at Nabble.com. > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 8 Date: Tue, 31 Oct 2006 17:27:29 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] pK values To: "Gerster Sarah" Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310127h75010e56ne31e188294e23803 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - The values are calculated using the SymbolPropertyTable returned by ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); This table gets it's values from the resource file org/biojava/bio/symbol/ResidueProperties.xml The pK values were added by david huen (I think). To read XML sequence files try one of the methods in RichSequence.IOTools from biojava 1.5 beta. - Mark On 10/31/06, Gerster Sarah wrote: > Hi! > > I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. > > And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? > > Cheers > > Sarah > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 9 Date: 31 Oct 2006 12:21:43 +0000 From: David Huen Subject: Re: [Biojava-l] pK values To: Mark Schreiber Cc: biojava-l at lists.open-bio.org Message-ID: Content-Type: text/plain; format=flowed; charset=ISO-8859-1 On Oct 31 2006, Mark Schreiber wrote: >Hi - > >The values are calculated using the SymbolPropertyTable returned by >ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); > >This table gets it's values from the resource file >org/biojava/bio/symbol/ResidueProperties.xml > >The pK values were added by david huen (I think). > I used the same pK values as those used by GCG to maintian cross-compability. Regards, David ------------------------------ Message: 10 Date: Wed, 1 Nov 2006 18:39:24 +1000 From: "Graham Etherington" Subject: [Biojava-l] Using Java to create BLAST searches To: Message-ID: <008901c6fd91$3c415e40$36776682 at IMBPC.AD> Content-Type: text/plain; charset="us-ascii" Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham ------------------------------ _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l End of Biojava-l Digest, Vol 47, Issue 1 **************************************** From mark.schreiber at novartis.com Thu Nov 2 01:03:13 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 2 Nov 2006 14:03:13 +0800 Subject: [Biojava-l] Can BioJava do Multiple Alignments? Message-ID: In short -- No. The best solution is probably to call ClustalW in a process. You could of course reimplement the algorithm in biojava if you wish. The DP library could also be extended for MSA but this would be hard work. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Michael Tran" Sent by: biojava-l-bounces at lists.open-bio.org 11/02/2006 01:43 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Can BioJava do Multiple Alignments? Hi, I know that BioJava 1.5 can do pairwise alignments using algorithms like SmithWaterman and NeedlemanWunch. But can BioJava do multiple alignments like the algorthm used for ClustalW? I have also checked the HMM classes, but they appear to only do pairwise alignments. Michael ________________________________ From: biojava-l-bounces at lists.open-bio.org on behalf of biojava-l-request at lists.open-bio.org Sent: Wed 1/11/2006 8:09 PM To: biojava-l at lists.open-bio.org Subject: Biojava-l Digest, Vol 47, Issue 1 Send Biojava-l mailing list submissions to biojava-l at lists.open-bio.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.open-bio.org/mailman/listinfo/biojava-l or, via email, send a message with subject or body 'help' to biojava-l-request at lists.open-bio.org You can reach the person managing the list at biojava-l-owner at lists.open-bio.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Biojava-l digest..." Today's Topics: 1. Re: can BioJava do alignment ? (Ramon Medrado) 2. Re: can BioJava do alignment ? (mark.schreiber at novartis.com) 3. More extensive Bioperl-run 1.5.2RC2 tests (Nathan S. Haigh) 4. Re: More extensive Bioperl-run 1.5.2RC2 tests (Nathan Haigh) 5. fasta description line (ThorstenInAnger) 6. pK values (Gerster Sarah) 7. Re: fasta description line (Mark Schreiber) 8. Re: pK values (Mark Schreiber) 9. Re: pK values (David Huen) 10. Using Java to create BLAST searches (Graham Etherington) ---------------------------------------------------------------------- Message: 1 Date: Thu, 19 Oct 2006 14:45:24 -0300 From: "Ramon Medrado" Subject: Re: [Biojava-l] can BioJava do alignment ? To: biojava Message-ID: <37ba4b050610191045q30a6282bjce052e31e1463cea at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 2 Date: Fri, 20 Oct 2006 09:57:09 +0800 From: mark.schreiber at novartis.com Subject: Re: [Biojava-l] can BioJava do alignment ? To: "Ramon Medrado" , CARMELK at il.ibm.com Cc: biojava Message-ID: Content-Type: text/plain; charset="us-ascii" Hi - You can also perform an alignment using HMMs in biojava 1.3 and 1.4. See the example at (http://biojava.org/wiki/BioJava:CookBook:DP:PairWise). This is actually the most flexible way to do it. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Ramon Medrado" Sent by: biojava-l-bounces at lists.open-bio.org 10/20/2006 01:45 AM To: biojava cc: (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-l] can BioJava do alignment ? Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l ------------------------------ Message: 3 Date: Wed, 25 Oct 2006 13:54:26 +0000 From: "Nathan S. Haigh" Subject: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <453F6C92.6020207 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 I have recently installed some more software for which there are bioperl-run tests and run the test suite with several versions of the software I could find. I've added info to http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any fails in any of the versions I tested I've noted them together with versions that were ok (if any). There maybe another 6 or so programs I'm trying to get hold of to run further tests - I'll update when I get them. Nath ------------------------------ Message: 4 Date: Thu, 26 Oct 2006 09:46:13 +0100 From: Nathan Haigh Subject: Re: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <454075D5.2030005 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 Nathan S. Haigh wrote: > I have recently installed some more software for which there are > bioperl-run tests and run the test suite with several versions of the > software I could find. I've added info to > http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any > fails in any of the versions I tested I've noted them together with > versions that were ok (if any). > > There maybe another 6 or so programs I'm trying to get hold of to run > further tests - I'll update when I get them. > Nath > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > My aplogies, this should have gone to the Bioperl mailing list! :o) ------------------------------ Message: 5 Date: Mon, 23 Oct 2006 02:57:14 -0700 (PDT) From: ThorstenInAnger Subject: [Biojava-l] fasta description line To: biojava-l at lists.open-bio.org Message-ID: <6950970.post at talk.nabble.com> Content-Type: text/plain; charset=us-ascii Hi, I want to do something very simple: - get id and sequence from a database - create a sequence object - write it out as fasta format file (with a defined description line) this is my code: rs = stmt.executeQuery(query); Feature.Template templ = new Feature.Template(); //fill in the template Annotation an = new SimpleAnnotation(); templ.location = Location.empty; while (rs.next()) { mepdId = rs.getInt(1); mepdName = rs.getString(2); seq = rs.getString(3); seqObj = DNATools.createDNASequence(seq, mepdName); an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description here"); templ.annotation = an; seqObj.createFeature(templ); SeqIOTools.writeFasta(fastaFos, seqObj); //db.addSequence(seqObj); } It works fine, but there is no description line in the resulting file! How can I change the fasta description line? Also I am using deprecated methods, but could not find out what to use instead: FastaFormat.PROPERTY_DESCRIPTIONLINE SeqIOTools.writeFasta All tutorials I found are using the deprecated. Cheers, Thorsten -- View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 Sent from the BioJava mailing list archive at Nabble.com. ------------------------------ Message: 6 Date: Tue, 31 Oct 2006 09:04:33 +0100 From: "Gerster Sarah" Subject: [Biojava-l] pK values To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi! I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? Cheers Sarah ------------------------------ Message: 7 Date: Tue, 31 Oct 2006 17:37:24 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] fasta description line To: ThorstenInAnger Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310137u68700b06se364f99da69feb47 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - If you are using biojava 1.5 beta (recommended) you should use RichSequence.IOTools to write the fasta (strongly recommended). With the new org.biojavax.bio.seq.io.FastaFormat object the description line is constructed from: richSequence.getIdentifier() richSequence.getNamespace().getName(); richSequence.getAccession() richSequence.getVersion() richSequence.getName() richSequence.getDescription() - Mark On 10/23/06, ThorstenInAnger wrote: > > Hi, > > I want to do something very simple: > > - get id and sequence from a database > - create a sequence object > - write it out as fasta format file (with a defined description line) > > this is my code: > rs = stmt.executeQuery(query); > Feature.Template templ = new Feature.Template(); > > //fill in the template > Annotation an = new SimpleAnnotation(); > templ.location = Location.empty; > > while (rs.next()) { > mepdId = rs.getInt(1); > mepdName = rs.getString(2); > seq = rs.getString(3); > seqObj = DNATools.createDNASequence(seq, mepdName); > an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description > here"); > templ.annotation = an; > seqObj.createFeature(templ); > SeqIOTools.writeFasta(fastaFos, seqObj); > //db.addSequence(seqObj); > } > > It works fine, but there is no description line in the resulting file! > How can I change the fasta description line? > > Also I am using deprecated methods, but could not find out what to use > instead: > FastaFormat.PROPERTY_DESCRIPTIONLINE > SeqIOTools.writeFasta > All tutorials I found are using the deprecated. > > Cheers, > > Thorsten > > -- > View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 > Sent from the BioJava mailing list archive at Nabble.com. > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 8 Date: Tue, 31 Oct 2006 17:27:29 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] pK values To: "Gerster Sarah" Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310127h75010e56ne31e188294e23803 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - The values are calculated using the SymbolPropertyTable returned by ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); This table gets it's values from the resource file org/biojava/bio/symbol/ResidueProperties.xml The pK values were added by david huen (I think). To read XML sequence files try one of the methods in RichSequence.IOTools from biojava 1.5 beta. - Mark On 10/31/06, Gerster Sarah wrote: > Hi! > > I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. > > And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? > > Cheers > > Sarah > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 9 Date: 31 Oct 2006 12:21:43 +0000 From: David Huen Subject: Re: [Biojava-l] pK values To: Mark Schreiber Cc: biojava-l at lists.open-bio.org Message-ID: Content-Type: text/plain; format=flowed; charset=ISO-8859-1 On Oct 31 2006, Mark Schreiber wrote: >Hi - > >The values are calculated using the SymbolPropertyTable returned by >ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); > >This table gets it's values from the resource file >org/biojava/bio/symbol/ResidueProperties.xml > >The pK values were added by david huen (I think). > I used the same pK values as those used by GCG to maintian cross-compability. Regards, David ------------------------------ Message: 10 Date: Wed, 1 Nov 2006 18:39:24 +1000 From: "Graham Etherington" Subject: [Biojava-l] Using Java to create BLAST searches To: Message-ID: <008901c6fd91$3c415e40$36776682 at IMBPC.AD> Content-Type: text/plain; charset="us-ascii" Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham ------------------------------ _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l End of Biojava-l Digest, Vol 47, Issue 1 **************************************** _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From cezard at nokad-technology.com Thu Nov 2 03:41:02 2006 From: cezard at nokad-technology.com (=?iso-8859-1?Q?CEZARD_Timoth=E9e?=) Date: Thu, 2 Nov 2006 09:41:02 +0100 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: <001a01c6fe03$6688b4b0$36776682@IMBPC.AD> Message-ID: <20061102084307.5F9EB75D8E@smtp2-g19.free.fr> Hi everyone, I've worked a bit on that point and want to share my view. When you launch a blast via the Runtime exec command it creates (and launches) a new thread outside the JVM. The Process object allows you to monitor and wait for the end of this thread. I've observed that for obscure reason sometime the thread never finish. In that case you have to clear the InputStream and the ErrorStream of the process. Last point I've worked on is how to notice the GUI of the end of the process. For that I've used the SwingWorker object and it worked fine. http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html Hope this helps someone. CEZARD Timoth?e Ms bioinformatics Manager NOKAD SA 4 rue Pierre Fontaine 91058 EVRY cedex Tel : 01.60.87.89.90 Fax : 01.60.87.89.99 www.nokad-technology.com -----Message d'origine----- De?: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-bounces at lists.open-bio.org] De la part de Graham Etherington Envoy??: mercredi 1 novembre 2006 23:17 ??: 'Ng, Peter'; mark.schreiber at novartis.com Cc?: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Objet?: Re: [Biojava-l] Using Java to create BLAST searches Peter, The method is explained quite well at: http://java.sun.com/j2se/1.3/docs/api/java/lang/Process.html#waitFor() Not sure about your threading question, but I'm presuming that the Process produces and exit value. By convention, 0 indicates normal termination. Hope this helps a little. Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 7:53 AM To: Graham Etherington; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Graham, thanks for the info! I have two instances of Runtime.getRuntime().exec going, should I be putting these into two threads? also, when does java see the process actually being finished? how does java know when blastn is done at the unix or window level? thanks, peter -----Original Message----- From: Graham Etherington [mailto:g.etherington at imb.uq.edu.au] Sent: November 1, 2006 1:22 PM To: Ng, Peter; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From zagato.gekko at gmail.com Thu Nov 2 16:37:58 2006 From: zagato.gekko at gmail.com (Alan Acosta) Date: Thu, 2 Nov 2006 16:37:58 -0500 Subject: [Biojava-l] Reading sequence identifier from file in FASTA format Message-ID: <98028b00611021337n4b7970d2q76f7a045d634f6c2@mail.gmail.com> Hello Everybody, this is my first write to the list, i'm a student of computer science, and a really newbie into this subjects, so i'm experimenting with BioJava against BioPerl... My problem is that i'm trying to read FASTA file with /////////////////// BufferedReader input = new BufferedReader( new FileReader("NC_008009.fna") ); RichSequenceIterator seqIter = RichSequence.IOTools.readFastaDNA( input, RichObjectFactory.getDefaultNamespace() ); RichSequence rseq = null; if( seqIter.hasNext() ) { rseq = seqIter.nextRichSequence(); System.out.println("Identifier: "+rseq.getIdentifier() ); System.out.println("Description: "+rseq.getDescription() ); System.out.println("SubList: "+rseq.subList(10, 20).seqString() ); } /////////////////// but i'm getting a "identifier: null" into the answer when it had to be a "Identifier: 94967031", the description and sublist works good... in ( http://biojava.org/wiki/BioJava:BioJavaXDocs#Reading) says that: >gi|||.| identifier will be read it with setIdentifier() and will available through getIdentifier() but i get a null. Then... this file is really in FASTA format ? or i'm doing into the wrong way this ? The test file is: ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Acidobacteria_bacterium_Ellin345/NC_008009.fna And the header is: >gi|94967031|ref|NC_008009.1| Acidobacteria bacterium Ellin345, complete genome CCGTGTGTTGCGCGGCCAGATGAGAAATTTCTATGTCCCTCTCGACCACGACTCCACCAGCTCCGAACCC Where i can find a newbie tutorial for starter task into BioJava ? I appreciate any help... thanks. Farewell Alan Acosta Cali - Colombia From g.etherington at imb.uq.edu.au Thu Nov 2 19:23:09 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Fri, 3 Nov 2006 10:23:09 +1000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: <008901c6fd91$3c415e40$36776682@IMBPC.AD> Message-ID: <000801c6fede$3d540870$36776682@IMBPC.AD> Hi, First of all, thanks for the replies and help that everyone sent for my BLAST query (see below). I figured out what the problems were and thought I should post the solutions to the forum. Firstly, as pointed out, when running on Windows the 'sh' and '-c' should be taken out. Process runBlast = r.exec (new String[] {cmd}); Secondly, I moved the location of blast to C:/blast/bin/, as to have no spaces in the path (I didn't try this when everything worked to see if it had an affect, so I don't know how essential this is) Thirdly, (and this was one of those real killers that have you kicking yourself once you realise what the problem was), the location of the database (ecoli.nt in this case) has to be explicitly set, so "C:/blast/bin/ecoli.nt" In the end, I used the org.biojava.utils.ExecRunner This handled the query really well and one of the best features is actually the error reporting. It told me that it couldn't find the ecoli.nt database which java.lang.Process did not. My final code looked like this: String cmd = "C:/blast/bin/blastall -p blastn -d C:/blast/bin/ecoli.nt -i test.fas -o blast.out"; org.biojava.utils.ExecRunner runner = new org.biojava.utils.ExecRunner (); runner.exec (cmd); out.println (runner.getErrString ()); My task for today is working out the best way to display the output/output file to the current jsp page. Again, thanks for your help. Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-bounces at lists.open-bio.org] On Behalf Of Graham Etherington Sent: Wednesday, 1 November 2006 6:39 PM To: biojava-l at lists.open-bio.org Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From johnson.biotech at gmail.com Fri Nov 3 17:31:00 2006 From: johnson.biotech at gmail.com (Seth Johnson) Date: Fri, 3 Nov 2006 17:31:00 -0500 Subject: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys Message-ID: Hello guys, I've setup a BioSQL to hold sequences of interest parsed from NCBI genbank release. I also have another proprietary schema that holds experimental and alignment data. I would like to connect the proprietary schema to BioSQL one using Hibernate persistence, so that objects from my database would contain linkages to sequence data in biosql. Wiki mentions that one need change "only the mapping files that tell Hibernate how to translate between objects and tables." Can anyone elaborate on that topic a little or point me to a tutorial or some other place that discusses the concept? -- Best Regards, Seth Johnson Senior Bioinformatics Associate From varvenne at genoway.com Mon Nov 6 07:57:24 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 06 Nov 2006 13:57:24 +0100 Subject: [Biojava-l] Parsing blast results Message-ID: Hello, I'm a new user of biojava and i'm trying to use it to parse blast results (against NCBI nr database). I've tried to do so using biojava1.4 and biojava1.5-beta but none of these seem to support the latest Blast version. I'd be very greatful to you if anyone could help me with that... Thanks, Best regards, Benoit Varvenne, Bioinformatics pearson in charge, Genoway Lyon (France). From varvenne at genoway.com Mon Nov 6 08:27:32 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 06 Nov 2006 14:27:32 +0100 Subject: [Biojava-l] Parsing blast results In-Reply-To: Message-ID: I've already found the answer to my question which seems to work in previous archives (?June 2006). This archive suggests to replace : BlastLikeSAXParser parser = new BlastLikeSAXParser(); By : BlastXMLParserFacade parser = new BlastXMLParserFacade(); And this seems to work well. So sorry for having posted a bit quickly. Regards, Beno?t Varvenne, Bioinformatics pearson in charge, Genoway Lyon (France). Le 6/11/06 13:57, ??Benoit VARVENNE?? a ?crit?: > Hello, > > I'm a new user of biojava and i'm trying to use it to parse blast results > (against NCBI nr database). I've tried to do so using biojava1.4 and > biojava1.5-beta but none of these seem to support the latest Blast version. > > I'd be very greatful to you if anyone could help me with that... > > Thanks, > Best regards, > > Benoit Varvenne, > Bioinformatics pearson in charge, > Genoway Lyon (France). > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > From johnson.biotech at gmail.com Mon Nov 6 23:59:01 2006 From: johnson.biotech at gmail.com (Seth Johnson) Date: Mon, 6 Nov 2006 23:59:01 -0500 Subject: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys In-Reply-To: <454F07D5.2040001@ebi.ac.uk> References: <454F07D5.2040001@ebi.ac.uk> Message-ID: Thank you Richard. I am using NetBeans 5.5 and JDK 5.0 that implements mapping metadata (EJB 3.0) instead of .hbm.xml files. I read up on Hibernate from you links and I think that the easiest solution would be to use RichSequence BioJavaX object as an embeddable object in my proprietary 'alignment' class. Basically, my goal is to have access to RichSequence object when I instantiate 'alignment' object from my 'alignment' table. That table contains a column with primary key of the bioentry that was used to produce that alignment. Since biosql is in different schema, I don't believe that cross schema foreign keys are possible in mySQL. Do you think that this is a right strategy? Seth On 11/6/06, Richard Holland wrote: > > If your proprietary database has a similar design to BioSQL, or can > easily be mapped on an approximately 1:1 basis to the existing BioJavaX > object model, then all you need to do is edit the .hbm.xml files and > look for references to table names and column names. Remove any tables > and columns that don't exist in your schema (including removing the > files if this leaves them empty), and edit the remaining ones so that > the table and column names match. > > If your new schema contains tables that do not map to existing BioJavaX > objects, then you'll need to create Java objects for those as well as > the appropriate mapping files. The easiest way to do this is to > copy-and-paste both an existing BioJavaX object and the related .hbm.xml > file - eg. SimpleCrossRef.java and CrossRef.hxm.xml. > > Hibernate is best explained through its own documentation at > http://www.hibernate.org/ . The 'getting started' tutorial they provide > (here: > http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html ) > is a good starting point. > > cheers, > Richard > > > Seth Johnson wrote: > > Hello guys, > > > > I've setup a BioSQL to hold sequences of interest parsed from NCBI > > genbank release. I also have another proprietary schema that holds > > experimental and alignment data. I would like to connect the > > proprietary schema to BioSQL one using Hibernate persistence, so that > > objects from my database would contain linkages to sequence data in > > biosql. Wiki mentions that one need change "only the mapping files > > that tell Hibernate how to translate between objects and tables." Can > > anyone elaborate on that topic a little or point me to a tutorial or > > some other place that discusses the concept? > > From mark.schreiber at novartis.com Tue Nov 7 03:57:58 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Tue, 7 Nov 2006 16:57:58 +0800 Subject: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys Message-ID: Hi - If you are using the JDK5 persistence API you either do your mappings as annotations or vendor neutral xml mappings. The vendor you choose for the actual ORM is specified in your persistence unit definition (eg Hibernate, KODO, TopLink etc). If you want to do the mapping with annotations you would need to make your own implemenation of RichSequence etc as biojava is not yet using JDK5 and won't support annotation. Basically you would just copy the appropriate "SimpleRich" Objects and pepper them with annotations pointing to the correct DB tables etc. Not sure which strategy is more appropriate for you. If MySQL doesn't allow for cross schema keys you may have to extend your copy of MySQL to include the extra table/ tables from your proprietary schema. - Mark "Seth Johnson" Sent by: biojava-l-bounces at lists.open-bio.org 11/07/2006 12:59 PM To: "Richard Holland" cc: biojava-l at biojava.org, (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys Thank you Richard. I am using NetBeans 5.5 and JDK 5.0 that implements mapping metadata (EJB 3.0) instead of .hbm.xml files. I read up on Hibernate from you links and I think that the easiest solution would be to use RichSequence BioJavaX object as an embeddable object in my proprietary 'alignment' class. Basically, my goal is to have access to RichSequence object when I instantiate 'alignment' object from my 'alignment' table. That table contains a column with primary key of the bioentry that was used to produce that alignment. Since biosql is in different schema, I don't believe that cross schema foreign keys are possible in mySQL. Do you think that this is a right strategy? Seth On 11/6/06, Richard Holland wrote: > > If your proprietary database has a similar design to BioSQL, or can > easily be mapped on an approximately 1:1 basis to the existing BioJavaX > object model, then all you need to do is edit the .hbm.xml files and > look for references to table names and column names. Remove any tables > and columns that don't exist in your schema (including removing the > files if this leaves them empty), and edit the remaining ones so that > the table and column names match. > > If your new schema contains tables that do not map to existing BioJavaX > objects, then you'll need to create Java objects for those as well as > the appropriate mapping files. The easiest way to do this is to > copy-and-paste both an existing BioJavaX object and the related .hbm.xml > file - eg. SimpleCrossRef.java and CrossRef.hxm.xml. > > Hibernate is best explained through its own documentation at > http://www.hibernate.org/ . The 'getting started' tutorial they provide > (here: > http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html ) > is a good starting point. > > cheers, > Richard > > > Seth Johnson wrote: > > Hello guys, > > > > I've setup a BioSQL to hold sequences of interest parsed from NCBI > > genbank release. I also have another proprietary schema that holds > > experimental and alignment data. I would like to connect the > > proprietary schema to BioSQL one using Hibernate persistence, so that > > objects from my database would contain linkages to sequence data in > > biosql. Wiki mentions that one need change "only the mapping files > > that tell Hibernate how to translate between objects and tables." Can > > anyone elaborate on that topic a little or point me to a tutorial or > > some other place that discusses the concept? > > _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From sgerster at student.ethz.ch Wed Nov 8 03:14:39 2006 From: sgerster at student.ethz.ch (Gerster Sarah) Date: Wed, 8 Nov 2006 09:14:39 +0100 Subject: [Biojava-l] reading paptides from a fasta file Message-ID: Hi! I'm trying to read peptides from a fasta file: >id|0|0.9992|1 ASITENGGAEEESVAK >id|1|0.9953|1 ASITENGGAEEESVAK >id|2|0.9998|1 ASNASSAGDEVDNVATSSK >id|3|0.9998|1 EAAAAEEPQPSDEGDVVAK >id|4|0.9998|1 EAAAAEEPQPSDEGDVVAK .... I would like to have all peptides somewhere in the memory. I need, their id, the sequence and the 2 numbers at the end (e.g. id = 0, probability = 0.9992, rank = 1 for the first entry in the file). I tried to use readFastaProtein... but I guess I don't use it right. Anyway, I get the sequences, but I don't get any of the other infomations I want... Here is my code: try { BufferedReader br = new BufferedReader(new FileReader(file_name)); RichSequenceIterator rich_stream = RichSequence.IOTools.readFastaProtein(br,null); while(rich_stream.hasNext()) { RichSequence rich_seq = rich_stream.nextRichSequence(); System.out.println(rich_seq.toString()); System.out.println(rich_seq.getAccession()); System.out.println(rich_seq.getAlphabet()); System.out.println(rich_seq.getAnnotation()); System.out.println(rich_seq.getName()); System.out.println(rich_seq.getDescription()); System.out.println(rich_seq.getIdentifier()); System.out.println(rich_seq.seqString()); } } catch(Exception e) { System.err.println("Bug while reading the sequences from the FASTA file"); } Here's the output (for the first entry in the fasta file): id|0:1/0.9992 0 org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 1df073d 1 null null ASITENGGAEEESVAK Can anyone tell me what's going wrong? Is there already a function to put all the sequences directly in the memory (like a HashSet) while reading them? Cheers Sarah From dreher at molgen.mpg.de Wed Nov 8 07:39:20 2006 From: dreher at molgen.mpg.de (Felix Dreher) Date: Wed, 08 Nov 2006 13:39:20 +0100 Subject: [Biojava-l] reading paptides from a fasta file In-Reply-To: References: Message-ID: <4551CFF8.9050507@molgen.mpg.de> Hi Sarah, just a few comments / guesses: maybe there are other approaches, but you could follow the FASTA-format BioJavaX understands, e.g.: |>gi|||| | http://biojava.org/wiki/BioJava:BioJavaXDocs#Reading (chapter 8.2.1) So, if your file would look like this: >gi|0|namespace|null|1 0.9992 ASITENGGAEEESVAK >gi|1|namespace|null|1 0.9953 ASITENGGAEEESVAK . . . you could use: System.out.println("id: "+rich_seq.getIdentifier()); System.out.println("rank: "+rich_seq.getName()); System.out.println("probability: "+rich_seq.getDescription()); System.out.println("sequence: "+rich_seq.seqString()); to get the data. However, 'rank' or 'probability' actually would be annotations of the sequence, so when processing the data (e.g. storing in a database), one would store these data as annotations. - As for Java-style / naming conventions for variables, the 'Camel-Case' is recommended, e.g.richSeq instead of rich_seq. - To get the alphabet: System.out.println("alphabet: "+rich_seq.getAlphabet().getName()); - Also maybe you should use the default namespace instead of null: RichSequenceIterator rich_stream = RichSequence.IOTools.readFastaProtein(br,RichObjectFactory.getDefaultNamespace()); Cheers, Felix Gerster Sarah wrote: > Hi! > > I'm trying to read peptides from a fasta file: > >> id|0|0.9992|1 >> > ASITENGGAEEESVAK > >> id|1|0.9953|1 >> > ASITENGGAEEESVAK > >> id|2|0.9998|1 >> > ASNASSAGDEVDNVATSSK > >> id|3|0.9998|1 >> > EAAAAEEPQPSDEGDVVAK > >> id|4|0.9998|1 >> > EAAAAEEPQPSDEGDVVAK > .... > I would like to have all peptides somewhere in the memory. I need, their id, the sequence and the 2 numbers at the end (e.g. id = 0, probability = 0.9992, rank = 1 for the first entry in the file). > > I tried to use readFastaProtein... but I guess I don't use it right. Anyway, I get the sequences, but I don't get any of the other infomations I want... > > Here is my code: > try > { > BufferedReader br = new BufferedReader(new FileReader(file_name)); > RichSequenceIterator rich_stream = RichSequence.IOTools.readFastaProtein(br,null); > while(rich_stream.hasNext()) > { > RichSequence rich_seq = rich_stream.nextRichSequence(); > System.out.println(rich_seq.toString()); > System.out.println(rich_seq.getAccession()); > System.out.println(rich_seq.getAlphabet()); > System.out.println(rich_seq.getAnnotation()); > System.out.println(rich_seq.getName()); > System.out.println(rich_seq.getDescription()); > System.out.println(rich_seq.getIdentifier()); > System.out.println(rich_seq.seqString()); > } > } > catch(Exception e) > { > System.err.println("Bug while reading the sequences from the FASTA file"); > } > > > Here's the output (for the first entry in the fasta file): > id|0:1/0.9992 > 0 > org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 1df073d > > 1 > null > null > ASITENGGAEEESVAK > > > Can anyone tell me what's going wrong? > Is there already a function to put all the sequences directly in the memory (like a HashSet) while reading them? > > Cheers > > Sarah > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > > -- Felix Dreher Max Planck Institute for Molecular Genetics Department of Vertebrate Genomics Bioinformatics Group Ihnestr. 73 D-14195 Berlin Phone: +49 30 - 8413 1682 Mobile: +49 163 - 754 24 26 E-mail: dreher at molgen.mpg.de www.molgen.mpg.de/~lh_bioinf From myammad at gmail.com Wed Nov 8 09:50:49 2006 From: myammad at gmail.com (Ammad Ud Din) Date: Wed, 8 Nov 2006 19:50:49 +0500 Subject: [Biojava-l] New To BioJava.org Message-ID: <887d6f690611080650j3a0f6caah610768dbb7dbe498@mail.gmail.com> Hi, i am a student of bs-bioinformatics from Muhammad Ali Jinnah University, islamabad Pakistan.I am curently taking a course in Java here at my university so i want to do work in java particularly in BioJava.I would like to welcome suggestions regarding my final project in this course and also would like to contribute as well. take care & best wishes, -- Ammad From mark.schreiber at novartis.com Wed Nov 8 20:53:37 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 9 Nov 2006 09:53:37 +0800 Subject: [Biojava-l] New To BioJava.org Message-ID: Hi - If you take a look at the API docs and the cookbook in www.biojava.org you will get an idea of what biojava can do and probably come up with a project from there. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Ammad Ud Din" Sent by: biojava-l-bounces at lists.open-bio.org 11/08/2006 10:50 PM To: biojava-l at lists.open-bio.org cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] New To BioJava.org Hi, i am a student of bs-bioinformatics from Muhammad Ali Jinnah University, islamabad Pakistan.I am curently taking a course in Java here at my university so i want to do work in java particularly in BioJava.I would like to welcome suggestions regarding my final project in this course and also would like to contribute as well. take care & best wishes, -- Ammad _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From varvenne at genoway.com Mon Nov 13 05:54:07 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 13 Nov 2006 11:54:07 +0100 Subject: [Biojava-l] Any memory-optimised blast parser available ? Message-ID: Hello, I'm trying to parse blast result files from a remote blast on NCBI databases. In order to do so, i'm using biojava XML parser like this : ----------- InputStream is = new FileInputStream(blastFile); BlastXMLParserFacade parser = new BlastXMLParserFacade(); SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); parser.setContentHandler(adapter); List results = new ArrayList(); SearchContentHandler builder = new BlastLikeSearchBuilder(results, new DummySequenceDB("queries"), new DummySequenceDBInstallation()); adapter.setSearchContentHandler(builder); // Here is the method that throws 'OutOfMemoryException' parser.parse(new InputSource(is)); ----------- While blasting a genomic sequence (i've tried with 50Kb long sequences max), I've got an OutOfMemory exception. Does anyone know a way to resolve this ? (this aim is not to dividde my genomic locus in too many parts, 50Kb is a quarter of my genomic...) Thanks, Regards, Benoit -- Benoit Varvenne, Bioinformatics pearson in charge, GenOway - Lyon (France) From ayates at ebi.ac.uk Mon Nov 13 06:28:29 2006 From: ayates at ebi.ac.uk (Andy Yates) Date: Mon, 13 Nov 2006 11:28:29 +0000 Subject: [Biojava-l] Any memory-optimised blast parser available ? In-Reply-To: References: Message-ID: <455856DD.9040605@ebi.ac.uk> Hi, Have you tried increasing the amount of memory the Java virtual machine has available? The problem with Java is that it starts with a default memory limit of approx. 128MB which if you've got a memory intensive process will not be enough. When running your program try adding the option -Xmx256M So if my class was called Main.class my command line would be: java -Xmx256M -cp .:biojava.jar Main Or if you're running this from ant then there is an attribute maxmemory which can be specified in the task. Hope that helps Andy Benoit VARVENNE wrote: > Hello, > > I'm trying to parse blast result files from a remote blast on NCBI > databases. > In order to do so, i'm using biojava XML parser like this : > > ----------- > InputStream is = new FileInputStream(blastFile); > BlastXMLParserFacade parser = new BlastXMLParserFacade(); > SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); > > parser.setContentHandler(adapter); > > List results = new ArrayList(); > > SearchContentHandler builder = new BlastLikeSearchBuilder(results, > new DummySequenceDB("queries"), new > DummySequenceDBInstallation()); > > adapter.setSearchContentHandler(builder); > > // Here is the method that throws 'OutOfMemoryException' > parser.parse(new InputSource(is)); > ----------- > > While blasting a genomic sequence (i've tried with 50Kb long sequences max), > I've got an OutOfMemory exception. > > Does anyone know a way to resolve this ? (this aim is not to dividde my > genomic locus in too many parts, 50Kb is a quarter of my genomic...) > > Thanks, > Regards, > > Benoit > > From varvenne at genoway.com Mon Nov 13 07:39:34 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 13 Nov 2006 13:39:34 +0100 Subject: [Biojava-l] Any memory-optimised blast parser available ? In-Reply-To: <455856DD.9040605@ebi.ac.uk> Message-ID: Great ! Thanks a lot to all for your answers. I hadn't thought to that way of solving the problem. That runs well with -Xmx option. Thanks again, Regards, Benoit Le 13/11/06 12:28, ??Andy Yates?? a ?crit?: > Hi, > > Have you tried increasing the amount of memory the Java virtual machine > has available? The problem with Java is that it starts with a default > memory limit of approx. 128MB which if you've got a memory intensive > process will not be enough. > > When running your program try adding the option > > -Xmx256M > > So if my class was called Main.class my command line would be: > > java -Xmx256M -cp .:biojava.jar Main > > Or if you're running this from ant then there is an attribute maxmemory > which can be specified in the task. > > Hope that helps > > Andy > > Benoit VARVENNE wrote: >> Hello, >> >> I'm trying to parse blast result files from a remote blast on NCBI >> databases. >> In order to do so, i'm using biojava XML parser like this : >> >> ----------- >> InputStream is = new FileInputStream(blastFile); >> BlastXMLParserFacade parser = new BlastXMLParserFacade(); >> SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); >> >> parser.setContentHandler(adapter); >> >> List results = new ArrayList(); >> >> SearchContentHandler builder = new BlastLikeSearchBuilder(results, >> new DummySequenceDB("queries"), new >> DummySequenceDBInstallation()); >> >> adapter.setSearchContentHandler(builder); >> >> // Here is the method that throws 'OutOfMemoryException' >> parser.parse(new InputSource(is)); >> ----------- >> >> While blasting a genomic sequence (i've tried with 50Kb long sequences max), >> I've got an OutOfMemory exception. >> >> Does anyone know a way to resolve this ? (this aim is not to dividde my >> genomic locus in too many parts, 50Kb is a quarter of my genomic...) >> >> Thanks, >> Regards, >> >> Benoit >> >> > From jolyon.holdstock at ogt.co.uk Mon Nov 13 06:33:43 2006 From: jolyon.holdstock at ogt.co.uk (Jolyon Holdstock) Date: Mon, 13 Nov 2006 11:33:43 -0000 Subject: [Biojava-l] Any memory-optimised blast parser available ?[Scanned] Message-ID: <588D0DD225D05746B5D8CAE1BE971F3F0111DCE1@EUCLID.internal.ogtip.com> Can you use the -Xmx flag to add more memory to the JRE? -----Original Message----- From: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-bounces at lists.open-bio.org] On Behalf Of Benoit VARVENNE Sent: 13 November 2006 10:54 To: biojava-l Subject: [Biojava-l] Any memory-optimised blast parser available ?[Scanned] Hello, I'm trying to parse blast result files from a remote blast on NCBI databases. In order to do so, i'm using biojava XML parser like this : ----------- InputStream is = new FileInputStream(blastFile); BlastXMLParserFacade parser = new BlastXMLParserFacade(); SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); parser.setContentHandler(adapter); List results = new ArrayList(); SearchContentHandler builder = new BlastLikeSearchBuilder(results, new DummySequenceDB("queries"), new DummySequenceDBInstallation()); adapter.setSearchContentHandler(builder); // Here is the method that throws 'OutOfMemoryException' parser.parse(new InputSource(is)); ----------- While blasting a genomic sequence (i've tried with 50Kb long sequences max), I've got an OutOfMemory exception. Does anyone know a way to resolve this ? (this aim is not to dividde my genomic locus in too many parts, 50Kb is a quarter of my genomic...) Thanks, Regards, Benoit -- Benoit Varvenne, Bioinformatics pearson in charge, GenOway - Lyon (France) _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l This email has been scanned by Oxford Gene Technology Security Systems. From dunarel at gmx.net Fri Nov 17 21:48:41 2006 From: dunarel at gmx.net (Dunarel Badescu) Date: Sat, 18 Nov 2006 03:48:41 +0100 Subject: [Biojava-l] New To BioJava.org, right in the question. In-Reply-To: References: Message-ID: <20061118024841.274400@gmx.net> Hello, My name is Dunarel Badescu, a student at UQAM University in Montreal,Quebec,Canada in Graduate Diploma of Bioinformatics. Currently I am using BioJavaX and BioSql for my session project. I have parsed NCBI GeneBank files using RichSequences. I then inserted the sequences into the database. Several problems arise: 1) A bug in the code pulled from CVS: In class BioSQLRichObjectBuilder: I had to append some code for the program to find the right constructors: // Get the results Object result = this.uniqueResult.invoke(query, null); // Return the found object, if found if (result!=null) return result; // Create, persist and return the new object otherwise else { /*NEW CODE*/ if (SimpleDocRef.class.isAssignableFrom(clazz)) { // convert String to List constructor ourParamsList.set(0, DocRefAuthor.Tools.parseAuthorString((String)ourParamsList.get(0))); } // Load the class 2) Meny memory problems, after inserting 800 sequences it slows extremely so performance is degraded. I thought of a hibernate cache problem and tried to turn it off by setting some parameters: 20 false false false false org.hibernate.cache.NoCacheProvider false false 3 to no much benefit. Then I observed some small performance gain by using : session.save("Sequence",rs); // persist the sequence session.getTransaction().commit(); session.flush(); session.evict(rs); The session.evict(rs); Any atempt to dealocate memory by closing the session, the session factory either generates errors or it will generate on reopening. So as a last resort I fragmented the original aprox. 130 mb containing one taxon from ncbi in 38 files 1000 sequences each and made a dos batch script executing the program in the commad line for each file. So that way it works but: 3) Inserting rows sometimes generates exceptions in the references table. After taking it more closely I found that by disabling the unique constraint on the dbxref_id on references table solves all the remaining problems. The coment about it on the original code is: -- No two references can reference the same reference database entry -- (dbxref_id). This is where the MEDLINE id goes: PUBMED:123456. and the modification is: --UNIQUE ( dbxref_id ) , I must say that the script for creating the biosql schema is version 1.29 from the cvs, the most recent I found. And I must say that for running the script on Postgresql 8.1.5 I had to modify each create table statement adding with oids at the end, now that 8.1.5 doesn't create oids by default. It must have be a more elegant aproch to all these problems isn't it? At least the constraint situation, I mean is it normal to exist or not as it seems. I wish You all the best and thank you for your work which is most useful and scarce as a resource. -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer From sanges at biogem.it Sat Nov 18 06:54:26 2006 From: sanges at biogem.it (Remo Sanges) Date: Sat, 18 Nov 2006 11:54:26 +0000 Subject: [Biojava-l] Fellowships for Junior Scientists In-Reply-To: <20061118024841.274400@gmx.net> References: <20061118024841.274400@gmx.net> Message-ID: <455EF472.1000903@biogem.it> Apologies for the off topic post and for the crossposting... AREA Science Park (http://www.area.trieste.it/opencms/opencms/area/en/) and CBM (http://www.cbm.fvg.it/?lang=en_US) are launching a mobility initiative aimed at attracting international scientists to work with the biomedical research community of Trieste. Research areas: * Biostatistics * Systems Biology * Algorithm Development The fellowships are funded by AREA Science Park and the CBM - Consortium for Molecular Biomedicine as part of an international mobility programme run by AREA Science Park and the CBM. The programme aims at attracting young scientists to the Friuli Venezia Giulia Region and adding them to the community of researchers operating in Trieste in the field of biomedicine. CBM and AREA Science Park are two research institutes recognised by the Ministry of Education, Universities and Research. Here there are laboratories integrating dry and wet lab research and developing a wide research program encompassing functional and comparative genomics, bioinformatics database, software development and algorithm development. The laboratories are already integrated in international collaborative projects tackling non-coding RNA genes, regulatory elements, and bioinformatics workflow management systems. For further information: http://www.cbm.fvg.it/?page=mobility&lang=en_US&id=2 Regards Remo Sanges From varvenne at genoway.com Mon Nov 20 11:19:38 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 20 Nov 2006 17:19:38 +0100 Subject: [Biojava-l] Any ORF Finder available ? Message-ID: Hello, I'm a working on a biojava project and i'm searching for a way to include an ORF Finder in my code. The aim is to find ORFs on cDNA sequences (or partial ORFs on ESTs ones) Anyone can help me ? Is there a module with biojava to do so ? Do you know any free-to-dowload software (source code or compiled one) ? Thanks, Regards Beno?t. From mark.schreiber at novartis.com Mon Nov 20 22:12:03 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Tue, 21 Nov 2006 11:12:03 +0800 Subject: [Biojava-l] Any ORF Finder available ? Message-ID: Hi - A quick and dirty way is to make a six frame translation (http://biojava.org/wiki/BioJava:Cookbook:Translation:SixFrames). Probably a better way is to scan in six frames (using a WindowedSymbolList) looking for a start codon and then look for the appropriate stop codon. You will want to define the start and stop codons as Symbols from the codon (DNAxDNAxDNA) alphabet. You can do this as follows: FiniteAlphabet codonAlpha = DNATools.getCodonAlphabet(); //make a ambiguity symbol for ATG, GTG and TTG codons //first make the A or G or T ambiguity BasisSymbol Set syms = new HashSet(); syms.add(DNATools.a()); syms.add(DNATools.t()); syms.add(DNATools.g()); Symbol amb = DNATools.getDNA().getAmbiguity(syms) ; //now make the [A|G|T] TG codon List l = new ArrayList(); l.add(amb); l.add(DNATools.t()); l.add(DNATools.g()); Symbol startCodon = codonAlpha.getSymbol(l); //You would construct the stop codons in a similar manner although you probably can't merge them all into one. The above example shows how you can use a single symbol to represent all 3 common bacterial start codons. You could also make all 3 seperatly and test them individually. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 Benoit VARVENNE Sent by: biojava-l-bounces at lists.open-bio.org 11/21/2006 12:19 AM To: biojava-l cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Any ORF Finder available ? Hello, I'm a working on a biojava project and i'm searching for a way to include an ORF Finder in my code. The aim is to find ORFs on cDNA sequences (or partial ORFs on ESTs ones) Anyone can help me ? Is there a module with biojava to do so ? Do you know any free-to-dowload software (source code or compiled one) ? Thanks, Regards Beno?t. _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From weelainy at hotmail.com Tue Nov 21 12:44:26 2006 From: weelainy at hotmail.com (Elaine Forbes) Date: Tue, 21 Nov 2006 17:44:26 +0000 Subject: [Biojava-l] remove me from your list Message-ID: Hi I no longer wish to recieve emails from the biojava email list- please remove me. THanks Elaine _________________________________________________________________ Windows Live? Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb From markjschreiber at gmail.com Wed Nov 22 01:35:54 2006 From: markjschreiber at gmail.com (Mark Schreiber) Date: Wed, 22 Nov 2006 14:35:54 +0800 Subject: [Biojava-l] Open JDK Message-ID: <93b45ca50611212235r265b4730sea68dfb6b41fb4e0@mail.gmail.com> Dear All - Everyone knows that BioJava is open-source but you may not know that the Java JDK is in the process of being made open-source several parts already are including the javac and HotSpot runtime. https://openjdk.dev.java.net/ Next time you think the GenBank parser is slow maybe you could optimise the HotSpot runtime instead : ) - Mark From kingsulaman at hotmail.com Thu Nov 23 08:02:31 2006 From: kingsulaman at hotmail.com (Sulaman Malik) Date: Thu, 23 Nov 2006 18:02:31 +0500 Subject: [Biojava-l] Looking For Project Message-ID: hi: This is Sulaman Malik BS(Bio-informatics) Student of MAJU,Islamabad Pakistan. I am looking for a good semester project which i could impelement using the Java as a platefarm,so give me a lsit of bio-projects or any bio-project so that i could go further. From varvenne at genoway.com Fri Nov 24 11:19:27 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Fri, 24 Nov 2006 17:19:27 +0100 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) Message-ID: Hello, I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with the code put at the end of this mail. I've tried this with a blastN query and there i got no trouble. However, i've tried to do exactly the same thing with a BlastP query and i've got the exception cited at the end of this mail. I've verified and the two infiles (blastn/blastp) seem to have the same structures (except that one is for prot so data are different). (Please find them as attached if you're used to this). Can someone help me ? I don't understand why it works in a case and not in the other one ... Thanks a lot, Cheers, Beno?t. ------------------- My code : ----- InputStream is = new FileInputStream(blastFile); // blastFile is the xml file, output of my blast //make a BlastLikeSAXParser BlastXMLParserFacade parser = new BlastXMLParserFacade(); //make the SAX event adapter that will pass events to a Handler. SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); //set the parsers SAX event adapter parser.setContentHandler(adapter); //The list to hold the SeqSimilaritySearchResults List results = new ArrayList(); //create the SearchContentHandler that will build SeqSimilaritySearchResults //in the results List SearchContentHandler builder = new BlastLikeSearchBuilder(results, new DummySequenceDB("queries"), new DummySequenceDBInstallation()); //register builder with adapter adapter.setSearchContentHandler(builder); parser.parse(new InputSource(is)); // From here come the Exception ------------------- ------------------- The exception : ---- org.xml.sax.SAXParseException: Une d?claration XML peut commencer des entit?s uniquement. at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376) at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3364) at org.apache.crimson.parser.Parser2.maybePI(Parser2.java:1140) at org.apache.crimson.parser.Parser2.maybeMisc(Parser2.java:1266) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:671) at org.apache.crimson.parser.Parser2.parse(Parser2.java:337) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at org.biojava.bio.program.sax.blastxml.BlastXMLParserFacade.parse(BlastXMLPars erFacade.java:180) From smh1008 at cam.ac.uk Fri Nov 24 12:08:54 2006 From: smh1008 at cam.ac.uk (David Huen) Date: 24 Nov 2006 17:08:54 +0000 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) In-Reply-To: References: Message-ID: On Nov 24 2006, Benoit VARVENNE wrote: >Hello, > >I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with >the code put at the end of this mail. > >I've tried this with a blastN query and there i got no trouble. >However, i've tried to do exactly the same thing with a BlastP query and >i've got the exception cited at the end of this mail. > > I've verified and the two infiles (blastn/blastp) seem to have the same > structures (except that one is for prot so data are different). (Please > find them as attached if you're used to this). > >Can someone help me ? I don't understand why it works in a case and not in >the other one ... > I am uncertain whether BlastXMLFacade will actually support a protein sequence parse. It was originally developed to handle blastn. Anyone else tried it with blastp? I'm offline till Sunday so I can't reply till then. Regards, David Huen From varvenne at genoway.com Fri Nov 24 12:53:49 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Fri, 24 Nov 2006 18:53:49 +0100 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) In-Reply-To: Message-ID: Le 24/11/06 18:08, ??David Huen?? a ?crit?: > On Nov 24 2006, Benoit VARVENNE wrote: > >> Hello, >> >> I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with >> the code put at the end of this mail. >> >> I've tried this with a blastN query and there i got no trouble. >> However, i've tried to do exactly the same thing with a BlastP query and >> i've got the exception cited at the end of this mail. >> >> I've verified and the two infiles (blastn/blastp) seem to have the same >> structures (except that one is for prot so data are different). (Please >> find them as attached if you're used to this). >> >> Can someone help me ? I don't understand why it works in a case and not in >> the other one ... >> > I am uncertain whether BlastXMLFacade will actually support a protein > sequence parse. It was originally developed to handle blastn. Anyone else > tried it with blastp? > > I'm offline till Sunday so I can't reply till then. > > Regards, > David Huen > David, As BlastLikeSAXParser seemed to support older versions of NCBI blastP (see "http://www.biojava.org/wiki/BioJava:Tutorial:Blast-like_Parsing_Cook_Book#S tep_A_-_Create_an_application_that_sets_up_the_parser_and_does_the_parsing") , i'll be surprised if BlastXMLParserFacade does not. However, i'll be very interested if someone's got any information. Can't it be dtd problem ? If yes, can we update dtd sources ? Cheers, Beno?t. From karl_harvey at hotmail.com Thu Nov 23 20:40:44 2006 From: karl_harvey at hotmail.com (Karl Harvey) Date: Thu, 23 Nov 2006 20:40:44 -0500 Subject: [Biojava-l] Query to blast.. on Internet. Message-ID: An HTML attachment was scrubbed... URL: http://lists.open-bio.org/pipermail/biojava-l/attachments/20061123/ee5052ec/attachment-0001.html From varvenne at genoway.com Fri Nov 24 12:04:01 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Fri, 24 Nov 2006 18:04:01 +0100 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) In-Reply-To: <45672448.7060906@ebi.ac.uk> Message-ID: Ooooo sorry i hadn't noticed that. Here is the traduction (home made...) "org.xml.sax.SAXParseException: An XML declaration can only begin with an entity" The problem is that my two files (attached this time) don't seem to differ. Have you got an xml validation tool to recommend me ? Cheers, Beno?t Le 24/11/06 17:56, ??Richard Holland?? a ?crit?: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Unfortunately the exception you are getting is in French and sadly my 1 > year of French lessons in school failed to make any impact on my ability > to understand it. :) > > But, my guess would be that something is wrong with the BlastP output, > as the exception is an XML parser one and not a BioJava one. It's most > likely that the BlastP report is not valid XML. Try running it through > an XML validation tool to check. > > cheers, > Richard > > Benoit VARVENNE wrote: >> Hello, >> >> I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with >> the code put at the end of this mail. >> >> I've tried this with a blastN query and there i got no trouble. >> However, i've tried to do exactly the same thing with a BlastP query and >> i've got the exception cited at the end of this mail. >> >> I've verified and the two infiles (blastn/blastp) seem to have the same >> structures (except that one is for prot so data are different). (Please find >> them as attached if you're used to this). >> >> Can someone help me ? I don't understand why it works in a case and not in >> the other one ... >> >> Thanks a lot, >> Cheers, >> >> Beno?t. >> >> >> ------------------- >> My code : >> ----- >> InputStream is = new FileInputStream(blastFile); >> // blastFile is the xml file, output of my blast >> >> //make a BlastLikeSAXParser >> BlastXMLParserFacade parser = new BlastXMLParserFacade(); >> //make the SAX event adapter that will pass events to a Handler. >> SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); >> >> //set the parsers SAX event adapter >> parser.setContentHandler(adapter); >> >> //The list to hold the SeqSimilaritySearchResults >> List results = new ArrayList(); >> >> //create the SearchContentHandler that will build >> SeqSimilaritySearchResults >> //in the results List >> SearchContentHandler builder = new BlastLikeSearchBuilder(results, >> new DummySequenceDB("queries"), new >> DummySequenceDBInstallation()); >> >> //register builder with adapter >> adapter.setSearchContentHandler(builder); >> >> parser.parse(new InputSource(is)); // From here come the Exception >> >> ------------------- >> >> >> ------------------- >> The exception : >> ---- org.xml.sax.SAXParseException: An XML declaration can only begin with an entity >> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376) >> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3364) >> at org.apache.crimson.parser.Parser2.maybePI(Parser2.java:1140) >> at org.apache.crimson.parser.Parser2.maybeMisc(Parser2.java:1266) >> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:671) >> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337) >> at >> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) >> at >> org.biojava.bio.program.sax.blastxml.BlastXMLParserFacade.parse(BlastXMLPars >> erFacade.java:180) >> >> >> _______________________________________________ >> Biojava-l mailing list - Biojava-l at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/biojava-l >> >> > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFZyRI4C5LeMEKA/QRAmQoAJoD1RjbKgqOsiRVW1rPBrYDcaAObgCglHYI > 48o/exGfv1xSSnLzMMjPKxo= > =tRNi > -----END PGP SIGNATURE----- > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/octet-stream Size: 2959941 bytes Desc: not available Url : http://lists.open-bio.org/pipermail/biojava-l/attachments/20061124/6fff7c36/attachment-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/octet-stream Size: 1961596 bytes Desc: not available Url : http://lists.open-bio.org/pipermail/biojava-l/attachments/20061124/6fff7c36/attachment-0003.obj From myammad at gmail.com Mon Nov 27 09:41:39 2006 From: myammad at gmail.com (Ammad Ud Din) Date: Mon, 27 Nov 2006 19:41:39 +0500 Subject: [Biojava-l] Looking forward for suggestions Message-ID: <887d6f690611270641x3aeefb63pc537210cda242b30@mail.gmail.com> Hi EveryBody, i am a final year Undergraduate student of bioinformatics.I am currently carrying a course in java so i want to contribute on open source projects.can anybody suggest me what type of open source projects are going on and how could i contribute in these....waiting for the reply..............tc bestwishes ----Ammad From mittalashr at yahoo.com Mon Nov 27 23:54:35 2006 From: mittalashr at yahoo.com (ashish mittal) Date: Mon, 27 Nov 2006 20:54:35 -0800 (PST) Subject: [Biojava-l] Using REstriction Mapper Message-ID: <20061128045435.9535.qmail@web52315.mail.yahoo.com> Hi all, I am trying to use restriction mapper to search for a list of resctriction enzymes in a given sequence. Can some one send me some sample code that does the same. I tried following and this code gives exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/utils/bytecode/CodeException at org.biojava.bio.seq.FeatureFilter$OnlyChildren.(FeatureFilter.java:1270) at org.biojava.bio.seq.FeatureFilter.(FeatureFilter.java:1813) at org.biojava.bio.seq.SimpleFeatureHolder.(SimpleFeatureHolder.java:52) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:116) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:143) at org.biojava.bio.molbio.RestrictionMapper.annotate(RestrictionMapper.java:115) at seed.rs.rsTry.Searcher.search(Searcher.java:91) at seed.rs.rsTry.Searcher.main(Searcher.java:101) CODE: public class Searcher { ThreadPool tPool = new ThreadPool() { public void addRequest(Runnable runnable) { } public void startThreads() { } public void stopThreads() { } public void waitForThreads() { } }; RestrictionMapper mapper = new RestrictionMapper(tPool); /** Creates a new instance of Searcher */ public Searcher() { } public void search(){ try { RestrictionEnzyme res1 = new RestrictionEnzyme("enz1",DNATools.createDNA("agtg"),0,0); RestrictionEnzyme res2 = new RestrictionEnzyme("enz2",DNATools.createDNA("gatt"),0,0); RestrictionEnzyme res3 = new RestrictionEnzyme("enz3",DNATools.createDNA("gatg"),0,0); mapper.addEnzyme(res1); mapper.addEnzyme(res2); mapper.addEnzyme(res3); RestrictionEnzymeManager.register(res1,new TreeSet()); RestrictionEnzymeManager.register(res2,new TreeSet()); RestrictionEnzymeManager.register(res3,new TreeSet()); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } catch (IllegalAlphabetException ex) { ex.printStackTrace(); } //RestrictionEnzymeManager resManager = new RestrictionEnzymeManager(); try { Sequence dnaSeq = DNATools.createDNASequence("agtgattcgtatcgattcggatggtcattttt","my_dnaseq"); Sequence newSeq = mapper.annotate(dnaSeq); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } } public static void main (String args[]) { Searcher searcherObj = new Searcher(); searcherObj.search(); } } Thanks in Advance. Ashish ____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited From mark.schreiber at novartis.com Tue Nov 28 00:55:43 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Tue, 28 Nov 2006 13:55:43 +0800 Subject: [Biojava-l] Using REstriction Mapper Message-ID: Hi - Looks like you forgot to include the bytecode.jar on your classpath. Take a look at these instructions : http://biojava.org/wiki/BioJava:GetStarted - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 ashish mittal Sent by: biojava-l-bounces at lists.open-bio.org 11/28/2006 12:54 PM To: biojava-l at lists.open-bio.org cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using REstriction Mapper Hi all, I am trying to use restriction mapper to search for a list of resctriction enzymes in a given sequence. Can some one send me some sample code that does the same. I tried following and this code gives exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/utils/bytecode/CodeException at org.biojava.bio.seq.FeatureFilter$OnlyChildren.(FeatureFilter.java:1270) at org.biojava.bio.seq.FeatureFilter.(FeatureFilter.java:1813) at org.biojava.bio.seq.SimpleFeatureHolder.(SimpleFeatureHolder.java:52) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:116) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:143) at org.biojava.bio.molbio.RestrictionMapper.annotate(RestrictionMapper.java:115) at seed.rs.rsTry.Searcher.search(Searcher.java:91) at seed.rs.rsTry.Searcher.main(Searcher.java:101) CODE: public class Searcher { ThreadPool tPool = new ThreadPool() { public void addRequest(Runnable runnable) { } public void startThreads() { } public void stopThreads() { } public void waitForThreads() { } }; RestrictionMapper mapper = new RestrictionMapper(tPool); /** Creates a new instance of Searcher */ public Searcher() { } public void search(){ try { RestrictionEnzyme res1 = new RestrictionEnzyme("enz1",DNATools.createDNA("agtg"),0,0); RestrictionEnzyme res2 = new RestrictionEnzyme("enz2",DNATools.createDNA("gatt"),0,0); RestrictionEnzyme res3 = new RestrictionEnzyme("enz3",DNATools.createDNA("gatg"),0,0); mapper.addEnzyme(res1); mapper.addEnzyme(res2); mapper.addEnzyme(res3); RestrictionEnzymeManager.register(res1,new TreeSet()); RestrictionEnzymeManager.register(res2,new TreeSet()); RestrictionEnzymeManager.register(res3,new TreeSet()); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } catch (IllegalAlphabetException ex) { ex.printStackTrace(); } //RestrictionEnzymeManager resManager = new RestrictionEnzymeManager(); try { Sequence dnaSeq = DNATools.createDNASequence("agtgattcgtatcgattcggatggtcattttt","my_dnaseq"); Sequence newSeq = mapper.annotate(dnaSeq); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } } public static void main (String args[]) { Searcher searcherObj = new Searcher(); searcherObj.search(); } } Thanks in Advance. Ashish ____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From kingsulaman at hotmail.com Mon Nov 27 09:44:11 2006 From: kingsulaman at hotmail.com (Sulaman Nawaz) Date: Mon, 27 Nov 2006 14:44:11 +0000 Subject: [Biojava-l] Willing to Contribute in BioJava In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: http://lists.open-bio.org/pipermail/biojava-l/attachments/20061127/8b8e7277/attachment.html From g.etherington at imb.uq.edu.au Wed Nov 1 08:39:24 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Wed, 1 Nov 2006 18:39:24 +1000 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: <008901c6fd91$3c415e40$36776682@IMBPC.AD> Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham From mark.schreiber at novartis.com Wed Nov 1 09:53:33 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Wed, 1 Nov 2006 17:53:33 +0800 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From ayates at ebi.ac.uk Wed Nov 1 10:00:23 2006 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 01 Nov 2006 10:00:23 +0000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: <008901c6fd91$3c415e40$36776682@IMBPC.AD> References: <008901c6fd91$3c415e40$36776682@IMBPC.AD> Message-ID: <45487037.1090205@ebi.ac.uk> Hi Graham, Your problem is probably that you're running this via sh which windows does not have. Even if you are running this via cygwin as far as I'm aware the JVM will use a normal windows shell/cmd. My advice would be to drop the sh and just try running the command as normal and see how that goes. Failing that BioJava has org.biojava.utils.ExecRunner which is quite good and takes into account a few lessons learned from this article on using runtime: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Hope that helps, Andy Yates Graham Etherington wrote: > Hi, > I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST > searches on a local BLAST database. Even though I'm not using BioJava > (intend to use it to parse the results), I thought this formum would be the > best place to ask for help. > Even when I hard code a good BLAST search I keep getting the same error when > I run my search, namely: > " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache > Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i > test.fas -o blast.out" error=2 " > > The pertinent bits of code I'm using are... > > String cmd = "C:/Program Files/Apache Software Foundation/Tomcat > 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; > > ............ > > > Runtime r = Runtime.getRuntime (); > Process runBlast = r.exec (new String[] {"sh","-c",cmd}); > > runBlast.waitFor (); > out.println ("Waiting for result"); > > //Write the results > BufferedReader br = new BufferedReader (new FileReader (output)); > String line = null; > String results = ""; > while ( (line = br.readLine ()) != null ) > results = results.concat ("/n" + line); > > ............. > > I'm not sure why it give me an IOException. I've checked that the file input > file exists and that all the paths are correct. > Any ideas? > > Many thanks, > Graham > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l From Peter.Ng at bccdc.ca Wed Nov 1 19:40:53 2006 From: Peter.Ng at bccdc.ca (Ng, Peter) Date: Wed, 1 Nov 2006 11:40:53 -0800 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From g.etherington at imb.uq.edu.au Wed Nov 1 21:21:53 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Thu, 2 Nov 2006 07:21:53 +1000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: Message-ID: <000301c6fdfb$c0c82a80$36776682@IMBPC.AD> Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From Peter.Ng at bccdc.ca Wed Nov 1 21:52:42 2006 From: Peter.Ng at bccdc.ca (Ng, Peter) Date: Wed, 1 Nov 2006 13:52:42 -0800 Subject: [Biojava-l] Using Java to create BLAST searches Message-ID: Graham, thanks for the info! I have two instances of Runtime.getRuntime().exec going, should I be putting these into two threads? also, when does java see the process actually being finished? how does java know when blastn is done at the unix or window level? thanks, peter -----Original Message----- From: Graham Etherington [mailto:g.etherington at imb.uq.edu.au] Sent: November 1, 2006 1:22 PM To: Ng, Peter; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From g.etherington at imb.uq.edu.au Wed Nov 1 22:16:38 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Thu, 2 Nov 2006 08:16:38 +1000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: Message-ID: <001a01c6fe03$6688b4b0$36776682@IMBPC.AD> Peter, The method is explained quite well at: http://java.sun.com/j2se/1.3/docs/api/java/lang/Process.html#waitFor() Not sure about your threading question, but I'm presuming that the Process produces and exit value. By convention, 0 indicates normal termination. Hope this helps a little. Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 7:53 AM To: Graham Etherington; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Graham, thanks for the info! I have two instances of Runtime.getRuntime().exec going, should I be putting these into two threads? also, when does java see the process actually being finished? how does java know when blastn is done at the unix or window level? thanks, peter -----Original Message----- From: Graham Etherington [mailto:g.etherington at imb.uq.edu.au] Sent: November 1, 2006 1:22 PM To: Ng, Peter; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From michael.tran at acpfg.com.au Thu Nov 2 05:43:09 2006 From: michael.tran at acpfg.com.au (Michael Tran) Date: Thu, 2 Nov 2006 16:13:09 +1030 Subject: [Biojava-l] Can BioJava do Multiple Alignments? References: Message-ID: Hi, I know that BioJava 1.5 can do pairwise alignments using algorithms like SmithWaterman and NeedlemanWunch. But can BioJava do multiple alignments like the algorthm used for ClustalW? I have also checked the HMM classes, but they appear to only do pairwise alignments. Michael ________________________________ From: biojava-l-bounces at lists.open-bio.org on behalf of biojava-l-request at lists.open-bio.org Sent: Wed 1/11/2006 8:09 PM To: biojava-l at lists.open-bio.org Subject: Biojava-l Digest, Vol 47, Issue 1 Send Biojava-l mailing list submissions to biojava-l at lists.open-bio.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.open-bio.org/mailman/listinfo/biojava-l or, via email, send a message with subject or body 'help' to biojava-l-request at lists.open-bio.org You can reach the person managing the list at biojava-l-owner at lists.open-bio.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Biojava-l digest..." Today's Topics: 1. Re: can BioJava do alignment ? (Ramon Medrado) 2. Re: can BioJava do alignment ? (mark.schreiber at novartis.com) 3. More extensive Bioperl-run 1.5.2RC2 tests (Nathan S. Haigh) 4. Re: More extensive Bioperl-run 1.5.2RC2 tests (Nathan Haigh) 5. fasta description line (ThorstenInAnger) 6. pK values (Gerster Sarah) 7. Re: fasta description line (Mark Schreiber) 8. Re: pK values (Mark Schreiber) 9. Re: pK values (David Huen) 10. Using Java to create BLAST searches (Graham Etherington) ---------------------------------------------------------------------- Message: 1 Date: Thu, 19 Oct 2006 14:45:24 -0300 From: "Ramon Medrado" Subject: Re: [Biojava-l] can BioJava do alignment ? To: biojava Message-ID: <37ba4b050610191045q30a6282bjce052e31e1463cea at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 2 Date: Fri, 20 Oct 2006 09:57:09 +0800 From: mark.schreiber at novartis.com Subject: Re: [Biojava-l] can BioJava do alignment ? To: "Ramon Medrado" , CARMELK at il.ibm.com Cc: biojava Message-ID: Content-Type: text/plain; charset="us-ascii" Hi - You can also perform an alignment using HMMs in biojava 1.3 and 1.4. See the example at (http://biojava.org/wiki/BioJava:CookBook:DP:PairWise). This is actually the most flexible way to do it. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Ramon Medrado" Sent by: biojava-l-bounces at lists.open-bio.org 10/20/2006 01:45 AM To: biojava cc: (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-l] can BioJava do alignment ? Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l ------------------------------ Message: 3 Date: Wed, 25 Oct 2006 13:54:26 +0000 From: "Nathan S. Haigh" Subject: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <453F6C92.6020207 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 I have recently installed some more software for which there are bioperl-run tests and run the test suite with several versions of the software I could find. I've added info to http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any fails in any of the versions I tested I've noted them together with versions that were ok (if any). There maybe another 6 or so programs I'm trying to get hold of to run further tests - I'll update when I get them. Nath ------------------------------ Message: 4 Date: Thu, 26 Oct 2006 09:46:13 +0100 From: Nathan Haigh Subject: Re: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <454075D5.2030005 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 Nathan S. Haigh wrote: > I have recently installed some more software for which there are > bioperl-run tests and run the test suite with several versions of the > software I could find. I've added info to > http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any > fails in any of the versions I tested I've noted them together with > versions that were ok (if any). > > There maybe another 6 or so programs I'm trying to get hold of to run > further tests - I'll update when I get them. > Nath > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > My aplogies, this should have gone to the Bioperl mailing list! :o) ------------------------------ Message: 5 Date: Mon, 23 Oct 2006 02:57:14 -0700 (PDT) From: ThorstenInAnger Subject: [Biojava-l] fasta description line To: biojava-l at lists.open-bio.org Message-ID: <6950970.post at talk.nabble.com> Content-Type: text/plain; charset=us-ascii Hi, I want to do something very simple: - get id and sequence from a database - create a sequence object - write it out as fasta format file (with a defined description line) this is my code: rs = stmt.executeQuery(query); Feature.Template templ = new Feature.Template(); //fill in the template Annotation an = new SimpleAnnotation(); templ.location = Location.empty; while (rs.next()) { mepdId = rs.getInt(1); mepdName = rs.getString(2); seq = rs.getString(3); seqObj = DNATools.createDNASequence(seq, mepdName); an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description here"); templ.annotation = an; seqObj.createFeature(templ); SeqIOTools.writeFasta(fastaFos, seqObj); //db.addSequence(seqObj); } It works fine, but there is no description line in the resulting file! How can I change the fasta description line? Also I am using deprecated methods, but could not find out what to use instead: FastaFormat.PROPERTY_DESCRIPTIONLINE SeqIOTools.writeFasta All tutorials I found are using the deprecated. Cheers, Thorsten -- View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 Sent from the BioJava mailing list archive at Nabble.com. ------------------------------ Message: 6 Date: Tue, 31 Oct 2006 09:04:33 +0100 From: "Gerster Sarah" Subject: [Biojava-l] pK values To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi! I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? Cheers Sarah ------------------------------ Message: 7 Date: Tue, 31 Oct 2006 17:37:24 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] fasta description line To: ThorstenInAnger Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310137u68700b06se364f99da69feb47 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - If you are using biojava 1.5 beta (recommended) you should use RichSequence.IOTools to write the fasta (strongly recommended). With the new org.biojavax.bio.seq.io.FastaFormat object the description line is constructed from: richSequence.getIdentifier() richSequence.getNamespace().getName(); richSequence.getAccession() richSequence.getVersion() richSequence.getName() richSequence.getDescription() - Mark On 10/23/06, ThorstenInAnger wrote: > > Hi, > > I want to do something very simple: > > - get id and sequence from a database > - create a sequence object > - write it out as fasta format file (with a defined description line) > > this is my code: > rs = stmt.executeQuery(query); > Feature.Template templ = new Feature.Template(); > > //fill in the template > Annotation an = new SimpleAnnotation(); > templ.location = Location.empty; > > while (rs.next()) { > mepdId = rs.getInt(1); > mepdName = rs.getString(2); > seq = rs.getString(3); > seqObj = DNATools.createDNASequence(seq, mepdName); > an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description > here"); > templ.annotation = an; > seqObj.createFeature(templ); > SeqIOTools.writeFasta(fastaFos, seqObj); > //db.addSequence(seqObj); > } > > It works fine, but there is no description line in the resulting file! > How can I change the fasta description line? > > Also I am using deprecated methods, but could not find out what to use > instead: > FastaFormat.PROPERTY_DESCRIPTIONLINE > SeqIOTools.writeFasta > All tutorials I found are using the deprecated. > > Cheers, > > Thorsten > > -- > View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 > Sent from the BioJava mailing list archive at Nabble.com. > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 8 Date: Tue, 31 Oct 2006 17:27:29 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] pK values To: "Gerster Sarah" Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310127h75010e56ne31e188294e23803 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - The values are calculated using the SymbolPropertyTable returned by ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); This table gets it's values from the resource file org/biojava/bio/symbol/ResidueProperties.xml The pK values were added by david huen (I think). To read XML sequence files try one of the methods in RichSequence.IOTools from biojava 1.5 beta. - Mark On 10/31/06, Gerster Sarah wrote: > Hi! > > I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. > > And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? > > Cheers > > Sarah > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 9 Date: 31 Oct 2006 12:21:43 +0000 From: David Huen Subject: Re: [Biojava-l] pK values To: Mark Schreiber Cc: biojava-l at lists.open-bio.org Message-ID: Content-Type: text/plain; format=flowed; charset=ISO-8859-1 On Oct 31 2006, Mark Schreiber wrote: >Hi - > >The values are calculated using the SymbolPropertyTable returned by >ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); > >This table gets it's values from the resource file >org/biojava/bio/symbol/ResidueProperties.xml > >The pK values were added by david huen (I think). > I used the same pK values as those used by GCG to maintian cross-compability. Regards, David ------------------------------ Message: 10 Date: Wed, 1 Nov 2006 18:39:24 +1000 From: "Graham Etherington" Subject: [Biojava-l] Using Java to create BLAST searches To: Message-ID: <008901c6fd91$3c415e40$36776682 at IMBPC.AD> Content-Type: text/plain; charset="us-ascii" Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham ------------------------------ _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l End of Biojava-l Digest, Vol 47, Issue 1 **************************************** From mark.schreiber at novartis.com Thu Nov 2 06:03:13 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 2 Nov 2006 14:03:13 +0800 Subject: [Biojava-l] Can BioJava do Multiple Alignments? Message-ID: In short -- No. The best solution is probably to call ClustalW in a process. You could of course reimplement the algorithm in biojava if you wish. The DP library could also be extended for MSA but this would be hard work. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Michael Tran" Sent by: biojava-l-bounces at lists.open-bio.org 11/02/2006 01:43 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Can BioJava do Multiple Alignments? Hi, I know that BioJava 1.5 can do pairwise alignments using algorithms like SmithWaterman and NeedlemanWunch. But can BioJava do multiple alignments like the algorthm used for ClustalW? I have also checked the HMM classes, but they appear to only do pairwise alignments. Michael ________________________________ From: biojava-l-bounces at lists.open-bio.org on behalf of biojava-l-request at lists.open-bio.org Sent: Wed 1/11/2006 8:09 PM To: biojava-l at lists.open-bio.org Subject: Biojava-l Digest, Vol 47, Issue 1 Send Biojava-l mailing list submissions to biojava-l at lists.open-bio.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.open-bio.org/mailman/listinfo/biojava-l or, via email, send a message with subject or body 'help' to biojava-l-request at lists.open-bio.org You can reach the person managing the list at biojava-l-owner at lists.open-bio.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Biojava-l digest..." Today's Topics: 1. Re: can BioJava do alignment ? (Ramon Medrado) 2. Re: can BioJava do alignment ? (mark.schreiber at novartis.com) 3. More extensive Bioperl-run 1.5.2RC2 tests (Nathan S. Haigh) 4. Re: More extensive Bioperl-run 1.5.2RC2 tests (Nathan Haigh) 5. fasta description line (ThorstenInAnger) 6. pK values (Gerster Sarah) 7. Re: fasta description line (Mark Schreiber) 8. Re: pK values (Mark Schreiber) 9. Re: pK values (David Huen) 10. Using Java to create BLAST searches (Graham Etherington) ---------------------------------------------------------------------- Message: 1 Date: Thu, 19 Oct 2006 14:45:24 -0300 From: "Ramon Medrado" Subject: Re: [Biojava-l] can BioJava do alignment ? To: biojava Message-ID: <37ba4b050610191045q30a6282bjce052e31e1463cea at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 2 Date: Fri, 20 Oct 2006 09:57:09 +0800 From: mark.schreiber at novartis.com Subject: Re: [Biojava-l] can BioJava do alignment ? To: "Ramon Medrado" , CARMELK at il.ibm.com Cc: biojava Message-ID: Content-Type: text/plain; charset="us-ascii" Hi - You can also perform an alignment using HMMs in biojava 1.3 and 1.4. See the example at (http://biojava.org/wiki/BioJava:CookBook:DP:PairWise). This is actually the most flexible way to do it. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Ramon Medrado" Sent by: biojava-l-bounces at lists.open-bio.org 10/20/2006 01:45 AM To: biojava cc: (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-l] can BioJava do alignment ? Hi, The information is true. Biojava 1.5 has the main algorithms of alignment as NeedlemanWunch, SmithWaterman and other implementations that are encapsulated on package org.biojava.bio.alignment All source is disponible in this link : http://www.biojava.org/download/bj15b/all/biojava-1.5-beta.tar.gz and the jar file is disponible in: http://www.biojava.org/download/bj15b/bin/biojava-1.5-beta.jar and the javadoc: http://www.biojava.org/download/bj15b/doc/doc.tar.gz I wait to have helped -- Ramon Undergraduate Student of Computer Science Universidade Estadual de Santa Cruz - Brasil 2006/10/19, Carmel Kent : > > > Hello, > > I'm interested in a Java package for sequence alignment. > I understood that BioJava 1.3 & 1.4 itself cannot align sequences, it can > only create objects that are representations of alignments generated by > third-party software. > > I had an impression that BioJava 1.5 can do alignment itself (e.g., I > saw in http://biojava.org/wiki/BioJava:CookBook:DP:PairWise2 the class > named org.biojava.bio.alignment.NeedlemanWunch) > > I have two questions: > > is this true ? I mean, does BioJava 1.5 contain the alignment > algorithm, > itself ? if it does, I downloaded the CVS view of BioJava 1.5, but could not find > any javadocs or the alignment package source. Where can I find it ? > > > Thanks very much, > > > Carmel Kent > Research Staff Member > Healthcare I/T Research > IBM Research Laboratory in Haifa > Tel. +972-4-8281059 > Email: carmelk at il.ibm.com > > > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l ------------------------------ Message: 3 Date: Wed, 25 Oct 2006 13:54:26 +0000 From: "Nathan S. Haigh" Subject: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <453F6C92.6020207 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 I have recently installed some more software for which there are bioperl-run tests and run the test suite with several versions of the software I could find. I've added info to http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any fails in any of the versions I tested I've noted them together with versions that were ok (if any). There maybe another 6 or so programs I'm trying to get hold of to run further tests - I'll update when I get them. Nath ------------------------------ Message: 4 Date: Thu, 26 Oct 2006 09:46:13 +0100 From: Nathan Haigh Subject: Re: [Biojava-l] More extensive Bioperl-run 1.5.2RC2 tests To: biojava-l at lists.open-bio.org Message-ID: <454075D5.2030005 at sheffield.ac.uk> Content-Type: text/plain; charset=ISO-8859-1 Nathan S. Haigh wrote: > I have recently installed some more software for which there are > bioperl-run tests and run the test suite with several versions of the > software I could find. I've added info to > http://www.bioperl.org/wiki/Release_1.5.2#bioperl-run. If there were any > fails in any of the versions I tested I've noted them together with > versions that were ok (if any). > > There maybe another 6 or so programs I'm trying to get hold of to run > further tests - I'll update when I get them. > Nath > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > My aplogies, this should have gone to the Bioperl mailing list! :o) ------------------------------ Message: 5 Date: Mon, 23 Oct 2006 02:57:14 -0700 (PDT) From: ThorstenInAnger Subject: [Biojava-l] fasta description line To: biojava-l at lists.open-bio.org Message-ID: <6950970.post at talk.nabble.com> Content-Type: text/plain; charset=us-ascii Hi, I want to do something very simple: - get id and sequence from a database - create a sequence object - write it out as fasta format file (with a defined description line) this is my code: rs = stmt.executeQuery(query); Feature.Template templ = new Feature.Template(); //fill in the template Annotation an = new SimpleAnnotation(); templ.location = Location.empty; while (rs.next()) { mepdId = rs.getInt(1); mepdName = rs.getString(2); seq = rs.getString(3); seqObj = DNATools.createDNASequence(seq, mepdName); an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description here"); templ.annotation = an; seqObj.createFeature(templ); SeqIOTools.writeFasta(fastaFos, seqObj); //db.addSequence(seqObj); } It works fine, but there is no description line in the resulting file! How can I change the fasta description line? Also I am using deprecated methods, but could not find out what to use instead: FastaFormat.PROPERTY_DESCRIPTIONLINE SeqIOTools.writeFasta All tutorials I found are using the deprecated. Cheers, Thorsten -- View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 Sent from the BioJava mailing list archive at Nabble.com. ------------------------------ Message: 6 Date: Tue, 31 Oct 2006 09:04:33 +0100 From: "Gerster Sarah" Subject: [Biojava-l] pK values To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi! I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? Cheers Sarah ------------------------------ Message: 7 Date: Tue, 31 Oct 2006 17:37:24 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] fasta description line To: ThorstenInAnger Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310137u68700b06se364f99da69feb47 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - If you are using biojava 1.5 beta (recommended) you should use RichSequence.IOTools to write the fasta (strongly recommended). With the new org.biojavax.bio.seq.io.FastaFormat object the description line is constructed from: richSequence.getIdentifier() richSequence.getNamespace().getName(); richSequence.getAccession() richSequence.getVersion() richSequence.getName() richSequence.getDescription() - Mark On 10/23/06, ThorstenInAnger wrote: > > Hi, > > I want to do something very simple: > > - get id and sequence from a database > - create a sequence object > - write it out as fasta format file (with a defined description line) > > this is my code: > rs = stmt.executeQuery(query); > Feature.Template templ = new Feature.Template(); > > //fill in the template > Annotation an = new SimpleAnnotation(); > templ.location = Location.empty; > > while (rs.next()) { > mepdId = rs.getInt(1); > mepdName = rs.getString(2); > seq = rs.getString(3); > seqObj = DNATools.createDNASequence(seq, mepdName); > an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description > here"); > templ.annotation = an; > seqObj.createFeature(templ); > SeqIOTools.writeFasta(fastaFos, seqObj); > //db.addSequence(seqObj); > } > > It works fine, but there is no description line in the resulting file! > How can I change the fasta description line? > > Also I am using deprecated methods, but could not find out what to use > instead: > FastaFormat.PROPERTY_DESCRIPTIONLINE > SeqIOTools.writeFasta > All tutorials I found are using the deprecated. > > Cheers, > > Thorsten > > -- > View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970 > Sent from the BioJava mailing list archive at Nabble.com. > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 8 Date: Tue, 31 Oct 2006 17:27:29 +0800 From: "Mark Schreiber" Subject: Re: [Biojava-l] pK values To: "Gerster Sarah" Cc: biojava-l at lists.open-bio.org Message-ID: <93b45ca50610310127h75010e56ne31e188294e23803 at mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi - The values are calculated using the SymbolPropertyTable returned by ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); This table gets it's values from the resource file org/biojava/bio/symbol/ResidueProperties.xml The pK values were added by david huen (I think). To read XML sequence files try one of the methods in RichSequence.IOTools from biojava 1.5 beta. - Mark On 10/31/06, Gerster Sarah wrote: > Hi! > > I want to compute the pI of some sequences. I looked at "IsoelectricPointCalc.java". Where do the values for the pks come from? are they defined as constants somewhere? I couldn't find them... I wanted to see if the values are the same ones than the ones that I am supposed to use. > > And another question> reading in sequences from an xml file... Is there something that I can use, or do I have to write it on my own? > > Cheers > > Sarah > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > ------------------------------ Message: 9 Date: 31 Oct 2006 12:21:43 +0000 From: David Huen Subject: Re: [Biojava-l] pK values To: Mark Schreiber Cc: biojava-l at lists.open-bio.org Message-ID: Content-Type: text/plain; format=flowed; charset=ISO-8859-1 On Oct 31 2006, Mark Schreiber wrote: >Hi - > >The values are calculated using the SymbolPropertyTable returned by >ProteinTools.getSymbolPropertyTable(SymbolPropertyTable.PK); > >This table gets it's values from the resource file >org/biojava/bio/symbol/ResidueProperties.xml > >The pK values were added by david huen (I think). > I used the same pK values as those used by GCG to maintian cross-compability. Regards, David ------------------------------ Message: 10 Date: Wed, 1 Nov 2006 18:39:24 +1000 From: "Graham Etherington" Subject: [Biojava-l] Using Java to create BLAST searches To: Message-ID: <008901c6fd91$3c415e40$36776682 at IMBPC.AD> Content-Type: text/plain; charset="us-ascii" Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham ------------------------------ _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l End of Biojava-l Digest, Vol 47, Issue 1 **************************************** _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From cezard at nokad-technology.com Thu Nov 2 08:41:02 2006 From: cezard at nokad-technology.com (=?iso-8859-1?Q?CEZARD_Timoth=E9e?=) Date: Thu, 2 Nov 2006 09:41:02 +0100 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: <001a01c6fe03$6688b4b0$36776682@IMBPC.AD> Message-ID: <20061102084307.5F9EB75D8E@smtp2-g19.free.fr> Hi everyone, I've worked a bit on that point and want to share my view. When you launch a blast via the Runtime exec command it creates (and launches) a new thread outside the JVM. The Process object allows you to monitor and wait for the end of this thread. I've observed that for obscure reason sometime the thread never finish. In that case you have to clear the InputStream and the ErrorStream of the process. Last point I've worked on is how to notice the GUI of the end of the process. For that I've used the SwingWorker object and it worked fine. http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html Hope this helps someone. CEZARD Timoth?e Ms bioinformatics Manager NOKAD SA 4 rue Pierre Fontaine 91058 EVRY cedex Tel : 01.60.87.89.90 Fax : 01.60.87.89.99 www.nokad-technology.com -----Message d'origine----- De?: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-bounces at lists.open-bio.org] De la part de Graham Etherington Envoy??: mercredi 1 novembre 2006 23:17 ??: 'Ng, Peter'; mark.schreiber at novartis.com Cc?: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Objet?: Re: [Biojava-l] Using Java to create BLAST searches Peter, The method is explained quite well at: http://java.sun.com/j2se/1.3/docs/api/java/lang/Process.html#waitFor() Not sure about your threading question, but I'm presuming that the Process produces and exit value. By convention, 0 indicates normal termination. Hope this helps a little. Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 7:53 AM To: Graham Etherington; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Graham, thanks for the info! I have two instances of Runtime.getRuntime().exec going, should I be putting these into two threads? also, when does java see the process actually being finished? how does java know when blastn is done at the unix or window level? thanks, peter -----Original Message----- From: Graham Etherington [mailto:g.etherington at imb.uq.edu.au] Sent: November 1, 2006 1:22 PM To: Ng, Peter; mark.schreiber at novartis.com Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Peter, If you are running a process, then you should be able to use the Process.waitFor() command. waitFor() causes the current thread to wait, if necessary, until the process represented by this Process object has terminated. I've used it in my code that I posted and have snippeted it below. Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); Hope this is of some help. Cheers, Graham Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: Ng, Peter [mailto:Peter.Ng at bccdc.ca] Sent: Thursday, 2 November 2006 5:41 AM To: mark.schreiber at novartis.com; Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: RE: [Biojava-l] Using Java to create BLAST searches Hi Mark/Andy, I have a similar question relating to command line blast searches. I'm using elements from both flatfile.txt and i.html to present on a html page. How do I ensure each of blast1 or blast2 is completed before I start the next step? I'm not sure how to maintain control once the command line is being executed. Is there a way to test the presence of the output files? Does synchronize work in this situation. If so, how would I put it in the code? Any help would be appreciated! thanks, peter blast1 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 8 -o c:/blast/files/flatfile.txt -v 2 -b 2 -F F"; blast2 = "CMD /c c:/blast/blastall -p blastn -d c:/blast/db/" + getLibrary() + " -i c:/blast/files/noc.txt -e .0001 -m 0 -o c:/batchBLAST/" + i + ".html -T T -v 5 -b 5 -F F"; Runtime.getRuntime().exec(blast1); Runtime.getRuntime().exec(blast2); -- Regards, Peter Ng Laboratory Information Management Coordinator Laboratory Services BC Centre for Disease Control 655 West 12th Avenue Vancouver BC V5Z 4R4 Tel: 604-660-2058 Page: 604-205-4814 Fax: 604-660-6073 Web: www.bccdc.org -----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: November 1, 2006 1:54 AM To: Graham Etherington Cc: biojava-l at lists.open-bio.org; biojava-l-bounces at lists.open-bio.org Subject: Re: [Biojava-l] Using Java to create BLAST searches Hi - It may not like the command line having spaces in the path. Try installing blast somewhere else as a test. Eg put it in C:\blast and then try String cmd = "C:/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; You could possibly even trick it by putting a short cut in the C directory. Also biojava has some nice tools for working with processes. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Graham Etherington" Sent by: biojava-l-bounces at lists.open-bio.org 11/01/2006 04:39 PM To: cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From zagato.gekko at gmail.com Thu Nov 2 21:37:58 2006 From: zagato.gekko at gmail.com (Alan Acosta) Date: Thu, 2 Nov 2006 16:37:58 -0500 Subject: [Biojava-l] Reading sequence identifier from file in FASTA format Message-ID: <98028b00611021337n4b7970d2q76f7a045d634f6c2@mail.gmail.com> Hello Everybody, this is my first write to the list, i'm a student of computer science, and a really newbie into this subjects, so i'm experimenting with BioJava against BioPerl... My problem is that i'm trying to read FASTA file with /////////////////// BufferedReader input = new BufferedReader( new FileReader("NC_008009.fna") ); RichSequenceIterator seqIter = RichSequence.IOTools.readFastaDNA( input, RichObjectFactory.getDefaultNamespace() ); RichSequence rseq = null; if( seqIter.hasNext() ) { rseq = seqIter.nextRichSequence(); System.out.println("Identifier: "+rseq.getIdentifier() ); System.out.println("Description: "+rseq.getDescription() ); System.out.println("SubList: "+rseq.subList(10, 20).seqString() ); } /////////////////// but i'm getting a "identifier: null" into the answer when it had to be a "Identifier: 94967031", the description and sublist works good... in ( http://biojava.org/wiki/BioJava:BioJavaXDocs#Reading) says that: >gi|||.| identifier will be read it with setIdentifier() and will available through getIdentifier() but i get a null. Then... this file is really in FASTA format ? or i'm doing into the wrong way this ? The test file is: ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Acidobacteria_bacterium_Ellin345/NC_008009.fna And the header is: >gi|94967031|ref|NC_008009.1| Acidobacteria bacterium Ellin345, complete genome CCGTGTGTTGCGCGGCCAGATGAGAAATTTCTATGTCCCTCTCGACCACGACTCCACCAGCTCCGAACCC Where i can find a newbie tutorial for starter task into BioJava ? I appreciate any help... thanks. Farewell Alan Acosta Cali - Colombia From g.etherington at imb.uq.edu.au Fri Nov 3 00:23:09 2006 From: g.etherington at imb.uq.edu.au (Graham Etherington) Date: Fri, 3 Nov 2006 10:23:09 +1000 Subject: [Biojava-l] Using Java to create BLAST searches In-Reply-To: <008901c6fd91$3c415e40$36776682@IMBPC.AD> Message-ID: <000801c6fede$3d540870$36776682@IMBPC.AD> Hi, First of all, thanks for the replies and help that everyone sent for my BLAST query (see below). I figured out what the problems were and thought I should post the solutions to the forum. Firstly, as pointed out, when running on Windows the 'sh' and '-c' should be taken out. Process runBlast = r.exec (new String[] {cmd}); Secondly, I moved the location of blast to C:/blast/bin/, as to have no spaces in the path (I didn't try this when everything worked to see if it had an affect, so I don't know how essential this is) Thirdly, (and this was one of those real killers that have you kicking yourself once you realise what the problem was), the location of the database (ecoli.nt in this case) has to be explicitly set, so "C:/blast/bin/ecoli.nt" In the end, I used the org.biojava.utils.ExecRunner This handled the query really well and one of the best features is actually the error reporting. It told me that it couldn't find the ecoli.nt database which java.lang.Process did not. My final code looked like this: String cmd = "C:/blast/bin/blastall -p blastn -d C:/blast/bin/ecoli.nt -i test.fas -o blast.out"; org.biojava.utils.ExecRunner runner = new org.biojava.utils.ExecRunner (); runner.exec (cmd); out.println (runner.getErrString ()); My task for today is working out the best way to display the output/output file to the current jsp page. Again, thanks for your help. Dr. Graham Etherington Post-doctoral Research Officer Bioinformatics Discovery Group, Institute for Molecular Bioscience, University of Queensland, St. Lucia Campus, Brisbane, QLD 4072 Australia -----Original Message----- From: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-bounces at lists.open-bio.org] On Behalf Of Graham Etherington Sent: Wednesday, 1 November 2006 6:39 PM To: biojava-l at lists.open-bio.org Subject: [Biojava-l] Using Java to create BLAST searches Hi, I'm developing on Windows (using Apache Tomcat) using jsp's to create BLAST searches on a local BLAST database. Even though I'm not using BioJava (intend to use it to parse the results), I thought this formum would be the best place to ask for help. Even when I hard code a good BLAST search I keep getting the same error when I run my search, namely: " java.io.IOException: CreateProcess: sh -c "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out" error=2 " The pertinent bits of code I'm using are... String cmd = "C:/Program Files/Apache Software Foundation/Tomcat 5.5/blast/bin/blastall -p blastn -d ecoli.nt -i test.fas -o blast.out"; ............ Runtime r = Runtime.getRuntime (); Process runBlast = r.exec (new String[] {"sh","-c",cmd}); runBlast.waitFor (); out.println ("Waiting for result"); //Write the results BufferedReader br = new BufferedReader (new FileReader (output)); String line = null; String results = ""; while ( (line = br.readLine ()) != null ) results = results.concat ("/n" + line); ............. I'm not sure why it give me an IOException. I've checked that the file input file exists and that all the paths are correct. Any ideas? Many thanks, Graham _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From johnson.biotech at gmail.com Fri Nov 3 22:31:00 2006 From: johnson.biotech at gmail.com (Seth Johnson) Date: Fri, 3 Nov 2006 17:31:00 -0500 Subject: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys Message-ID: Hello guys, I've setup a BioSQL to hold sequences of interest parsed from NCBI genbank release. I also have another proprietary schema that holds experimental and alignment data. I would like to connect the proprietary schema to BioSQL one using Hibernate persistence, so that objects from my database would contain linkages to sequence data in biosql. Wiki mentions that one need change "only the mapping files that tell Hibernate how to translate between objects and tables." Can anyone elaborate on that topic a little or point me to a tutorial or some other place that discusses the concept? -- Best Regards, Seth Johnson Senior Bioinformatics Associate From varvenne at genoway.com Mon Nov 6 12:57:24 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 06 Nov 2006 13:57:24 +0100 Subject: [Biojava-l] Parsing blast results Message-ID: Hello, I'm a new user of biojava and i'm trying to use it to parse blast results (against NCBI nr database). I've tried to do so using biojava1.4 and biojava1.5-beta but none of these seem to support the latest Blast version. I'd be very greatful to you if anyone could help me with that... Thanks, Best regards, Benoit Varvenne, Bioinformatics pearson in charge, Genoway Lyon (France). From varvenne at genoway.com Mon Nov 6 13:27:32 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 06 Nov 2006 14:27:32 +0100 Subject: [Biojava-l] Parsing blast results In-Reply-To: Message-ID: I've already found the answer to my question which seems to work in previous archives (?June 2006). This archive suggests to replace : BlastLikeSAXParser parser = new BlastLikeSAXParser(); By : BlastXMLParserFacade parser = new BlastXMLParserFacade(); And this seems to work well. So sorry for having posted a bit quickly. Regards, Beno?t Varvenne, Bioinformatics pearson in charge, Genoway Lyon (France). Le 6/11/06 13:57, ??Benoit VARVENNE?? a ?crit?: > Hello, > > I'm a new user of biojava and i'm trying to use it to parse blast results > (against NCBI nr database). I've tried to do so using biojava1.4 and > biojava1.5-beta but none of these seem to support the latest Blast version. > > I'd be very greatful to you if anyone could help me with that... > > Thanks, > Best regards, > > Benoit Varvenne, > Bioinformatics pearson in charge, > Genoway Lyon (France). > > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > From johnson.biotech at gmail.com Tue Nov 7 04:59:01 2006 From: johnson.biotech at gmail.com (Seth Johnson) Date: Mon, 6 Nov 2006 23:59:01 -0500 Subject: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys In-Reply-To: <454F07D5.2040001@ebi.ac.uk> References: <454F07D5.2040001@ebi.ac.uk> Message-ID: Thank you Richard. I am using NetBeans 5.5 and JDK 5.0 that implements mapping metadata (EJB 3.0) instead of .hbm.xml files. I read up on Hibernate from you links and I think that the easiest solution would be to use RichSequence BioJavaX object as an embeddable object in my proprietary 'alignment' class. Basically, my goal is to have access to RichSequence object when I instantiate 'alignment' object from my 'alignment' table. That table contains a column with primary key of the bioentry that was used to produce that alignment. Since biosql is in different schema, I don't believe that cross schema foreign keys are possible in mySQL. Do you think that this is a right strategy? Seth On 11/6/06, Richard Holland wrote: > > If your proprietary database has a similar design to BioSQL, or can > easily be mapped on an approximately 1:1 basis to the existing BioJavaX > object model, then all you need to do is edit the .hbm.xml files and > look for references to table names and column names. Remove any tables > and columns that don't exist in your schema (including removing the > files if this leaves them empty), and edit the remaining ones so that > the table and column names match. > > If your new schema contains tables that do not map to existing BioJavaX > objects, then you'll need to create Java objects for those as well as > the appropriate mapping files. The easiest way to do this is to > copy-and-paste both an existing BioJavaX object and the related .hbm.xml > file - eg. SimpleCrossRef.java and CrossRef.hxm.xml. > > Hibernate is best explained through its own documentation at > http://www.hibernate.org/ . The 'getting started' tutorial they provide > (here: > http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html ) > is a good starting point. > > cheers, > Richard > > > Seth Johnson wrote: > > Hello guys, > > > > I've setup a BioSQL to hold sequences of interest parsed from NCBI > > genbank release. I also have another proprietary schema that holds > > experimental and alignment data. I would like to connect the > > proprietary schema to BioSQL one using Hibernate persistence, so that > > objects from my database would contain linkages to sequence data in > > biosql. Wiki mentions that one need change "only the mapping files > > that tell Hibernate how to translate between objects and tables." Can > > anyone elaborate on that topic a little or point me to a tutorial or > > some other place that discusses the concept? > > From mark.schreiber at novartis.com Tue Nov 7 08:57:58 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Tue, 7 Nov 2006 16:57:58 +0800 Subject: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys Message-ID: Hi - If you are using the JDK5 persistence API you either do your mappings as annotations or vendor neutral xml mappings. The vendor you choose for the actual ORM is specified in your persistence unit definition (eg Hibernate, KODO, TopLink etc). If you want to do the mapping with annotations you would need to make your own implemenation of RichSequence etc as biojava is not yet using JDK5 and won't support annotation. Basically you would just copy the appropriate "SimpleRich" Objects and pepper them with annotations pointing to the correct DB tables etc. Not sure which strategy is more appropriate for you. If MySQL doesn't allow for cross schema keys you may have to extend your copy of MySQL to include the extra table/ tables from your proprietary schema. - Mark "Seth Johnson" Sent by: biojava-l-bounces at lists.open-bio.org 11/07/2006 12:59 PM To: "Richard Holland" cc: biojava-l at biojava.org, (bcc: Mark Schreiber/GP/Novartis) Subject: Re: [Biojava-l] BioSQL -> BioJava Hibernate -> RichSequence access to primary keys Thank you Richard. I am using NetBeans 5.5 and JDK 5.0 that implements mapping metadata (EJB 3.0) instead of .hbm.xml files. I read up on Hibernate from you links and I think that the easiest solution would be to use RichSequence BioJavaX object as an embeddable object in my proprietary 'alignment' class. Basically, my goal is to have access to RichSequence object when I instantiate 'alignment' object from my 'alignment' table. That table contains a column with primary key of the bioentry that was used to produce that alignment. Since biosql is in different schema, I don't believe that cross schema foreign keys are possible in mySQL. Do you think that this is a right strategy? Seth On 11/6/06, Richard Holland wrote: > > If your proprietary database has a similar design to BioSQL, or can > easily be mapped on an approximately 1:1 basis to the existing BioJavaX > object model, then all you need to do is edit the .hbm.xml files and > look for references to table names and column names. Remove any tables > and columns that don't exist in your schema (including removing the > files if this leaves them empty), and edit the remaining ones so that > the table and column names match. > > If your new schema contains tables that do not map to existing BioJavaX > objects, then you'll need to create Java objects for those as well as > the appropriate mapping files. The easiest way to do this is to > copy-and-paste both an existing BioJavaX object and the related .hbm.xml > file - eg. SimpleCrossRef.java and CrossRef.hxm.xml. > > Hibernate is best explained through its own documentation at > http://www.hibernate.org/ . The 'getting started' tutorial they provide > (here: > http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html ) > is a good starting point. > > cheers, > Richard > > > Seth Johnson wrote: > > Hello guys, > > > > I've setup a BioSQL to hold sequences of interest parsed from NCBI > > genbank release. I also have another proprietary schema that holds > > experimental and alignment data. I would like to connect the > > proprietary schema to BioSQL one using Hibernate persistence, so that > > objects from my database would contain linkages to sequence data in > > biosql. Wiki mentions that one need change "only the mapping files > > that tell Hibernate how to translate between objects and tables." Can > > anyone elaborate on that topic a little or point me to a tutorial or > > some other place that discusses the concept? > > _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From sgerster at student.ethz.ch Wed Nov 8 08:14:39 2006 From: sgerster at student.ethz.ch (Gerster Sarah) Date: Wed, 8 Nov 2006 09:14:39 +0100 Subject: [Biojava-l] reading paptides from a fasta file Message-ID: Hi! I'm trying to read peptides from a fasta file: >id|0|0.9992|1 ASITENGGAEEESVAK >id|1|0.9953|1 ASITENGGAEEESVAK >id|2|0.9998|1 ASNASSAGDEVDNVATSSK >id|3|0.9998|1 EAAAAEEPQPSDEGDVVAK >id|4|0.9998|1 EAAAAEEPQPSDEGDVVAK .... I would like to have all peptides somewhere in the memory. I need, their id, the sequence and the 2 numbers at the end (e.g. id = 0, probability = 0.9992, rank = 1 for the first entry in the file). I tried to use readFastaProtein... but I guess I don't use it right. Anyway, I get the sequences, but I don't get any of the other infomations I want... Here is my code: try { BufferedReader br = new BufferedReader(new FileReader(file_name)); RichSequenceIterator rich_stream = RichSequence.IOTools.readFastaProtein(br,null); while(rich_stream.hasNext()) { RichSequence rich_seq = rich_stream.nextRichSequence(); System.out.println(rich_seq.toString()); System.out.println(rich_seq.getAccession()); System.out.println(rich_seq.getAlphabet()); System.out.println(rich_seq.getAnnotation()); System.out.println(rich_seq.getName()); System.out.println(rich_seq.getDescription()); System.out.println(rich_seq.getIdentifier()); System.out.println(rich_seq.seqString()); } } catch(Exception e) { System.err.println("Bug while reading the sequences from the FASTA file"); } Here's the output (for the first entry in the fasta file): id|0:1/0.9992 0 org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 1df073d 1 null null ASITENGGAEEESVAK Can anyone tell me what's going wrong? Is there already a function to put all the sequences directly in the memory (like a HashSet) while reading them? Cheers Sarah From dreher at molgen.mpg.de Wed Nov 8 12:39:20 2006 From: dreher at molgen.mpg.de (Felix Dreher) Date: Wed, 08 Nov 2006 13:39:20 +0100 Subject: [Biojava-l] reading paptides from a fasta file In-Reply-To: References: Message-ID: <4551CFF8.9050507@molgen.mpg.de> Hi Sarah, just a few comments / guesses: maybe there are other approaches, but you could follow the FASTA-format BioJavaX understands, e.g.: |>gi|||| | http://biojava.org/wiki/BioJava:BioJavaXDocs#Reading (chapter 8.2.1) So, if your file would look like this: >gi|0|namespace|null|1 0.9992 ASITENGGAEEESVAK >gi|1|namespace|null|1 0.9953 ASITENGGAEEESVAK . . . you could use: System.out.println("id: "+rich_seq.getIdentifier()); System.out.println("rank: "+rich_seq.getName()); System.out.println("probability: "+rich_seq.getDescription()); System.out.println("sequence: "+rich_seq.seqString()); to get the data. However, 'rank' or 'probability' actually would be annotations of the sequence, so when processing the data (e.g. storing in a database), one would store these data as annotations. - As for Java-style / naming conventions for variables, the 'Camel-Case' is recommended, e.g.richSeq instead of rich_seq. - To get the alphabet: System.out.println("alphabet: "+rich_seq.getAlphabet().getName()); - Also maybe you should use the default namespace instead of null: RichSequenceIterator rich_stream = RichSequence.IOTools.readFastaProtein(br,RichObjectFactory.getDefaultNamespace()); Cheers, Felix Gerster Sarah wrote: > Hi! > > I'm trying to read peptides from a fasta file: > >> id|0|0.9992|1 >> > ASITENGGAEEESVAK > >> id|1|0.9953|1 >> > ASITENGGAEEESVAK > >> id|2|0.9998|1 >> > ASNASSAGDEVDNVATSSK > >> id|3|0.9998|1 >> > EAAAAEEPQPSDEGDVVAK > >> id|4|0.9998|1 >> > EAAAAEEPQPSDEGDVVAK > .... > I would like to have all peptides somewhere in the memory. I need, their id, the sequence and the 2 numbers at the end (e.g. id = 0, probability = 0.9992, rank = 1 for the first entry in the file). > > I tried to use readFastaProtein... but I guess I don't use it right. Anyway, I get the sequences, but I don't get any of the other infomations I want... > > Here is my code: > try > { > BufferedReader br = new BufferedReader(new FileReader(file_name)); > RichSequenceIterator rich_stream = RichSequence.IOTools.readFastaProtein(br,null); > while(rich_stream.hasNext()) > { > RichSequence rich_seq = rich_stream.nextRichSequence(); > System.out.println(rich_seq.toString()); > System.out.println(rich_seq.getAccession()); > System.out.println(rich_seq.getAlphabet()); > System.out.println(rich_seq.getAnnotation()); > System.out.println(rich_seq.getName()); > System.out.println(rich_seq.getDescription()); > System.out.println(rich_seq.getIdentifier()); > System.out.println(rich_seq.seqString()); > } > } > catch(Exception e) > { > System.err.println("Bug while reading the sequences from the FASTA file"); > } > > > Here's the output (for the first entry in the fasta file): > id|0:1/0.9992 > 0 > org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 1df073d > > 1 > null > null > ASITENGGAEEESVAK > > > Can anyone tell me what's going wrong? > Is there already a function to put all the sequences directly in the memory (like a HashSet) while reading them? > > Cheers > > Sarah > > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > > -- Felix Dreher Max Planck Institute for Molecular Genetics Department of Vertebrate Genomics Bioinformatics Group Ihnestr. 73 D-14195 Berlin Phone: +49 30 - 8413 1682 Mobile: +49 163 - 754 24 26 E-mail: dreher at molgen.mpg.de www.molgen.mpg.de/~lh_bioinf From myammad at gmail.com Wed Nov 8 14:50:49 2006 From: myammad at gmail.com (Ammad Ud Din) Date: Wed, 8 Nov 2006 19:50:49 +0500 Subject: [Biojava-l] New To BioJava.org Message-ID: <887d6f690611080650j3a0f6caah610768dbb7dbe498@mail.gmail.com> Hi, i am a student of bs-bioinformatics from Muhammad Ali Jinnah University, islamabad Pakistan.I am curently taking a course in Java here at my university so i want to do work in java particularly in BioJava.I would like to welcome suggestions regarding my final project in this course and also would like to contribute as well. take care & best wishes, -- Ammad From mark.schreiber at novartis.com Thu Nov 9 01:53:37 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 9 Nov 2006 09:53:37 +0800 Subject: [Biojava-l] New To BioJava.org Message-ID: Hi - If you take a look at the API docs and the cookbook in www.biojava.org you will get an idea of what biojava can do and probably come up with a project from there. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 "Ammad Ud Din" Sent by: biojava-l-bounces at lists.open-bio.org 11/08/2006 10:50 PM To: biojava-l at lists.open-bio.org cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] New To BioJava.org Hi, i am a student of bs-bioinformatics from Muhammad Ali Jinnah University, islamabad Pakistan.I am curently taking a course in Java here at my university so i want to do work in java particularly in BioJava.I would like to welcome suggestions regarding my final project in this course and also would like to contribute as well. take care & best wishes, -- Ammad _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From varvenne at genoway.com Mon Nov 13 10:54:07 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 13 Nov 2006 11:54:07 +0100 Subject: [Biojava-l] Any memory-optimised blast parser available ? Message-ID: Hello, I'm trying to parse blast result files from a remote blast on NCBI databases. In order to do so, i'm using biojava XML parser like this : ----------- InputStream is = new FileInputStream(blastFile); BlastXMLParserFacade parser = new BlastXMLParserFacade(); SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); parser.setContentHandler(adapter); List results = new ArrayList(); SearchContentHandler builder = new BlastLikeSearchBuilder(results, new DummySequenceDB("queries"), new DummySequenceDBInstallation()); adapter.setSearchContentHandler(builder); // Here is the method that throws 'OutOfMemoryException' parser.parse(new InputSource(is)); ----------- While blasting a genomic sequence (i've tried with 50Kb long sequences max), I've got an OutOfMemory exception. Does anyone know a way to resolve this ? (this aim is not to dividde my genomic locus in too many parts, 50Kb is a quarter of my genomic...) Thanks, Regards, Benoit -- Benoit Varvenne, Bioinformatics pearson in charge, GenOway - Lyon (France) From ayates at ebi.ac.uk Mon Nov 13 11:28:29 2006 From: ayates at ebi.ac.uk (Andy Yates) Date: Mon, 13 Nov 2006 11:28:29 +0000 Subject: [Biojava-l] Any memory-optimised blast parser available ? In-Reply-To: References: Message-ID: <455856DD.9040605@ebi.ac.uk> Hi, Have you tried increasing the amount of memory the Java virtual machine has available? The problem with Java is that it starts with a default memory limit of approx. 128MB which if you've got a memory intensive process will not be enough. When running your program try adding the option -Xmx256M So if my class was called Main.class my command line would be: java -Xmx256M -cp .:biojava.jar Main Or if you're running this from ant then there is an attribute maxmemory which can be specified in the task. Hope that helps Andy Benoit VARVENNE wrote: > Hello, > > I'm trying to parse blast result files from a remote blast on NCBI > databases. > In order to do so, i'm using biojava XML parser like this : > > ----------- > InputStream is = new FileInputStream(blastFile); > BlastXMLParserFacade parser = new BlastXMLParserFacade(); > SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); > > parser.setContentHandler(adapter); > > List results = new ArrayList(); > > SearchContentHandler builder = new BlastLikeSearchBuilder(results, > new DummySequenceDB("queries"), new > DummySequenceDBInstallation()); > > adapter.setSearchContentHandler(builder); > > // Here is the method that throws 'OutOfMemoryException' > parser.parse(new InputSource(is)); > ----------- > > While blasting a genomic sequence (i've tried with 50Kb long sequences max), > I've got an OutOfMemory exception. > > Does anyone know a way to resolve this ? (this aim is not to dividde my > genomic locus in too many parts, 50Kb is a quarter of my genomic...) > > Thanks, > Regards, > > Benoit > > From varvenne at genoway.com Mon Nov 13 12:39:34 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 13 Nov 2006 13:39:34 +0100 Subject: [Biojava-l] Any memory-optimised blast parser available ? In-Reply-To: <455856DD.9040605@ebi.ac.uk> Message-ID: Great ! Thanks a lot to all for your answers. I hadn't thought to that way of solving the problem. That runs well with -Xmx option. Thanks again, Regards, Benoit Le 13/11/06 12:28, ??Andy Yates?? a ?crit?: > Hi, > > Have you tried increasing the amount of memory the Java virtual machine > has available? The problem with Java is that it starts with a default > memory limit of approx. 128MB which if you've got a memory intensive > process will not be enough. > > When running your program try adding the option > > -Xmx256M > > So if my class was called Main.class my command line would be: > > java -Xmx256M -cp .:biojava.jar Main > > Or if you're running this from ant then there is an attribute maxmemory > which can be specified in the task. > > Hope that helps > > Andy > > Benoit VARVENNE wrote: >> Hello, >> >> I'm trying to parse blast result files from a remote blast on NCBI >> databases. >> In order to do so, i'm using biojava XML parser like this : >> >> ----------- >> InputStream is = new FileInputStream(blastFile); >> BlastXMLParserFacade parser = new BlastXMLParserFacade(); >> SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); >> >> parser.setContentHandler(adapter); >> >> List results = new ArrayList(); >> >> SearchContentHandler builder = new BlastLikeSearchBuilder(results, >> new DummySequenceDB("queries"), new >> DummySequenceDBInstallation()); >> >> adapter.setSearchContentHandler(builder); >> >> // Here is the method that throws 'OutOfMemoryException' >> parser.parse(new InputSource(is)); >> ----------- >> >> While blasting a genomic sequence (i've tried with 50Kb long sequences max), >> I've got an OutOfMemory exception. >> >> Does anyone know a way to resolve this ? (this aim is not to dividde my >> genomic locus in too many parts, 50Kb is a quarter of my genomic...) >> >> Thanks, >> Regards, >> >> Benoit >> >> > From jolyon.holdstock at ogt.co.uk Mon Nov 13 11:33:43 2006 From: jolyon.holdstock at ogt.co.uk (Jolyon Holdstock) Date: Mon, 13 Nov 2006 11:33:43 -0000 Subject: [Biojava-l] Any memory-optimised blast parser available ?[Scanned] Message-ID: <588D0DD225D05746B5D8CAE1BE971F3F0111DCE1@EUCLID.internal.ogtip.com> Can you use the -Xmx flag to add more memory to the JRE? -----Original Message----- From: biojava-l-bounces at lists.open-bio.org [mailto:biojava-l-bounces at lists.open-bio.org] On Behalf Of Benoit VARVENNE Sent: 13 November 2006 10:54 To: biojava-l Subject: [Biojava-l] Any memory-optimised blast parser available ?[Scanned] Hello, I'm trying to parse blast result files from a remote blast on NCBI databases. In order to do so, i'm using biojava XML parser like this : ----------- InputStream is = new FileInputStream(blastFile); BlastXMLParserFacade parser = new BlastXMLParserFacade(); SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); parser.setContentHandler(adapter); List results = new ArrayList(); SearchContentHandler builder = new BlastLikeSearchBuilder(results, new DummySequenceDB("queries"), new DummySequenceDBInstallation()); adapter.setSearchContentHandler(builder); // Here is the method that throws 'OutOfMemoryException' parser.parse(new InputSource(is)); ----------- While blasting a genomic sequence (i've tried with 50Kb long sequences max), I've got an OutOfMemory exception. Does anyone know a way to resolve this ? (this aim is not to dividde my genomic locus in too many parts, 50Kb is a quarter of my genomic...) Thanks, Regards, Benoit -- Benoit Varvenne, Bioinformatics pearson in charge, GenOway - Lyon (France) _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l This email has been scanned by Oxford Gene Technology Security Systems. From dunarel at gmx.net Sat Nov 18 02:48:41 2006 From: dunarel at gmx.net (Dunarel Badescu) Date: Sat, 18 Nov 2006 03:48:41 +0100 Subject: [Biojava-l] New To BioJava.org, right in the question. In-Reply-To: References: Message-ID: <20061118024841.274400@gmx.net> Hello, My name is Dunarel Badescu, a student at UQAM University in Montreal,Quebec,Canada in Graduate Diploma of Bioinformatics. Currently I am using BioJavaX and BioSql for my session project. I have parsed NCBI GeneBank files using RichSequences. I then inserted the sequences into the database. Several problems arise: 1) A bug in the code pulled from CVS: In class BioSQLRichObjectBuilder: I had to append some code for the program to find the right constructors: // Get the results Object result = this.uniqueResult.invoke(query, null); // Return the found object, if found if (result!=null) return result; // Create, persist and return the new object otherwise else { /*NEW CODE*/ if (SimpleDocRef.class.isAssignableFrom(clazz)) { // convert String to List constructor ourParamsList.set(0, DocRefAuthor.Tools.parseAuthorString((String)ourParamsList.get(0))); } // Load the class 2) Meny memory problems, after inserting 800 sequences it slows extremely so performance is degraded. I thought of a hibernate cache problem and tried to turn it off by setting some parameters: 20 false false false false org.hibernate.cache.NoCacheProvider false false 3 to no much benefit. Then I observed some small performance gain by using : session.save("Sequence",rs); // persist the sequence session.getTransaction().commit(); session.flush(); session.evict(rs); The session.evict(rs); Any atempt to dealocate memory by closing the session, the session factory either generates errors or it will generate on reopening. So as a last resort I fragmented the original aprox. 130 mb containing one taxon from ncbi in 38 files 1000 sequences each and made a dos batch script executing the program in the commad line for each file. So that way it works but: 3) Inserting rows sometimes generates exceptions in the references table. After taking it more closely I found that by disabling the unique constraint on the dbxref_id on references table solves all the remaining problems. The coment about it on the original code is: -- No two references can reference the same reference database entry -- (dbxref_id). This is where the MEDLINE id goes: PUBMED:123456. and the modification is: --UNIQUE ( dbxref_id ) , I must say that the script for creating the biosql schema is version 1.29 from the cvs, the most recent I found. And I must say that for running the script on Postgresql 8.1.5 I had to modify each create table statement adding with oids at the end, now that 8.1.5 doesn't create oids by default. It must have be a more elegant aproch to all these problems isn't it? At least the constraint situation, I mean is it normal to exist or not as it seems. I wish You all the best and thank you for your work which is most useful and scarce as a resource. -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer From sanges at biogem.it Sat Nov 18 11:54:26 2006 From: sanges at biogem.it (Remo Sanges) Date: Sat, 18 Nov 2006 11:54:26 +0000 Subject: [Biojava-l] Fellowships for Junior Scientists In-Reply-To: <20061118024841.274400@gmx.net> References: <20061118024841.274400@gmx.net> Message-ID: <455EF472.1000903@biogem.it> Apologies for the off topic post and for the crossposting... AREA Science Park (http://www.area.trieste.it/opencms/opencms/area/en/) and CBM (http://www.cbm.fvg.it/?lang=en_US) are launching a mobility initiative aimed at attracting international scientists to work with the biomedical research community of Trieste. Research areas: * Biostatistics * Systems Biology * Algorithm Development The fellowships are funded by AREA Science Park and the CBM - Consortium for Molecular Biomedicine as part of an international mobility programme run by AREA Science Park and the CBM. The programme aims at attracting young scientists to the Friuli Venezia Giulia Region and adding them to the community of researchers operating in Trieste in the field of biomedicine. CBM and AREA Science Park are two research institutes recognised by the Ministry of Education, Universities and Research. Here there are laboratories integrating dry and wet lab research and developing a wide research program encompassing functional and comparative genomics, bioinformatics database, software development and algorithm development. The laboratories are already integrated in international collaborative projects tackling non-coding RNA genes, regulatory elements, and bioinformatics workflow management systems. For further information: http://www.cbm.fvg.it/?page=mobility&lang=en_US&id=2 Regards Remo Sanges From varvenne at genoway.com Mon Nov 20 16:19:38 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Mon, 20 Nov 2006 17:19:38 +0100 Subject: [Biojava-l] Any ORF Finder available ? Message-ID: Hello, I'm a working on a biojava project and i'm searching for a way to include an ORF Finder in my code. The aim is to find ORFs on cDNA sequences (or partial ORFs on ESTs ones) Anyone can help me ? Is there a module with biojava to do so ? Do you know any free-to-dowload software (source code or compiled one) ? Thanks, Regards Beno?t. From mark.schreiber at novartis.com Tue Nov 21 03:12:03 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Tue, 21 Nov 2006 11:12:03 +0800 Subject: [Biojava-l] Any ORF Finder available ? Message-ID: Hi - A quick and dirty way is to make a six frame translation (http://biojava.org/wiki/BioJava:Cookbook:Translation:SixFrames). Probably a better way is to scan in six frames (using a WindowedSymbolList) looking for a start codon and then look for the appropriate stop codon. You will want to define the start and stop codons as Symbols from the codon (DNAxDNAxDNA) alphabet. You can do this as follows: FiniteAlphabet codonAlpha = DNATools.getCodonAlphabet(); //make a ambiguity symbol for ATG, GTG and TTG codons //first make the A or G or T ambiguity BasisSymbol Set syms = new HashSet(); syms.add(DNATools.a()); syms.add(DNATools.t()); syms.add(DNATools.g()); Symbol amb = DNATools.getDNA().getAmbiguity(syms) ; //now make the [A|G|T] TG codon List l = new ArrayList(); l.add(amb); l.add(DNATools.t()); l.add(DNATools.g()); Symbol startCodon = codonAlpha.getSymbol(l); //You would construct the stop codons in a similar manner although you probably can't merge them all into one. The above example shows how you can use a single symbol to represent all 3 common bacterial start codons. You could also make all 3 seperatly and test them individually. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 Benoit VARVENNE Sent by: biojava-l-bounces at lists.open-bio.org 11/21/2006 12:19 AM To: biojava-l cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Any ORF Finder available ? Hello, I'm a working on a biojava project and i'm searching for a way to include an ORF Finder in my code. The aim is to find ORFs on cDNA sequences (or partial ORFs on ESTs ones) Anyone can help me ? Is there a module with biojava to do so ? Do you know any free-to-dowload software (source code or compiled one) ? Thanks, Regards Beno?t. _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From weelainy at hotmail.com Tue Nov 21 17:44:26 2006 From: weelainy at hotmail.com (Elaine Forbes) Date: Tue, 21 Nov 2006 17:44:26 +0000 Subject: [Biojava-l] remove me from your list Message-ID: Hi I no longer wish to recieve emails from the biojava email list- please remove me. THanks Elaine _________________________________________________________________ Windows Live? Messenger has arrived. Click here to download it for free! http://imagine-msn.com/messenger/launch80/?locale=en-gb From markjschreiber at gmail.com Wed Nov 22 06:35:54 2006 From: markjschreiber at gmail.com (Mark Schreiber) Date: Wed, 22 Nov 2006 14:35:54 +0800 Subject: [Biojava-l] Open JDK Message-ID: <93b45ca50611212235r265b4730sea68dfb6b41fb4e0@mail.gmail.com> Dear All - Everyone knows that BioJava is open-source but you may not know that the Java JDK is in the process of being made open-source several parts already are including the javac and HotSpot runtime. https://openjdk.dev.java.net/ Next time you think the GenBank parser is slow maybe you could optimise the HotSpot runtime instead : ) - Mark From kingsulaman at hotmail.com Thu Nov 23 13:02:31 2006 From: kingsulaman at hotmail.com (Sulaman Malik) Date: Thu, 23 Nov 2006 18:02:31 +0500 Subject: [Biojava-l] Looking For Project Message-ID: hi: This is Sulaman Malik BS(Bio-informatics) Student of MAJU,Islamabad Pakistan. I am looking for a good semester project which i could impelement using the Java as a platefarm,so give me a lsit of bio-projects or any bio-project so that i could go further. From varvenne at genoway.com Fri Nov 24 16:19:27 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Fri, 24 Nov 2006 17:19:27 +0100 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) Message-ID: Hello, I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with the code put at the end of this mail. I've tried this with a blastN query and there i got no trouble. However, i've tried to do exactly the same thing with a BlastP query and i've got the exception cited at the end of this mail. I've verified and the two infiles (blastn/blastp) seem to have the same structures (except that one is for prot so data are different). (Please find them as attached if you're used to this). Can someone help me ? I don't understand why it works in a case and not in the other one ... Thanks a lot, Cheers, Beno?t. ------------------- My code : ----- InputStream is = new FileInputStream(blastFile); // blastFile is the xml file, output of my blast //make a BlastLikeSAXParser BlastXMLParserFacade parser = new BlastXMLParserFacade(); //make the SAX event adapter that will pass events to a Handler. SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); //set the parsers SAX event adapter parser.setContentHandler(adapter); //The list to hold the SeqSimilaritySearchResults List results = new ArrayList(); //create the SearchContentHandler that will build SeqSimilaritySearchResults //in the results List SearchContentHandler builder = new BlastLikeSearchBuilder(results, new DummySequenceDB("queries"), new DummySequenceDBInstallation()); //register builder with adapter adapter.setSearchContentHandler(builder); parser.parse(new InputSource(is)); // From here come the Exception ------------------- ------------------- The exception : ---- org.xml.sax.SAXParseException: Une d?claration XML peut commencer des entit?s uniquement. at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376) at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3364) at org.apache.crimson.parser.Parser2.maybePI(Parser2.java:1140) at org.apache.crimson.parser.Parser2.maybeMisc(Parser2.java:1266) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:671) at org.apache.crimson.parser.Parser2.parse(Parser2.java:337) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) at org.biojava.bio.program.sax.blastxml.BlastXMLParserFacade.parse(BlastXMLPars erFacade.java:180) From smh1008 at cam.ac.uk Fri Nov 24 17:08:54 2006 From: smh1008 at cam.ac.uk (David Huen) Date: 24 Nov 2006 17:08:54 +0000 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) In-Reply-To: References: Message-ID: On Nov 24 2006, Benoit VARVENNE wrote: >Hello, > >I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with >the code put at the end of this mail. > >I've tried this with a blastN query and there i got no trouble. >However, i've tried to do exactly the same thing with a BlastP query and >i've got the exception cited at the end of this mail. > > I've verified and the two infiles (blastn/blastp) seem to have the same > structures (except that one is for prot so data are different). (Please > find them as attached if you're used to this). > >Can someone help me ? I don't understand why it works in a case and not in >the other one ... > I am uncertain whether BlastXMLFacade will actually support a protein sequence parse. It was originally developed to handle blastn. Anyone else tried it with blastp? I'm offline till Sunday so I can't reply till then. Regards, David Huen From varvenne at genoway.com Fri Nov 24 17:53:49 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Fri, 24 Nov 2006 18:53:49 +0100 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) In-Reply-To: Message-ID: Le 24/11/06 18:08, ??David Huen?? a ?crit?: > On Nov 24 2006, Benoit VARVENNE wrote: > >> Hello, >> >> I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with >> the code put at the end of this mail. >> >> I've tried this with a blastN query and there i got no trouble. >> However, i've tried to do exactly the same thing with a BlastP query and >> i've got the exception cited at the end of this mail. >> >> I've verified and the two infiles (blastn/blastp) seem to have the same >> structures (except that one is for prot so data are different). (Please >> find them as attached if you're used to this). >> >> Can someone help me ? I don't understand why it works in a case and not in >> the other one ... >> > I am uncertain whether BlastXMLFacade will actually support a protein > sequence parse. It was originally developed to handle blastn. Anyone else > tried it with blastp? > > I'm offline till Sunday so I can't reply till then. > > Regards, > David Huen > David, As BlastLikeSAXParser seemed to support older versions of NCBI blastP (see "http://www.biojava.org/wiki/BioJava:Tutorial:Blast-like_Parsing_Cook_Book#S tep_A_-_Create_an_application_that_sets_up_the_parser_and_does_the_parsing") , i'll be surprised if BlastXMLParserFacade does not. However, i'll be very interested if someone's got any information. Can't it be dtd problem ? If yes, can we update dtd sources ? Cheers, Beno?t. From karl_harvey at hotmail.com Fri Nov 24 01:40:44 2006 From: karl_harvey at hotmail.com (Karl Harvey) Date: Thu, 23 Nov 2006 20:40:44 -0500 Subject: [Biojava-l] Query to blast.. on Internet. Message-ID: An HTML attachment was scrubbed... URL: From varvenne at genoway.com Fri Nov 24 17:04:01 2006 From: varvenne at genoway.com (Benoit VARVENNE) Date: Fri, 24 Nov 2006 18:04:01 +0100 Subject: [Biojava-l] A problem parsing Blast XML output (blastN vs. blastP) In-Reply-To: <45672448.7060906@ebi.ac.uk> Message-ID: Ooooo sorry i hadn't noticed that. Here is the traduction (home made...) "org.xml.sax.SAXParseException: An XML declaration can only begin with an entity" The problem is that my two files (attached this time) don't seem to differ. Have you got an xml validation tool to recommend me ? Cheers, Beno?t Le 24/11/06 17:56, ??Richard Holland?? a ?crit?: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Unfortunately the exception you are getting is in French and sadly my 1 > year of French lessons in school failed to make any impact on my ability > to understand it. :) > > But, my guess would be that something is wrong with the BlastP output, > as the exception is an XML parser one and not a BioJava one. It's most > likely that the BlastP report is not valid XML. Try running it through > an XML validation tool to check. > > cheers, > Richard > > Benoit VARVENNE wrote: >> Hello, >> >> I'm parsing blast results using biojava1.5 and a BlastXMLParserFacade with >> the code put at the end of this mail. >> >> I've tried this with a blastN query and there i got no trouble. >> However, i've tried to do exactly the same thing with a BlastP query and >> i've got the exception cited at the end of this mail. >> >> I've verified and the two infiles (blastn/blastp) seem to have the same >> structures (except that one is for prot so data are different). (Please find >> them as attached if you're used to this). >> >> Can someone help me ? I don't understand why it works in a case and not in >> the other one ... >> >> Thanks a lot, >> Cheers, >> >> Beno?t. >> >> >> ------------------- >> My code : >> ----- >> InputStream is = new FileInputStream(blastFile); >> // blastFile is the xml file, output of my blast >> >> //make a BlastLikeSAXParser >> BlastXMLParserFacade parser = new BlastXMLParserFacade(); >> //make the SAX event adapter that will pass events to a Handler. >> SeqSimilarityAdapter adapter = new SeqSimilarityAdapter(); >> >> //set the parsers SAX event adapter >> parser.setContentHandler(adapter); >> >> //The list to hold the SeqSimilaritySearchResults >> List results = new ArrayList(); >> >> //create the SearchContentHandler that will build >> SeqSimilaritySearchResults >> //in the results List >> SearchContentHandler builder = new BlastLikeSearchBuilder(results, >> new DummySequenceDB("queries"), new >> DummySequenceDBInstallation()); >> >> //register builder with adapter >> adapter.setSearchContentHandler(builder); >> >> parser.parse(new InputSource(is)); // From here come the Exception >> >> ------------------- >> >> >> ------------------- >> The exception : >> ---- org.xml.sax.SAXParseException: An XML declaration can only begin with an entity >> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3376) >> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3364) >> at org.apache.crimson.parser.Parser2.maybePI(Parser2.java:1140) >> at org.apache.crimson.parser.Parser2.maybeMisc(Parser2.java:1266) >> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:671) >> at org.apache.crimson.parser.Parser2.parse(Parser2.java:337) >> at >> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) >> at >> org.biojava.bio.program.sax.blastxml.BlastXMLParserFacade.parse(BlastXMLPars >> erFacade.java:180) >> >> >> _______________________________________________ >> Biojava-l mailing list - Biojava-l at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/biojava-l >> >> > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFZyRI4C5LeMEKA/QRAmQoAJoD1RjbKgqOsiRVW1rPBrYDcaAObgCglHYI > 48o/exGfv1xSSnLzMMjPKxo= > =tRNi > -----END PGP SIGNATURE----- > -------------- next part -------------- A non-text attachment was scrubbed... Name: BlastN_XML_ouput.txt Type: application/octet-stream Size: 2959941 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: BlastP_XML_output.txt Type: application/octet-stream Size: 1961596 bytes Desc: not available URL: From myammad at gmail.com Mon Nov 27 14:41:39 2006 From: myammad at gmail.com (Ammad Ud Din) Date: Mon, 27 Nov 2006 19:41:39 +0500 Subject: [Biojava-l] Looking forward for suggestions Message-ID: <887d6f690611270641x3aeefb63pc537210cda242b30@mail.gmail.com> Hi EveryBody, i am a final year Undergraduate student of bioinformatics.I am currently carrying a course in java so i want to contribute on open source projects.can anybody suggest me what type of open source projects are going on and how could i contribute in these....waiting for the reply..............tc bestwishes ----Ammad From mittalashr at yahoo.com Tue Nov 28 04:54:35 2006 From: mittalashr at yahoo.com (ashish mittal) Date: Mon, 27 Nov 2006 20:54:35 -0800 (PST) Subject: [Biojava-l] Using REstriction Mapper Message-ID: <20061128045435.9535.qmail@web52315.mail.yahoo.com> Hi all, I am trying to use restriction mapper to search for a list of resctriction enzymes in a given sequence. Can some one send me some sample code that does the same. I tried following and this code gives exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/utils/bytecode/CodeException at org.biojava.bio.seq.FeatureFilter$OnlyChildren.(FeatureFilter.java:1270) at org.biojava.bio.seq.FeatureFilter.(FeatureFilter.java:1813) at org.biojava.bio.seq.SimpleFeatureHolder.(SimpleFeatureHolder.java:52) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:116) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:143) at org.biojava.bio.molbio.RestrictionMapper.annotate(RestrictionMapper.java:115) at seed.rs.rsTry.Searcher.search(Searcher.java:91) at seed.rs.rsTry.Searcher.main(Searcher.java:101) CODE: public class Searcher { ThreadPool tPool = new ThreadPool() { public void addRequest(Runnable runnable) { } public void startThreads() { } public void stopThreads() { } public void waitForThreads() { } }; RestrictionMapper mapper = new RestrictionMapper(tPool); /** Creates a new instance of Searcher */ public Searcher() { } public void search(){ try { RestrictionEnzyme res1 = new RestrictionEnzyme("enz1",DNATools.createDNA("agtg"),0,0); RestrictionEnzyme res2 = new RestrictionEnzyme("enz2",DNATools.createDNA("gatt"),0,0); RestrictionEnzyme res3 = new RestrictionEnzyme("enz3",DNATools.createDNA("gatg"),0,0); mapper.addEnzyme(res1); mapper.addEnzyme(res2); mapper.addEnzyme(res3); RestrictionEnzymeManager.register(res1,new TreeSet()); RestrictionEnzymeManager.register(res2,new TreeSet()); RestrictionEnzymeManager.register(res3,new TreeSet()); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } catch (IllegalAlphabetException ex) { ex.printStackTrace(); } //RestrictionEnzymeManager resManager = new RestrictionEnzymeManager(); try { Sequence dnaSeq = DNATools.createDNASequence("agtgattcgtatcgattcggatggtcattttt","my_dnaseq"); Sequence newSeq = mapper.annotate(dnaSeq); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } } public static void main (String args[]) { Searcher searcherObj = new Searcher(); searcherObj.search(); } } Thanks in Advance. Ashish ____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited From mark.schreiber at novartis.com Tue Nov 28 05:55:43 2006 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Tue, 28 Nov 2006 13:55:43 +0800 Subject: [Biojava-l] Using REstriction Mapper Message-ID: Hi - Looks like you forgot to include the bytecode.jar on your classpath. Take a look at these instructions : http://biojava.org/wiki/BioJava:GetStarted - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 ashish mittal Sent by: biojava-l-bounces at lists.open-bio.org 11/28/2006 12:54 PM To: biojava-l at lists.open-bio.org cc: (bcc: Mark Schreiber/GP/Novartis) Subject: [Biojava-l] Using REstriction Mapper Hi all, I am trying to use restriction mapper to search for a list of resctriction enzymes in a given sequence. Can some one send me some sample code that does the same. I tried following and this code gives exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/utils/bytecode/CodeException at org.biojava.bio.seq.FeatureFilter$OnlyChildren.(FeatureFilter.java:1270) at org.biojava.bio.seq.FeatureFilter.(FeatureFilter.java:1813) at org.biojava.bio.seq.SimpleFeatureHolder.(SimpleFeatureHolder.java:52) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:116) at org.biojava.bio.seq.impl.ViewSequence.(ViewSequence.java:143) at org.biojava.bio.molbio.RestrictionMapper.annotate(RestrictionMapper.java:115) at seed.rs.rsTry.Searcher.search(Searcher.java:91) at seed.rs.rsTry.Searcher.main(Searcher.java:101) CODE: public class Searcher { ThreadPool tPool = new ThreadPool() { public void addRequest(Runnable runnable) { } public void startThreads() { } public void stopThreads() { } public void waitForThreads() { } }; RestrictionMapper mapper = new RestrictionMapper(tPool); /** Creates a new instance of Searcher */ public Searcher() { } public void search(){ try { RestrictionEnzyme res1 = new RestrictionEnzyme("enz1",DNATools.createDNA("agtg"),0,0); RestrictionEnzyme res2 = new RestrictionEnzyme("enz2",DNATools.createDNA("gatt"),0,0); RestrictionEnzyme res3 = new RestrictionEnzyme("enz3",DNATools.createDNA("gatg"),0,0); mapper.addEnzyme(res1); mapper.addEnzyme(res2); mapper.addEnzyme(res3); RestrictionEnzymeManager.register(res1,new TreeSet()); RestrictionEnzymeManager.register(res2,new TreeSet()); RestrictionEnzymeManager.register(res3,new TreeSet()); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } catch (IllegalAlphabetException ex) { ex.printStackTrace(); } //RestrictionEnzymeManager resManager = new RestrictionEnzymeManager(); try { Sequence dnaSeq = DNATools.createDNASequence("agtgattcgtatcgattcggatggtcattttt","my_dnaseq"); Sequence newSeq = mapper.annotate(dnaSeq); } catch (IllegalSymbolException ex) { ex.printStackTrace(); } } public static void main (String args[]) { Searcher searcherObj = new Searcher(); searcherObj.search(); } } Thanks in Advance. Ashish ____________________________________________________________________________________ Yahoo! Music Unlimited Access over 1 million songs. http://music.yahoo.com/unlimited _______________________________________________ Biojava-l mailing list - Biojava-l at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-l From kingsulaman at hotmail.com Mon Nov 27 14:44:11 2006 From: kingsulaman at hotmail.com (Sulaman Nawaz) Date: Mon, 27 Nov 2006 14:44:11 +0000 Subject: [Biojava-l] Willing to Contribute in BioJava In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: