copy stanfords current work in progress to somewhere
authorRami Rauch <rrauch@stanford.edu>
Fri, 2 May 2008 23:57:08 +0000 (23:57 +0000)
committerRami Rauch <rrauch@stanford.edu>
Fri, 2 May 2008 23:57:08 +0000 (23:57 +0000)
shared with caltech

gaworkflow/frontend/fctracker/models.py
gaworkflow/frontend/settings.py
gaworkflow/frontend/urls.py

index b21484231a3444e33a7491bf185aa4ec4eb18745..87afc9ee8b3107a1d5cbf317f4df0586a9c24085 100644 (file)
@@ -1,13 +1,61 @@
 from django.db import models
 from gaworkflow.frontend import settings
 
-# Create your models here.
+class Antibody(models.Model):
+
+  antibody_name = models.CharField(max_length=100, unique=True, db_index=True, core=True)
+  notes = models.TextField(blank=True)
+  def __str__(self):
+    return self.antibody_name
+  class Meta:
+    verbose_name_plural = "antibodies"
+    ordering = ["antibody_name"]
+  class Admin:
+      fields = (
+        (None, {
+            'fields': (('antibody_name','notes'),)
+        }),
+       )
+
+class Cellline(models.Model):
+
+  cellline_name = models.CharField(max_length=100, unique=True, db_index=True, core=True)
+  notes = models.TextField(blank=True)
+  def __str__(self):
+    return self.cellline_name
+
+  class Meta:
+    ordering = ["cellline_name"]
+
+  class Admin:
+      fields = (
+        (None, {
+            'fields': (('cellline_name','notes'),)
+        }),
+       )
+
+class Condition(models.Model):
+
+  condition_name = models.CharField(max_length=2000, unique=True, db_index=True, core=True)
+  notes = models.TextField(blank=True)
+  def __str__(self):
+    return self.condition_name
+
+  class Meta:
+    ordering = ["condition_name"]
+
+  class Admin:
+      fields = (
+        (None, {
+            'fields': (('condition_name','notes'),)
+        }),
+       )
 
 class Species(models.Model):
   
   scientific_name = models.CharField(max_length=256, unique=False, db_index=True, core=True)
   common_name = models.CharField(max_length=256, blank=True)
-  use_genome_build = models.CharField(max_length=100, blank=False, null=False)
+  use_genome_build = models.CharField(max_length=100, blank=True) #blank=False, null=False)
 
   def __str__(self):
     return '%s (%s)|%s' % (self.scientific_name, self.common_name, self.use_genome_build)
@@ -25,17 +73,32 @@ class Species(models.Model):
 
 class Library(models.Model):
   
-  library_id = models.IntegerField(primary_key=True, db_index=True, core=True)
+  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)
   library_species = models.ForeignKey(Species, core=True)
   #use_genome_build = models.CharField(max_length=100, blank=False, null=False)
-  RNAseq = models.BooleanField()
-  
-  made_by = models.CharField(max_length=50, blank=True, default="Lorian")
+  #RNAseq = models.BooleanField()
+  cell_line = models.ForeignKey(Cellline, blank=True, core=True)
+  condition = models.ForeignKey(Condition,blank=True,core=True)
+  antibody = models.ForeignKey(Antibody,blank=True,core=True)
+  
+  EXPERIMENT_TYPES = (
+      ('INPUT_RXLCh','INPUT_RXLCh'),
+      ('ChIP-seq', 'ChIP-seq'),
+      ('Sheared', 'Sheared'),
+      ('RNA-seq', 'RNA-seq'),
+      ('Methyl-seq', 'Methyl-seq'),
+      ('DIP-seq', 'DIP-seq'),
+    ) 
+  experiment_type = models.CharField(max_length=50, choices=EXPERIMENT_TYPES, default='ChIP-seq')
+
+  made_by = models.CharField(max_length=50, blank=True)
   creation_date = models.DateField(blank=True, null=True)
   made_for = models.CharField(max_length=50, blank=True)
+  made_by = models.CharField(max_length=50, blank=True)
   
   PROTOCOL_END_POINTS = (
+      ('Completed','Completed'),
       ('?', 'Unknown'),
       ('Sample', 'Raw sample'),
       ('Gel', 'Ran gel'),
@@ -43,13 +106,13 @@ class Library(models.Model):
       ('2A', '2nd PCR'),
       ('Progress', 'In progress'),
     )
-  stopping_point = models.CharField(max_length=50, choices=PROTOCOL_END_POINTS)
+  stopping_point = models.CharField(max_length=50, choices=PROTOCOL_END_POINTS, default='Completed')
   amplified_from_sample = models.ForeignKey('self', blank=True, null=True)
   
-  undiluted_concentration = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
+  undiluted_concentration = models.DecimalField("Template concentr. (ng/ul)",max_digits=5, decimal_places=2, blank=True, null=True)
   ten_nM_dilution = models.BooleanField()
