本文整理汇总了Python中tasks.models.Task.analysis方法的典型用法代码示例。如果您正苦于以下问题:Python Task.analysis方法的具体用法?Python Task.analysis怎么用?Python Task.analysis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tasks.models.Task
的用法示例。
在下文中一共展示了Task.analysis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_analysis_tasks
# 需要导入模块: from tasks.models import Task [as 别名]
# 或者: from tasks.models.Task import analysis [as 别名]
def create_analysis_tasks(analysis_id):
print('analysis_id', analysis_id)
# samples = []
# print('hello!')
#create analysis tasks
# analysis = Analysis.objects.()
analysis = Analysis.objects.get(pk=analysis_id)
print(dir(analysis))
params = analysis.params
files = params['files']
for file in files:
task = Task(user=analysis.user)
task.manifest = {}
task.manifest['files'] = [file]
task.manifest['analysis_types'] = params['analysis_types']
task.status = 'new'
task.analysis = analysis
task.action = 'analysis'
task.save()
analysis.tasks.add(task)
# if 'sample_groups' in params:
# samples = Sample.objects.filter(samplegroup_members__in=params['sample_groups'])
# # sample = Sample.objects.first()
# # print(dir(sample))
# for sample in samples:
# print(sample)
# for file in sample.files.all():
# bam_size = 9223372036854775807
# if file.extension == 'bam':
# if file.size < bam_size:
# bamfile = file
# bam_size = file.size
# print('small bam', bamfile.size)
# get smallest bam file