added Replicate filed in Library table. added as well a 'Short Name' field in Antibod...
authorRami Rauch <rrauch@stanford.edu>
Wed, 20 Aug 2008 19:34:09 +0000 (19:34 +0000)
committerRami Rauch <rrauch@stanford.edu>
Wed, 20 Aug 2008 19:34:09 +0000 (19:34 +0000)
htswfrontend/htswfrontend/fctracker/models.py

index 16dd2bf0a0d5e1c550eeb7e6debab9fe7a27e077..fd01b1918a2dd65e94bf941d95bd603a5cc58f5f 100644 (file)
@@ -19,6 +19,9 @@ class Primer(models.Model):
 
 class Antibody(models.Model):
   antigene = models.CharField(max_length=500, db_index=True)
+  # New field Aug/20/08                                                                                                                                                            
+  # SQL to add column: alter table fctracker_antibody add column "nickname" varchar(20) NULL;
+  nickname = models.CharField(max_length=20,blank=True,null=True, db_index=True,verbose_name = 'Short Name')
   catalog = models.CharField(max_length=50, unique=True, db_index=True)
   antibodies = models.CharField(max_length=500, db_index=True)
   source = models.CharField(max_length=500, blank=True, db_index=True)
@@ -34,7 +37,7 @@ class Antibody(models.Model):
       list_filter = ('antibodies','source')
       fields = (
         (None, {
-            'fields': (('antigene','antibodies'),('catalog','source'),('biology'),('notes'))
+            'fields': (('antigene','nickname','antibodies'),('catalog','source'),('biology'),('notes'))
         }),
        )
 
@@ -91,6 +94,7 @@ class Species(models.Model):
         }),
       )
 
+
 class Library(models.Model):
   library_id = models.CharField(max_length=30, unique=True, db_index=True, core=True)
   library_name = models.CharField(max_length=100, unique=True, core=True)
@@ -98,7 +102,12 @@ class Library(models.Model):
   cell_line = models.ForeignKey(Cellline,core=True)
   condition = models.ForeignKey(Condition,core=True)
   antibody = models.ForeignKey(Antibody,blank=True,null=True,core=True)
-  
+
+  # 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))
+  replicate =  models.PositiveSmallIntegerField(choices=REPLICATE_NUM,default=1) 
+
   EXPERIMENT_TYPES = (
       ('INPUT_RXLCh','INPUT_RXLCh'),
       ('ChIP-seq', 'ChIP-seq'),
@@ -145,12 +154,12 @@ class Library(models.Model):
     save_as = True
     save_on_top = True
     search_fields = ['library_name', 'library_id','made_by','made_for','antibody__antigene','antibody__catalog','antibody__antibodies','antibody__source','cell_line__cellline_name','library_species__scientific_name','library_species__common_name','library_species__use_genome_build']
-    list_display = ('library_id', 'library_name','experiment_type','cell_line','made_by','creation_date')
+    list_display = ('library_id', 'library_name','experiment_type','replicate','cell_line','made_by','creation_date')
     list_display_links = ('library_id', 'library_name')
-    list_filter = ('experiment_type','library_species','made_for', 'made_by')
+    list_filter = ('experiment_type','library_species','made_for', 'made_by','replicate')
     fields = (
         (None, {
-            'fields': (('library_id', 'library_name'),('library_species'),('experiment_type'),('cell_line','condition','antibody'),)
+            'fields': (('replicate','library_id','library_name'),('library_species'),('experiment_type'),('cell_line','condition','antibody'),)
         }),
         ('Creation Information:', {
             'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('avg_lib_size','undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'notes',)