From 4324a6784363c06d4d2b286a0601cc88caf8acd0 Mon Sep 17 00:00:00 2001 From: Rami Rauch Date: Thu, 5 Mar 2009 19:22:14 +0000 Subject: [PATCH] minor changes --- htswfrontend/htswfrontend/fctracker/models.py | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/htswfrontend/htswfrontend/fctracker/models.py b/htswfrontend/htswfrontend/fctracker/models.py index 95b4a84..2b9aaeb 100644 --- a/htswfrontend/htswfrontend/fctracker/models.py +++ b/htswfrontend/htswfrontend/fctracker/models.py @@ -34,9 +34,9 @@ class Antibody(models.Model): verbose_name_plural = "antibodies" ordering = ["antigene"] class Admin: - search_fields = ['antigene','nickname','catalog','antibodies','source','biology','notes'] list_display = ('antigene','nickname','antibodies','catalog','source','biology','notes') list_filter = ('antibodies','source') + search_fields = ['antigene','nickname','catalog','antibodies','source','biology','notes'] fields = ( (None, { 'fields': (('antigene','nickname','antibodies'),('catalog','source'),('biology'),('notes')) @@ -52,7 +52,7 @@ class Cellline(models.Model): class Meta: ordering = ["cellline_name"] - + class Admin: list_display = ('cellline_name','nickname','notes') search_fields = ['cellline_name','nickname','notes'] @@ -123,7 +123,7 @@ class Affiliation(models.Model): ) class Tag(models.Model): - tag_name = models.CharField(max_length=100, unique=True,db_index=True,core=True,blank=False,null=False) + tag_name = models.CharField(max_length=100,unique=True, db_index=True,core=True,blank=False,null=False) TAG_CONTEXT = ( #('Antibody','Antibody'), #('Cellline', 'Cellline'), @@ -157,7 +157,7 @@ class Library(models.Model): # New field Aug/25/08. SQL: alter table fctracker_library add column "lib_affiliation" varchar(256) NULL; affiliations = models.ManyToManyField(Affiliation,related_name='library_affiliations',null=True,filter_interface=models.HORIZONTAL) # New field Nov/14/08 - tags = models.ManyToManyField(Tag,related_name='library_tags',blank=True,null=True,filter_interface=models.HORIZONTAL) + tags = models.ManyToManyField(Tag,related_name='library_tags',null=True,blank=True,filter_interface=models.HORIZONTAL) # New field Aug/19/08 # SQL to add column: alter table fctracker_library add column "replicate" smallint unsigned NULL; REPLICATE_NUM = ((1,1),(2,2),(3,3),(4,4)) @@ -242,30 +242,35 @@ class Library(models.Model): def aligned_reads(self): res = getLibReads(self.library_id) - # Check data sanlty + # Check data sanlty if res[2] != 'OK': return '
'+res[2]+'
' rc = "%1.2f" % (res[1]/1000000.0) # Color Scheme: green is more than 12M, blue is more than 5M, orange is more than 3M and red is less. For RNAseq, all those thresholds should be doubled - if res[0] > 0: - bgcolor = '#FFCDD0' # Red, the color for minimum read count - rc_thr = [12000000,5000000,3000000] - if self.experiment_type == 'RNA-seq': - rc_thr = [20000000,10000000,6000000] + bgcolor = '#FFCDD0' # Red, the color for minimum read count + rc_thr = [12000000,5000000,3000000] + if self.experiment_type == 'RNA-seq': + rc_thr = [20000000,10000000,6000000] + + if self.libtags().find('Bad library')!=-1: + bgcolor = '#cccccc' + else: if res[1] > rc_thr[0]: - bgcolor = '#66ff66' # Green + bgcolor = '#66ff66' # Green else: if res[1] > rc_thr[1]: - bgcolor ='#00ccff' # Blue + bgcolor ='#00ccff' # Blue else: - if res[1] > rc_thr[2]: + if res[1] > rc_thr[2]: bgcolor ='#ffcc33' # Orange - tstr = '
' - tstr += res[0].__str__()+' Lanes, '+rc+' M' - tstr += '
' - else: tstr = 'not processed yet' + + tstr = '
' + if res[0] > 0: tstr += res[0].__str__()+' Lanes, '+rc+' M' + else: tstr += 'not processed yet' + tstr += '
' + return tstr aligned_reads.allow_tags = True -- 2.30.2