scout/adapter/mongo/panel.py
def gene_panel(self, panel_id, version=None):
        """Fetch a gene panel.

        If no panel is sent return all panels

        Args:
            panel_id (str): unique id for the panel
            version (str): version of the panel. If 'None' latest version will be returned

        Returns:
            gene_panel: gene panel object
        """
        query = {'panel_name': panel_id}
        if version:
            LOG.info("Fetch gene panel {0}, version {1} from database".format(
                panel_id, version
            ))
            query['version'] = version
            return self.panel_collection.find_one(query)
        else:
            LOG.info("Fetching gene panels %s from database", panel_id)
            res = self.panel_collection.find(query).sort('version', -1)
            if res.count() > 0:
                return res[0]
            else:
                LOG.info("No gene panel found")
                return None
def gene_panel(self, panel_id, version=None):
        query = {'panel_name': panel_id}
        if version:
            LOG.info("Fetch gene panel {0}, version {1} from database".format(
                panel_id, version
            ))
            query['version'] = version
            return self.panel_collection.find_one(query)
        else:
            LOG.info("Fetching gene panels %s from database", panel_id)
            res = self.panel_collection.find(query).sort('version', -1)
            if res.count() > 0:
                return res[0]
            else:
                LOG.info("No gene panel found")
                return None
def gene_panel ( self , panel_id , version = None ) : query = { 'panel_name' : panel_id } if version : LOG . info ( "Fetch gene panel {0}, version {1} from database" . format ( panel_id , version ) ) query [ 'version' ] = version return self . panel_collection . find_one ( query ) else : LOG . info ( "Fetching gene panels %s from database" , panel_id ) res = self . panel_collection . find ( query ) . sort ( 'version' , - 1 ) if res . count ( ) > 0 : return res [ 0 ] else : LOG . info ( "No gene panel found" ) return None
Fetch a gene panel.

        If no panel is sent return all panels

        Args:
            panel_id (str): unique id for the panel
            version (str): version of the panel. If 'None' latest version will be returned

        Returns:
            gene_panel: gene panel object
Fetch a gene panel .