+import logging
+
+from django.core.exceptions import ObjectDoesNotExist
+from django.core import urlresolvers
from django.db import models
+
from htsworkflow.frontend.samples.models import *
from htsworkflow.frontend.settings import options
-from django.core.exceptions import ObjectDoesNotExist
-import logging
class ClusterStation(models.Model):
name = models.CharField(max_length=50, unique=True)
except ValueError,e:
logging.error("invalid value for frontend.default_pm")
-
-
-
class FlowCell(models.Model):
flowcell_id = models.CharField(max_length=20, unique=True, db_index=True)
advanced_run = models.BooleanField(default=False)
paired_end = models.BooleanField(default=False)
read_length = models.IntegerField(default=32) #Stanford is currenlty 25
+ control_lane = models.IntegerField(choices=[(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8)], null=True)
cluster_station = models.ForeignKey(ClusterStation, default=3)
sequencer = models.ForeignKey(Sequencer, default=1)
class Meta:
ordering = ["-run_date"]
-
+
+ def get_admin_url(self):
+ # that's the django way... except it didn't work
+ #return urlresolvers.reverse('admin_experiments_FlowCell_change', args=(self.id,))
+ return '/admin/experiments/flowcell/%s/' % (self.id,)
+
+ def flowcell_type(self):
+ """
+ Convert our boolean 'is paired' flag to a name
+ """
+ if self.paired_end:
+ return u"Paired"
+ else:
+ return u"Single"
+
### -----------------------
class DataRun(models.Model):
ConfTemplate = "CONFIG PARAMS WILL BE GENERATED BY THE PIPELINE SCRIPT.\nYOU'LL BE ABLE TO EDIT AFTER IF NEEDED."