本文整理汇总了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==========')