scout/adapter/mongo/variant.py
def other_causatives(self, case_obj, variant_obj):
        """Find the same variant in other cases marked causative.

        Args:
            case_obj(dict)
            variant_obj(dict)

        Yields:
            other_variant(dict)
        """
        # variant id without "*_[variant_type]"
        variant_id = variant_obj['display_name'].rsplit('_', 1)[0]

        institute_causatives = self.get_causatives(variant_obj['institute'])
        for causative_id in institute_causatives:
            other_variant = self.variant(causative_id)
            if not other_variant:
                continue
            not_same_case = other_variant['case_id'] != case_obj['_id']
            same_variant = other_variant['display_name'].startswith(variant_id)
            if not_same_case and same_variant:
                yield other_variant
def other_causatives(self, case_obj, variant_obj):
        # variant id without "*_[variant_type]"
        variant_id = variant_obj['display_name'].rsplit('_', 1)[0]

        institute_causatives = self.get_causatives(variant_obj['institute'])
        for causative_id in institute_causatives:
            other_variant = self.variant(causative_id)
            if not other_variant:
                continue
            not_same_case = other_variant['case_id'] != case_obj['_id']
            same_variant = other_variant['display_name'].startswith(variant_id)
            if not_same_case and same_variant:
                yield other_variant
def other_causatives ( self , case_obj , variant_obj ) : # variant id without "*_[variant_type]" variant_id = variant_obj [ 'display_name' ] . rsplit ( '_' , 1 ) [ 0 ] institute_causatives = self . get_causatives ( variant_obj [ 'institute' ] ) for causative_id in institute_causatives : other_variant = self . variant ( causative_id ) if not other_variant : continue not_same_case = other_variant [ 'case_id' ] != case_obj [ '_id' ] same_variant = other_variant [ 'display_name' ] . startswith ( variant_id ) if not_same_case and same_variant : yield other_variant
Find the same variant in other cases marked causative.

        Args:
            case_obj(dict)
            variant_obj(dict)

        Yields:
            other_variant(dict)
Find the same variant in other cases marked causative .