From 5293d730907d98aa378f3d7929cebc82f2d1bb27 Mon Sep 17 00:00:00 2001 From: Rami Rauch Date: Fri, 6 Jun 2008 23:14:44 +0000 Subject: [PATCH] This new component is the front-end interface to data analysis planning and managing. It communicates with the analysis server to: submit analysis projects (a project is a `container` holding one or more tasks), get updated status on a project in proccess, as well as display the project results (directly from the analysis server) --- gaworkflow/frontend/exp_track/exptrack.py | 2 +- gaworkflow/frontend/exp_track/models.py | 107 +++++++++++++++++----- 2 files changed, 86 insertions(+), 23 deletions(-) diff --git a/gaworkflow/frontend/exp_track/exptrack.py b/gaworkflow/frontend/exp_track/exptrack.py index 82f0c26..38daaab 100644 --- a/gaworkflow/frontend/exp_track/exptrack.py +++ b/gaworkflow/frontend/exp_track/exptrack.py @@ -116,7 +116,7 @@ def generateConfile(fcid): cnfgfile += '8:'+eland_genome+rec.lane_8_library.library_species.use_genome_build except ObjectDoesNotExist: - cnfgfile = 'Entry not found for runfolder = '+runfolder + cnfgfile = 'Entry not found for fcid = '+fcid return cnfgfile diff --git a/gaworkflow/frontend/exp_track/models.py b/gaworkflow/frontend/exp_track/models.py index 7bdaff7..82aa037 100644 --- a/gaworkflow/frontend/exp_track/models.py +++ b/gaworkflow/frontend/exp_track/models.py @@ -1,29 +1,92 @@ from django.db import models -from gaworkflow.frontend.fctracker.models import FlowCell +from datetime import datetime +from gaworkflow.frontend.fctracker.models import Library -class DataRun(models.Model): - #ConfTemplate = "READ_LENGTH 25\nGENOME_DIR /Volumes/Genomes/hg18\nELAND_GENOME /Volumes/Genomes/hg18\nANALYSIS eland\nGENOME_FILE all_chr.fa\nELAND_MULTIPLE_INSTANCES 8" - ConfTemplate = "CONFIG PARAMS WILL BE GENERATED BY THE PIPELINE SCRIPT.\nYOU'LL BE ABLE TO EDIT AFTER IF NEEDED." - ##----- - run_folder = models.CharField(max_length=50,unique=True, db_index=True) - fcid = models.ForeignKey(FlowCell,verbose_name="Flowcell Id") #, null=True) - config_params = models.TextField(default=ConfTemplate) - run_start_time = models.DateTimeField(core=True) - RUN_STATUS_CHOICES = ( - (0, 'Solexa Pipeline Not Yet Started'), - (1, 'Solexa Pipeline Started'), - (2, 'Solexa Pipeline Interrupted'), - (3, 'Solexa Pipeline Finished'), - (4, 'CollectReads Started'), - (5, 'CollectReads Finished'), +class Task(models.Model): + task_name = models.CharField(max_length=50,unique=True, db_index=True) + subject1 = models.ForeignKey(Library,related_name='sbj1_library',verbose_name="Subject") + subject2 = models.ForeignKey(Library,related_name='sbj2_library',verbose_name="Subject 2 / Control",blank=True,null=True) + CALCS = ( + ('QuEST', 'QuEST Peak Calling'), + ('WingPeaks', 'Wing Peak Calling'), + ('qPCR', 'In Silico qPCR'), + ('CompareLibs', 'Compare Libaraies'), + ('ComparePeakCalls','Compare Peak Calls'), + ('ProfileReads','Profile Reads') ) - run_status = models.IntegerField(choices=RUN_STATUS_CHOICES, default=0) - run_note = models.CharField(max_length=500,blank=True) + apply_calc = models.CharField(max_length=50,choices=CALCS,verbose_name='Applied Calculation') + ## userid = # logged in user + task_status = models.CharField(max_length=500,blank=True,null=True,default='defined') + results_location = models.CharField(max_length=2000,blank=True,null=True) + submitted_on = models.DateTimeField(core=True,default=datetime.now()) + run_note = models.CharField(max_length=500,blank=True,null=True) - #def __unicode__(self): - # return ... + def __str__(self): + return '"%s" - %s on [%s]/[%s]' % (self.task_name,self.apply_calc,self.subject1,self.subject2) + + def InProjects(self): + return '...' + ps = self.project_set.all() + pstr = 'In ' + return pstr + for p in ps: + pstr += '%s, ' % (p.project_name) + return pstr class Admin: - list_display = ('run_folder','fcid','run_start_time','run_status','run_note') - list_filter = ('run_status','run_start_time') + list_display = ('task_name','apply_calc','subject1','subject2','InProjects','submitted_on','task_status') + list_filter = ('apply_calc',) + fields = ( + (None, { + 'fields': (('task_name'),('apply_calc'),('subject1'),('subject2')) + }), + ('system fields', { + 'classes': 'collapse', + 'fields': (('submitted_on'),('task_status','run_note')) + }), + ) + +class Project(models.Model): + project_name = models.CharField(max_length=50,unique=True, db_index=True) + tasks = models.ManyToManyField(Task,related_name='project_tasks',null=True) + project_notes = models.CharField(max_length=500,blank=True,null=True) + + def __str__(self): + return '%s' % (self.project_name) + + def ProjectTasks(self): + ptasks = self.tasks.all().order_by('id') + surl = 'data analysis server' + tstr = '' + tstr += '' + for t in ptasks: + tstr += '' % (t.task_name,t.task_status) + + tstr += '
TaskJob Status
%s%s
' + tstr += '
' + tstr += '
VIEW PROJECT RESULTS
' + tstr += '
' + + return tstr + + ProjectTasks.allow_tags = True + + class Admin: + list_display = ('project_name','ProjectTasks') + # list_filter = ('...',) + fields = ( + (None, { + 'fields': (('project_name'),('tasks'),('project_notes'))}), + ) -- 2.30.2