tools
This commit is contained in:
@@ -5,5 +5,6 @@ from tools import views
|
||||
urlpatterns = [
|
||||
url("(.*\.html$)", views.out_page),
|
||||
url("id_transform", views.id_transform),
|
||||
url("gen_to_fa", views.gen_to_fa),
|
||||
url("blast", views.blast)
|
||||
]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import os
|
||||
import os, time
|
||||
|
||||
from django.http import JsonResponse
|
||||
from django.shortcuts import render
|
||||
from chart import tools
|
||||
from Bio.SeqRecord import SeqRecord
|
||||
|
||||
|
||||
def out_page(request, page):
|
||||
@@ -23,9 +24,13 @@ def blast(request):
|
||||
pass
|
||||
|
||||
|
||||
def gen_to_fa(request):
|
||||
file = request.FILES.get("file")
|
||||
file_path, file_id = tools.path_out("chart")
|
||||
keep_file(file, file_path)
|
||||
data = {"id": file_id}
|
||||
time.sleep(1)
|
||||
# records = SeqIO.parse(file_path, "genbank") # 读入
|
||||
# SeqIO.write(records, f"{file_path}", "fasta") # 写出
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return JsonResponse(data)
|
||||
|
||||
Reference in New Issue
Block a user