from django.db import models
from gaworkflow.frontend import settings
+class Primer(models.Model):
+ primer_name = models.CharField(max_length=100, db_index=True)
+ primer_seq = models.CharField(max_length=50, blank=True, null=True)
+ notes = models.TextField(blank=True)
+ def __str__(self):
+ return '%s' % (self.primer_name)
+ class Meta:
+ ordering = ["primer_name"]
+ class Admin:
+ list_display = ('primer_name','primer_seq','notes')
+ fields = (
+ (None, {
+ 'fields': (('primer_name'),('primer_seq'),('notes'))
+ }),
+ )
+
class Antibody(models.Model):
antigene = models.CharField(max_length=500, db_index=True)
catalog = models.CharField(max_length=50, unique=True, db_index=True)
ordering = ["cellline_name"]
class Admin:
+ list_display = ('cellline_name','notes')
fields = (
(None, {
'fields': (('cellline_name'),('notes'),)
ordering = ["condition_name"]
class Admin:
+ list_display = ('condition_name','notes')
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=True) #blank=False, null=False)
+ use_genome_build = models.CharField(max_length=100, blank=False, null=False)
def __str__(self):
return '%s (%s)|%s' % (self.scientific_name, self.common_name, self.use_genome_build)
)
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)
+ made_for = models.CharField(max_length=50, blank=True,verbose_name = 'ChIP/DNA/RNA Made By')
+ made_by = models.CharField(max_length=50, blank=True,verbose_name = 'Library Made By')
PROTOCOL_END_POINTS = (
('Completed','Completed'),
('?', 'Unknown'),
('Sample', 'Raw sample'),
- ('Gel', 'Ran gel'),
- ('1A', 'Gel purification'),
- ('2A', '2nd PCR'),
('Progress', 'In progress'),
+ ('1A', 'Ligation, then gel'),
+ ('PCR', 'Ligation, then PCR'),
+ ('1Ab', 'Ligation, PCR, then gel'),
+ ('1Aa', 'Ligation, gel, then PCR'),
+ ('2A', 'Ligation, PCR, gel, PCR'),
)
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("Template concentr. (ng/ul)",max_digits=5, decimal_places=2, blank=True, null=True)
ten_nM_dilution = models.BooleanField()
successful_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=True, null=True)
- avg_lib_size = models.IntegerField()
+ avg_lib_size = models.IntegerField(default=225, blank=True, null=True)
notes = models.TextField(blank=True)
def __str__(self):
date_hierarchy = "creation_date"
save_as = True
save_on_top = True
- search_fields = ['library_name']
- list_display = ('library_id', 'library_name', 'made_by', 'creation_date', 'ten_nM_dilution', 'stopping_point', 'successful_pM')
+ 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_links = ('library_id', 'library_name')
- list_filter = ('stopping_point', 'ten_nM_dilution', 'library_species', 'made_for', 'made_by')
+ list_filter = ('experiment_type','library_species','made_for', 'made_by')
fields = (
(None, {
'fields': (('library_id', 'library_name'),('library_species'),('experiment_type'),('cell_line','condition','antibody'),)
'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) #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")
- lane_3_library = models.ForeignKey(Library, related_name="lane_3_library")
- lane_4_library = models.ForeignKey(Library, related_name="lane_4_library")
- lane_5_library = models.ForeignKey(Library, related_name="lane_5_library")
- lane_6_library = models.ForeignKey(Library, related_name="lane_6_library")
- 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.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)
- lane_3_cluster_estimate = models.IntegerField(blank=True, null=True)
- lane_4_cluster_estimate = models.IntegerField(blank=True, null=True)
- lane_5_cluster_estimate = models.IntegerField(blank=True, null=True)
- lane_6_cluster_estimate = models.IntegerField(blank=True, null=True)
- 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'),
- )
-
- cluster_mac_id = models.CharField(max_length=50, choices=CLUSTER_MAC, default='M304')
- seq_mac_id = models.CharField(max_length=50, choices=SEQ_MAC, verbose_name = 'Sequencer', default='EAS149')
-
- notes = models.TextField(blank=True)
-
- def __str__(self):
- #return '%s (%s)' % (self.flowcell_id, self.run_date)
- return '%s' % (self.flowcell_id)
-
-
- def Lanes(self):
- return '<div><span style="margin-right:10px">1)%s</span><span style="margin-right:10px">2)%s</span><span style="margin-right:10px">3)%s</span><span style="margin-right:10px">4)%s</span><span style="margin-right:10px">5)%s</span><span style="margin-right:10px">6)%s</span><span style="margin-right:10px">7)%s</span><span style="margin-right:10px">8)%s</span></div>' % (self.lane_1_library,self.lane_2_library,self.lane_3_library,self.lane_4_library,self.lane_5_library,self.lane_6_library,self.lane_7_library,self.lane_8_library)
- Lanes.allow_tags = True
-
- 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','seq_mac_id','run_date', 'Lanes')
- list_filter = ('seq_mac_id',)
- fields = (
- (None, {
- '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'),)
- }),
- (None, {
- 'fields' : ('notes',)
- }),
- )
-
-#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)