[Biojava-l] equality of proteins based on their aminoacid sequence signature

Andy Yates ayates at ebi.ac.uk
Thu Mar 10 09:17:45 UTC 2011


I cannot remember the reason why we decided to not include equality for these objects. It's not an unreasonable thing to want though. Assuming I have some time soon I can have a look into implementing it on AbstractCompound, AbstractSequence & the backing stores but it will be some time away. If anyone else wants to give it a shot ... :)

Andy

On 10 Mar 2011, at 01:04, Andreas Prlic wrote:

> Hi François,
> 
> you could try to compare the string representation of the sequences...
> 
> Andreas
> 
> 2011/3/9 Andy Yates <ayates at ebi.ac.uk>:
>> Hi Francois,
>> 
>> Neither Compounds nor Sequences have an over-ridden equals() & hashcode() method which is why you're seeing the current behaviour.
>> 
>> Andy
>> 
>> On 9 Mar 2011, at 20:12, François Le Fevre wrote:
>> 
>>> Dear all,
>>> 
>>> I would like to know if 2 proteins that have the same sequence of aminoacid should be equals?
>>> I was wandering that 2 Sequence<AminoAcidCompound> that have exactly the same string signature should be the same.
>>> But it seems to be not the case.
>>> Is it normal?
>>> 
>>> Thank for your help.
>>> 
>>> 
>>> Sequence<AminoAcidCompound> protein1 = MKRISTTITTTITITTGNGAG    hash=801818331
>>> Sequence<AminoAcidCompound> protein2 = MKRISTTITTTITITTGNGAG    hash=700804192
>>> 
>>> protein1.equals(protein2) return false.
>>> 
>>> Francois
>>> 
>>> --
>>> ----------------------
>>> Francois LE FEVRE
>>> 
>>> _______________________________________________
>>> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>> 
>> --
>> Andrew Yates                   Ensembl Genomes Engineer
>> EMBL-EBI                       Tel: +44-(0)1223-492538
>> Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
>> Cambridge CB10 1SD, UK         http://www.ensemblgenomes.org/
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>> 

-- 
Andrew Yates                   Ensembl Genomes Engineer
EMBL-EBI                       Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK         http://www.ensemblgenomes.org/








More information about the Biojava-l mailing list