[BioPython] How to test Sequence objects for equality?

Peter biopython at maubp.freeserve.co.uk
Sat Mar 29 12:31:38 EDT 2008


I wrote:
>  So you want to know if two ambiguous sequences are "compatible"? ...

I realised I wasn't being entirely consistent:
 ACT and ACT -> True
 ACT and ACA -> False
 ACT and ACR -> False (R = G or C)
 ACT and ACN -> Maybe
 ACY and ACN -> Maybe
 ACY and ACR -> False (Y = T or C, R = G or A)
 ACY and ACM -> Maybe

So a boolean function which returns True when two ambiguous sequences
could be equal is actually possible.

On the implementation, rather than generating all possible
non-ambiguous interpretations of the sequences and looking for a
match, we'd just need to tabulate all the possible pairwise
combinations of letters.  We'd also need to do this for DNA vs DNA,
RNA vs RNA and Protein vs Protein.  This could probably live somewhere
in Bio.SeqUtils

Peter


More information about the BioPython mailing list