scout/adapter/mongo/hgnc.py
def add_hgnc_id(self, genes):
        """Add the correct hgnc id to a set of genes with hgnc symbols

        Args:
            genes(list(dict)): A set of genes with hgnc symbols only

        """
        genes_by_alias = self.genes_by_alias()

        for gene in genes:
            id_info = genes_by_alias.get(gene['hgnc_symbol'])
            if not id_info:
                LOG.warning("Gene %s does not exist in scout", gene['hgnc_symbol'])
                continue
            gene['hgnc_id'] = id_info['true']
            if not id_info['true']:
                if len(id_info['ids']) > 1:
                    LOG.warning("Gene %s has ambiguous value, please choose one hgnc id in result", gene['hgnc_symbol'])
                gene['hgnc_id'] = ','.join([str(hgnc_id) for hgnc_id in id_info['ids']])
def add_hgnc_id(self, genes):
        genes_by_alias = self.genes_by_alias()

        for gene in genes:
            id_info = genes_by_alias.get(gene['hgnc_symbol'])
            if not id_info:
                LOG.warning("Gene %s does not exist in scout", gene['hgnc_symbol'])
                continue
            gene['hgnc_id'] = id_info['true']
            if not id_info['true']:
                if len(id_info['ids']) > 1:
                    LOG.warning("Gene %s has ambiguous value, please choose one hgnc id in result", gene['hgnc_symbol'])
                gene['hgnc_id'] = ','.join([str(hgnc_id) for hgnc_id in id_info['ids']])
def add_hgnc_id ( self , genes ) : genes_by_alias = self . genes_by_alias ( ) for gene in genes : id_info = genes_by_alias . get ( gene [ 'hgnc_symbol' ] ) if not id_info : LOG . warning ( "Gene %s does not exist in scout" , gene [ 'hgnc_symbol' ] ) continue gene [ 'hgnc_id' ] = id_info [ 'true' ] if not id_info [ 'true' ] : if len ( id_info [ 'ids' ] ) > 1 : LOG . warning ( "Gene %s has ambiguous value, please choose one hgnc id in result" , gene [ 'hgnc_symbol' ] ) gene [ 'hgnc_id' ] = ',' . join ( [ str ( hgnc_id ) for hgnc_id in id_info [ 'ids' ] ] )
Add the correct hgnc id to a set of genes with hgnc symbols

        Args:
            genes(list(dict)): A set of genes with hgnc symbols only
Add the correct hgnc id to a set of genes with hgnc symbols