Commit 0b34ce14 authored by Nijveen's avatar Nijveen
Browse files

small modifications to the web interface

parent 6f00bc3d
......@@ -16,7 +16,9 @@ import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
MEDIA_ROOT = os.path.join(BASE_DIR,'media')
MEDIA_URL = "http://www.bioinformatics.nl/AraQTL/media/"
MEDIA_URL = "/AraQTL/media/"
BASE_URL = "/AraQTL/"
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
......@@ -93,7 +95,7 @@ WSGI_APPLICATION = 'AraQTL.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'PlantQTL',
'NAME': 'AraQTL',
'USER': 'plantqtl',
'PASSWORD': 'q1w2e3r4',
'HOST': '',
......
......@@ -415,7 +415,7 @@
link_pre = "/AraQTL/multiplot/?query=";
var hyper_link = link_pre+ trans;
if (trans !== null) {
titletxt += " (" + trans + ")";
//titletxt += " (" + trans + ")";
//open window in a new tab <a href="#" target="_blank">Link</a>
xlink = probeaxes.append("a").attr("target","_blank").attr("xlink:href", hyper_link);
xlink.append("text").text(titletxt).attr("x", (left[1] + right[1]) / 2).attr("y", top[1] - pad.top / 2).attr("fill", maincolor).style("font-size", "18px");
......
......@@ -15,7 +15,7 @@ def eQTLPlotView(request):
plot eQTL maping
'''
experiments = Experiment.objects.filter(species__species_name="Arabidopsis thaliana")
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
if request.method == 'GET':
if request.GET.get('experiment_name'):
exp_name = request.GET.get('experiment_name')
......
......@@ -25,9 +25,8 @@ def selectMarker(request):
select a marker, experiment and threshold
'''
species_name = "Arabidopsis thaliana"
experiments = Experiment.objects.filter(species__species_name=species_name)
species_short_name = Species.objects.get(species_name=species_name).short_name
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
species_short_name = Species.objects.get(species_name=settings.SPECIES).short_name
if request.method == 'GET':
if request.GET.get('experiment_name') and request.GET.get('query'):
......
......@@ -28,9 +28,8 @@ def correlation(request):
select a gene and experiment, and find the top genes that show correlation
'''
species_name = "Arabidopsis thaliana"
experiments = Experiment.objects.filter(species__species_name=species_name)
species_short_name = Species.objects.get(species_name=species_name).short_name
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
species_short_name = Species.objects.get(species_name=settings.SPECIES).short_name
if request.method == 'GET':
if request.GET.get('query'):
......@@ -43,7 +42,7 @@ def correlation(request):
if not gene_id:
return render_to_response('correlation.html', {'experiments': experiments})
geneInfoList = GeneInfo.objects.filter(gene_id = gene_id, species__species_name = species_name)
geneInfoList = GeneInfo.objects.filter(gene_id = gene_id, species__species_name = settings.SPECIES)
if geneInfoList.count() == 0:
geneInfoList = GeneInfo.objects.filter(gene_name__iexact=gene_id)
......
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.conf import settings
from main.models import Experiment
from main.models import ArraySpot
from main.models import Experiment, ArraySpot
import csv
def index(request):
experiments = Experiment.objects.filter(species__species_name="Arabidopsis thaliana")
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
mode = 'multiplot'
......@@ -19,7 +19,7 @@ def index(request):
'mode' :mode})
def no_results(query, mode):
experiments = Experiment.objects.filter(species__species_name="Arabidopsis thaliana")
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
return render_to_response('index.html', {'experiments': experiments,
'query': query,
......@@ -28,7 +28,7 @@ def no_results(query, mode):
def AGI_list(request):
genelist = ArraySpot.objects.filter(experiment__species__species_name="Arabidopsis thaliana").values_list('spot_id', flat=True)
genelist = ArraySpot.objects.filter(experiment__species__species_name=settings.SPECIES).values_list('spot_id', flat=True)
AGI_list = '\n'.join(genelist)
response = HttpResponse(content_type='text/plain')
......
......@@ -171,6 +171,7 @@ dot["pos"] = {{ gene_info_list.0.start }};
<th><input type="checkbox" name="allgenes_checkbox" value="all"></th>
<th>Gene&nbsp;ID (count={{ gene_list|length }})</th>
<th>Gene Name</th>
<th>Position</th>
<th>Description</th>
<th>
<button onclick="DownloadGeneList()" title="Opens new browser window with the selected gene IDs">Download selected gene IDs</button>
......@@ -186,6 +187,7 @@ dot["pos"] = {{ gene_info_list.0.start }};
</a>
</td>
<td>{{ gene.gene_name }}</td>
<td>{{ gene.chr }}:{{ gene.start }}</td>
<td align=left colspan=2>{{ gene.description }}</td></tr>
{% endfor %}
</tbody>
......
from django.shortcuts import render_to_response, HttpResponse, redirect
from django.conf import settings
from main.models import Experiment, GeneInfo, ArraySpot, GeneGO, GO, Species
......@@ -16,9 +17,8 @@ def multiplot(request):
select a gene and experiment, and find the top genes that show correlation
'''
species_name = "Arabidopsis thaliana"
experiments = Experiment.objects.filter(species__species_name=species_name)
species_short_name = Species.objects.get(species_name=species_name).short_name
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
species_short_name = Species.objects.get(species_name=settings.SPECIES).short_name
if request.method == 'GET':
if 'query' in request.GET:
......@@ -86,9 +86,8 @@ def multiexperimentplot(request):
plot lod scores for one gene for all experiments
'''
species_name = "Arabidopsis thaliana"
experiments = Experiment.objects.filter(species__species_name=species_name)
species_short_name = Species.objects.get(species_name=species_name).short_name
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
species_short_name = Species.objects.get(species_name=settings.SPECIES).short_name
query = request.GET.get('query')
query = urllib2.unquote(query).strip().upper()
......@@ -112,7 +111,7 @@ def multiexperimentplot(request):
experiments4gene = Experiment.objects.filter(arrayspot__spot_id=query).values_list('experiment_name', flat=True)
geneInfoList = GeneInfo.objects.filter(gene_id=query, species__species_name=species_name)
geneInfoList = GeneInfo.objects.filter(gene_id=query, species__species_name=settings.SPECIES)
if (geneInfoList.count() == 0):
return HttpResponse('<h1> Unknown gene %s </h1>' % query)
gene = geneInfoList[0]
......
import urllib2
from django.shortcuts import render_to_response, HttpResponse
from django.conf import settings
from main.models import GeneInfo, GO, GeneGO, Experiment
......@@ -24,8 +25,7 @@ def index(request):
return suggest(None,None,None)
def suggest(query, experiment_name, mode):
species_name = "Arabidopsis thaliana"
experiments = Experiment.objects.filter(species__species_name=species_name)
experiments = Experiment.objects.filter(species__species_name=settings.SPECIES)
if not query:
return render_to_response('suggestions.html', {'experiments': experiments})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment