From a36ef6e5c11112bbbbf9d1342654edc457c4e99c Mon Sep 17 00:00:00 2001 From: Rami Rauch Date: Thu, 23 Apr 2009 22:46:27 +0000 Subject: [PATCH] added FlowcellId data status (by read count from libinfo). Now data status is reported on DatRun level, besides the Library level. --- htswfrontend/htswfrontend/exp_track/models.py | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/htswfrontend/htswfrontend/exp_track/models.py b/htswfrontend/htswfrontend/exp_track/models.py index 1dcfee2..f650e22 100755 --- a/htswfrontend/htswfrontend/exp_track/models.py +++ b/htswfrontend/htswfrontend/exp_track/models.py @@ -58,11 +58,14 @@ class FlowCell(models.Model): ('EAS46','EAS46'), ('EAS45','Paris'), ('Britney','Britney'), + ('EAS614','LiLo'), ) - + cluster_mac_id = models.CharField(max_length=50, choices=CLUSTER_MAC, default='BitBit') seq_mac_id = models.CharField(max_length=50, choices=SEQ_MAC, verbose_name = 'Sequencer', default='Britney') + is_paired_end = models.BooleanField(default=False) + notes = models.TextField(blank=True) def __str__(self): @@ -77,6 +80,10 @@ class FlowCell(models.Model): str +='
DataRun ..' except ObjectDoesNotExist: str += '
not sequenced' + + if self.is_paired_end: + str += '
Paired End
' + return str Create_LOG.allow_tags = True @@ -92,11 +99,11 @@ class FlowCell(models.Model): date_hierarchy = "run_date" save_on_top = True search_fields = ['flowcell_id','seq_mac_id','cluster_mac_id','=lane_1_library__library_id','=lane_2_library__library_id','=lane_3_library__library_id','=lane_4_library__library_id','=lane_5_library__library_id','=lane_6_library__library_id','=lane_7_library__library_id','=lane_8_library__library_id'] - list_display = ('flowcell_id','seq_mac_id','run_date', 'Create_LOG','Lanes') + list_display = ('flowcell_id','seq_mac_id','run_date', 'Create_LOG','Lanes','notes') list_filter = ('seq_mac_id','cluster_mac_id') fields = ( (None, { - 'fields': ('run_date', ('flowcell_id','cluster_mac_id','seq_mac_id'), ('read_length'),) + 'fields': ('run_date', ('flowcell_id','cluster_mac_id','seq_mac_id','is_paired_end'), ('read_length'),) }), ('Lanes:', { ##'fields' : (('lane_1_library', 'lane_1_pM', 'lane_1_cluster_estimate', 'lane_1_primer'), ('lane_2_library', 'lane_2_pM', 'lane_2_cluster_estimate', 'lane_2_primer'), ('lane_3_library', 'lane_3_pM', 'lane_3_cluster_estimate', 'lane_3_primer'), ('lane_4_library', 'lane_4_pM', 'lane_4_cluster_estimate', 'lane_4_primer'), ('lane_5_library', 'lane_5_pM', 'lane_5_cluster_estimate', 'lane_5_primer'), ('lane_6_library', 'lane_6_pM', 'lane_6_cluster_estimate', 'lane_6_primer'), ('lane_7_library', 'lane_7_pM', 'lane_7_cluster_estimate', 'lane_7_primer'), ('lane_8_library', 'lane_8_pM', 'lane_8_cluster_estimate', 'lane_8_primer'),) @@ -109,6 +116,12 @@ class FlowCell(models.Model): ### ----------------------- + +#Global Util vars +Dict_SEQ_MAC = dict((row[0], row[1]) for row in FlowCell.SEQ_MAC) +Dict_CLUSTER_MAC = dict((row[0], row[1]) for row in FlowCell.CLUSTER_MAC) + + class DataRun(models.Model): 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) @@ -134,20 +147,38 @@ class DataRun(models.Model): if self.run_status >= 5: str += ' style="color:green">' str += ''+self.RUN_STATUS_CHOICES[self.run_status][1]+'' - str += '

' #New!' - str +='
View QC Page' + str +='
View QC Page
' else: str += '>'+self.RUN_STATUS_CHOICES[self.run_status][1] + str += '' + + ## Check Analysis Server Report + str += '
Data analyzed:
' + res = getLibReads(self.fcid.flowcell_id.__str__(),'ByFC') + + if res[2] != 'OK': + str += '
'+res[2]+'
' + else: + lc = res[0] + if(lc>0): + rc = "%1.2f" % (res[1]/1000000.0) + str += '
'+lc.__str__()+' lanes
'+rc.__str__()+' M reads
' + else: + str += '
no data yet
' str += '
' + return str main_status.allow_tags = True - main_status.allow_tags = True + ## Util + #Dict_SEQ_MAC = dict((row[0], row[1]) for row in FlowCell.SEQ_MAC) def Flowcell_Info(self): str = ''+self.fcid.__str__()+'' - str += ' (c: '+self.fcid.cluster_mac_id+', s: '+self.fcid.seq_mac_id+')' + str += ' (c: '+Dict_CLUSTER_MAC[self.fcid.cluster_mac_id]+', s: '+Dict_SEQ_MAC[self.fcid.seq_mac_id]+')' + if self.fcid.is_paired_end: + str += 'Paired End' str += '
' str +='View/hide lanes' str += '
' -- 2.30.2