[BioSQL-l] [Biojava-l] Problems with adding miRNA to sequence
Richard Holland
dicknetherlands at gmail.com
Mon Sep 1 13:47:01 UTC 2008
You raise two points in this email.
The second one, which is easier to deal with, I'll answer first!
Bascially yes please do file a bug report about the unique
identifiers for features not getting reset on new sequences, using
Bugzilla at biojava.org.
Now the first one, which relates to your stack trace.
Mid way through the stacktrace you see this line:
Caused by: java.lang.OutOfMemoryError: Java heap space
Basically you're loading loads of stuff into memory and so you're
running out of it. Java 5 by default allocates no less than 1/64th and
no more than 1/4th of the machine's memory to your program, which you
can increase using the -Xms and -Xmx params when starting up your JVM
(e.g. when you type the java comand to start your program). Increasing
these params will help prevent out of memory messages, particularly if
you are dealing with very large sequences.
See this link for info on the -Xms and -Xmx options and how they work
in various different environments (command line, Tomcat, Eclipse,
etc.):
http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html
cheers,
Richard
2008/9/1 Gabrielle Doan <gabrielle_doan at gmx.net>:
> Hi Richard,
> thanks a lot for your answer. I've changed the size of the rank in the
> BioSQL table seqfeature from smallint unsigned to int unsigned. So that the
> error messages because of the rank do not occur anymore.
> But now I'm facing an other problem. If I try to insert a new feature to
> human chromosome 1 and 2 into my database I get following message:
>
> org.hibernate.PropertyAccessException: Exception occurred inside getter of
> org.biojavax.bio.seq.SimpleRichSequence.stringSequence
> at
> org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:148)
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValues(AbstractEntityTuplizer.java:256)
> at
> org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValues(PojoEntityTuplizer.java:209)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:3581)
> at
> org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:167)
> at
> org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
> 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 org.viewer.db.HBioSQLDB.updateSequence(HBioSQLDB.java:254)
> at org.viewer.io.MakeMiRNA.splitLine(MakeMiRNA.java:220)
> at org.viewer.io.MakeMiRNA.main(MakeMiRNA.java:57)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
> ... 14 more
> Caused by: java.lang.OutOfMemoryError: Java heap space
> at java.util.Arrays.copyOf(Arrays.java:2882)
> at
> java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
> at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)
> at java.lang.StringBuffer.append(StringBuffer.java:320)
> at
> org.biojava.bio.seq.io.CharacterTokenization.tokenizeSymbolList(CharacterTokenization.java:214)
> at
> org.biojava.bio.symbol.AlphabetManager$WellKnownTokenizationWrapper.tokenizeSymbolList(AlphabetManager.java:1460)
> at
> org.biojava.bio.symbol.AbstractSymbolList.seqString(AbstractSymbolList.java:102)
> at
> org.biojavax.bio.seq.DummyRichSequenceHandler.seqString(DummyRichSequenceHandler.java:115)
> at
> org.biojavax.bio.db.biosql.BioSQLRichSequenceHandler.seqString(BioSQLRichSequenceHandler.java:155)
> at
> org.biojavax.bio.seq.ThinRichSequence.seqString(ThinRichSequence.java:188)
> at
> org.biojavax.bio.seq.SimpleRichSequence.getStringSequence(SimpleRichSequence.java:77)
> ... 19 more
>
> I also had a conversation with Hilmar Lapp, who told me that there's
> possibly a bug in BioJava because the unique property does hold for the four
> elements bioentry_id, type_term_id, source_term_id and rank but it seems
> that BioJava always inkrements the rank for each new feature. Should I post
> a bug report?
>
> It would be very nice if you could help me. I am grateful for any
> hints. Thanks a lot.
>
> cheers
> Gabrielle
>
>
>
>
>
> -------- Original-Nachricht --------
> Betreff: Re: [Biojava-l] Problems with adding miRNA to sequence
> Datum: Thu, 28 Aug 2008 23:45:35 +0100
> Von: Richard Holland <dicknetherlands at gmail.com>
> An: Gabrielle Doan <gabrielle_doan at gmx.net>
> CC: biojava-l at biojava.org
> Referenzen: <48B6B354.6010307 at gmx.net>
>
> Looks like your sequence has so many features that it exceeds the
> maximum permitted by BioSQL:
>
> com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of
> range value adjusted for column 'rank' at row 1
>
> Not sure what you can do about this other than go to the Feature table
> in your database and increase the maximum value allowed in the 'rank'
> column.
>
> cheers,
> Richard
>
>
> 2008/8/28 Gabrielle Doan <gabrielle_doan at gmx.net>:
>>
>> Hi all,
>> I would like to insert new features (miRNA) into my exitsting BioSQL
>> database. At the moment the database contains the chromosomes 1-22, X, Y
>> and MT downloaded from ftp://ftp.ncbi.nih.gov/genomes/H_sapiens/. And
>> now I have tried to add the information about miRNA from
>> http://microrna.sanger.ac.uk/cgi-bin/targets/v5/download.pl into my
>> database with following code:
>>
>> private void makeAFeature(String id, String chr, int startpos,
>> int endpos, Strand strand, float score, String gene)
>> throws ChangeVetoExceptionIllegalSymbolException
>> {
>> RichSequence rs = chromosomes.get(chr);
>> if (rs == null) {
>> rs = db.SearchForSequence(chr);
>> chromosomes.put(chr, rs);
>> }
>> RichFeature feat = RichFeature.Tools.makeEmptyFeature();
>> feat.setName(id);
>> RichLocation rl = new SimpleRichLocation(new
>>
>> SimplePosition(startpos),new SimplePosition(endpos),
>> 1,strand);
>> feat.setLocation(rl);
>> try {
>>
>> feat.setTypeTerm(RichObjectFactory.getDefaultOntology()
>> .getOrCreateTerm("miRNA"));
>> feat.setType(feat.getTypeTerm().getName());
>> } catch (InvalidTermException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>> feat.getAnnotation().setProperty("score",
>> Float.valueOf(score));
>> feat.getAnnotation().setProperty("gene", gene);
>> feat.setParent(rs);
>> rs.getFeatureSet().add(feat);
>> }
>>
>> I successfully inserted the information for chromosome 3-22, X, Y and MT.
>> But when I try to deal with chromosome 1, 2 in the same way I get
>> following message:
>>
>> org.hibernate.exception.DataException: could not insert: [Feature]
>> at
>>
>> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
>> at
>>
>> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
>> at
>>
>> org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)
>> at
>>
>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2163)
>> at
>>
>> org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2643)
>> at
>>
>> org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:51)
>> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
>> at
>>
>> org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
>> at
>>
>> org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
>> at
>>
>> org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
>> at
>>
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
>> at
>>
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
>> at
>>
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>> at
>>
>> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>> at
>> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
>> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
>> at
>> org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:218)
>> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
>> at
>> org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
>> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
>> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
>> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
>> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
>> at
>>
>> org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
>> at
>>
>> org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
>> at
>>
>> org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
>> at
>>
>> org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
>> 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 org.viewer.db.HBioSQLDB.updateSequence(HBioSQLDB.java:254)
>> at org.viewer.io.MakeMiRNA.splitLine(MakeMiRNA.java:220)
>> at org.viewer.io.MakeMiRNA.main(MakeMiRNA.java:57)
>> Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of
>> range value adjusted for column 'rank' at row 1
>> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2973)
>> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
>> at
>>
>> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1129)
>> at
>>
>> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:681)
>> at
>>
>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1368)
>> at
>>
>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1283)
>> at
>>
>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1268)
>> at
>>
>> org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
>> at
>>
>> org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
>> ... 32 more
>>
>> It would be very nice if someone could help me. I am grateful for any
>> hints. Thanks a lot.
>>
>> Cheers,
>> Gabrielle
>>
>> _______________________________________________
>> Biojava-l mailing list - Biojava-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>>
>
>
>
> --
> Richard Holland
> Finance Director
> Eagle Genomics
> http://www.eaglegenomics.com/
>
>
--
Richard Holland
Finance Director
Eagle Genomics
http://www.eaglegenomics.com/
More information about the BioSQL-l
mailing list