[Biojava-l] Symbol equality
Matthew Pocock
matthew_pocock@yahoo.co.uk
Mon, 14 Jan 2002 12:56:45 +0000 (GMT)
Hi Mark,
I don't know if there are any utility methods
available for this sort of thing. Java provides two
equivalence methods - the == operator and the
.equals() method. == checks if the two objects are
identical - do they reside in the same chunk of
memory? .equals() checks if the two objects behave the
same - have the same responses for all methods under
all circumstances. I guess comparing symbols is
another equivalence relation, but Java doesn't provide
a nice framework for plugging in equivalences.
You could look at this as a partial ordering over sets
of sequences.
A > B iff the sequence B has the same length as A, and
Ai.getSymbols().accepts(Bi), which we could write as
Ai > Bi
A == B iff A.length() == B.length() && Ai == Bi
C = A u B iff A.length() == B.length() && Ai > Ci &&
Bi > Ci
The last one of these three comparisons says that two
sequences are in the same class iff there is at least
one sequence that is a specific case of both of them
e.g. ANY and AYN both can match to AYY.
This should all be trivial to code up. Unfortunately,
I still don't have a propper net connection. Any
takers?
Matthew
--- "Schreiber, Mark"
<mark.schreiber@agresearch.co.nz> wrote: > Hi -
>
> What is the best way to test for symbol equality in
> biojava.
>
> for example one would expect that N is not
> equivalent to A, however in
> some cases it would be nice to tolerate the fact
> that sometimes N can be
> A and that A is a member of N.
>
> So what is the best way to do a strict equality test
> ie is subsequence x
> equal to acggttg
>
> and what is the best way to do an ambiguous equality
> test, ie is
> subsequence x a member of yynggws
>
> thanks -
>
>
> Mark Schreiber
> Bioinformatics
> AgResearch Invermay
> PO Box 50034
> Mosgiel
> New Zealand
>
> PH: +64 3 489 9175
>
>
>
>
=======================================================================
> 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.
>
=======================================================================
> _______________________________________________
> Biojava-l mailing list - Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com