+ # Class method to convert a sequence string to a bit string
+ # where the bit positions in each char corresponds to the following:
+ # A = 1000
+ # C = 0100
+ # G = 0010
+ # T = 0001
+ # And ambiguity codes are expressed using similar bit fields.
+ def self.to_bin(seq)
+ seq.tr(AMBIGUITY_STR, AMBIGUITY_BIN)
+ end
+
+ # Class method to convert a bit string to a NArray.
+ def self.to_na(seq)
+ NArray.to_na(self.to_bin(seq), 'byte')
+ end
+
+ # Class method to calculate the Hamming Distance between
+ # two bit fields encoding in NArrays.