[Bioperl-l] hash key for SeqFeatureI

Hilmar Lapp hlapp at gnf.org
Mon Mar 29 16:22:40 EST 2004


On Thursday, March 25, 2004, at 07:05  AM, Peter van Heusden wrote:

> for SeqFeatureI, I was wondering whether the following is adaquate: 
> primary_tag(), display_id(), location->start(), location->end()?

You will also need strand and source_tag, whereas display_id has no 
bearing on uniqueness.

You may want to check out ChrisM's recent generate_unique_ID code and 
hash the resulting string.

> The point of a hash_key() method is to return a string which uniquely 
> identifies the object - i.e. if two hash keys are identical, then the 
> objects are equivalent.

Be very careful with this one though. What is the hash function you're 
going to use? Almost all hash functions define inequality directly, but 
not equality. I.e., if two objects have different hash codes, they must 
compare unequal, but two objects returning the same hash code may still 
compare as unequal.

	-hilmar
-- 
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------




More information about the Bioperl-l mailing list