scout/adapter/mongo/hgnc.py
def hgncsymbol_to_gene(self, build='37', genes=None):
        """Return a dictionary with hgnc_symbol as key and gene_obj as value

        The result will have ONE entry for each gene in the database.
        (For a specific build)

        Args:
            build(str)
            genes(iterable(scout.models.HgncGene)):

        Returns:
            hgnc_dict(dict): {<hgnc_symbol(str)>: <gene(dict)>}

        """
        hgnc_dict = {}
        LOG.info("Building hgncsymbol_to_gene")
        if not genes:
            genes = self.hgnc_collection.find({'build':build})

        for gene_obj in genes:
            hgnc_dict[gene_obj['hgnc_symbol']] = gene_obj
        LOG.info("All genes fetched")
        return hgnc_dict
def hgncsymbol_to_gene(self, build='37', genes=None):
        hgnc_dict = {}
        LOG.info("Building hgncsymbol_to_gene")
        if not genes:
            genes = self.hgnc_collection.find({'build':build})

        for gene_obj in genes:
            hgnc_dict[gene_obj['hgnc_symbol']] = gene_obj
        LOG.info("All genes fetched")
        return hgnc_dict
def hgncsymbol_to_gene ( self , build = '37' , genes = None ) : hgnc_dict = { } LOG . info ( "Building hgncsymbol_to_gene" ) if not genes : genes = self . hgnc_collection . find ( { 'build' : build } ) for gene_obj in genes : hgnc_dict [ gene_obj [ 'hgnc_symbol' ] ] = gene_obj LOG . info ( "All genes fetched" ) return hgnc_dict
Return a dictionary with hgnc_symbol as key and gene_obj as value

        The result will have ONE entry for each gene in the database.
        (For a specific build)

        Args:
            build(str)
            genes(iterable(scout.models.HgncGene)):

        Returns:
            hgnc_dict(dict): {<hgnc_symbol(str)>: <gene(dict)>}
Return a dictionary with hgnc_symbol as key and gene_obj as value