This is a partial merge of the stanford branch with the caltech branch of
authorDiane Trout <diane@caltech.edu>
Thu, 8 Jan 2009 20:12:03 +0000 (20:12 +0000)
committerDiane Trout <diane@caltech.edu>
Thu, 8 Jan 2009 20:12:03 +0000 (20:12 +0000)
the web application, it doesn't work correctly yet, the libraries admin page
is broken, and lacks the ability to browe the 'made_for' column.

This is based on a merge that started a few month ago, but I hadn't finished
the merge, I'll need to check for more updates from their branch soon.

During the process I decided it would be a good idea to update to django 1.0
which is going to make things even more unstable, so I thought I should
check this work in progess in before continuing.

17 files changed:
htsworkflow/frontend/analysis/an_urls.py [deleted file]
htsworkflow/frontend/analysis/main.py
htsworkflow/frontend/analysis/models.py
htsworkflow/frontend/analysis/urls.py [new file with mode: 0644]
htsworkflow/frontend/eland_config/views.py
htsworkflow/frontend/experiments/et_urls.py [deleted file]
htsworkflow/frontend/experiments/experiments.py [new file with mode: 0755]
htsworkflow/frontend/experiments/exptrack.py [deleted file]
htsworkflow/frontend/experiments/models.py
htsworkflow/frontend/experiments/urls.py [new file with mode: 0755]
htsworkflow/frontend/experiments/views.py
htsworkflow/frontend/reports/ht_urls.py [deleted file]
htsworkflow/frontend/reports/models.py
htsworkflow/frontend/reports/urls.py [new file with mode: 0644]
htsworkflow/frontend/samples/models.py
htsworkflow/frontend/settings.py
htsworkflow/frontend/urls.py

diff --git a/htsworkflow/frontend/analysis/an_urls.py b/htsworkflow/frontend/analysis/an_urls.py
deleted file mode 100644 (file)
index 57fa33e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('',                                               
-    (r'^updStatus$', 'htswfrontend.analys_track.main.updStatus'),
-    (r'^getProjects/$', 'htswfrontend.analys_track.main.getProjects'),
-)
index 015a69c823503435c3eb2dfd98a3fbff1937edc2..511390b6d8bc9ae5fdc6ebd7a72afb98ce338287 100644 (file)
@@ -3,8 +3,8 @@ from django.http import HttpResponse
 from datetime import datetime
 from string import *
 import re
-from htswfrontend import settings
-from htswfrontend.analys_track.models import Task, Project
+from htsworkflow.frontend import settings
+from htsworkflow.frontend.analysis.models import Task, Project
 from django.core.exceptions import ObjectDoesNotExist
 
 def updStatus(request):
index 301be2721c891112438156042c6eee48b7782593..4b1c72d1d0b1faa9af538a622f0e69ab3dafc3be 100644 (file)
@@ -1,6 +1,6 @@
 from django.db import models
 from datetime import datetime
-from htswfrontend.fctracker.models import Library 
+from htsworkflow.frontend.samples.models import Library 
 from string import *
 
 class Task(models.Model):
@@ -20,7 +20,7 @@ class Task(models.Model):
   ## userid = # logged in user
   task_status = models.CharField(max_length=500,blank=True,null=True,default='defined')
   results_location = models.CharField(max_length=2000,blank=True,null=True) 
-  submitted_on = models.DateTimeField(core=True,default=datetime.now())
+  submitted_on = models.DateTimeField(default=datetime.now())
   run_note = models.CharField(max_length=500,blank=True,null=True)
   
   def __str__(self):
diff --git a/htsworkflow/frontend/analysis/urls.py b/htsworkflow/frontend/analysis/urls.py
new file mode 100644 (file)
index 0000000..b1be3d2
--- /dev/null
@@ -0,0 +1,6 @@
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+    (r'^updStatus$', 'htsworkflow.frontend.analysis.main.updStatus'),
+    (r'^getProjects/$', 'htsworkflow.frontend.analysis.main.getProjects'),
+)
index 25edea96fcaf893f4abdb8029c3ad171523daab0..d4be4ea2e082228e32ff8b7969d585fa1e7db0b8 100644 (file)
@@ -4,7 +4,7 @@ from django.core.exceptions import ObjectDoesNotExist
 
 from htsworkflow.frontend.eland_config import forms
 from htsworkflow.frontend import settings
-from htsworkflow.frontend.fctracker import models
+from htsworkflow.frontend.samples import models
 
 import os
 import glob
