本文整理匯總了Python中criteria.helper.criteria.Criteria.process_criteria方法的典型用法代碼示例。如果您正苦於以下問題:Python Criteria.process_criteria方法的具體用法?Python Criteria.process_criteria怎麽用?Python Criteria.process_criteria使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類criteria.helper.criteria.Criteria
的用法示例。
在下文中一共展示了Criteria.process_criteria方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: process_criterias
# 需要導入模塊: from criteria.helper.criteria import Criteria [as 別名]
# 或者: from criteria.helper.criteria.Criteria import process_criteria [as 別名]
def process_criterias(cls, feature, criteria=None, config=None, show=False, test=False):
'''function to delegate the call to the right criteria class and build the criteria for that class
'''
from criteria.helper.criteria import Criteria
from criteria.helper.gene_criteria import GeneCriteria
from criteria.helper.marker_criteria import MarkerCriteria
from criteria.helper.region_criteria import RegionCriteria
from criteria.helper.study_criteria import StudyCriteria
if config is None:
if test:
config = cls.get_criteria_config(ini_file='test_criteria.ini')
else:
config = cls.get_criteria_config(ini_file='criteria.ini')
available_criterias = Criteria.get_available_criterias(feature, config=config, test=test)[feature]
criterias_to_process = []
if criteria is None:
criterias_to_process = available_criterias
else:
criterias_list = criteria.split(',')
criterias_to_process = [criteria.strip() for criteria in criterias_list
if criteria.strip() in available_criterias]
if show:
print(criterias_to_process)
return criterias_to_process
logger.debug(datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d %H:%M:%S'))
for section in criterias_to_process:
if feature == 'gene':
print('Call to build criteria gene index')
Criteria.process_criteria(feature, section, config, GeneCriteria, test=test)
elif feature == 'marker':
print('Call to build criteria marker index')
Criteria.process_criteria(feature, section, config, MarkerCriteria, test=test)
elif feature == 'region':
print('Call to build criteria region index')
Criteria.process_criteria(feature, section, config, RegionCriteria, test=test)
elif feature == 'study':
print('Call to build criteria study index')
Criteria.process_criteria(feature, section, config, StudyCriteria, test=test)
else:
logger.critical('Unsupported feature ... please check the inputs')
logger.debug(datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d %H:%M:%S'))
logger.debug('========DONE==========')