@entries.size
end
+ # Method that returns the identity of an alignment with two members.
+ def identity
+ if self.members != 2
+ raise AlignError "Bad number of members for similarity calculation: #{self.members}"
+ end
+
+ na1 = NArray.to_na(@entries[0].seq.upcase, "byte")
+ na2 = NArray.to_na(@entries[1].seq.upcase, "byte")
+
+ shared = (na1 - na2).count_false
+ total = (@entries[0].length < @entries[1].length) ? @entries[0].length : @entries[1].length
+ identity = (shared.to_f / total).round(2)
+
+ identity
+ end
+
# Method to create a consensus sequence from an Align object and
# return a new Seq object with the consensus.
def consensus