def compute_distances(self, sequences): for seq1, val1 in sequences.items(): for seq2, val2 in sequences.items(): if ("".join([seq1, seq2]) not in self.distances): self.distances["".join([seq1, seq2])] = \ hamming_distance(val1, val2) self.distances["".join([seq2, seq1])] = \ self.distances["".join([seq1, seq2])]
def compute_distances(self, sequences): for seq1 in sequences.keys(): for seq2 in sequences.keys(): if ("".join([seq1, seq2]) not in self.distances): self.distances["".join([seq1, seq2])] = hamming_distance( sequences[seq1], sequences[seq2]) self.distances["".join( [seq2, seq1])] = self.distances["".join([seq1, seq2])]
def compute_distances(self, sequences): for seq1 in sequences.keys(): for seq2 in sequences.keys(): if "".join([seq1, seq2]) not in self.distances: self.distances["".join([seq1, seq2])] = hamming_distance(sequences[seq1], sequences[seq2]) self.distances["".join([seq2, seq1])] = self.distances["".join([seq1, seq2])]