def scan_genotypes(self, genotypes, sub_ids=None, db=None):
"""Pass through all genotypes and return only the indices of those that pass the filter.
:param genotypes: np.ndarray[uint64, dim=2]
:rtype: np.ndarray[uint64]"""
if self.shortcut:
return np.zeros(0)
N = len(genotypes)
if sub_ids is not None:
variant_ids = sub_ids
elif self.val == 'x_linked' and db:
variant_ids = genotypes_service(db).chrX
else:
variant_ids = np.asarray(range(1,N+1), dtype=np.uint64)
active_idx = np.asarray(self.ss.active_idx, dtype=np.uint16)
conditions = self.conditions_vector
is_and = self.merge_op == AND
if len(conditions) == 0:
passing = variant_ids
else:
passing = self.parallel_apply_bitwise(genotypes, variant_ids, conditions, active_idx, is_and)
return passing
评论列表
文章目录