From 5a35aed907dab40f3fd8813e3f82cab1ea7d722f Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Mon, 9 Mar 2009 19:28:10 +0000 Subject: [PATCH] Change default picomolarity to 5, and allow overriding the default via the htsworkflow ini file. closes [ticket:120] and [ticket:83] --- htsworkflow/frontend/experiments/models.py | 24 ++++++++++++++-------- htsworkflow/frontend/settings.py | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/htsworkflow/frontend/experiments/models.py b/htsworkflow/frontend/experiments/models.py index 0ac386e..a6635c5 100755 --- a/htsworkflow/frontend/experiments/models.py +++ b/htsworkflow/frontend/experiments/models.py @@ -1,6 +1,8 @@ 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) @@ -14,6 +16,12 @@ class Sequencer(models.Model): def __unicode__(self): return unicode(self.name) +default_pM = 5 +try: + default_pM = int(options.get('frontend', 'default_pm')) +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) @@ -31,14 +39,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.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_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_2_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_3_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_4_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_5_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_6_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_7_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) + lane_8_pM = models.DecimalField(max_digits=5, decimal_places=2,blank=False, null=False,default=default_pM) lane_1_cluster_estimate = models.IntegerField(blank=True, null=True) lane_2_cluster_estimate = models.IntegerField(blank=True, null=True) diff --git a/htsworkflow/frontend/settings.py b/htsworkflow/frontend/settings.py index 01ec35a..eb30b90 100644 --- a/htsworkflow/frontend/settings.py +++ b/htsworkflow/frontend/settings.py @@ -54,6 +54,7 @@ options = ConfigParser.SafeConfigParser( 'database_name': os.path.abspath('/htsworkflow/htswfrontend/dev_fctracker.db'), 'time_zone': 'America/Los_Angeles', + 'default_pm': '5' }) options.read([os.path.expanduser("~/.htsworkflow.ini"), -- 2.30.2