# result in a new bit array. Bits are copied if they exists in BOTH operands.
# 00111100 & 00001101 = 00001100
def &(ba)
- raise BitArrayError, "uneven size of bit arrays: #{self.size} vs #{ba.size}" if self.size != ba.size
+ raise BitArrayError, "uneven size of bit arrays: #{self.size} != #{ba.size}" if self.size != ba.size
result = BitArray.new(ba.size)
# result in a new bit array. Bits are copied if they exists in EITHER operands.
# 00111100 | 00001101 = 00111101
def |(ba)
- raise BitArrayError, "uneven size of bit arrays: #{self.size} vs #{ba.size}" if self.size != ba.size
+ raise BitArrayError, "uneven size of bit arrays: #{self.size} != #{ba.size}" if self.size != ba.size
result = BitArray.new(ba.size)
# result in a new bit array. Bits are copied if they exists in ONE BUT NOT BOTH operands.
# 00111100 ^ 00001101 = 00110001
def ^(ba)
- raise BitArrayError, "uneven size of bit arrays: #{self.size} vs #{ba.size}" if self.size != ba.size
+ raise BitArrayError, "uneven size of bit arrays: #{self.size} != #{ba.size}" if self.size != ba.size
result = BitArray.new(ba.size)
string
end
+ alias :to_s :to_string
+
private
# Method to initialize the byte array (string) that constitutes the bit array.
self.seq.nil? ? 0 : self.seq.length
end
- alias len length
+ alias :len :length
# Return the number indels in a sequence.
def indels
self.complement
end
- alias revcomp reverse_complement
+ alias :revcomp :reverse_complement
# Method to reverse the sequence.
def reverse