<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div dir="ltr" id="yui_3_16_0_1_1423087516925_43530"><span id="yui_3_16_0_1_1423087516925_44484">I finally had some time to try the serialization/deserialization library&nbsp; (Kryo) you mentioned, but I do not seem to get it to work. I can not even save a DNASequence:</span></div><div id="yui_3_16_0_1_1423087516925_44483" dir="ltr"><br><span></span></div><div id="yui_3_16_0_1_1423087516925_43539" dir="ltr"><span id="yui_3_16_0_1_1423087516925_43799">void test() {<br style="" class="">&nbsp;&nbsp;&nbsp; Kryo kryo = new Kryo();<br style="" class="">&nbsp;&nbsp;&nbsp; DNASequence dna=null;<br style="" class="">&nbsp;&nbsp;&nbsp; try {<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dna = new DNASequence("AGCT");<br style="" class="">&nbsp;&nbsp;&nbsp; } catch (CompoundNotFoundException e1) {<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e1.printStackTrace();<br style="" class="">&nbsp;&nbsp;&nbsp; }<br style="" class="">&nbsp;&nbsp;&nbsp; try {<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Output output = new Output(new FileOutputStream("test.ser"));<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; kryo.writeObject(output, dna);<br style="" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output.close();&nbsp;&nbsp;&nbsp; <br style="" class="">&nbsp;&nbsp;&nbsp; } catch (FileNotFoundException e) {<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.printStackTrace();<br style="" class="">&nbsp;&nbsp;&nbsp; }<br style="" class="">&nbsp;&nbsp;&nbsp; try {<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Input input = new Input(new FileInputStream("test.ser"));<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dna = kryo.readObject(input, DNASequence.class);<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; input.close();<br style="" class="">&nbsp;&nbsp;&nbsp; } catch (FileNotFoundException e) {<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated catch block<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("file not found");<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.printStackTrace();<br style="" class="">&nbsp;&nbsp;&nbsp; }<br style="" class="">}<br style="" class=""></span></div><div id="yui_3_16_0_1_1423087516925_44476" dir="ltr"><span id="yui_3_16_0_1_1423087516925_43799">I tried several calls of Kryo and also registration, but I can not get it to work.... Any ideas?</span></div><div id="yui_3_16_0_1_1423087516925_45368" dir="ltr"><span id="yui_3_16_0_1_1423087516925_43799"><br></span></div><div id="yui_3_16_0_1_1423087516925_44477" dir="ltr"><br><span id="yui_3_16_0_1_1423087516925_43799"></span></div><div id="yui_3_16_0_1_1423087516925_44478" dir="ltr"><span id="yui_3_16_0_1_1423087516925_43799">Cheers</span></div><div id="yui_3_16_0_1_1423087516925_44479" dir="ltr"><span id="yui_3_16_0_1_1423087516925_43799">Stefan</span></div><div id="yui_3_16_0_1_1423087516925_45367" dir="ltr"><span id="yui_3_16_0_1_1423087516925_43799"></span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font face="Arial" size="2"> Andreas Prlic &lt;andreas@sdsc.edu&gt; schrieb am 3:47 Samstag, 31.Januar 2015:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv7087970419"><div><div dir="ltr">Hi Stefan,<div><br clear="none"></div><div>for your use case (save and load at server start/stop) I'd recommend the Kryo library.&nbsp; It will store your data as a binary. Should be only two lines of code each to persist and load the data.&nbsp;<a rel="nofollow" shape="rect" target="_blank" href="https://github.com/EsotericSoftware/kryo">https://github.com/EsotericSoftware/kryo</a></div><div><br clear="none"></div><div>You are right, writing is not very well developed, but then there are so many utility libraries in Java that can be used for efficient serialization/deserialization in many ways, once you have an object in memory.</div><div><br clear="none"></div><div>Andreas</div><div><br clear="none"></div><div><br clear="none"></div><div class="yiv7087970419yqt9155343051" id="yiv7087970419yqt63755"><div class="yiv7087970419gmail_extra"><br clear="none"><div class="yiv7087970419gmail_quote">On Fri, Jan 30, 2015 at 3:01 AM, stefan harjes <span dir="ltr">&lt;<a rel="nofollow" shape="rect" ymailto="mailto:stefanharjes@yahoo.de" target="_blank" href="mailto:stefanharjes@yahoo.de">stefanharjes@yahoo.de</a>&gt;</span> wrote:<br clear="none"><blockquote class="yiv7087970419gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex;"><div style="color:rgb(0,0,0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;background-color:rgb(255,255,255);">Hi biojava-l<div><br clear="none"><br clear="none"></div><div style="display:block;"><div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"><div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"><div><div><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;background-color:rgb(255,255,255);"><div style="display:block;"><div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"><div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"><div><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;background-color:rgb(255,255,255);"><div><br clear="none"></div><div dir="ltr">I have a huge number of small sequences in an Array (ListArray&lt;Sequence&lt;?&gt;&gt;) which for server start and stop I would like to store on disk. Unfortunately Sequence is not serilizable, so I searched and found that GenbankWriterHelper.writeSequences(OutputStream os, Collection&lt;Sequence&lt;?&gt;&gt; seqs) should be able to do the job. <br clear="none"></div><div dir="ltr"><div>However when looking at GenbankReaderHelper, there are no methods which correspond to the above writer method. Am I on the wrong track completely? <br clear="none"></div><div><br clear="none"></div><div dir="ltr">When looking at the writer/reader helpers, I think I remember reading that they are rudimentary and save only the sequence (fasta)? I would expect in such an advanced verision of biojava (4.0 is being prepared?) that there must be a standard way to serialize rich sequences/arrays of them in order to send them around on streams/Json etc?<br clear="none"></div><div><br clear="none"></div><div>Any help would be appreciated</div></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Cheers</div><span class="yiv7087970419"><font color="#888888"></font></span><div dir="ltr">Stefan</div><br clear="none"></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div><div><br clear="none"></div>
</div></div></div></div></div><br><br></div>  </div> </div>  </div> </div></body></html>