def gene_to_panels(self, case_obj):
LOG.info("<STR_LIT>")<EOL>gene_dict = {}<EOL>for panel_info in case_obj.get('<STR_LIT>', []):<EOL><INDENT>panel_name = panel_info['<STR_LIT>']<EOL>panel_version = panel_info['<STR_LIT:version>']<EOL>panel_obj = self.gene_panel(panel_name, version=panel_version)<EOL>if not panel_obj:<EOL><INDENT>LOG.warning("<STR_LIT>".format(panel_name, panel_version))<EOL><DEDENT>for gene in panel_obj['<STR_LIT>']:<EOL><INDENT>hgnc_id = gene['<STR_LIT>']<EOL>if hgnc_id not in gene_dict:<EOL><INDENT>gene_dict[hgnc_id] = set([panel_name])<EOL>continue<EOL><DEDENT>gene_dict[hgnc_id].add(panel_name)<EOL><DEDENT><DEDENT>LOG.info("<STR_LIT>")<EOL>return gene_dict<EOL>
Fetch all gene panels and group them by gene

            Args:
                case_obj(scout.models.Case)
            Returns:
                gene_dict(dict): A dictionary with gene as keys and a set of
                                 panel names as value