[Biojava-dev] Sequence cloning with annotations & features...

mark.schreiber at novartis.com mark.schreiber at novartis.com
Tue Mar 29 20:51:02 EST 2005


A very crude way to "deep clone" would be to serialize the Sequence object 
and deserialize it as another object. We did a lot of work on 
Serialization a few years back to get biojava to work with it. If you 
notice anything odd let us know. The advantage of this is that both would 
be exactly the same, even down to the implementing classes.

Another less crude method with a bigger overhead would be to serialize to 
BioSQL and then read it back in. You could also write the sequence to a 
flat file (EMBL format or similar) and read it back in again, actually 
that may destroy your nested features as I don't think there is a flatfile 
format that can support them. 
Finally and most elegantly you could code up a Sequence copier that 
regenerates the annotation and feature heirachy. This would be ideal and 
possibly not to hard to do it simplistically. If you wanted to get really 
fancy you could use reflection to make sure you even got the exact same 
implementation of Sequence, Feature etc.

Mark Schreiber
Principal Scientist (Bioinformatics)

Novartis Institute for Tropical Diseases (NITD)
10 Biopolis Road
#05-01 Chromos
Singapore 138670
www.nitd.novartis.com

phone +65 6722 2973
fax  +65 6722 2910





David Jung <jungdl at ornl.gov>
Sent by: biojava-dev-bounces at portal.open-bio.org
03/30/2005 06:52 AM

 
        To:     biojava-dev at biojava.org
        cc:     (bcc: Mark Schreiber/GP/Novartis)
        Subject:        [Biojava-dev] Sequence cloning with annotations & features...


Hello.
I was wondering if someone could suggest the best way to
clone a Sequence (since it isn't a Cloneable).  I'd like
to clone the raw sequence, annotations and features.
I know how to clone the raw sequence and annotations,
but aren't sure how to clone features, including
all nested features recursively.
(This is so that I can add features to the clone
and they won't appear on the original Sequence)
Thanks,
-David Jung.

_______________________________________________
biojava-dev mailing list
biojava-dev at biojava.org
http://biojava.org/mailman/listinfo/biojava-dev




______________________________________________________________________
The Novartis email address format has changed to 
firstname.lastname at novartis.com.  Please update your address book 
accordingly.
______________________________________________________________________


More information about the biojava-dev mailing list