<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 (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=""> Kryo kryo = new Kryo();<br style="" class=""> DNASequence dna=null;<br style="" class=""> try {<br style="" class=""> dna = new DNASequence("AGCT");<br style="" class=""> } catch (CompoundNotFoundException e1) {<br style="" class=""> // TODO Auto-generated catch block<br style="" class=""> e1.printStackTrace();<br style="" class=""> }<br style="" class=""> try {<br style="" class=""> Output output = new Output(new FileOutputStream("test.ser"));<br style="" class=""> kryo.writeObject(output, dna);<br style="" class=""> output.close(); <br style="" class=""> } catch (FileNotFoundException e) {<br style="" class=""> // TODO Auto-generated catch block<br style="" class=""> e.printStackTrace();<br style="" class=""> }<br style="" class=""> try {<br style="" class=""> Input input = new Input(new FileInputStream("test.ser"));<br style="" class=""> dna = kryo.readObject(input, DNASequence.class);<br style="" class=""> input.close();<br style="" class=""> } catch (FileNotFoundException e) {<br style="" class=""> // TODO Auto-generated catch block<br style="" class=""> System.out.println("file not found");<br style="" class=""> e.printStackTrace();<br style="" class=""> }<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 <andreas@sdsc.edu> 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. It will store your data as a binary. Should be only two lines of code each to persist and load the data. <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"><<a rel="nofollow" shape="rect" ymailto="mailto:stefanharjes@yahoo.de" target="_blank" href="mailto:stefanharjes@yahoo.de">stefanharjes@yahoo.de</a>></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<Sequence<?>>) 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<Sequence<?>> 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>