# Columns with less than sequence_min are 0'ed, otherwise set to 1.
def mask_sequence_min
mask = NArray.byte(@cols, @rows) + 1
- mask *= ((@na_seq > 0).sum(1) >= @options[:sequence_min])
+ mask *= ((@na_seq > 0).to_type("int").sum(1) >= @options[:sequence_min])
mask
end
# Positions with residues above the residue_min are indicated with 1.
def mask_residue_min
cons_min = @options[:residue_min]
- factor = 1 / @na_seq.ne(0).sum(1).to_type("float")
+ factor = 1 / @na_seq.ne(0).to_type("float").sum(1)
- mask_A = @na_seq & BIT_A > 0
- mask_T = @na_seq & BIT_T > 0
- mask_C = @na_seq & BIT_C > 0
- mask_G = @na_seq & BIT_G > 0
+ mask_A = (@na_seq & BIT_A > 0).to_type("int")
+ mask_T = (@na_seq & BIT_T > 0).to_type("int")
+ mask_C = (@na_seq & BIT_C > 0).to_type("int")
+ mask_G = (@na_seq & BIT_G > 0).to_type("int")
mask_A = (mask_A * mask_A.sum(1)) * factor >= cons_min
mask_T = (mask_T * mask_T.sum(1)) * factor >= cons_min
# Columns with more gaps are 0'ed, others are set to 1.
def mask_gap_max
mask = NArray.byte(@cols, @rows) + 1
- mask *= @na_seq.ne(0).sum(1).to_type("float") / @rows > @options[:gap_max]
+ mask *= @na_seq.ne(0).to_type("float").sum(1) / @rows > @options[:gap_max]
mask
end