scout/adapter/mongo/hgnc.py
def hgnc_genes(self, hgnc_symbol, build='37', search=False):
        """Fetch all hgnc genes that match a hgnc symbol

            Check both hgnc_symbol and aliases

            Args:
                hgnc_symbol(str)
                build(str): The build in which to search
                search(bool): if partial searching should be used

            Returns:
                result()
        """
        LOG.debug("Fetching genes with symbol %s" % hgnc_symbol)
        if search:
            # first search for a full match
            full_query = self.hgnc_collection.find({
                '$or': [
                    {'aliases': hgnc_symbol},
                    {'hgnc_id': int(hgnc_symbol) if hgnc_symbol.isdigit() else None},
                ],
                'build': build
            })
            if full_query.count() != 0:
                return full_query

            return self.hgnc_collection.find({
                'aliases': {'$regex': hgnc_symbol, '$options': 'i'},
                'build': build
            })

        return self.hgnc_collection.find({'build': build, 'aliases': hgnc_symbol})
def hgnc_genes(self, hgnc_symbol, build='37', search=False):
        """Fetch all hgnc genes that match a hgnc symbol

            Check both hgnc_symbol and aliases

            Args:
                hgnc_symbol(str)
                build(str): The build in which to search
                search(bool): if partial searching should be used

            Returns:
                result()
        """
        LOG.debug("Fetching genes with symbol %s" % hgnc_symbol)
        if search:
            # first search for a full match
            full_query = self.hgnc_collection.find({
                '$or': [
                    {'aliases': hgnc_symbol},
                    {'hgnc_id': int(hgnc_symbol) if hgnc_symbol.isdigit() else None},
                ],
                'build': build
            })
            if full_query.count() != 0:
                return full_query

            return self.hgnc_collection.find({
                'aliases': {'$regex': hgnc_symbol, '$options': 'i'},
                'build': build
            })

        return self.hgnc_collection.find({'build': build, 'aliases': hgnc_symbol})
Fetch all hgnc genes that match a hgnc symbol

            Check both hgnc_symbol and aliases

            Args:
                hgnc_symbol(str)
                build(str): The build in which to search
                search(bool): if partial searching should be used

            Returns:
                result()