From holland at eaglegenomics.com Mon Jan 4 05:57:54 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Mon, 4 Jan 2010 10:57:54 +0000 Subject: [Biojava-l] BioJava 2010 Hackathon Message-ID: Hi all, For those attending the 2010 BioJava hackathon at the Wellcome Trust Genome Campus, near Cambridge, all details can be found on this wiki: http://biojava.org/wiki/BioJava:Hackathon2010 If your name is not listed on the wiki but you are planning on attending, please let us know by Jan 12th latest. Due to security arrangements at the campus it is not possible to just turn up on the day. Subjects for the hackathon are open for discussion on the wiki. Looking forward to seeing you all there! cheers, Richard -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From andylu0320 at gmail.com Sat Jan 9 21:36:29 2010 From: andylu0320 at gmail.com (Andy Lu) Date: Sat, 9 Jan 2010 21:36:29 -0500 Subject: [Biojava-l] Jmol help Message-ID: <4a1a3f7d1001091836q1e084357v156a6dae902ba21f@mail.gmail.com> Hi, does anyone know how to add menu listener in JMol through JMol script? I tried using this: viewer.evalString ("set debugScript;"); viewer.evalString ("set ScriptCallback spacefill ;"); But is there a way to make the above to an "if" statement? Like if I click the "ball and stick" option in the menu, then something happens? Thanks! From andreas at sdsc.edu Sun Jan 10 07:20:28 2010 From: andreas at sdsc.edu (Andreas Prlic) Date: Sun, 10 Jan 2010 04:20:28 -0800 Subject: [Biojava-l] Jmol help In-Reply-To: <4a1a3f7d1001091836q1e084357v156a6dae902ba21f@mail.gmail.com> References: <4a1a3f7d1001091836q1e084357v156a6dae902ba21f@mail.gmail.com> Message-ID: <59a41c431001100420n58c786efv4c014984978d695a@mail.gmail.com> Hi Andy, Not sure what you mean - you mean you want you want to create a menu in a frame, which also contains a Jmol panel? Probably the easiest solution is to create a JMenu with JMenuItems, add actionListeners to them and these can trigger a script in Jmol. Have a look at this tutorial http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html Andreas On Sat, Jan 9, 2010 at 6:36 PM, Andy Lu wrote: > Hi, does anyone know how to add menu listener in JMol through JMol script? > > I tried using this: > > ? ? ? ?viewer.evalString ("set debugScript;"); > ? ? ? ?viewer.evalString ("set ScriptCallback spacefill ;"); > > But is there a way to make the above to an "if" statement? Like if I click > the "ball and stick" option in the menu, then something happens? > > Thanks! > _______________________________________________ > Biojava-l mailing list ?- ?Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > From chris at compbio.dundee.ac.uk Mon Jan 11 09:34:21 2010 From: chris at compbio.dundee.ac.uk (Chris Cole) Date: Mon, 11 Jan 2010 14:34:21 +0000 Subject: [Biojava-l] Error parsing ipi.HUMAN.fasta file In-Reply-To: References: <4B2BA575.5010007@compbio.dundee.ac.uk> <991F3D0D-0702-4EB7-9718-676986A1415E@eaglegenomics.com> <4B4B16A6.7030406@compbio.dundee.ac.uk> Message-ID: <4B4B36ED.9060105@compbio.dundee.ac.uk> [ posting back to biojava-l as omitted the address previously ] Ah, right. It wasn't clear on the wiki whether those were included or not with the 'all' package. It compiles fine now (with one warning) and through trial and error a buffer value of 2000 works with ipi.HUMAN.fasta as well as mouse and chicken. Thanks very much for your help. Chris On 11/01/10 12:31, Richard Holland wrote: > Hello. You need to make sure the support libraries are also on your classpath: > > http://www.biojava.org/wiki/BioJava:Download#Support_libraries > > cheers, > Richard > > On 11 Jan 2010, at 12:16, Chris Cole wrote: > >> Thanks for the reply, Richard. >> >> Just getting back to this problem. I've upped the buffer to 1000 bytes, but I can't get it to compile with ant. I get a whole slew of compile errors, there seems to be something missing, but I don't know how to solve it. Output from ant build follows: >> >> caterpillar: ~/Downloads/biojava-1.7/src> ant -f ../build.xml >> Buildfile: ../build.xml >> >> init: >> [echo] Building biojava-1.7 >> [echo] Java Home: /usr/java/jdk1.6.0_17/jre >> [echo] JUnit present: ${junit.present} >> [echo] JUnit supported by Ant: ${junit.support} >> [echo] HSQLDB driver present: ${sqlDriver.hsqldb} >> [echo] XSLT support: true >> >> prepare: >> >> prepare-biojava: >> >> compile-biojava: >> [javac] Compiling 1462 source files to /opt/Downloads/biojava-1.7/ant-build/classes/biojava >> [javac] /opt/Downloads/biojava-1.7/src/org/biojava/bio/dp/twohead/DPCompiler.java:55: package org.biojava.utils.bytecode does not exist >> [javac] import org.biojava.utils.bytecode.ByteCode; >> [javac] ^ >> [javac] /opt/Downloads/biojava-1.7/src/org/biojava/bio/dp/twohead/DPCompiler.java:56: package org.biojava.utils.bytecode does not exist >> [javac] import org.biojava.utils.bytecode.CodeClass; >> [javac] ^ >> [javac] /opt/Downloads/biojava-1.7/src/org/biojava/bio/dp/twohead/DPCompiler.java:57: package org.biojava.utils.bytecode does not exist >> [javac] import org.biojava.utils.bytecode.CodeException; >> [javac] ^ >> ...etc. >> >> I downloaded the biojava-1.7-all.jar, originally and I can't what else I need? >> >> I'm also trying to do this from within Eclipse, so any Eclipse-specific pointers would be much appreciated. >> Cheers, >> >> Chris >> >> On 18/12/09 16:58, Richard Holland wrote: >>> The FASTA parser has a buffer which it uses to read ahead to the next >>> complete line then back up before it actually parses it on the second >>> pass (in order to allow it to do things like hasNext()). The >>> exception shows that the size of that buffer is being exceeded, >>> causing it to fail to back up again afterwards. >>> >>> There's two cures - one is to rewrite the FASTA parser to buffer >>> things in a different way. The other is to open up >>> org/biojavax/bio/seq/io/FastaFormat.java in a text editor, search for >>> the line where it sets the buffer (somewhere around line 202 >>> according to the exception, in the readRichSequence() method - the >>> command to look for is 'mark'), and increase the buffer size to >>> something suitably large enough (it's currently set at 500 bytes). >>> Then recompile BioJava and it should work. >>> >>> cheers, Richard >>> >>> On 18 Dec 2009, at 15:53, Chris Cole wrote: >>> >>>> I'm wanting to parse a fasta file obtained from IPI using the code >>>> at the bottom of this message, but I get the following error: >>>> >>>> org.biojava.bio.BioException: Could not read sequence at >>>> org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:113) >>>> >>>> >> at test.readFasta(test.java:39) >>>> at test.main(test.java:18) Caused by: java.io.IOException: Mark >>>> invalid at java.io.BufferedReader.reset(BufferedReader.java:485) at >>>> org.biojavax.bio.seq.io.FastaFormat.readRichSequence(FastaFormat.java:202) >>>> >>>> >> at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110) >>>> ... 2 more >>>> >>>> Looking at the Fasta file itself and doing some tests, it seems to >>>> fail consistently at one or two entries /preceding/ an entry with a >>>> very long description line e.g.: >>>>> IPI:IPI00021421.4|SWISS-PROT:Q9UMR5-1|TREMBL:B0S868|ENSEMBL:ENSP00000382748;ENSP00000382749;ENSP00000382750;ENSP00000387679;ENSP00000388341;ENSP00000388618;ENSP00000389930;ENSP00000392885;ENSP00000393009;ENSP00000395242;ENSP00000395562;ENSP00000397025;ENSP00000399879;ENSP00000403820;ENSP00000406496;ENSP00000406566;ENSP00000408703;ENSP00000411007;ENSP00000411625;ENSP00000412827|REFSEQ:NP_005146|VEGA:OTTHUMP00000014775;OTTHUMP00000014776;OTTHUMP00000014778;OTTHUMP00000175028;OTTHUMP00000175029;OTTHUMP00000175030;OTTHUMP00000193135;OTTHUMP00000193136;OTTHUMP00000193138;OTTHUMP00000193964;OTTHUMP00000193965;OTTHUMP00000193967;OTTHUMP00000194391;OTTHUMP00000194392;OTTHUMP00000194394 >>>>> Tax_Id=9606 Gene_Symbol=PPT2 Isoform 1 of Lysosomal thioesterase >>>>> PPT2 >>>> MLGLWGQRLPAAWVLLLLPFLPLLLLAAPAPHRASYKPVIVVHGLFDSSYSFRHLLEYIN >>>> ETHPGTVVTVLDLFDGRESLRPLWEQVQGFREAVVPIMAKAPQGVHLICYSQGGLVCRAL >>>> LSVMDDHNVDSFISLSSPQMGQYGDTDYLKWLFPTSMRSNLYRICYSPWGQEFSICNYWH >>>> DPHHDDLYLNASSFLALINGERDHPNATVWRKNFLRVGHLVLIGGPDDGVITPWQSSFFG >>>> FYDANETVLEMEEQLVYLRDSFGLKTLLARGAIVRCPMAGISHTAWHSNRTLYETCIEPW LS >>>> >>>> Deleting the large entries allows the code to continue until it >>>> reaches another long description line. >>>> >>>> It also seems to be a feature of large Fasta files as reading the >>>> above sequence alone or as part of a small file is fine. >>>> >>>> Is this a known problem or am I doing something wrong? BTW I'm >>>> using biojava 1.7 and Java 1.6.0_17. Any help would be most >>>> appreciated. Cheers. >>>> >>>> code: import java.io.*; >>>> >>>> import org.biojava.bio.*; import org.biojavax.*; import >>>> org.biojavax.bio.seq.*; >>>> >>>> public class test { private static PrintStream o = System.out; >>>> >>>> public static void main(String[] args) { // TODO Auto-generated >>>> method stub readFasta(args[0]); } public static void >>>> readFasta(String filename) { try { o.println("Reading file: " + >>>> filename); //prepare a BufferedReader for file io BufferedReader br >>>> = new BufferedReader(new FileReader(filename)); >>>> >>>> // read Fasta file as BioJava RichSequence object Namespace ns = >>>> RichObjectFactory.getDefaultNamespace(); RichSequenceIterator iter >>>> = RichSequence.IOTools.readFastaProtein(br,ns); >>>> >>>> int numProteins = 0; while(iter.hasNext()) { ++numProteins; >>>> >>>> // Retrieve sequence and description data RichSequence seq = >>>> iter.nextRichSequence(); String ipi = >>>> seq.getName().substring(4,15); o.println(ipi); } o.println("Found >>>> " + numProteins + " in Fasta file"); } catch (FileNotFoundException >>>> ex) { //can't find file specified by args[0] ex.printStackTrace(); >>>> } catch (BioException ex) { //error parsing requested format >>>> ex.printStackTrace(); } } >>>> >>>> } > > -- > Richard Holland, BSc MBCS > Operations and Delivery Director, Eagle Genomics Ltd > T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com > http://www.eaglegenomics.com/ > -- Dr Chris Cole Senior Bioinformatics Research Officer School of Life Sciences Research University of Dundee Dow Street Dundee DD1 5EH Scotland, UK url: http://network.nature.com/profile/drchriscole e-mail: chris at compbio.dundee.ac.uk Tel: +44 (0)1382 388 721 The University of Dundee is a registered Scottish charity, No: SC015096 From andreas at sdsc.edu Mon Jan 18 11:37:48 2010 From: andreas at sdsc.edu (Andreas Prlic) Date: Mon, 18 Jan 2010 08:37:48 -0800 Subject: [Biojava-l] BioJava Hackathon - Day 1 Message-ID: <59a41c431001180837m4f9e4117j36a3dccd555b635@mail.gmail.com> Hi, Today is the first day of the BioJava Hackathon. We are 8 BioJava developers meeting here at the Genome Campus in Hinxton to hack on the latest code-base. If you want to stay in touch which what is going on, I am going to blog every day at: http://openbioinformatics.blogspot.com . Andy Yates is tweeting at http://twitter.com/search?q=%23biojava Other ways of staying in touch with us are via Skype or Google Chat. Send me your skype username or google account if you want to talk to us directly. Andreas From gwaldon at geneinfinity.org Mon Jan 18 14:17:08 2010 From: gwaldon at geneinfinity.org (George Waldon) Date: Mon, 18 Jan 2010 14:17:08 -0500 Subject: [Biojava-l] BioJava Hackathon - Day 1 Message-ID: <20100118191708.68936.qmail@mxw1102.verio-web.com> Hi Andreas, Thanks for the link. It is quite nice to get news from the hackathon this way. Quick question on my side. I understand that there is a need for having a bridge between sequence objects and strings, especially for beginners, but how does this becomes a critical issue to the point of saying "Sequences should be Strings as far as possible"? . - George On Mon, Jan 18, 2010 at 8:37 AM, Andreas Prlic wrote: > Hi, > > Today is the first day of the BioJava Hackathon. We are 8 BioJava > developers meeting here at the Genome Campus in Hinxton to hack on > the latest code-base. If you want to stay in touch which what is going > on, I am going to blog every day at: > http://openbioinformatics.blogspot.com . Andy Yates is tweeting at > http://twitter.com/search?q=%23biojava > > Other ways of staying in touch with us are via Skype or Google Chat. > Send me your skype username or google account if you want to talk to > us directly. > > Andreas > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > From holland at eaglegenomics.com Mon Jan 18 16:12:14 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Mon, 18 Jan 2010 21:12:14 +0000 Subject: [Biojava-l] BioJava Hackathon - Day 1 In-Reply-To: <20100118191708.68936.qmail@mxw1102.verio-web.com> References: <20100118191708.68936.qmail@mxw1102.verio-web.com> Message-ID: <95988839-75A3-4087-8071-5A19BEECDD04@eaglegenomics.com> I'll be there tomorrow to explain in person to those who are there, but for now here's a brief summary: Files are made of strings, as are streams. Therefore to grab the sequence as a string out of a file or stream is trivial and cheap. As long as the code doesn't need to do anything that can't be done at the string level, there's no need for it to be converted into a SymbolList equivalent. Therefore any code that doesn't need to convert it should be able to accept and work with a plain string, and be much faster/efficient/cheaper. Code that does need to have more than just a string should be able to convert that string into a SymboLlist equivalent on demand, which can be backed by strings, files, nio, whatever. By making the new SymbolList implement the CharSequence interface, and making methods that only need strings require CharSequence parameters and not Strings, you can pass either type to those string-only methods (because String implements CharSequence), therefore if you've parsed the thing already into a SymbolList, you can keep that representation, drop the original, and still be able to use the string-only methods. Also by making the new SymbolList implement the standard List interface from Collections, it can be used in nice Java shortcuts such as the new foreach loops, and standard iterators can be used (instead of the current SymbolListIterator method). Collections API can also be used then to do things like subsets or reverses. ...hope it all makes sense! On 18 Jan 2010, at 19:17, George Waldon wrote: > Hi Andreas, > > Thanks for the link. It is quite nice to get news from the hackathon this way. > > Quick question on my side. I understand that there is a need for having a bridge between sequence objects and strings, especially for beginners, but how does this becomes a critical issue to the point of saying "Sequences should be Strings as far as possible"? . > > - George > > > > > > On Mon, Jan 18, 2010 at 8:37 AM, Andreas Prlic wrote: >> Hi, >> >> Today is the first day of the BioJava Hackathon. We are 8 BioJava >> developers meeting here at the Genome Campus in Hinxton to hack on >> the latest code-base. If you want to stay in touch which what is going >> on, I am going to blog every day at: >> http://openbioinformatics.blogspot.com . Andy Yates is tweeting at >> http://twitter.com/search?q=%23biojava >> >> Other ways of staying in touch with us are via Skype or Google Chat. >> Send me your skype username or google account if you want to talk to >> us directly. >> >> Andreas >> _______________________________________________ >> 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 -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From jw12 at sanger.ac.uk Tue Jan 19 05:41:12 2010 From: jw12 at sanger.ac.uk (Jonathan Warren) Date: Tue, 19 Jan 2010 10:41:12 +0000 Subject: [Biojava-l] DAS Workshop Registrations now Open (workshop date 7-9 April 2010) Message-ID: <9EDF4E46-15F8-434E-B557-2DE5906C4182@sanger.ac.uk> If you don't know about DAS and wish to know how to distribute your latest biological annotation to the world then the upcoming DAS workshop maybe for you. If you know about DAS and are maybe a DAS client developer then the upcoming DAS workshop is for you (as you will need to know about the upcoming DAS 1.6 Specification and how it may affect your software). For information on the workshop and registration please go to: http://www.ebi.ac.uk/training/handson/DAS_070410.html Jonathan Warren Senior Developer and DAS coordinator jw12 at sanger.ac.uk -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. From andreas at sdsc.edu Fri Jan 22 13:03:46 2010 From: andreas at sdsc.edu (Andreas Prlic) Date: Fri, 22 Jan 2010 10:03:46 -0800 Subject: [Biojava-l] BioJava hackathon - Last Day Message-ID: <59a41c431001221003g428e6826oa5cf9f74f3435964@mail.gmail.com> Today was the last day of the BioJava Hackathon. It has been an exciting week and we made progress along several lines, which I will talk about in a moment. Special thanks go to Jonathan Warren for organizing the meeting room at the Sanger Institute. Also thanks to our hackers without who this hackathon would not have been possible. In particular thanks to Scooter Willis, Jules Jacobsen, Andy Yates, Jonathan Warren, Christoph Gille, Matias Piipari for participating during the week and to our special guests who joined us for a day, Richard Holland and Jim Procter. All the code that has been written is available through the new modules labeled with the biojava3 name. Most work was related to the new sequence and protein structure modules: Sequence modules There have been a lot of discussions about the current way sequences are represented over the last years. As such the "sequence guys" among the developers were working on coming up with a new design which is providing a biological meaningful (think central dogma) representation of sequences. What is still missing are file parsers using the new modules. The first fasta parser is about to be committed by Scooter as I am writing this. There is still more work required before the code will be ready for the next release. Still this is the beginning of a new data representation which should make the code base ready for the next couple of years. Structure modules The protein structure modules are the BioJava3-part which is closest to be released. During this week we added the CE algorithm for protein structure alignment, implemented core interfaces for a generic Model View Control wrapping of various 3D visualization tools, we added better support for chemically modified residues (like MSE) and natural ones like Selenocysteine. They are treated now as amino acids. We also re-factored the code base to have the structure data model clearly separated from the new graphical user interfaces. This gui module now provides a nice way for calculating and visualizing protein structure alignments. Next BioJava release (3.0) There is still more work required to push the new sequence module to a state where it can be released. We also did not write any documentation this week, so that will have to be added later on. We will try to bring up the modules to a state where they can be released over the next weeks. Once a module is release ready a detailed summary of the new features will be posted to the mailing list. In any case there will be a BioJava 3.0 release in time for the ISMB/BOSC conference as we have been doing during the last years. From sheoran143 at gmail.com Sun Jan 24 16:20:03 2010 From: sheoran143 at gmail.com (Deepak Sheoran) Date: Sun, 24 Jan 2010 15:20:03 -0600 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema Message-ID: <4B5CB983.6000207@gmail.com> Hi, I was trying to load the bct(bacteria) nucleotide genbank record from NCBI to my own instance of biosql and I got an hibernate exception(see it at the end of email): The record which i tried to load is : LOCUS AL596172 248050 bp DNA linear BCT 16-APR-2005 I don't why I am getting this error because I am not doing any manipulation to richSequence object I am simply reading it from file and trying to load it to database.The part of program which is responsible for loading the sequence is below: while (seqs.hasNext()) { try { richSequence = seqs.nextRichSequence(); // hibernate work begins // start a transaction session tx = session.beginTransaction(); // if got exception go to proper exception catch session.save("Sequence", richSequence); tx.commit(); successFullRecord++; // one more record successfully added to database session.clear(); // clear out the resources session.flush(); // force memory cache to go to hardisk RichObjectFactory.clearLRUCache(); // clear out LRU cache System.out.println("Changes committed. Records added: " + successFullRecord); richSequence = null; // clear out the memory references to richsequence } catch (HibernateException he) { hibernateException++; // update the error count he.printStackTrace(); richSequence = null; // reset the newRichSequence tx.rollback(); // undo the changes before the error occured session.clear(); // clear out the session session.flush(); // force the session cache to hard disk RichObjectFactory.clearLRUCache(); // clear out the LRU cache } catch (BioException ex) { bioJavaException++; // update the biojavaException error count RichObjectFactory.clearLRUCache(); session.clear(); session.flush(); RichObjectFactory.clearLRUCache(); richSequence = null; } catch (Exception ex) { otherException++; // update the otherError count richSequence = null; tx.rollback(); // rollBack the changes //TODO make this to logger System.out.println("Got general exception: " + ex.getLocalizedMessage()); ex.printStackTrace(); session.clear(); session.flush(); RichObjectFactory.clearLRUCache(); richSequence = null; } } Please help I am really stuck on this issue. Thanks Deepak Sheoran sheoran143 at gmail.com _*Exception:*_ Jan 24, 2010 2:59:21 PM org.hibernate.jdbc.BatchingBatcher doExecuteBatch SEVERE: Exception executing batch: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) Jan 24, 2010 2:59:21 PM org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) From holland at eaglegenomics.com Mon Jan 25 04:18:58 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Mon, 25 Jan 2010 09:18:58 +0000 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema In-Reply-To: <4B5CB983.6000207@gmail.com> References: <4B5CB983.6000207@gmail.com> Message-ID: <496E6E99-CACB-4C51-97CF-A5680471193C@eaglegenomics.com> This happens in one of two situations: 1. Something else is modifying the database at the same time, e.g. if you are running the same piece of code in parallel. 2. The Hibernate session has become inconsistent with the database (possibly due to partial or incomplete removal of cached objects because references to them remain elsewhere). In your code, you're doing a lot of session.clear() and session.flush() and RichObjectFactory.clearLRUCache() calls - are these really necessary? Also your code is creating the RichSequence objects outside of the transaction - this can cause problems too. There's some template code on Biojava.org which you can use as a shortcut to what you're trying to do: http://www.biojava.org/wiki/BioJava:BioJavaXDocs#BioEntryDB_and_RichSequenceDB_convenience_wrappers cheers, Richard On 24 Jan 2010, at 21:20, Deepak Sheoran wrote: > org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From sheoran143 at gmail.com Mon Jan 25 21:02:20 2010 From: sheoran143 at gmail.com (Deepak Sheoran) Date: Mon, 25 Jan 2010 20:02:20 -0600 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema In-Reply-To: <616a29411001242351x6ed40febq7442c73c81f9bbb1@mail.gmail.com> References: <4B5CB983.6000207@gmail.com> <616a29411001242249u1287a34elc874e18c23afea@mail.gmail.com> <4B5D414A.3000608@gmail.com> <616a29411001242351x6ed40febq7442c73c81f9bbb1@mail.gmail.com> Message-ID: <4B5E4D2C.3020407@gmail.com> simon rayner wrote: > it sounds like there is something up with those sequences. are they > longer than some limit. if you grep the locus line of these > sequences, what are the lengths? The average length for each record which are getting hibernate exception is around 14715 lines, which is kind of huge but I am able to get the things working by the suggestion of Richard. i.e is create richSequence after you start a transaction. I don't if this was only the issue, because i am able to load the record which are causing the hibernate exception by creating them after I start a transaction. I don't know what will be the statistics once I will change my program and run it on my complete data set. Thanks Deepak Sheoran > > On Mon, Jan 25, 2010 at 1:59 AM, Deepak Sheoran > wrote: > > simon rayner wrote: > > do you get the error with this sequence only, or with any > sequence you try to load? > > I get these error with around 2000 record out of 50000 record > which i am able to load successfully. The record number which i > sent you is one of the 2000 record with me waiting to enter my > database, I can send the accession of all those record if you need > them. > > Thanks for helping me out > Deepak Sheoran > > > On Sun, Jan 24, 2010 at 4:20 PM, Deepak Sheoran > > >> > wrote: > > Hi, > I was trying to load the bct(bacteria) nucleotide genbank > record > from NCBI to my own instance of biosql and I got an hibernate > exception(see it at the end of email): > The record which i tried to load is : LOCUS AL596172 > 248050 bp DNA linear BCT 16-APR-2005 > I don't why I am getting this error because I am not doing any > manipulation to richSequence object I am simply reading it from > file and trying to load it to database.The part of program > which > is responsible for loading the sequence is below: > > while (seqs.hasNext()) { > try { > richSequence = seqs.nextRichSequence(); > // hibernate work begins > // start a transaction session > tx = session.beginTransaction(); > // if got exception go to proper > exception catch > session.save("Sequence", richSequence); > tx.commit(); > successFullRecord++; // one more record > successfully added to database > session.clear(); // clear out the > resources > session.flush(); // force memory cache > to go > to hardisk > RichObjectFactory.clearLRUCache(); // > clear out > LRU cache > System.out.println("Changes committed. > Records > added: " + successFullRecord); > richSequence = null; // clear out the memory > references to richsequence > } catch (HibernateException he) { > hibernateException++; // update the error > count > he.printStackTrace(); > richSequence = null; // reset the > newRichSequence > tx.rollback(); // undo the changes > before the > error occured > session.clear(); // clear out the session > session.flush(); // force the session > cache to > hard disk > RichObjectFactory.clearLRUCache(); // > clear out > the LRU cache > } catch (BioException ex) { > bioJavaException++; // update the > biojavaException error count > RichObjectFactory.clearLRUCache(); > session.clear(); > session.flush(); > RichObjectFactory.clearLRUCache(); > richSequence = null; > } catch (Exception ex) { > otherException++; // update the > otherError count > richSequence = null; > tx.rollback(); // rollBack the changes > //TODO make this to logger > System.out.println("Got general > exception: " + > ex.getLocalizedMessage()); > ex.printStackTrace(); > session.clear(); > session.flush(); > RichObjectFactory.clearLRUCache(); > richSequence = null; > } > } > > Please help I am really stuck on this issue. > Thanks > Deepak Sheoran > sheoran143 at gmail.com > > > > > > > _*Exception:*_ > Jan 24, 2010 2:59:21 PM org.hibernate.jdbc.BatchingBatcher > doExecuteBatch > SEVERE: Exception executing batch: > org.hibernate.StaleStateException: Batch update returned > unexpected row count from update [1]; actual row count: 0; > expected: 1 > at > > org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) > > at > > org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) > > at > > org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) > at > > org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) > at > > org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) > > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) > > at > > org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) > at > org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) > at > > org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) > > at > > org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) > > at > org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) > at > > org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) > at > > org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) > at > > trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) > Jan 24, 2010 2:59:21 PM > org.hibernate.event.def.AbstractFlushingEventListener > performExecutions > SEVERE: Could not synchronize database state with session > org.hibernate.StaleStateException: Batch update returned > unexpected row count from update [1]; actual row count: 0; > expected: 1 > at > > org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) > > at > > org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) > > at > > org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) > at > > org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) > at > > org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) > > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) > > at > > org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) > at > org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) > at > > org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) > > at > > org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) > > at > org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) > at > > org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) > at > > org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) > at > > trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > > > > > http://lists.open-bio.org/mailman/listinfo/biojava-l > > > > > -- > Simon Rayner > > State Key Laboratory of Virology > Wuhan Institute of Virology > Chinese Academy of Sciences > Wuhan, Hubei 430071 > P.R.China > > +86 (27) 87199895 (office) > +86 15972923715 (cell) > > > > > > -- > Simon Rayner > > State Key Laboratory of Virology > Wuhan Institute of Virology > Chinese Academy of Sciences > Wuhan, Hubei 430071 > P.R.China > > +86 (27) 87199895 (office) > +86 15972923715 (cell) > From sheoran143 at gmail.com Mon Jan 25 21:23:29 2010 From: sheoran143 at gmail.com (Deepak Sheoran) Date: Mon, 25 Jan 2010 20:23:29 -0600 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema In-Reply-To: <496E6E99-CACB-4C51-97CF-A5680471193C@eaglegenomics.com> References: <4B5CB983.6000207@gmail.com> <496E6E99-CACB-4C51-97CF-A5680471193C@eaglegenomics.com> Message-ID: <4B5E5221.3060200@gmail.com> Richard Holland wrote: > This happens in one of two situations: > > 1. Something else is modifying the database at the same time, e.g. if you are running the same piece of code in parallel. > Ans: No, My program is the only thing which is working with the database instance on which I am performing load operation and my program is single thread based, i.e. it will create one richsequence and then persist it to database and then move to next one. > 2. The Hibernate session has become inconsistent with the database (possibly due to partial or incomplete removal of cached objects because references to them remain elsewhere). > Ans: I am not referencing cached objects any where else. The only operation I do with rich sequence is to create one and then load it to database and if it went successfully in to database, then forget about it and create new, on failure clean everything and start with next sequence. I don't know if RichSequenceFactory is doing something internally as far as referencing is concerned. ? > In your code, you're doing a lot of session.clear() and session.flush() and RichObjectFactory.clearLRUCache() calls - are these really necessary? Also your code is creating the RichSequence objects outside of the transaction - this can cause problems too. > > The only reason for doing session.clear() and session.flush() and clearLRUCache() was i don't need the richSequenceObject any time later because my program sole purpose is load sequence into database from genbank file. Also when I was trying to do this I found after loading certain number of records to database if you don't clear session or clear LRU cache things will get really slow and seems to be freezing. http://www.biojava.org/pipermail/biojava-l/2008-May/006283.html http://www.mail-archive.com/biojava-l at lists.open-bio.org/msg01379.html As you suggested I tried creating richSequence object after starting a transaction and its working for the records which are getting hibernate exception, but I will only say its working once I test it on my complete dataset which will take another 20 hours. Thanks Deepak Sheoran, BSc (Senior year) North Dakota State University > There's some template code on Biojava.org which you can use as a shortcut to what you're trying to do: > > http://www.biojava.org/wiki/BioJava:BioJavaXDocs#BioEntryDB_and_RichSequenceDB_convenience_wrappers > > cheers, > Richard > > On 24 Jan 2010, at 21:20, Deepak Sheoran wrote: > > >> org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 >> > > -- > Richard Holland, BSc MBCS > Operations and Delivery Director, Eagle Genomics Ltd > T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com > http://www.eaglegenomics.com/ > > From holland at eaglegenomics.com Thu Jan 28 16:11:01 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Thu, 28 Jan 2010 21:11:01 +0000 Subject: [Biojava-l] Error In Fetching Data from STRING EMBL File In-Reply-To: <326ea8620912180900l23efefads4fdc4693f11cb61c@mail.gmail.com> References: <326ea8620912180900l23efefads4fdc4693f11cb61c@mail.gmail.com> Message-ID: A full stack trace would be very helpful. PS. I am going away so won't be able to answer, but if you post the stack trace to the list someone there can help. On 18 Dec 2009, at 17:00, jitesh dundas wrote: > Dear Sir/Madam, > > I am trying to fetch data from EMBL STRING Database (http://string.embl.de/) > for a list of protein interactors. The file is attached with this email. > > On executing the code, it gives me a "version number" error. The same code > is working fine when I fetch data from NCBI databases. Thus, I am trying to > know what is going wrong here. > > I request your reply. Please let me know if you need anything else from my > side. > > Regards, > Jitesh Dundas > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From jbdundas at gmail.com Thu Jan 28 17:21:10 2010 From: jbdundas at gmail.com (jitesh dundas) Date: Fri, 29 Jan 2010 03:51:10 +0530 Subject: [Biojava-l] Error In Fetching Data from STRING EMBL File In-Reply-To: References: <326ea8620912180900l23efefads4fdc4693f11cb61c@mail.gmail.com> Message-ID: <326ea8621001281421p5a2d617am1beb114f326764fa@mail.gmail.com> Dear Sir, I solved the problem. Thank you everyone for your help. Thank you Richard Sir, you are very helpful. I am trying to implement biojava in my system. I might need help in the same soon. Thanks everyone for your help.Appreciate it. Regards, Jitesh Dundas On 1/29/10, Richard Holland wrote: > A full stack trace would be very helpful. > > PS. I am going away so won't be able to answer, but if you post the stack > trace to the list someone there can help. > > On 18 Dec 2009, at 17:00, jitesh dundas wrote: > >> Dear Sir/Madam, >> >> I am trying to fetch data from EMBL STRING Database >> (http://string.embl.de/) >> for a list of protein interactors. The file is attached with this email. >> >> On executing the code, it gives me a "version number" error. The same >> code >> is working fine when I fetch data from NCBI databases. Thus, I am trying >> to >> know what is going wrong here. >> >> I request your reply. Please let me know if you need anything else from my >> side. >> >> Regards, >> Jitesh Dundas >> _______________________________________________ >> Biojava-l mailing list - Biojava-l at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/biojava-l > > -- > Richard Holland, BSc MBCS > Operations and Delivery Director, Eagle Genomics Ltd > T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com > http://www.eaglegenomics.com/ > > From holland at eaglegenomics.com Mon Jan 4 10:57:54 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Mon, 4 Jan 2010 10:57:54 +0000 Subject: [Biojava-l] BioJava 2010 Hackathon Message-ID: Hi all, For those attending the 2010 BioJava hackathon at the Wellcome Trust Genome Campus, near Cambridge, all details can be found on this wiki: http://biojava.org/wiki/BioJava:Hackathon2010 If your name is not listed on the wiki but you are planning on attending, please let us know by Jan 12th latest. Due to security arrangements at the campus it is not possible to just turn up on the day. Subjects for the hackathon are open for discussion on the wiki. Looking forward to seeing you all there! cheers, Richard -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From andylu0320 at gmail.com Sun Jan 10 02:36:29 2010 From: andylu0320 at gmail.com (Andy Lu) Date: Sat, 9 Jan 2010 21:36:29 -0500 Subject: [Biojava-l] Jmol help Message-ID: <4a1a3f7d1001091836q1e084357v156a6dae902ba21f@mail.gmail.com> Hi, does anyone know how to add menu listener in JMol through JMol script? I tried using this: viewer.evalString ("set debugScript;"); viewer.evalString ("set ScriptCallback spacefill ;"); But is there a way to make the above to an "if" statement? Like if I click the "ball and stick" option in the menu, then something happens? Thanks! From andreas at sdsc.edu Sun Jan 10 12:20:28 2010 From: andreas at sdsc.edu (Andreas Prlic) Date: Sun, 10 Jan 2010 04:20:28 -0800 Subject: [Biojava-l] Jmol help In-Reply-To: <4a1a3f7d1001091836q1e084357v156a6dae902ba21f@mail.gmail.com> References: <4a1a3f7d1001091836q1e084357v156a6dae902ba21f@mail.gmail.com> Message-ID: <59a41c431001100420n58c786efv4c014984978d695a@mail.gmail.com> Hi Andy, Not sure what you mean - you mean you want you want to create a menu in a frame, which also contains a Jmol panel? Probably the easiest solution is to create a JMenu with JMenuItems, add actionListeners to them and these can trigger a script in Jmol. Have a look at this tutorial http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html Andreas On Sat, Jan 9, 2010 at 6:36 PM, Andy Lu wrote: > Hi, does anyone know how to add menu listener in JMol through JMol script? > > I tried using this: > > ? ? ? ?viewer.evalString ("set debugScript;"); > ? ? ? ?viewer.evalString ("set ScriptCallback spacefill ;"); > > But is there a way to make the above to an "if" statement? Like if I click > the "ball and stick" option in the menu, then something happens? > > Thanks! > _______________________________________________ > Biojava-l mailing list ?- ?Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > From chris at compbio.dundee.ac.uk Mon Jan 11 14:34:21 2010 From: chris at compbio.dundee.ac.uk (Chris Cole) Date: Mon, 11 Jan 2010 14:34:21 +0000 Subject: [Biojava-l] Error parsing ipi.HUMAN.fasta file In-Reply-To: References: <4B2BA575.5010007@compbio.dundee.ac.uk> <991F3D0D-0702-4EB7-9718-676986A1415E@eaglegenomics.com> <4B4B16A6.7030406@compbio.dundee.ac.uk> Message-ID: <4B4B36ED.9060105@compbio.dundee.ac.uk> [ posting back to biojava-l as omitted the address previously ] Ah, right. It wasn't clear on the wiki whether those were included or not with the 'all' package. It compiles fine now (with one warning) and through trial and error a buffer value of 2000 works with ipi.HUMAN.fasta as well as mouse and chicken. Thanks very much for your help. Chris On 11/01/10 12:31, Richard Holland wrote: > Hello. You need to make sure the support libraries are also on your classpath: > > http://www.biojava.org/wiki/BioJava:Download#Support_libraries > > cheers, > Richard > > On 11 Jan 2010, at 12:16, Chris Cole wrote: > >> Thanks for the reply, Richard. >> >> Just getting back to this problem. I've upped the buffer to 1000 bytes, but I can't get it to compile with ant. I get a whole slew of compile errors, there seems to be something missing, but I don't know how to solve it. Output from ant build follows: >> >> caterpillar: ~/Downloads/biojava-1.7/src> ant -f ../build.xml >> Buildfile: ../build.xml >> >> init: >> [echo] Building biojava-1.7 >> [echo] Java Home: /usr/java/jdk1.6.0_17/jre >> [echo] JUnit present: ${junit.present} >> [echo] JUnit supported by Ant: ${junit.support} >> [echo] HSQLDB driver present: ${sqlDriver.hsqldb} >> [echo] XSLT support: true >> >> prepare: >> >> prepare-biojava: >> >> compile-biojava: >> [javac] Compiling 1462 source files to /opt/Downloads/biojava-1.7/ant-build/classes/biojava >> [javac] /opt/Downloads/biojava-1.7/src/org/biojava/bio/dp/twohead/DPCompiler.java:55: package org.biojava.utils.bytecode does not exist >> [javac] import org.biojava.utils.bytecode.ByteCode; >> [javac] ^ >> [javac] /opt/Downloads/biojava-1.7/src/org/biojava/bio/dp/twohead/DPCompiler.java:56: package org.biojava.utils.bytecode does not exist >> [javac] import org.biojava.utils.bytecode.CodeClass; >> [javac] ^ >> [javac] /opt/Downloads/biojava-1.7/src/org/biojava/bio/dp/twohead/DPCompiler.java:57: package org.biojava.utils.bytecode does not exist >> [javac] import org.biojava.utils.bytecode.CodeException; >> [javac] ^ >> ...etc. >> >> I downloaded the biojava-1.7-all.jar, originally and I can't what else I need? >> >> I'm also trying to do this from within Eclipse, so any Eclipse-specific pointers would be much appreciated. >> Cheers, >> >> Chris >> >> On 18/12/09 16:58, Richard Holland wrote: >>> The FASTA parser has a buffer which it uses to read ahead to the next >>> complete line then back up before it actually parses it on the second >>> pass (in order to allow it to do things like hasNext()). The >>> exception shows that the size of that buffer is being exceeded, >>> causing it to fail to back up again afterwards. >>> >>> There's two cures - one is to rewrite the FASTA parser to buffer >>> things in a different way. The other is to open up >>> org/biojavax/bio/seq/io/FastaFormat.java in a text editor, search for >>> the line where it sets the buffer (somewhere around line 202 >>> according to the exception, in the readRichSequence() method - the >>> command to look for is 'mark'), and increase the buffer size to >>> something suitably large enough (it's currently set at 500 bytes). >>> Then recompile BioJava and it should work. >>> >>> cheers, Richard >>> >>> On 18 Dec 2009, at 15:53, Chris Cole wrote: >>> >>>> I'm wanting to parse a fasta file obtained from IPI using the code >>>> at the bottom of this message, but I get the following error: >>>> >>>> org.biojava.bio.BioException: Could not read sequence at >>>> org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:113) >>>> >>>> >> at test.readFasta(test.java:39) >>>> at test.main(test.java:18) Caused by: java.io.IOException: Mark >>>> invalid at java.io.BufferedReader.reset(BufferedReader.java:485) at >>>> org.biojavax.bio.seq.io.FastaFormat.readRichSequence(FastaFormat.java:202) >>>> >>>> >> at org.biojavax.bio.seq.io.RichStreamReader.nextRichSequence(RichStreamReader.java:110) >>>> ... 2 more >>>> >>>> Looking at the Fasta file itself and doing some tests, it seems to >>>> fail consistently at one or two entries /preceding/ an entry with a >>>> very long description line e.g.: >>>>> IPI:IPI00021421.4|SWISS-PROT:Q9UMR5-1|TREMBL:B0S868|ENSEMBL:ENSP00000382748;ENSP00000382749;ENSP00000382750;ENSP00000387679;ENSP00000388341;ENSP00000388618;ENSP00000389930;ENSP00000392885;ENSP00000393009;ENSP00000395242;ENSP00000395562;ENSP00000397025;ENSP00000399879;ENSP00000403820;ENSP00000406496;ENSP00000406566;ENSP00000408703;ENSP00000411007;ENSP00000411625;ENSP00000412827|REFSEQ:NP_005146|VEGA:OTTHUMP00000014775;OTTHUMP00000014776;OTTHUMP00000014778;OTTHUMP00000175028;OTTHUMP00000175029;OTTHUMP00000175030;OTTHUMP00000193135;OTTHUMP00000193136;OTTHUMP00000193138;OTTHUMP00000193964;OTTHUMP00000193965;OTTHUMP00000193967;OTTHUMP00000194391;OTTHUMP00000194392;OTTHUMP00000194394 >>>>> Tax_Id=9606 Gene_Symbol=PPT2 Isoform 1 of Lysosomal thioesterase >>>>> PPT2 >>>> MLGLWGQRLPAAWVLLLLPFLPLLLLAAPAPHRASYKPVIVVHGLFDSSYSFRHLLEYIN >>>> ETHPGTVVTVLDLFDGRESLRPLWEQVQGFREAVVPIMAKAPQGVHLICYSQGGLVCRAL >>>> LSVMDDHNVDSFISLSSPQMGQYGDTDYLKWLFPTSMRSNLYRICYSPWGQEFSICNYWH >>>> DPHHDDLYLNASSFLALINGERDHPNATVWRKNFLRVGHLVLIGGPDDGVITPWQSSFFG >>>> FYDANETVLEMEEQLVYLRDSFGLKTLLARGAIVRCPMAGISHTAWHSNRTLYETCIEPW LS >>>> >>>> Deleting the large entries allows the code to continue until it >>>> reaches another long description line. >>>> >>>> It also seems to be a feature of large Fasta files as reading the >>>> above sequence alone or as part of a small file is fine. >>>> >>>> Is this a known problem or am I doing something wrong? BTW I'm >>>> using biojava 1.7 and Java 1.6.0_17. Any help would be most >>>> appreciated. Cheers. >>>> >>>> code: import java.io.*; >>>> >>>> import org.biojava.bio.*; import org.biojavax.*; import >>>> org.biojavax.bio.seq.*; >>>> >>>> public class test { private static PrintStream o = System.out; >>>> >>>> public static void main(String[] args) { // TODO Auto-generated >>>> method stub readFasta(args[0]); } public static void >>>> readFasta(String filename) { try { o.println("Reading file: " + >>>> filename); //prepare a BufferedReader for file io BufferedReader br >>>> = new BufferedReader(new FileReader(filename)); >>>> >>>> // read Fasta file as BioJava RichSequence object Namespace ns = >>>> RichObjectFactory.getDefaultNamespace(); RichSequenceIterator iter >>>> = RichSequence.IOTools.readFastaProtein(br,ns); >>>> >>>> int numProteins = 0; while(iter.hasNext()) { ++numProteins; >>>> >>>> // Retrieve sequence and description data RichSequence seq = >>>> iter.nextRichSequence(); String ipi = >>>> seq.getName().substring(4,15); o.println(ipi); } o.println("Found >>>> " + numProteins + " in Fasta file"); } catch (FileNotFoundException >>>> ex) { //can't find file specified by args[0] ex.printStackTrace(); >>>> } catch (BioException ex) { //error parsing requested format >>>> ex.printStackTrace(); } } >>>> >>>> } > > -- > Richard Holland, BSc MBCS > Operations and Delivery Director, Eagle Genomics Ltd > T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com > http://www.eaglegenomics.com/ > -- Dr Chris Cole Senior Bioinformatics Research Officer School of Life Sciences Research University of Dundee Dow Street Dundee DD1 5EH Scotland, UK url: http://network.nature.com/profile/drchriscole e-mail: chris at compbio.dundee.ac.uk Tel: +44 (0)1382 388 721 The University of Dundee is a registered Scottish charity, No: SC015096 From andreas at sdsc.edu Mon Jan 18 16:37:48 2010 From: andreas at sdsc.edu (Andreas Prlic) Date: Mon, 18 Jan 2010 08:37:48 -0800 Subject: [Biojava-l] BioJava Hackathon - Day 1 Message-ID: <59a41c431001180837m4f9e4117j36a3dccd555b635@mail.gmail.com> Hi, Today is the first day of the BioJava Hackathon. We are 8 BioJava developers meeting here at the Genome Campus in Hinxton to hack on the latest code-base. If you want to stay in touch which what is going on, I am going to blog every day at: http://openbioinformatics.blogspot.com . Andy Yates is tweeting at http://twitter.com/search?q=%23biojava Other ways of staying in touch with us are via Skype or Google Chat. Send me your skype username or google account if you want to talk to us directly. Andreas From gwaldon at geneinfinity.org Mon Jan 18 19:17:08 2010 From: gwaldon at geneinfinity.org (George Waldon) Date: Mon, 18 Jan 2010 14:17:08 -0500 Subject: [Biojava-l] BioJava Hackathon - Day 1 Message-ID: <20100118191708.68936.qmail@mxw1102.verio-web.com> Hi Andreas, Thanks for the link. It is quite nice to get news from the hackathon this way. Quick question on my side. I understand that there is a need for having a bridge between sequence objects and strings, especially for beginners, but how does this becomes a critical issue to the point of saying "Sequences should be Strings as far as possible"? . - George On Mon, Jan 18, 2010 at 8:37 AM, Andreas Prlic wrote: > Hi, > > Today is the first day of the BioJava Hackathon. We are 8 BioJava > developers meeting here at the Genome Campus in Hinxton to hack on > the latest code-base. If you want to stay in touch which what is going > on, I am going to blog every day at: > http://openbioinformatics.blogspot.com . Andy Yates is tweeting at > http://twitter.com/search?q=%23biojava > > Other ways of staying in touch with us are via Skype or Google Chat. > Send me your skype username or google account if you want to talk to > us directly. > > Andreas > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l > From holland at eaglegenomics.com Mon Jan 18 21:12:14 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Mon, 18 Jan 2010 21:12:14 +0000 Subject: [Biojava-l] BioJava Hackathon - Day 1 In-Reply-To: <20100118191708.68936.qmail@mxw1102.verio-web.com> References: <20100118191708.68936.qmail@mxw1102.verio-web.com> Message-ID: <95988839-75A3-4087-8071-5A19BEECDD04@eaglegenomics.com> I'll be there tomorrow to explain in person to those who are there, but for now here's a brief summary: Files are made of strings, as are streams. Therefore to grab the sequence as a string out of a file or stream is trivial and cheap. As long as the code doesn't need to do anything that can't be done at the string level, there's no need for it to be converted into a SymbolList equivalent. Therefore any code that doesn't need to convert it should be able to accept and work with a plain string, and be much faster/efficient/cheaper. Code that does need to have more than just a string should be able to convert that string into a SymboLlist equivalent on demand, which can be backed by strings, files, nio, whatever. By making the new SymbolList implement the CharSequence interface, and making methods that only need strings require CharSequence parameters and not Strings, you can pass either type to those string-only methods (because String implements CharSequence), therefore if you've parsed the thing already into a SymbolList, you can keep that representation, drop the original, and still be able to use the string-only methods. Also by making the new SymbolList implement the standard List interface from Collections, it can be used in nice Java shortcuts such as the new foreach loops, and standard iterators can be used (instead of the current SymbolListIterator method). Collections API can also be used then to do things like subsets or reverses. ...hope it all makes sense! On 18 Jan 2010, at 19:17, George Waldon wrote: > Hi Andreas, > > Thanks for the link. It is quite nice to get news from the hackathon this way. > > Quick question on my side. I understand that there is a need for having a bridge between sequence objects and strings, especially for beginners, but how does this becomes a critical issue to the point of saying "Sequences should be Strings as far as possible"? . > > - George > > > > > > On Mon, Jan 18, 2010 at 8:37 AM, Andreas Prlic wrote: >> Hi, >> >> Today is the first day of the BioJava Hackathon. We are 8 BioJava >> developers meeting here at the Genome Campus in Hinxton to hack on >> the latest code-base. If you want to stay in touch which what is going >> on, I am going to blog every day at: >> http://openbioinformatics.blogspot.com . Andy Yates is tweeting at >> http://twitter.com/search?q=%23biojava >> >> Other ways of staying in touch with us are via Skype or Google Chat. >> Send me your skype username or google account if you want to talk to >> us directly. >> >> Andreas >> _______________________________________________ >> 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 -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From jw12 at sanger.ac.uk Tue Jan 19 10:41:12 2010 From: jw12 at sanger.ac.uk (Jonathan Warren) Date: Tue, 19 Jan 2010 10:41:12 +0000 Subject: [Biojava-l] DAS Workshop Registrations now Open (workshop date 7-9 April 2010) Message-ID: <9EDF4E46-15F8-434E-B557-2DE5906C4182@sanger.ac.uk> If you don't know about DAS and wish to know how to distribute your latest biological annotation to the world then the upcoming DAS workshop maybe for you. If you know about DAS and are maybe a DAS client developer then the upcoming DAS workshop is for you (as you will need to know about the upcoming DAS 1.6 Specification and how it may affect your software). For information on the workshop and registration please go to: http://www.ebi.ac.uk/training/handson/DAS_070410.html Jonathan Warren Senior Developer and DAS coordinator jw12 at sanger.ac.uk -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. From andreas at sdsc.edu Fri Jan 22 18:03:46 2010 From: andreas at sdsc.edu (Andreas Prlic) Date: Fri, 22 Jan 2010 10:03:46 -0800 Subject: [Biojava-l] BioJava hackathon - Last Day Message-ID: <59a41c431001221003g428e6826oa5cf9f74f3435964@mail.gmail.com> Today was the last day of the BioJava Hackathon. It has been an exciting week and we made progress along several lines, which I will talk about in a moment. Special thanks go to Jonathan Warren for organizing the meeting room at the Sanger Institute. Also thanks to our hackers without who this hackathon would not have been possible. In particular thanks to Scooter Willis, Jules Jacobsen, Andy Yates, Jonathan Warren, Christoph Gille, Matias Piipari for participating during the week and to our special guests who joined us for a day, Richard Holland and Jim Procter. All the code that has been written is available through the new modules labeled with the biojava3 name. Most work was related to the new sequence and protein structure modules: Sequence modules There have been a lot of discussions about the current way sequences are represented over the last years. As such the "sequence guys" among the developers were working on coming up with a new design which is providing a biological meaningful (think central dogma) representation of sequences. What is still missing are file parsers using the new modules. The first fasta parser is about to be committed by Scooter as I am writing this. There is still more work required before the code will be ready for the next release. Still this is the beginning of a new data representation which should make the code base ready for the next couple of years. Structure modules The protein structure modules are the BioJava3-part which is closest to be released. During this week we added the CE algorithm for protein structure alignment, implemented core interfaces for a generic Model View Control wrapping of various 3D visualization tools, we added better support for chemically modified residues (like MSE) and natural ones like Selenocysteine. They are treated now as amino acids. We also re-factored the code base to have the structure data model clearly separated from the new graphical user interfaces. This gui module now provides a nice way for calculating and visualizing protein structure alignments. Next BioJava release (3.0) There is still more work required to push the new sequence module to a state where it can be released. We also did not write any documentation this week, so that will have to be added later on. We will try to bring up the modules to a state where they can be released over the next weeks. Once a module is release ready a detailed summary of the new features will be posted to the mailing list. In any case there will be a BioJava 3.0 release in time for the ISMB/BOSC conference as we have been doing during the last years. From sheoran143 at gmail.com Sun Jan 24 21:20:03 2010 From: sheoran143 at gmail.com (Deepak Sheoran) Date: Sun, 24 Jan 2010 15:20:03 -0600 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema Message-ID: <4B5CB983.6000207@gmail.com> Hi, I was trying to load the bct(bacteria) nucleotide genbank record from NCBI to my own instance of biosql and I got an hibernate exception(see it at the end of email): The record which i tried to load is : LOCUS AL596172 248050 bp DNA linear BCT 16-APR-2005 I don't why I am getting this error because I am not doing any manipulation to richSequence object I am simply reading it from file and trying to load it to database.The part of program which is responsible for loading the sequence is below: while (seqs.hasNext()) { try { richSequence = seqs.nextRichSequence(); // hibernate work begins // start a transaction session tx = session.beginTransaction(); // if got exception go to proper exception catch session.save("Sequence", richSequence); tx.commit(); successFullRecord++; // one more record successfully added to database session.clear(); // clear out the resources session.flush(); // force memory cache to go to hardisk RichObjectFactory.clearLRUCache(); // clear out LRU cache System.out.println("Changes committed. Records added: " + successFullRecord); richSequence = null; // clear out the memory references to richsequence } catch (HibernateException he) { hibernateException++; // update the error count he.printStackTrace(); richSequence = null; // reset the newRichSequence tx.rollback(); // undo the changes before the error occured session.clear(); // clear out the session session.flush(); // force the session cache to hard disk RichObjectFactory.clearLRUCache(); // clear out the LRU cache } catch (BioException ex) { bioJavaException++; // update the biojavaException error count RichObjectFactory.clearLRUCache(); session.clear(); session.flush(); RichObjectFactory.clearLRUCache(); richSequence = null; } catch (Exception ex) { otherException++; // update the otherError count richSequence = null; tx.rollback(); // rollBack the changes //TODO make this to logger System.out.println("Got general exception: " + ex.getLocalizedMessage()); ex.printStackTrace(); session.clear(); session.flush(); RichObjectFactory.clearLRUCache(); richSequence = null; } } Please help I am really stuck on this issue. Thanks Deepak Sheoran sheoran143 at gmail.com _*Exception:*_ Jan 24, 2010 2:59:21 PM org.hibernate.jdbc.BatchingBatcher doExecuteBatch SEVERE: Exception executing batch: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) Jan 24, 2010 2:59:21 PM org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) From holland at eaglegenomics.com Mon Jan 25 09:18:58 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Mon, 25 Jan 2010 09:18:58 +0000 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema In-Reply-To: <4B5CB983.6000207@gmail.com> References: <4B5CB983.6000207@gmail.com> Message-ID: <496E6E99-CACB-4C51-97CF-A5680471193C@eaglegenomics.com> This happens in one of two situations: 1. Something else is modifying the database at the same time, e.g. if you are running the same piece of code in parallel. 2. The Hibernate session has become inconsistent with the database (possibly due to partial or incomplete removal of cached objects because references to them remain elsewhere). In your code, you're doing a lot of session.clear() and session.flush() and RichObjectFactory.clearLRUCache() calls - are these really necessary? Also your code is creating the RichSequence objects outside of the transaction - this can cause problems too. There's some template code on Biojava.org which you can use as a shortcut to what you're trying to do: http://www.biojava.org/wiki/BioJava:BioJavaXDocs#BioEntryDB_and_RichSequenceDB_convenience_wrappers cheers, Richard On 24 Jan 2010, at 21:20, Deepak Sheoran wrote: > org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From sheoran143 at gmail.com Tue Jan 26 02:02:20 2010 From: sheoran143 at gmail.com (Deepak Sheoran) Date: Mon, 25 Jan 2010 20:02:20 -0600 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema In-Reply-To: <616a29411001242351x6ed40febq7442c73c81f9bbb1@mail.gmail.com> References: <4B5CB983.6000207@gmail.com> <616a29411001242249u1287a34elc874e18c23afea@mail.gmail.com> <4B5D414A.3000608@gmail.com> <616a29411001242351x6ed40febq7442c73c81f9bbb1@mail.gmail.com> Message-ID: <4B5E4D2C.3020407@gmail.com> simon rayner wrote: > it sounds like there is something up with those sequences. are they > longer than some limit. if you grep the locus line of these > sequences, what are the lengths? The average length for each record which are getting hibernate exception is around 14715 lines, which is kind of huge but I am able to get the things working by the suggestion of Richard. i.e is create richSequence after you start a transaction. I don't if this was only the issue, because i am able to load the record which are causing the hibernate exception by creating them after I start a transaction. I don't know what will be the statistics once I will change my program and run it on my complete data set. Thanks Deepak Sheoran > > On Mon, Jan 25, 2010 at 1:59 AM, Deepak Sheoran > wrote: > > simon rayner wrote: > > do you get the error with this sequence only, or with any > sequence you try to load? > > I get these error with around 2000 record out of 50000 record > which i am able to load successfully. The record number which i > sent you is one of the 2000 record with me waiting to enter my > database, I can send the accession of all those record if you need > them. > > Thanks for helping me out > Deepak Sheoran > > > On Sun, Jan 24, 2010 at 4:20 PM, Deepak Sheoran > > >> > wrote: > > Hi, > I was trying to load the bct(bacteria) nucleotide genbank > record > from NCBI to my own instance of biosql and I got an hibernate > exception(see it at the end of email): > The record which i tried to load is : LOCUS AL596172 > 248050 bp DNA linear BCT 16-APR-2005 > I don't why I am getting this error because I am not doing any > manipulation to richSequence object I am simply reading it from > file and trying to load it to database.The part of program > which > is responsible for loading the sequence is below: > > while (seqs.hasNext()) { > try { > richSequence = seqs.nextRichSequence(); > // hibernate work begins > // start a transaction session > tx = session.beginTransaction(); > // if got exception go to proper > exception catch > session.save("Sequence", richSequence); > tx.commit(); > successFullRecord++; // one more record > successfully added to database > session.clear(); // clear out the > resources > session.flush(); // force memory cache > to go > to hardisk > RichObjectFactory.clearLRUCache(); // > clear out > LRU cache > System.out.println("Changes committed. > Records > added: " + successFullRecord); > richSequence = null; // clear out the memory > references to richsequence > } catch (HibernateException he) { > hibernateException++; // update the error > count > he.printStackTrace(); > richSequence = null; // reset the > newRichSequence > tx.rollback(); // undo the changes > before the > error occured > session.clear(); // clear out the session > session.flush(); // force the session > cache to > hard disk > RichObjectFactory.clearLRUCache(); // > clear out > the LRU cache > } catch (BioException ex) { > bioJavaException++; // update the > biojavaException error count > RichObjectFactory.clearLRUCache(); > session.clear(); > session.flush(); > RichObjectFactory.clearLRUCache(); > richSequence = null; > } catch (Exception ex) { > otherException++; // update the > otherError count > richSequence = null; > tx.rollback(); // rollBack the changes > //TODO make this to logger > System.out.println("Got general > exception: " + > ex.getLocalizedMessage()); > ex.printStackTrace(); > session.clear(); > session.flush(); > RichObjectFactory.clearLRUCache(); > richSequence = null; > } > } > > Please help I am really stuck on this issue. > Thanks > Deepak Sheoran > sheoran143 at gmail.com > > > > > > > _*Exception:*_ > Jan 24, 2010 2:59:21 PM org.hibernate.jdbc.BatchingBatcher > doExecuteBatch > SEVERE: Exception executing batch: > org.hibernate.StaleStateException: Batch update returned > unexpected row count from update [1]; actual row count: 0; > expected: 1 > at > > org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) > > at > > org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) > > at > > org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) > at > > org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) > at > > org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) > > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) > > at > > org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) > at > org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) > at > > org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) > > at > > org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) > > at > org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) > at > > org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) > at > > org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) > at > > trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) > Jan 24, 2010 2:59:21 PM > org.hibernate.event.def.AbstractFlushingEventListener > performExecutions > SEVERE: Could not synchronize database state with session > org.hibernate.StaleStateException: Batch update returned > unexpected row count from update [1]; actual row count: 0; > expected: 1 > at > > org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) > > at > > org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) > > at > > org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) > at > > org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) > at > > org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:34) > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2247) > > at > > org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) > > at > > org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56) > at > org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) > at > > org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) > at > > org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) > > at > > org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) > > at > org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) > at > > org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) > at > > org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) > at > > trashtesting.GenBankLoaderTesting.main(GenBankLoaderTesting.java:79) > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > > > > > http://lists.open-bio.org/mailman/listinfo/biojava-l > > > > > -- > Simon Rayner > > State Key Laboratory of Virology > Wuhan Institute of Virology > Chinese Academy of Sciences > Wuhan, Hubei 430071 > P.R.China > > +86 (27) 87199895 (office) > +86 15972923715 (cell) > > > > > > -- > Simon Rayner > > State Key Laboratory of Virology > Wuhan Institute of Virology > Chinese Academy of Sciences > Wuhan, Hubei 430071 > P.R.China > > +86 (27) 87199895 (office) > +86 15972923715 (cell) > From sheoran143 at gmail.com Tue Jan 26 02:23:29 2010 From: sheoran143 at gmail.com (Deepak Sheoran) Date: Mon, 25 Jan 2010 20:23:29 -0600 Subject: [Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema In-Reply-To: <496E6E99-CACB-4C51-97CF-A5680471193C@eaglegenomics.com> References: <4B5CB983.6000207@gmail.com> <496E6E99-CACB-4C51-97CF-A5680471193C@eaglegenomics.com> Message-ID: <4B5E5221.3060200@gmail.com> Richard Holland wrote: > This happens in one of two situations: > > 1. Something else is modifying the database at the same time, e.g. if you are running the same piece of code in parallel. > Ans: No, My program is the only thing which is working with the database instance on which I am performing load operation and my program is single thread based, i.e. it will create one richsequence and then persist it to database and then move to next one. > 2. The Hibernate session has become inconsistent with the database (possibly due to partial or incomplete removal of cached objects because references to them remain elsewhere). > Ans: I am not referencing cached objects any where else. The only operation I do with rich sequence is to create one and then load it to database and if it went successfully in to database, then forget about it and create new, on failure clean everything and start with next sequence. I don't know if RichSequenceFactory is doing something internally as far as referencing is concerned. ? > In your code, you're doing a lot of session.clear() and session.flush() and RichObjectFactory.clearLRUCache() calls - are these really necessary? Also your code is creating the RichSequence objects outside of the transaction - this can cause problems too. > > The only reason for doing session.clear() and session.flush() and clearLRUCache() was i don't need the richSequenceObject any time later because my program sole purpose is load sequence into database from genbank file. Also when I was trying to do this I found after loading certain number of records to database if you don't clear session or clear LRU cache things will get really slow and seems to be freezing. http://www.biojava.org/pipermail/biojava-l/2008-May/006283.html http://www.mail-archive.com/biojava-l at lists.open-bio.org/msg01379.html As you suggested I tried creating richSequence object after starting a transaction and its working for the records which are getting hibernate exception, but I will only say its working once I test it on my complete dataset which will take another 20 hours. Thanks Deepak Sheoran, BSc (Senior year) North Dakota State University > There's some template code on Biojava.org which you can use as a shortcut to what you're trying to do: > > http://www.biojava.org/wiki/BioJava:BioJavaXDocs#BioEntryDB_and_RichSequenceDB_convenience_wrappers > > cheers, > Richard > > On 24 Jan 2010, at 21:20, Deepak Sheoran wrote: > > >> org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1 >> > > -- > Richard Holland, BSc MBCS > Operations and Delivery Director, Eagle Genomics Ltd > T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com > http://www.eaglegenomics.com/ > > From holland at eaglegenomics.com Thu Jan 28 21:11:01 2010 From: holland at eaglegenomics.com (Richard Holland) Date: Thu, 28 Jan 2010 21:11:01 +0000 Subject: [Biojava-l] Error In Fetching Data from STRING EMBL File In-Reply-To: <326ea8620912180900l23efefads4fdc4693f11cb61c@mail.gmail.com> References: <326ea8620912180900l23efefads4fdc4693f11cb61c@mail.gmail.com> Message-ID: A full stack trace would be very helpful. PS. I am going away so won't be able to answer, but if you post the stack trace to the list someone there can help. On 18 Dec 2009, at 17:00, jitesh dundas wrote: > Dear Sir/Madam, > > I am trying to fetch data from EMBL STRING Database (http://string.embl.de/) > for a list of protein interactors. The file is attached with this email. > > On executing the code, it gives me a "version number" error. The same code > is working fine when I fetch data from NCBI databases. Thus, I am trying to > know what is going wrong here. > > I request your reply. Please let me know if you need anything else from my > side. > > Regards, > Jitesh Dundas > _______________________________________________ > Biojava-l mailing list - Biojava-l at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-l -- Richard Holland, BSc MBCS Operations and Delivery Director, Eagle Genomics Ltd T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com http://www.eaglegenomics.com/ From jbdundas at gmail.com Thu Jan 28 22:21:10 2010 From: jbdundas at gmail.com (jitesh dundas) Date: Fri, 29 Jan 2010 03:51:10 +0530 Subject: [Biojava-l] Error In Fetching Data from STRING EMBL File In-Reply-To: References: <326ea8620912180900l23efefads4fdc4693f11cb61c@mail.gmail.com> Message-ID: <326ea8621001281421p5a2d617am1beb114f326764fa@mail.gmail.com> Dear Sir, I solved the problem. Thank you everyone for your help. Thank you Richard Sir, you are very helpful. I am trying to implement biojava in my system. I might need help in the same soon. Thanks everyone for your help.Appreciate it. Regards, Jitesh Dundas On 1/29/10, Richard Holland wrote: > A full stack trace would be very helpful. > > PS. I am going away so won't be able to answer, but if you post the stack > trace to the list someone there can help. > > On 18 Dec 2009, at 17:00, jitesh dundas wrote: > >> Dear Sir/Madam, >> >> I am trying to fetch data from EMBL STRING Database >> (http://string.embl.de/) >> for a list of protein interactors. The file is attached with this email. >> >> On executing the code, it gives me a "version number" error. The same >> code >> is working fine when I fetch data from NCBI databases. Thus, I am trying >> to >> know what is going wrong here. >> >> I request your reply. Please let me know if you need anything else from my >> side. >> >> Regards, >> Jitesh Dundas >> _______________________________________________ >> Biojava-l mailing list - Biojava-l at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/biojava-l > > -- > Richard Holland, BSc MBCS > Operations and Delivery Director, Eagle Genomics Ltd > T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com > http://www.eaglegenomics.com/ > >