scout/adapter/mongo/variant.py
def overlapping(self, variant_obj):
        """Return overlapping variants.

        Look at the genes that a variant overlaps to.
        Then return all variants that overlap these genes.

        If variant_obj is sv it will return the overlapping snvs and oposite
        There is a problem when SVs are huge since there are to many overlapping variants.

        Args:
            variant_obj(dict)

        Returns:
            variants(iterable(dict))
        """
        #This is the category of the variants that we want to collect
        category = 'snv' if variant_obj['category'] == 'sv' else 'sv'

        query = {
            '$and': [
                {'case_id': variant_obj['case_id']},
                {'category': category},
                {'hgnc_ids' : { '$in' : variant_obj['hgnc_ids']}}
            ]
        }

        sort_key = [('rank_score', pymongo.DESCENDING)]
        # We collect the 30 most severe overlapping variants
        variants = self.variant_collection.find(query).sort(sort_key).limit(30)

        return variants
def overlapping(self, variant_obj):
        """Return overlapping variants.

        Look at the genes that a variant overlaps to.
        Then return all variants that overlap these genes.

        If variant_obj is sv it will return the overlapping snvs and oposite
        There is a problem when SVs are huge since there are to many overlapping variants.

        Args:
            variant_obj(dict)

        Returns:
            variants(iterable(dict))
        """
        #This is the category of the variants that we want to collect
        category = 'snv' if variant_obj['category'] == 'sv' else 'sv'

        query = {
            '$and': [
                {'case_id': variant_obj['case_id']},
                {'category': category},
                {'hgnc_ids' : { '$in' : variant_obj['hgnc_ids']}}
            ]
        }

        sort_key = [('rank_score', pymongo.DESCENDING)]
        # We collect the 30 most severe overlapping variants
        variants = self.variant_collection.find(query).sort(sort_key).limit(30)

        return variants
Return overlapping variants.

        Look at the genes that a variant overlaps to.
        Then return all variants that overlap these genes.

        If variant_obj is sv it will return the overlapping snvs and oposite
        There is a problem when SVs are huge since there are to many overlapping variants.

        Args:
            variant_obj(dict)

        Returns:
            variants(iterable(dict))