diff --git a/htsworkflow/frontend/experiments/et_urls.py b/htsworkflow/frontend/experiments/et_urls.py
deleted file mode 100755 (executable)
index 7ad709d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('',
-                                                                                                      
-    (r'^$', 'htswfrontend.exp_track.views.index'),
-    (r'^liblist$', 'htswfrontend.exp_track.views.test_Libs'),
-    #(r'^(?P<run_folder>.+)/$', 'gaworkflow.frontend.exp_track.views.detail'),
-    (r'^(?P<fcid>.+)/$', 'htswfrontend.exp_track.views.makeFCSheet'),
-    (r'^updStatus$', 'htswfrontend.exp_track.exptrack.updStatus'),
-    (r'^getConfile$', 'htswfrontend.exp_track.exptrack.getConfile'),
-    (r'^getLanesNames$', 'htswfrontend.exp_track.exptrack.getLaneLibs')   
-)
diff --git a/htsworkflow/frontend/experiments/experiments.py b/htsworkflow/frontend/experiments/experiments.py
new file mode 100755 (executable)
index 0000000..d11cda7
--- /dev/null
@@ -0,0 +1,194 @@
+# some core functions of the exp tracker module
+from django.http import HttpResponse
+from datetime import datetime
+from string import *
+import re
+from htsworkflow.frontend import settings
+from htsworkflow.frontend.experiments.models import FlowCell, DataRun
+from htsworkflow.frontend.samples.models import Library
+from django.core.exceptions import ObjectDoesNotExist
+from django.core.mail import send_mail, mail_admins
+
+def updStatus(request):
+    output=''
+    user = 'none'
+    pswd = ''
+    UpdatedStatus = 'unknown'
+    fcid = 'none'
+    runfolder = 'unknown'
+    ClIP = request.META['REMOTE_ADDR']
+    granted = False    
+
+    if request.has_key('user'):
+      user = request['user']
+
+    #Check access permission 
+    if (user == 'rami' and settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
+    if not granted: return HttpResponse("access denied.")
+
+
+    # ~~~~~~Parameters for the job ~~~~
+    if request.has_key('fcid'):
+      fcid = request['fcid']
+    else:
+      return HttpResponse('missing fcid')
+    
+    if request.has_key('runf'):
+      runfolder = request['runf']
+    else:
+      return HttpResponse('missing runf')
+
+    
+    if request.has_key('updst'):
+      UpdatedStatus = request['updst']
+    else:
+      return HttpResponse('missing status')
+    
+    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
+
+    # Update Data Run status in DB
+    # Try get rec. If not found return 'entry not found + <fcid><runfolder>', if found try update and return updated 
+    try:
+      rec = DataRun.objects.get(run_folder=runfolder)
+      rec.run_status = UpdatedStatus
+
+      #if there's a message update that too
+      mytimestamp = datetime.now().__str__()
+      mytimestamp = re.sub(pattern=":[^:]*$",repl="",string=mytimestamp)
+      if request.has_key('msg'):
+        rec.run_note += ", "+request['msg']+" ("+mytimestamp+")"
+      else :
+        if UpdatedStatus == '1':
+          rec.run_note = "Started ("+mytimestamp+")"
+
+      rec.save()
+      output = "Hello "+settings.ALLOWED_IPS[ClIP]+". Updated to:'"+DataRun.RUN_STATUS_CHOICES[int(UpdatedStatus)][1].__str__()+"'"
+    except ObjectDoesNotExist:
+      output = "entry not found: "+fcid+", "+runfolder
+
+
+    #Notify researcher by email
+    # Doesn't work
+    #send_mail('Exp Tracker', 'Data Run Status '+output, 'rrauch@stanford.edu', ['rrrami@gmail.com'], fail_silently=False)
+    #mail_admins("test subject", "testing , testing", fail_silently=False)
+    # gives error: (49, "Can't assign requested address")
+    return HttpResponse(output)
+
+def generateConfile(request,fcid):
+    #granted = False
+    #ClIP = request.META['REMOTE_ADDR']
+    #if (settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
+
+    #if not granted: return HttpResponse("access denied.")
+
+    cnfgfile = 'READ_LENGTH 25\n'
+    cnfgfile += 'ANALYSIS eland\n'
+    cnfgfile += 'GENOME_FILE all_chr.fa\n'
+    cnfgfile += 'ELAND_MULTIPLE_INSTANCES 8\n'
+    genome_dir = 'GENOME_DIR /Volumes/Genomes/'
+    eland_genome = 'ELAND_GENOME /Volumes/Genomes/'
+    
+    try:                                                                                                                                              
+      rec = FlowCell.objects.get(flowcell_id=fcid)
+      
+      cnfgfile += '1:'+genome_dir+rec.lane_1_library.library_species.use_genome_build+'\n'
+      cnfgfile += '1:'+eland_genome+rec.lane_1_library.library_species.use_genome_build+'\n'
+
+      cnfgfile += '2:'+genome_dir+rec.lane_2_library.library_species.use_genome_build+'\n'
+      cnfgfile += '2:'+eland_genome+rec.lane_2_library.library_species.use_genome_build+'\n'
+      cnfgfile += '3:'+genome_dir+rec.lane_3_library.library_species.use_genome_build+'\n'
+      cnfgfile += '3:'+eland_genome+rec.lane_3_library.library_species.use_genome_build+'\n'
+
+      cnfgfile += '4:'+genome_dir+rec.lane_4_library.library_species.use_genome_build+'\n'
+      cnfgfile += '4:'+eland_genome+rec.lane_4_library.library_species.use_genome_build+'\n'
+      
+      cnfgfile += '5:'+genome_dir+rec.lane_5_library.library_species.use_genome_build+'\n'
+      cnfgfile += '5:'+eland_genome+rec.lane_5_library.library_species.use_genome_build+'\n'
+
+      cnfgfile += '6:'+genome_dir+rec.lane_6_library.library_species.use_genome_build+'\n'
+      cnfgfile += '6:'+eland_genome+rec.lane_6_library.library_species.use_genome_build+'\n'
+
+      cnfgfile += '7:'+genome_dir+rec.lane_7_library.library_species.use_genome_build+'\n'
+      cnfgfile += '7:'+eland_genome+rec.lane_7_library.library_species.use_genome_build+'\n'
+
+      cnfgfile += '8:'+genome_dir+rec.lane_8_library.library_species.use_genome_build+'\n'
+      cnfgfile += '8:'+eland_genome+rec.lane_8_library.library_species.use_genome_build
+
+    except ObjectDoesNotExist:
+      cnfgfile = 'Entry not found for fcid  = '+fcid
+
+    return cnfgfile
+
+def getConfile(request):
+    granted = False
+    ClIP = request.META['REMOTE_ADDR']
+    if (settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
+
+    if not granted: return HttpResponse("access denied. IP: "+ClIP)
+
+    fcid = 'none'
+    cnfgfile = ''
+    runfolder = 'unknown'
+    if request.has_key('fcid'):
+      fcid = request['fcid']
+      if request.has_key('runf'):
+        runfolder = request['runf']
+        try:
+          rec = DataRun.objects.get(run_folder=runfolder) #,flowcell_id=fcid)
+          cnfgfile = rec.config_params
+          #match_str = re.compile(r"READ_LENGTH.+$")
+          match_str = re.compile('^READ_LENGTH.+')
+          if not match_str.search(cnfgfile):
+            cnfgfile = generateConfile(request,fcid)
+            if match_str.search(cnfgfile):
+              rec = DataRun.objects.get(run_folder=runfolder) #,flowcell_id=fcid)
+              rec.config_params = cnfgfile
+              rec.save()
+            else:
+              cnfgfile = 'Failed generating config params for RunFolder = '+runfolder +', Flowcell id = '+ fcid+ ' Config Text:\n'+cnfgfile  
+            
+        except ObjectDoesNotExist:
+          cnfgfile = 'Entry not found for RunFolder = '+runfolder
+
+    return HttpResponse(cnfgfile)
+
+def getLaneLibs(request):
+    granted = False
+    ClIP = request.META['REMOTE_ADDR']
+    if (settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
+
+    if not granted: return HttpResponse("access denied.")
+
+    fcid = 'none'
+    outputfile = ''
+    if request.has_key('fcid'):
+      fcid = request['fcid']                                                                                                      
+      try:                                
+        rec = FlowCell.objects.get(flowcell_id=fcid)
+        #Ex: 071211
+        year = datetime.today().year.__str__()
+        year = replace(year,'20','')
+        month = datetime.today().month
+        if month < 10: month = "0"+month.__str__()
+        else: month = month.__str__() 
+        day = datetime.today().day
+        if day < 10: day = "0"+day.__str__()
+        else: day = day.__str__()
+        mydate = year+month+day
+        outputfile = '<?xml version="1.0" ?>'
+        outputfile += '\n<SolexaResult Date="'+mydate+'" Flowcell="'+fcid+'" Client="'+settings.ALLOWED_IPS[ClIP]+'">'
+        outputfile += '\n<Lane Index="1" Name="'+rec.lane_1_library.library_name+'" Library="'+rec.lane_1_library.library_id+'" Genome="'+rec.lane_1_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="2" Name="'+rec.lane_2_library.library_name+'" Library="'+rec.lane_2_library.library_id+'" Genome="'+rec.lane_2_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="3" Name="'+rec.lane_3_library.library_name+'" Library="'+rec.lane_3_library.library_id+'" Genome="'+rec.lane_3_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="4" Name="'+rec.lane_4_library.library_name+'" Library="'+rec.lane_4_library.library_id+'" Genome="'+rec.lane_4_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="5" Name="'+rec.lane_5_library.library_name+'" Library="'+rec.lane_5_library.library_id+'" Genome="'+rec.lane_5_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="6" Name="'+rec.lane_6_library.library_name+'" Library="'+rec.lane_6_library.library_id+'" Genome="'+rec.lane_6_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="7" Name="'+rec.lane_7_library.library_name+'" Library="'+rec.lane_7_library.library_id+'" Genome="'+rec.lane_7_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n<Lane Index="8" Name="'+rec.lane_8_library.library_name+'" Library="'+rec.lane_8_library.library_id+'" Genome="'+rec.lane_8_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
+        outputfile += '\n</SolexaResult>'
+      except ObjectDoesNotExist:
+        outputfile = 'Flowcell entry not found for: '+fcid
+    else: outputfile = 'Missing input: flowcell id'
+
+    return HttpResponse(outputfile)
diff --git a/htsworkflow/frontend/experiments/exptrack.py b/htsworkflow/frontend/experiments/exptrack.py
deleted file mode 100755 (executable)
index 6486b5c..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-# some core functions of the exp tracker module
-from django.http import HttpResponse
-from datetime import datetime
-from string import *
-import re
-from htswfrontend import settings
-from htswfrontend.exp_track.models import FlowCell, DataRun
-from htswfrontend.fctracker.models import Library
-from django.core.exceptions import ObjectDoesNotExist
-from django.core.mail import send_mail, mail_admins
-
-def updStatus(request):
-    output=''
-    user = 'none'
-    pswd = ''
-    UpdatedStatus = 'unknown'
-    fcid = 'none'
-    runfolder = 'unknown'
-    ClIP = request.META['REMOTE_ADDR']
-    granted = False    
-
-    if request.has_key('user'):
-      user = request['user']
-
-    #Check access permission 
-    if (user == 'rami' and settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
-    if not granted: return HttpResponse("access denied.")
-
-
-    # ~~~~~~Parameters for the job ~~~~
-    if request.has_key('fcid'):
-      fcid = request['fcid']
-    else:
-      return HttpResponse('missing fcid')
-    
-    if request.has_key('runf'):
-      runfolder = request['runf']
-    else:
-      return HttpResponse('missing runf')
-
-    
-    if request.has_key('updst'):
-      UpdatedStatus = request['updst']
-    else:
-      return HttpResponse('missing status')
-    
-    # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
-
-    # Update Data Run status in DB
-    # Try get rec. If not found return 'entry not found + <fcid><runfolder>', if found try update and return updated 
-    try:
-      rec = DataRun.objects.get(run_folder=runfolder)
-      rec.run_status = UpdatedStatus
-
-      #if there's a message update that too
-      mytimestamp = datetime.now().__str__()
-      mytimestamp = re.sub(pattern=":[^:]*$",repl="",string=mytimestamp)
-      if request.has_key('msg'):
-        rec.run_note += ", "+request['msg']+" ("+mytimestamp+")"
-      else :
-        if UpdatedStatus == '1':
-          rec.run_note = "Started ("+mytimestamp+")"
-
-      rec.save()
-      output = "Hello "+settings.ALLOWED_IPS[ClIP]+". Updated to:'"+DataRun.RUN_STATUS_CHOICES[int(UpdatedStatus)][1].__str__()+"'"
-    except ObjectDoesNotExist:
-      output = "entry not found: "+fcid+", "+runfolder
-
-
-    #Notify researcher by email
-    # Doesn't work
-    #send_mail('Exp Tracker', 'Data Run Status '+output, 'rrauch@stanford.edu', ['rrrami@gmail.com'], fail_silently=False)
-    #mail_admins("test subject", "testing , testing", fail_silently=False)
-    # gives error: (49, "Can't assign requested address")
-    return HttpResponse(output)
-
-def generateConfile(request,fcid):
-    #granted = False
-    #ClIP = request.META['REMOTE_ADDR']
-    #if (settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
-
-    #if not granted: return HttpResponse("access denied.")
-
-    cnfgfile = 'READ_LENGTH 25\n'
-    cnfgfile += 'ANALYSIS eland\n'
-    cnfgfile += 'GENOME_FILE all_chr.fa\n'
-    cnfgfile += 'ELAND_MULTIPLE_INSTANCES 8\n'
-    genome_dir = 'GENOME_DIR /Volumes/Genomes/'
-    eland_genome = 'ELAND_GENOME /Volumes/Genomes/'
-    
-    try:                                                                                                                                              
-      rec = FlowCell.objects.get(flowcell_id=fcid)
-      
-      cnfgfile += '1:'+genome_dir+rec.lane_1_library.library_species.use_genome_build+'\n'
-      cnfgfile += '1:'+eland_genome+rec.lane_1_library.library_species.use_genome_build+'\n'
-
-      cnfgfile += '2:'+genome_dir+rec.lane_2_library.library_species.use_genome_build+'\n'
-      cnfgfile += '2:'+eland_genome+rec.lane_2_library.library_species.use_genome_build+'\n'
-      cnfgfile += '3:'+genome_dir+rec.lane_3_library.library_species.use_genome_build+'\n'
-      cnfgfile += '3:'+eland_genome+rec.lane_3_library.library_species.use_genome_build+'\n'
-
-      cnfgfile += '4:'+genome_dir+rec.lane_4_library.library_species.use_genome_build+'\n'
-      cnfgfile += '4:'+eland_genome+rec.lane_4_library.library_species.use_genome_build+'\n'
-      
-      cnfgfile += '5:'+genome_dir+rec.lane_5_library.library_species.use_genome_build+'\n'
-      cnfgfile += '5:'+eland_genome+rec.lane_5_library.library_species.use_genome_build+'\n'
-
-      cnfgfile += '6:'+genome_dir+rec.lane_6_library.library_species.use_genome_build+'\n'
-      cnfgfile += '6:'+eland_genome+rec.lane_6_library.library_species.use_genome_build+'\n'
-
-      cnfgfile += '7:'+genome_dir+rec.lane_7_library.library_species.use_genome_build+'\n'
-      cnfgfile += '7:'+eland_genome+rec.lane_7_library.library_species.use_genome_build+'\n'
-
-      cnfgfile += '8:'+genome_dir+rec.lane_8_library.library_species.use_genome_build+'\n'
-      cnfgfile += '8:'+eland_genome+rec.lane_8_library.library_species.use_genome_build
-
-    except ObjectDoesNotExist:
-      cnfgfile = 'Entry not found for fcid  = '+fcid
-
-    return cnfgfile
-
-def getConfile(request):
-    granted = False
-    ClIP = request.META['REMOTE_ADDR']
-    if (settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
-
-    if not granted: return HttpResponse("access denied. IP: "+ClIP)
-
-    fcid = 'none'
-    cnfgfile = ''
-    runfolder = 'unknown'
-    if request.has_key('fcid'):
-      fcid = request['fcid']
-      if request.has_key('runf'):
-        runfolder = request['runf']
-        try:
-          rec = DataRun.objects.get(run_folder=runfolder) #,flowcell_id=fcid)
-          cnfgfile = rec.config_params
-          #match_str = re.compile(r"READ_LENGTH.+$")
-          match_str = re.compile('^READ_LENGTH.+')
-          if not match_str.search(cnfgfile):
-            cnfgfile = generateConfile(request,fcid)
-            if match_str.search(cnfgfile):
-              rec = DataRun.objects.get(run_folder=runfolder) #,flowcell_id=fcid)
-              rec.config_params = cnfgfile
-              rec.save()
-            else:
-              cnfgfile = 'Failed generating config params for RunFolder = '+runfolder +', Flowcell id = '+ fcid+ ' Config Text:\n'+cnfgfile  
-            
-        except ObjectDoesNotExist:
-          cnfgfile = 'Entry not found for RunFolder = '+runfolder
-
-    return HttpResponse(cnfgfile)
-
-def getLaneLibs(request):
-    granted = False
-    ClIP = request.META['REMOTE_ADDR']
-    if (settings.ALLOWED_IPS.has_key(ClIP)):  granted = True
-
-    if not granted: return HttpResponse("access denied.")
-
-    fcid = 'none'
-    outputfile = ''
-    if request.has_key('fcid'):
-      fcid = request['fcid']                                                                                                      
-      try:                                
-        rec = FlowCell.objects.get(flowcell_id=fcid)
-        #Ex: 071211
-        year = datetime.today().year.__str__()
-        year = replace(year,'20','')
-        month = datetime.today().month
-        if month < 10: month = "0"+month.__str__()
-        else: month = month.__str__() 
-        day = datetime.today().day
-        if day < 10: day = "0"+day.__str__()
-        else: day = day.__str__()
-        mydate = year+month+day
-        outputfile = '<?xml version="1.0" ?>'
-        outputfile += '\n<SolexaResult Date="'+mydate+'" Flowcell="'+fcid+'" Client="'+settings.ALLOWED_IPS[ClIP]+'">'
-        outputfile += '\n<Lane Index="1" Name="'+rec.lane_1_library.library_name+'" Library="'+rec.lane_1_library.library_id+'" Genome="'+rec.lane_1_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="2" Name="'+rec.lane_2_library.library_name+'" Library="'+rec.lane_2_library.library_id+'" Genome="'+rec.lane_2_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="3" Name="'+rec.lane_3_library.library_name+'" Library="'+rec.lane_3_library.library_id+'" Genome="'+rec.lane_3_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="4" Name="'+rec.lane_4_library.library_name+'" Library="'+rec.lane_4_library.library_id+'" Genome="'+rec.lane_4_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="5" Name="'+rec.lane_5_library.library_name+'" Library="'+rec.lane_5_library.library_id+'" Genome="'+rec.lane_5_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="6" Name="'+rec.lane_6_library.library_name+'" Library="'+rec.lane_6_library.library_id+'" Genome="'+rec.lane_6_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="7" Name="'+rec.lane_7_library.library_name+'" Library="'+rec.lane_7_library.library_id+'" Genome="'+rec.lane_7_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n<Lane Index="8" Name="'+rec.lane_8_library.library_name+'" Library="'+rec.lane_8_library.library_id+'" Genome="'+rec.lane_8_library.library_species.use_genome_build+'" PrimerName="" PrimerSeq=""/>'
-        outputfile += '\n</SolexaResult>'
-      except ObjectDoesNotExist:
-        outputfile = 'Flowcell entry not found for: '+fcid
-    else: outputfile = 'Missing input: flowcell id'
-
-    return HttpResponse(outputfile)
index 08397e6f9267e2717b1dd72907819d9c52bb944e..4e7e696797a1f6afb6a93a18ee315dff2d46d868 100755 (executable)
@@ -1,9 +1,9 @@
 from django.db import models
-from htswfrontend.fctracker.models import *
+from htsworkflow.frontend.samples.models import *
 
 class FlowCell(models.Model):
   
-  flowcell_id = models.CharField(max_length=20, unique=True, db_index=True, core=True)
+  flowcell_id = models.CharField(max_length=20, unique=True, db_index=True)
   run_date = models.DateTimeField(core=True)
   advanced_run = models.BooleanField(default=False)
   read_length = models.IntegerField(default=32) #Stanford is currenlty 25
diff --git a/htsworkflow/frontend/experiments/urls.py b/htsworkflow/frontend/experiments/urls.py
new file mode 100755 (executable)
index 0000000..62ade81
--- /dev/null
@@ -0,0 +1,12 @@
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',
+                                                                                                      
+    (r'^$', 'htsworkflow.frontend.experiments.views.index'),
+    (r'^liblist$', 'htsworkflow.frontend.experiments.views.test_Libs'),
+    #(r'^(?P<run_folder>.+)/$', 'gaworkflow.frontend.experiments.views.detail'),
+    (r'^(?P<fcid>.+)/$', 'htsworkflow.frontend.experiments.views.makeFCSheet'),
+    (r'^updStatus$', 'htsworkflow.frontend.experiments.experiments.updStatus'),
+    (r'^getConfile$', 'htsworkflow.frontend.experiments.experiments.getConfile'),
+    (r'^getLanesNames$', 'htsworkflow.frontend.experiments.experiments.getLaneLibs')   
+)
index 38880166cd00fe644624c4d382608f288ec74a9d..11d09cfe23a8ce068d324bb7ef4bab48fe34987b 100755 (executable)
@@ -3,7 +3,7 @@
 #shortcut to the above modules
 from django.shortcuts import render_to_response, get_object_or_404
 #from htswfrontend.fctracker.models import *
-from htswfrontend.exp_track.models import *
+from htsworkflow.frontend.experiments.models import *
 from django.http import HttpResponse
 from django.core.exceptions import ObjectDoesNotExist
 
diff --git a/htsworkflow/frontend/reports/ht_urls.py b/htsworkflow/frontend/reports/ht_urls.py
deleted file mode 100644 (file)
index 39871b8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-from django.conf.urls.defaults import *
-
-urlpatterns = patterns('',                                               
-    (r'^updLibInfo$', 'htswfrontend.htsw_reports.libinfopar.refreshLibInfoFile'),
-)
index 8554688d90dbef2d38f1e6d0e4a9803909d526be..ddcdc535d488a04b05359ee5c43ff5320a7a2d31 100644 (file)
@@ -2,11 +2,11 @@ from django.db import models
 from django.db.models import Q
 from django.core.exceptions import ObjectDoesNotExist
 from datetime import datetime
-from htswfrontend.fctracker.models import * 
-from htswfrontend.analys_track.models import *
-from htswfrontend.exp_track.models import *
+from htsworkflow.frontend.samples.models import * 
+from htsworkflow.frontend.analysis.models import *
+from htsworkflow.frontend.experiments.models import *
 from string import *
-from htswfrontend.htsw_reports.utils import *
+from htsworkflow.frontend.reports.utils import *
 import re
 ##from p1 import LibInfo
 from libinfopar import *
@@ -218,8 +218,8 @@ class ProgressReport(models.Model):
     return 'coming up ..'
 
   QPCR = models.CharField(max_length=500,blank=True,null=True)    
-  submitted_to_DCC = models.DateTimeField(core=True,blank=True,null=True)
-  submitted_to_NCBI = models.DateTimeField(core=True,blank=True,null=True)
+  submitted_to_DCC = models.DateTimeField(blank=True,null=True)
+  submitted_to_NCBI = models.DateTimeField(blank=True,null=True)
   note_about_DCC =  models.TextField(blank=True)
   note_about_NCBI = models.TextField(blank=True)
   
diff --git a/htsworkflow/frontend/reports/urls.py b/htsworkflow/frontend/reports/urls.py
new file mode 100644 (file)
index 0000000..9b0acf9
--- /dev/null
@@ -0,0 +1,5 @@
+from django.conf.urls.defaults import *
+
+urlpatterns = patterns('',                                               
+    (r'^updLibInfo$', 'htsworkflow.reports.libinfopar.refreshLibInfoFile'),
+)
index c4e1e3ce97475acf280edb5e640bef3f368aa129..b393028c62cf038d03739c98ebdfd62aee7929c9 100644 (file)
@@ -1,7 +1,7 @@
 from django.db import models
 from django.contrib.auth.models import User
 from htsworkflow.frontend import settings
-from htsworkflow.reports.libinfopar import *
+#from htsworkflow.reports.libinfopar import *
 
 # Create your models here.
 
@@ -63,7 +63,7 @@ class Condition(models.Model):
 
 class Species(models.Model):
   
-  scientific_name = models.CharField(max_length=256, unique=False, db_index=True, core=True)
+  scientific_name = models.CharField(max_length=256, unique=False, db_index=True)
   common_name = models.CharField(max_length=256, blank=True)
   use_genome_build = models.CharField(max_length=100, blank=False, null=False)
 
@@ -82,7 +82,7 @@ class Species(models.Model):
       )
 
 class Affiliation(models.Model):
-  name = models.CharField(max_length=256, db_index=True, core=True,verbose_name='Group Name')
+  name = models.CharField(max_length=256, db_index=True, verbose_name='Group Name')
   contact = models.CharField(max_length=256, null=True, blank=True,verbose_name='Contact Name')  
   email = models.EmailField(null=True,blank=True)
   
@@ -106,12 +106,12 @@ class Affiliation(models.Model):
 
 class Library(models.Model):
   
-  library_id = models.CharField(max_length=30, primary_key=True, db_index=True, core=True)
-  library_name = models.CharField(max_length=100, unique=True, core=True)
-  library_species = models.ForeignKey(Species, core=True)
-  cell_line = models.ForeignKey(Cellline,core=True)
-  condition = models.ForeignKey(Condition,core=True)
-  antibody = models.ForeignKey(Antibody,blank=True,null=True,core=True)
+  library_id = models.CharField(max_length=30, primary_key=True, db_index=True)
+  library_name = models.CharField(max_length=100, unique=True)
+  library_species = models.ForeignKey(Species)
+  cell_line = models.ForeignKey(Cellline)
+  condition = models.ForeignKey(Condition)
+  antibody = models.ForeignKey(Antibody,blank=True,null=True)
   # New field Aug/25/08. SQL: alter table fctracker_library add column "lib_affiliation" varchar(256)  NULL;
   affiliations = models.ManyToManyField(Affiliation,related_name='library_affiliations',null=True,filter_interface=models.HORIZONTAL)
   # New field Aug/19/08
@@ -131,7 +131,7 @@ class Library(models.Model):
                                      default='RNA-seq')
   
   creation_date = models.DateField(blank=True, null=True)
-  made_for = models.ForeignKey(User)
+  made_for = models.ForeignKey(User, edit_inline=models.TABULAR)
   made_by = models.CharField(max_length=50, blank=True, default="Lorian")
   
   PROTOCOL_END_POINTS = (
@@ -207,13 +207,14 @@ class Library(models.Model):
     save_on_top = True
     ##search_fields = ['library_id','library_name','affiliations__name','affiliations__contact','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']
     search_fields = ['library_id','library_name','cell_line__cellline_name','library_species__scientific_name','library_species__common_name','library_species__use_genome_build']
-    list_display = ('affiliation','library_id','aligned_reads','library_name','experiment_type','org','replicate','antibody_name','cell_line','made_by','creation_date')
-    list_display_links = ('library_id', 'library_name')
+    #list_display = ('affiliation','library_id','aligned_reads','library_name','experiment_type','org','replicate','antibody_name','cell_line','made_by','creation_date')
+    list_display = ('library_id','library_name','experiment_type','replicate','antibody_name','made_by','creation_date')
+    #list_display_links = ('library_id', 'library_name')
 
-    list_filter = ('experiment_type','affiliations','library_species','made_for', 'made_by','replicate')
+    list_filter = ('experiment_type','affiliations','library_species', 'made_by','replicate')
     fields = (
         (None, {
-            'fields': (('replicate','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'), ('undiluted_concentration', 'library_size'), 'notes',)
index ec400418a4e4fcecaba21dd07014d1fc5e6d18ba..32272242a3548c5b943754f902e1241ccef2f737 100644 (file)
@@ -143,11 +143,11 @@ INSTALLED_APPS = (
     'django.contrib.sessions',
     'django.contrib.sites',
     'htsworkflow.frontend.eland_config',
-    'htsworkflow.frontend.fctracker',
+    'htsworkflow.frontend.samples',
     # modules from htsworkflow branch
-    #'htswfrontend.exp_track',
-    #'htswfrontend.analys_track', 
-    #'htswfrontend.htsw_reports',
+    'htsworkflow.frontend.experiments',
+    'htsworkflow.frontend.analysis', 
+    'htsworkflow.frontend.reports',
     'django.contrib.databrowse',
 )
 
index e06d92d65059819074b9cb5f3f4d0ae0b859b008..51bf8c41bab1cec970e7d735de87ae4a35610391 100644 (file)
@@ -2,9 +2,9 @@ from django.conf.urls.defaults import *
 
 # Databrowser:
 from django.contrib import databrowse
-from fctracker.models import Library, FlowCell
+from htsworkflow.frontend.samples.models import Library
 databrowse.site.register(Library)
-databrowse.site.register(FlowCell)
+#databrowse.site.register(FlowCell)
 
 urlpatterns = patterns('',
     # Base:
@@ -12,9 +12,12 @@ urlpatterns = patterns('',
     # Admin:
      (r'^admin/', include('django.contrib.admin.urls')),
     # ExpTrack:
-     (r'^experiments/', include('htswfrontend.experiments.et_urls')),
+     (r'^experiments/', include('htsworkflow.frontend.experiments.urls')),
     # AnalysTrack:
-     (r'^analysis/', include('htswfrontend.analysis.an_urls')),
+     (r'^analysis/', include('htsworkflow.frontend.analysis.urls')),
     # Report Views:
     # (r'^reports/', include('gaworkflow.frontend....urls')),
+    
+    # databrowser
+    (r'^databrowse/(.*)', databrowse.site.root)
 )