Exemplo n.º 1
0
def dendogram_homepage(request):
    """This loads the bestmatchfinder homepage."""
    form = DendogramForm()
    return render(
        request,
        "newwebpage/domain_cry_tree_d3js.html",
        {"form": form},
    )
Exemplo n.º 2
0
def dendogram_homepage2(request):
    """This loads the bestmatchfinder homepage."""
    form = DendogramForm()
    context = {
        "form": form,
        "descriptions": Description.objects.order_by("name"),
    }
    return render(request, "newwebpage/dendogram_homepage.html", context)
Exemplo n.º 3
0
def dendogram_homepage2(request):
    """This loads the bestmatchfinder homepage."""
    form = DendogramForm()
    context = {
        'form': form,
        'descriptions': Description.objects.order_by('name')
    }
    return render(request, 'clustalanalysis/dendogram_homepage.html', context)
Exemplo n.º 4
0
def dendogram_celery(request):
    form = DendogramForm()
    print("dendogram celery is running")
    if request.method == "POST":
        form = DendogramForm(request.POST)
        if form.is_valid():
            context = {}
            input_file, output_file = form.save()

            # if newlines <= 3:
            #     message_profile = "Atleast three or more sequences aare needed.This category has less than 3"
            #     messages.success(request, messages)
            #     return HttpResponseRedirect('/dendogram_homepage2/')

            task = create_tree.delay(input_file, output_file)
            # t = [(1, 400, 400), (401, 800, 600),
            #      (801, 1200, 700), (1201, 1400, 800), (1401, 1600, 900), (1401, 1600, 1000), (1601, 1800, 1100), (1801, 2000, 1200), (2001, 2200, 1300), (2201, 2400, 1400), (2401, 2600, 1500)]
            # radius = 0
            # print(radius)
            # for i in t:
            #     if i[0] <= newlines <= i[1]:
            #         radius = i[2]
            #         break
            # for i in t:
            #     if i[0] <= newlines
            #         radius = i[1]
            #         break

            context["task_id"] = task.id
            context["task_status"] = task.status
            context["numlines"] = form.numlines
            # context['radius'] = radius

            # print("outputfile", newlines)
            # print("radius", radius)

            return render(
                request,
                "newwebpage/clustal_processing.html",
                context,
            )

        return render(
            request,
            "newwebpage/dendogram_homepage.html",
            {"form": form},
        )

    return HttpResponseRedirect("/dendogram_homepage2/")
Exemplo n.º 5
0
def dendogram(request):
    form = DendogramForm()
    if request.method == "POST":
        form = DendogramForm(request.POST)
        if form.is_valid():

            rooted_tree = form.save()

            context = {
                "tree": rooted_tree,
            }
            return render(request, "newwebpage/dendogram.html", context)

        context = {"form": form}
        return render(request, "newwebpage/dendogram.html", context)

    return HttpResponseRedirect("/dendogram_homepage/")
Exemplo n.º 6
0
def dendogram(request):
    form = DendogramForm()
    if request.method == 'POST':
        form = DendogramForm(request.POST)
        if form.is_valid():

            rooted_tree = form.save()

            context = {
                'tree': rooted_tree,
            }
            return render(request, 'clustalanalysis/dendogram.html', context)

        context = {'form': form}
        return render(request, 'clustalanalysis/dendogram.html', context)

    return HttpResponseRedirect('/dendogram_homepage/')
Exemplo n.º 7
0
def dendogram_homepage(request):
    """This loads the bestmatchfinder homepage."""
    form = DendogramForm()
    return render(request, 'clustalanalysis/domain_cry_tree_d3js.html',
                  {'form': form})