-  successful_pM = models.IntegerField(blank=True, null=True)
-  
+  successful_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=True, null=True)
+  avg_lib_size = models.IntegerField()
   notes = models.TextField(blank=True)
   
   def __str__(self):
@@ -64,24 +127,24 @@ class Library(models.Model):
     save_as = True
     save_on_top = True
     search_fields = ['library_name']
-    list_display = ('library_id', 'library_name', 'made_for', 'creation_date', 'ten_nM_dilution', 'stopping_point', 'successful_pM')
+    list_display = ('library_id', 'library_name', 'made_by', 'creation_date', 'ten_nM_dilution', 'stopping_point', 'successful_pM')
     list_display_links = ('library_id', 'library_name')
     list_filter = ('stopping_point', 'ten_nM_dilution', 'library_species', 'made_for', 'made_by')
     fields = (
         (None, {
-            'fields': (('library_id', 'library_name'), ('library_species', 'RNAseq'),)
+            'fields': (('library_id', 'library_name'), ('library_species'),)
         }),
         ('Creation Information:', {
-            'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'notes',)
+            'fields' : (('made_for', 'made_by', 'creation_date'), ('stopping_point', 'amplified_from_sample'), ('avg_lib_size','undiluted_concentration', 'ten_nM_dilution', 'successful_pM'), 'notes',)
         }),
-    )
+        )
 
 class FlowCell(models.Model):
   
   flowcell_id = models.CharField(max_length=20, unique=True, db_index=True, core=True)
   run_date = models.DateTimeField(core=True)
   advanced_run = models.BooleanField(default=False)
-  read_length = models.IntegerField(default=32)
+  read_length = models.IntegerField(default=32) #Stanford is currenlty 25
   
   lane_1_library = models.ForeignKey(Library, related_name="lane_1_library")
   lane_2_library = models.ForeignKey(Library, related_name="lane_2_library")
@@ -92,14 +155,14 @@ class FlowCell(models.Model):
   lane_7_library = models.ForeignKey(Library, related_name="lane_7_library")
   lane_8_library = models.ForeignKey(Library, related_name="lane_8_library")
 
-  lane_1_pM = models.IntegerField(default=4)
-  lane_2_pM = models.IntegerField(default=4)
-  lane_3_pM = models.IntegerField(default=4)
-  lane_4_pM = models.IntegerField(default=4)
-  lane_5_pM = models.IntegerField(default=4)
-  lane_6_pM = models.IntegerField(default=4)
-  lane_7_pM = models.IntegerField(default=4)
-  lane_8_pM = models.IntegerField(default=4)
+  lane_1_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_2_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_3_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_4_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_5_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_6_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_7_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
+  lane_8_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=2.5)
   
   lane_1_cluster_estimate = models.IntegerField(blank=True, null=True)
   lane_2_cluster_estimate = models.IntegerField(blank=True, null=True)
@@ -110,22 +173,43 @@ class FlowCell(models.Model):
   lane_7_cluster_estimate = models.IntegerField(blank=True, null=True)
   lane_8_cluster_estimate = models.IntegerField(blank=True, null=True)
   
+  #Machine Names
+  CLUSTER_MAC = (
+      ('M304','M304'),
+      ('R349','R349'),
+      ('Tinkerbell','Tinkerbell'),
+      ('BitBit','BitBit'),
+    )
+  
+  SEQ_MAC = (
+      ('EAS149','EAS149'),
+      ('EAS46','EAS46'),
+      ('EAS45','Paris'),
+      ('Britney','Britney'),
+    )
+  
+  #kit_id = models.CharField(max_length=50, blank=True)
+  cluster_mac_id = models.CharField(max_length=50, choices=CLUSTER_MAC, default='M304')
+  seq_mac_id = models.CharField(max_length=50, choices=SEQ_MAC, default='EAS149')
+  
   notes = models.TextField(blank=True)
 
   def __str__(self):
-    return '%s (%s)' % (self.flowcell_id, self.run_date) 
-  
+    #return '%s (%s)' % (self.flowcell_id, self.run_date) 
+    return '%s' % (self.flowcell_id) 
   class Meta:
     ordering = ["run_date"]
   
   class Admin:
