tools
This commit is contained in:
@@ -10,5 +10,6 @@ urlpatterns = [
|
||||
url("orf", views.orf),
|
||||
url("basics", views.basics),
|
||||
url("pfam", views.pfam),
|
||||
url("Differential_expression_analysis", views.Differential_expression_analysis)
|
||||
url("Differential_expression_analysis", views.Differential_expression_analysis),
|
||||
url("blast", views.blast)
|
||||
]
|
||||
|
||||
@@ -21,8 +21,28 @@ def id_transform(request):
|
||||
|
||||
|
||||
def blast(request):
|
||||
file = request.FILES.get('file', None)
|
||||
file1 = request.FILES.get('file1', None)
|
||||
pass
|
||||
id_ = request.POST.get("id", None)
|
||||
fl = request.POST.get("fl", None)
|
||||
if fl:
|
||||
file_path, file_id = tools.path_out("chart", name=id_ + "seq")
|
||||
tools.keep_file(file, file_path)
|
||||
return JsonResponse({})
|
||||
else:
|
||||
file_path, file_id = tools.path_out("chart", name=id_)
|
||||
|
||||
tools.keep_file(file1, file_path)
|
||||
outfmt = request.POST.get("outfmt", None)
|
||||
evalue = request.POST.get("evalue", None)
|
||||
num_descriptions = request.POST.get("num_descriptions", None)
|
||||
type = request.POST.get("type", None)
|
||||
os.system(
|
||||
f"makeblastdb -in {file_path} -dbtype {'prot' if type in ['blastx'] else 'nucl'} -parse_seqids -out db")
|
||||
os.system(
|
||||
f"{type} -query {file_path}seq -out {file_path}.blast -db db -outfmt {outfmt} -evalue {evalue} -num_descriptions {num_descriptions} -num_threads 8")
|
||||
|
||||
return JsonResponse({"id": id_})
|
||||
|
||||
|
||||
def gen_to_fa(request):
|
||||
@@ -96,7 +116,7 @@ def pfam(request):
|
||||
tools.keep_file(file, file_path)
|
||||
data = {"id": file_id}
|
||||
os.system(
|
||||
f"{tools.tools_path}/pfam_scan.pl -fasta {file_path} -b_dom {b_dom} -b_seq {b_seq} -e_dom {e_dom} -e_seq {e_seq} -align {align} -clan_overlap {clan_overlap} -dir {tools.tools_path}/db/ -out {file_path}.txt")
|
||||
f"{tools.tools_path}/pfam_scan.pl -fasta {file_path} -b_dom {b_dom} -b_seq {b_seq} -e_dom {e_dom} -e_seq {e_seq} -align {align} -clan_overlap {clan_overlap} -dir {tools.tools_path}/pfam_db/ -out {file_path}.txt")
|
||||
|
||||
return JsonResponse(data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user