Re: new problem: serializable

George Waldon <[email protected]>
Newsgroups gmane.comp.java.bio.general
Message-ID <[email protected]>
Hi Bernd:

I am having this need too. Have you been able to serialize properly  
SimpleRichSequence? Is-it possible for you to share you code? We could  
add it to BioJava. Let me know.

Thanks,
George

------------------------------------------------------------------------------
On Mon, Sep 27, 2010 at 6:17 AM, Bernd Jagla <[email protected]> wrote:

      Yes, that's what I am doing. I have subclassed from  
SimpleRichSequence to SimpleSerializableRichSequence (couldn't think  
of something nicer...) and am working my way through the bits...
     I just haven't found the tools that make this a "jiffy". I am  
sweating here; more or less at least.. ;)
     Thanks again
     B

     On 9/27/2010 2:04 PM, Richard Holland wrote:

         I think you can follow James' advice and subclass  
SimpleRichSequence, and then annotate it such that the awkward bits  
are not seralised.

         Or, you can just extract the parameters of interest out of  
the original object and put them into some holding class (e.g. a  
simple HashMap) as I suggested and serialise that instead.

         cheers,
         Richard

         On 27 Sep 2010, at 13:01, Bernd Jagla wrote:

             Thanks everyone. I got the biojavax working.
             Unfortunately the serialization process is not completely  
done yet ...
             It turns out the following information is more difficult  
than expected to serialize... I haven't found a tool in Eclipse that  
can help me there.

             Generally the problems arise when dealing with Sets like  
annotation, features, notes, RankedDocRef.
             But I also have problems with SimpleNCBITaxon.

             At least I was able to create a SimpleRichSequence object

             Please let me know if you can think of something that  
would ease the work a bit....

             Thanks a lot,

             Bernd



             On 9/23/2010 6:01 PM, James Swetnam wrote:

                 How about subclassing SimpleRichSequence and  
implementing serializable yourself?  Doesn't seem to be final.   
Eclipse can do it in a jiffy.  Hacky, but will get you over the bump.

                 James Swetnam

                 On Thu, Sep 23, 2010 at 11:34 AM, Richard  
Holland<[email protected]>  wrote:
                 The RichSequence interface doesn't extend  
Serializable, so therefore you can't seralize BioJavaX sequence  
objects. :( I can't remember the logic behind that one but it seemed  
like there was a good reason at the time...

                 If you're passing sequences around by serialisation,  
do you really need to pass the complete object or could you just pass  
the bits you're interested in in some kind of basic data structure?


                 On 23 Sep 2010, at 16:27, Bernd Jagla wrote:

                     Sorry, again me...

                     I now get the following error:

                     Caused by: java.io.NotSerializableException:  
org.biojavax.bio.seq.SimpleRichSequence
                        at  
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
                        at  
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
                        at  
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
                        at  
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
                        at  
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
                        at  
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
                        at  
org.knime.core.data.container.DCObjectOutputVersion2.writeDataCellPerJavaSerialization(DCObjectOutputVersion2.java:127)
                        at  
org.knime.core.data.container.Buffer.writeBlobDataCell(Buffer.java:1253)
                        at  
org.knime.core.data.container.Buffer.handleIncomingBlob(Buffer.java:790)
                        at  
org.knime.core.data.container.Buffer.saveBlobs(Buffer.java:607)
                        at  
org.knime.core.data.container.Buffer.addRow(Buffer.java:551)
                        ... 9 more

                     It seems that the SimpleRichSequence is not  
serializable....

                     Is there a way to make use of a serializable object?

                     Thanks,

                     Bernd

                     _______________________________________________
                     Biojava-l mailing list  -  [email protected]
                     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: [email protected]
                 http://www.eaglegenomics.com/


                 _______________________________________________
                 Biojava-l mailing list  -  [email protected]
                 http://lists.open-bio.org/mailman/listinfo/biojava-l



                 --
                 James Swetnam
                 Lead Scientific Programmer
                 Department of Pharmacology
                 NYU Langone Medical Center

         --
         Richard Holland, BSc MBCS
         Operations and Delivery Director, Eagle Genomics Ltd
         T: +44 (0)1223 654481 ext 3 | E: [email protected]
         http://www.eaglegenomics.com/




     _______________________________________________
     Biojava-l mailing list  -  [email protected]
     http://lists.open-bio.org/mailman/listinfo/biojava-l

_______________________________________________
Biojava-l mailing list  -  [email protected]
http://lists.open-bio.org/mailman/listinfo/biojava-l
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.