+    save_on_top = True
     date_hierarchy = "run_date"
     save_on_top = True
     search_fields = ['lane_1_library', 'lane_2_library', 'lane_3_library', 'lane_4_library', 'lane_5_library', 'lane_6_library', 'lane_7_library', 'lane_8_library']
     list_display = ('flowcell_id', 'run_date', 'lane_1_library', 'lane_2_library', 'lane_3_library', 'lane_4_library', 'lane_5_library', 'lane_6_library', 'lane_7_library', 'lane_8_library')
     fields = (
         (None, {
-            'fields': ('run_date', 'flowcell_id', ('read_length', 'advanced_run'),)
+            'fields': ('run_date', ('flowcell_id','cluster_mac_id','seq_mac_id'), ('read_length'),)
         }),
         ('Lanes:', {
             'fields' : (('lane_1_library', 'lane_1_pM', 'lane_1_cluster_estimate'), ('lane_2_library', 'lane_2_pM', 'lane_2_cluster_estimate'), ('lane_3_library', 'lane_3_pM', 'lane_3_cluster_estimate'), ('lane_4_library', 'lane_4_pM', 'lane_4_cluster_estimate'), ('lane_5_library', 'lane_5_pM', 'lane_5_cluster_estimate'), ('lane_6_library', 'lane_6_pM', 'lane_6_cluster_estimate'), ('lane_7_library', 'lane_7_pM', 'lane_7_cluster_estimate'), ('lane_8_library', 'lane_8_pM', 'lane_8_cluster_estimate'),)
@@ -135,13 +219,13 @@ class FlowCell(models.Model):
        }),
     )
 
-class ElandResult(models.Model):
-  
-  class Admin: pass
-  
-  flow_cell = models.ForeignKey(FlowCell)
-  config_file = models.FileField(upload_to=settings.UPLOADTO_CONFIG_FILE)
-  eland_result_pack = models.FileField(upload_to=settings.UPLOADTO_ELAND_RESULT_PACKS)
-  bed_file_pack = models.FileField(upload_to=settings.UPLOADTO_BED_PACKS)
-  
-  notes = models.TextField(blank=True)
+#class ElandResult(models.Model):
+#  
+#  class Admin: pass
+#  
+#  flow_cell = models.ForeignKey(FlowCell)
+#  config_file = models.FileField(upload_to=settings.UPLOADTO_CONFIG_FILE)
+#  eland_result_pack = models.FileField(upload_to=settings.UPLOADTO_ELAND_RESULT_PACKS)
+#  bed_file_pack = models.FileField(upload_to=settings.UPLOADTO_BED_PACKS)
+#  
+#  notes = models.TextField(blank=True)
index 853cc1e40de4f96b7c63b63199afda984f1a0679..0832d670d0e6c60443de5ec6b599525204fe8e48 100644 (file)
@@ -6,13 +6,16 @@ DEBUG = True
 TEMPLATE_DEBUG = DEBUG
 
 ADMINS = (
-    # ('Your Name', 'your_email@domain.com'),
+     ('Rami Rauch', 'rrauch@stanford.edu'),
 )
 
 MANAGERS = ADMINS
 
+EMAIL_HOST = 'myerslab.stanford.edu'
+EMAIL_PORT = 25
+
 DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
-DATABASE_NAME = os.path.abspath('../../fctracker.db')             # Or path to database file if using sqlite3.
+DATABASE_NAME = os.path.abspath('/gaworkflow/dev_fctracker.db')             # Or path to database file if using sqlite3.
 DATABASE_USER = ''             # Not used with sqlite3.
 DATABASE_PASSWORD = ''         # Not used with sqlite3.
 DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
@@ -81,14 +84,15 @@ INSTALLED_APPS = (
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.sites',
-    'gaworkflow.frontend.eland_config',
+    #'gaworkflow.frontend.eland_config',
     'gaworkflow.frontend.fctracker',
+    'gaworkflow.frontend.exp_track',
     'django.contrib.databrowse',
 )
 
 # Project specific settings
-UPLOADTO_HOME = os.path.abspath('../../uploads')
-UPLOADTO_CONFIG_FILE = os.path.join(UPLOADTO_HOME, 'eland_config')
-UPLOADTO_ELAND_RESULT_PACKS = os.path.join(UPLOADTO_HOME, 'eland_results')
-UPLOADTO_BED_PACKS = os.path.join(UPLOADTO_HOME, 'bed_packs')
+#UPLOADTO_HOME = os.path.abspath('../../uploads')
+#UPLOADTO_CONFIG_FILE = os.path.join(UPLOADTO_HOME, 'eland_config')
+#UPLOADTO_ELAND_RESULT_PACKS = os.path.join(UPLOADTO_HOME, 'eland_results')
+#UPLOADTO_BED_PACKS = os.path.join(UPLOADTO_HOME, 'bed_packs')
 
index 0c6701524a390c6aaa98f4dd1bed848f40f372fe..118cac5604857c3a19b50767308677c55dac450c 100644 (file)
@@ -8,9 +8,11 @@ databrowse.site.register(FlowCell)
 
 urlpatterns = patterns('',
     # Base:
-    (r'^eland_config/', include('gaworkflow.frontend.eland_config.urls')),
+    #(r'^eland_config/', include('gaworkflow.frontend.eland_config.urls')),
     # Admin:
      (r'^admin/', include('django.contrib.admin.urls')),
+    # ExpTrack:
+     (r'^exp_track/', include('gaworkflow.frontend.exp_track.et_urls')),
     # Databrowser:
      (r'^databrowse/(.*)', databrowse.site.root),
 )