[Biojava-l] FeatureHolder.containsFeature()

Schreiber, Mark mark.schreiber@agresearch.co.nz
Fri, 5 Apr 2002 09:26:59 +1200


I suppose two features from different sequences/ feature holders could
produce the same template but like you say there is no easy way around
this. We could specify that features only look to see if the have the
same chain of parents, ignoring children. However a Sequence if
converted to a GenBank (or similar) file looses all its nested feature
heirachy so when the sequence is read back from the GB file it will have
the same features but not nescesarrily nested as the original thus if
parent child relationships are taken into account equality would fail
here.

Mark

> -----Original Message-----
> From: Matthew Pocock [mailto:matthew_pocock@yahoo.co.uk] 
> Sent: Thursday, 4 April 2002 10:53 p.m.
> To: David Huen; biojava-l@biojava.org
> Subject: Re: [Biojava-l] FeatureHolder.containsFeature()
> 
> 
> Hum,
> 
> I would be happy if equals and hashCode on feature worked by 
> being equivalent to delegating to the return value of 
> makeTemplate - this includes all info except the children and 
> parent. Since features can access both children and parents, 
> you would potentialy get into a circular stack if you took 
> hashcodes or equals of all fields.
> 
> Are there cases where two "equivalent" feature instances 
> wouldn't produce the same templates? Are there any cases 
> where two "non-equivalent" features would produce the same 
> template (baring parent/child issues)?
> 
> Matthew
> 
> ----- Original Message -----
> From: "David Huen" <smh1008@cus.cam.ac.uk>
> To: <biojava-l@biojava.org>
> Sent: Wednesday, April 03, 2002 10:17 PM
> Subject: [Biojava-l] FeatureHolder.containsFeature()
> 
> 
> > Hi,
> > I'm going thru' the process of doing a Gadfly-to-BioJava bridge.
> >
> > What are the semantics of containsFeature() should have?  In 
> > SimpleFeatureHolder.java, it goes for the objects being identical 
> > which makes sense for an in-memory implementation but much more 
> > problematic with a database-backed object.
> >
> > If containsFeature() should work on "equality" of object, 
> when should 
> > objects be equal?  When all fields are identical?  Or when Location 
> > type (and strand if relevant) match?  How do we deal with the 
> > annotation bundle?  If it is required for equality how do we deem 
> > equality?
> >
> > Or do we attempt to circumvent all this by requiring that 
> the feature 
> > has the same row id in its respective table as the feature being 
> > compared?
> >
> > Thanks,
> > David Huen
> >
> > _______________________________________________
> > Biojava-l mailing list  -  Biojava-l@biojava.org 
> > http://biojava.org/mailman/listinfo/biojava-l
> 
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org 
> http://biojava.org/mailman/listinfo/biojava-l
> 
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================