From: Diane Trout Date: Thu, 8 Jan 2009 20:12:03 +0000 (+0000) Subject: This is a partial merge of the stanford branch with the caltech branch of X-Git-Tag: stanford.caltech-merged-database-2009-jan-15~2 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=a78a3200ca7cc091ac2eace0871fccb87b52f00c This is a partial merge of the stanford branch with the caltech branch of 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. --- diff --git a/htsworkflow/frontend/analysis/an_urls.py b/htsworkflow/frontend/analysis/an_urls.py deleted file mode 100644 index 57fa33e..0000000 --- a/htsworkflow/frontend/analysis/an_urls.py +++ /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'), -) diff --git a/htsworkflow/frontend/analysis/main.py b/htsworkflow/frontend/analysis/main.py index 015a69c..511390b 100644 --- a/htsworkflow/frontend/analysis/main.py +++ b/htsworkflow/frontend/analysis/main.py @@ -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): diff --git a/htsworkflow/frontend/analysis/models.py b/htsworkflow/frontend/analysis/models.py index 301be27..4b1c72d 100644 --- a/htsworkflow/frontend/analysis/models.py +++ b/htsworkflow/frontend/analysis/models.py @@ -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 index 0000000..b1be3d2 --- /dev/null +++ b/htsworkflow/frontend/analysis/urls.py @@ -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'), +) diff --git a/htsworkflow/frontend/eland_config/views.py b/htsworkflow/frontend/eland_config/views.py index 25edea9..d4be4ea 100644 --- a/htsworkflow/frontend/eland_config/views.py +++ b/htsworkflow/frontend/eland_config/views.py @@ -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 index 7ad709d..0000000 --- a/htsworkflow/frontend/experiments/et_urls.py +++ /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.+)/$', 'gaworkflow.frontend.exp_track.views.detail'), - (r'^(?P.+)/$', '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 index 0000000..d11cda7 --- /dev/null +++ b/htsworkflow/frontend/experiments/experiments.py @@ -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 + ', 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 = '' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + outputfile += '\n' + 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 index 6486b5c..0000000 --- a/htsworkflow/frontend/experiments/exptrack.py +++ /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 + ', 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 = '' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - outputfile += '\n' - except ObjectDoesNotExist: - outputfile = 'Flowcell entry not found for: '+fcid - else: outputfile = 'Missing input: flowcell id' - - return HttpResponse(outputfile) diff --git a/htsworkflow/frontend/experiments/models.py b/htsworkflow/frontend/experiments/models.py index 08397e6..4e7e696 100755 --- a/htsworkflow/frontend/experiments/models.py +++ b/htsworkflow/frontend/experiments/models.py @@ -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 index 0000000..62ade81 --- /dev/null +++ b/htsworkflow/frontend/experiments/urls.py @@ -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.+)/$', 'gaworkflow.frontend.experiments.views.detail'), + (r'^(?P.+)/$', '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') +) diff --git a/htsworkflow/frontend/experiments/views.py b/htsworkflow/frontend/experiments/views.py index 3888016..11d09cf 100755 --- a/htsworkflow/frontend/experiments/views.py +++ b/htsworkflow/frontend/experiments/views.py @@ -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 index 39871b8..0000000 --- a/htsworkflow/frontend/reports/ht_urls.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.conf.urls.defaults import * - -urlpatterns = patterns('', - (r'^updLibInfo$', 'htswfrontend.htsw_reports.libinfopar.refreshLibInfoFile'), -) diff --git a/htsworkflow/frontend/reports/models.py b/htsworkflow/frontend/reports/models.py index 8554688..ddcdc53 100644 --- a/htsworkflow/frontend/reports/models.py +++ b/htsworkflow/frontend/reports/models.py @@ -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 index 0000000..9b0acf9 --- /dev/null +++ b/htsworkflow/frontend/reports/urls.py @@ -0,0 +1,5 @@ +from django.conf.urls.defaults import * + +urlpatterns = patterns('', + (r'^updLibInfo$', 'htsworkflow.reports.libinfopar.refreshLibInfoFile'), +) diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index c4e1e3c..b393028 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -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',) diff --git a/htsworkflow/frontend/settings.py b/htsworkflow/frontend/settings.py index ec40041..3227224 100644 --- a/htsworkflow/frontend/settings.py +++ b/htsworkflow/frontend/settings.py @@ -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', ) diff --git a/htsworkflow/frontend/urls.py b/htsworkflow/frontend/urls.py index e06d92d..51bf8c4 100644 --- a/htsworkflow/frontend/urls.py +++ b/htsworkflow/frontend/urls.py @@ -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) )