def filter_clades(self):
passed = []<EOL>carrs = np.array([list(i[<NUM_LIT:0>]) for i in self.clade_counts], dtype=int)<EOL>freqs = np.array([i[<NUM_LIT:1>] for i in self.clade_counts])<EOL>for idx in range(carrs.shape[<NUM_LIT:0>]):<EOL><INDENT>conflict = False<EOL>if freqs[idx] < self.cutoff:<EOL><INDENT>continue<EOL><DEDENT>for pidx in passed:<EOL><INDENT>intersect = np.max(carrs[idx] + carrs[pidx]) > <NUM_LIT:1><EOL>subset_test0 = np.all(carrs[idx] - carrs[pidx] >= <NUM_LIT:0>)<EOL>subset_test1 = np.all(carrs[pidx] - carrs[idx] >= <NUM_LIT:0>)<EOL>if intersect:<EOL><INDENT>if (not subset_test0) and (not subset_test1):<EOL><INDENT>conflict = True<EOL><DEDENT><DEDENT><DEDENT>if not conflict:<EOL><INDENT>passed.append(idx)<EOL><DEDENT><DEDENT>rclades = []<EOL>for idx in passed:<EOL><INDENT>rclades.append((carrs[idx], freqs[idx]))<EOL><DEDENT>self.fclade_counts = rclades<EOL>
Remove conflicting clades and those < cutoff to get majority rule