Commit e4b3fa80 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Add alignment file as input instead of query and target, Implements #126

See merge request !3
parents 0295c795 003c20cf
...@@ -121,7 +121,7 @@ def run(mode="standalone", debug=False, host="127.0.0.1", port=5000, no_crons=Fa ...@@ -121,7 +121,7 @@ def run(mode="standalone", debug=False, host="127.0.0.1", port=5000, no_crons=Fa
"app": app "app": app
}) })
thread.start() thread.start()
app.run(host=host, port=port, debug=debug) app.run(host=host, port=port, debug=debug, threaded=True)
def clear_crons(): def clear_crons():
......
...@@ -8,7 +8,7 @@ from filter_contigs import Filter ...@@ -8,7 +8,7 @@ from filter_contigs import Filter
from index import index_file from index import index_file
def index_fasta(name, filepath, out_dir, type_f): def index_fasta(name, filepath, out_dir, type_f, dofilter = True):
""" """
Index and filter fasta Index and filter fasta
:param name: name of the specie :param name: name of the specie
...@@ -17,23 +17,25 @@ def index_fasta(name, filepath, out_dir, type_f): ...@@ -17,23 +17,25 @@ def index_fasta(name, filepath, out_dir, type_f):
:param type_f: type of fasta (query or target) :param type_f: type of fasta (query or target)
""" """
uncompressed = None uncompressed = None
if filepath.endswith(".gz"): if filepath.endswith(".gz") and dofilter:
uncompressed = filepath[:-3] uncompressed = filepath[:-3]
index = os.path.join(out_dir, type_f + ".idx") index = os.path.join(out_dir, type_f + ".idx")
success, nb_contigs = index_file(filepath, name, index, uncompressed) success, nb_contigs = index_file(filepath, name, index, uncompressed)
if success: if success:
in_fasta = filepath is_filtered = False
if uncompressed is not None: if dofilter:
in_fasta = uncompressed in_fasta = filepath
filtered_fasta = os.path.join(os.path.dirname(in_fasta), "filtered_" + os.path.basename(in_fasta)) if uncompressed is not None:
filter_f = Filter(fasta=in_fasta, in_fasta = uncompressed
index_file=index, filtered_fasta = os.path.join(os.path.dirname(in_fasta), "filtered_" + os.path.basename(in_fasta))
type_f=type_f, filter_f = Filter(fasta=in_fasta,
min_filtered=nb_contigs / 4, index_file=index,
split=False, type_f=type_f,
out_fasta=filtered_fasta, min_filtered=nb_contigs / 4,
replace_fa=True) split=False,
is_filtered = filter_f.filter() out_fasta=filtered_fasta,
replace_fa=True)
is_filtered = filter_f.filter()
if uncompressed is not None: if uncompressed is not None:
if is_filtered: if is_filtered:
os.remove(filepath) os.remove(filepath)
...@@ -41,6 +43,7 @@ def index_fasta(name, filepath, out_dir, type_f): ...@@ -41,6 +43,7 @@ def index_fasta(name, filepath, out_dir, type_f):
save_file.write(uncompressed) save_file.write(uncompressed)
else: else:
os.remove(uncompressed) os.remove(uncompressed)
else: else:
if uncompressed is not None: if uncompressed is not None:
try: try:
...@@ -53,16 +56,21 @@ def index_fasta(name, filepath, out_dir, type_f): ...@@ -53,16 +56,21 @@ def index_fasta(name, filepath, out_dir, type_f):
parser = argparse.ArgumentParser(description="Split huge contigs") parser = argparse.ArgumentParser(description="Split huge contigs")
parser.add_argument('-q', '--query', type=str, required=False, help="Query fasta file") parser.add_argument('-q', '--query', type=str, required=False, help="Query fasta file")
parser.add_argument('-u', '--query-split', type=str, required=False, help="Query fasta file split") parser.add_argument('-u', '--query-split', type=str, required=False, help="Query fasta file split")
parser.add_argument('-t', '--target', type=str, required=True, help="Target fasta file") parser.add_argument('-t', '--target', type=str, required=False, help="Target fasta file")
parser.add_argument('-n', '--query-name', type=str, required=False, help="Query name") parser.add_argument('-n', '--query-name', type=str, required=False, help="Query name")
parser.add_argument('-m', '--target-name', type=str, required=True, help="Target name") parser.add_argument('-m', '--target-name', type=str, required=False, help="Target name")
parser.add_argument('-s', '--size', type=int, required=False, default=10, parser.add_argument('-s', '--size', type=int, required=False, default=10,
help="Max size of contigs (Mb) - for query split") help="Max size of contigs (Mb) - for query split")
parser.add_argument('-p', '--preptime-file', type=str, required=True, help="File into save prep times") parser.add_argument('-p', '--preptime-file', type=str, required=True, help="File into save prep times")
parser.add_argument('--split', type=bool, const=True, nargs="?", required=False, default=False, parser.add_argument('--split', type=bool, const=True, nargs="?", required=False, default=False,
help="Split query") help="Split query")
parser.add_argument('--index-only', type=bool, const=True, nargs="?", required=False, default=False,
help="Index files only. No split, no filter.")
args = parser.parse_args() args = parser.parse_args()
if args.index_only and args.split:
raise Exception("--index-only and --split arguments are mutually exclusive")
out_dir = os.path.dirname(args.target) out_dir = os.path.dirname(args.target)
with open(args.preptime_file, "w") as ptime: with open(args.preptime_file, "w") as ptime:
...@@ -88,9 +96,13 @@ with open(args.preptime_file, "w") as ptime: ...@@ -88,9 +96,13 @@ with open(args.preptime_file, "w") as ptime:
else: else:
exit(1) exit(1)
else: else:
index_fasta(name=args.query_name, filepath=args.query, out_dir=out_dir, type_f="query") print("Indexing query...")
print("Indexing target...") index_fasta(name=args.query_name, filepath=args.query, out_dir=out_dir, type_f="query",
index_fasta(name=args.target_name, filepath=args.target, out_dir=out_dir, type_f="target") dofilter=not args.index_only)
if args.target is not None:
print("Indexing target...")
index_fasta(name=args.target_name, filepath=args.target, out_dir=out_dir, type_f="target",
dofilter=not args.index_only)
ptime.write(str(round(time.time())) + "\n") ptime.write(str(round(time.time())) + "\n")
......
...@@ -68,7 +68,7 @@ if MODE == "webserver": ...@@ -68,7 +68,7 @@ if MODE == "webserver":
error = CharField(default="") error = CharField(default="")
mem_peak = IntegerField(null=True) mem_peak = IntegerField(null=True)
time_elapsed = IntegerField(null=True) time_elapsed = IntegerField(null=True)
tool = CharField(default="minimap2", max_length=50) tool = CharField(default="minimap2", max_length=50, null=True)
class Gallery(BaseModel): class Gallery(BaseModel):
......
...@@ -3,7 +3,7 @@ class Fasta: ...@@ -3,7 +3,7 @@ class Fasta:
self._name = name self._name = name
self._path = path self._path = path
self._type = type_f self._type = type_f
self._example = example self._example = example is not False
def set_path(self, path): def set_path(self, path):
self._path = path self._path = path
......
...@@ -6,12 +6,17 @@ import shutil ...@@ -6,12 +6,17 @@ import shutil
import sys import sys
import re import re
import traceback import traceback
from inspect import getmembers, isfunction
from collections import OrderedDict from collections import OrderedDict
from Bio import SeqIO from Bio import SeqIO
from jinja2 import Template from jinja2 import Template
from dgenies.config_reader import AppConfigReader from dgenies.config_reader import AppConfigReader
import dgenies.lib.validators as validators
ALLOWED_EXTENSIONS = ['fa', 'fasta', 'fna', 'fa.gz', 'fasta.gz', 'fna.gz'] ALLOWED_EXTENSIONS = {"fasta": ['fa', 'fasta', 'fna', 'fa.gz', 'fasta.gz', 'fna.gz'],
"idx": ['idx'],
"map": [o[0] for o in getmembers(validators) if isfunction(o[1]) and not o[0].startswith("_")]}
# map: all functions of validators which does not starts with an underscore.
class Functions: class Functions:
...@@ -19,10 +24,13 @@ class Functions: ...@@ -19,10 +24,13 @@ class Functions:
config = AppConfigReader() config = AppConfigReader()
@staticmethod @staticmethod
def allowed_file(filename): def allowed_file(filename, file_formats=("fasta",)):
return '.' in filename and \ for file_format in file_formats:
(filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS or ".".join(filename.rsplit('.', 2)[1:]).lower() if '.' in filename and \
in ALLOWED_EXTENSIONS) (filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS[file_format]
or ".".join(filename.rsplit('.', 2)[1:]).lower() in ALLOWED_EXTENSIONS[file_format]):
return True
return False
@staticmethod @staticmethod
def random_string(s_len): def random_string(s_len):
...@@ -256,3 +264,8 @@ class Functions: ...@@ -256,3 +264,8 @@ class Functions:
if "gallery" in all_jobs: if "gallery" in all_jobs:
all_jobs.remove("gallery") all_jobs.remove("gallery")
return sorted(all_jobs, key=lambda x: x.lower()) return sorted(all_jobs, key=lambda x: x.lower())
@staticmethod
def query_fasta_file_exists(res_dir):
fasta_file = os.path.join(res_dir, ".query")
return os.path.exists(fasta_file) and os.path.isfile(fasta_file)
This diff is collapsed.
...@@ -113,6 +113,12 @@ class Paf: ...@@ -113,6 +113,12 @@ class Paf:
keep_lines[cls].append(line) keep_lines[cls].append(line)
return keep_lines return keep_lines
def keyerror_message(self, exception: KeyError, type_f):
message = "Invalid contig for %s: %s" % (type_f, exception.args[0])
if os.path.exists(os.path.join(self.data_dir, ".align")):
message += ". May be you invert query and target files?"
return message
def parse_paf(self, merge_index=True, noise=True): def parse_paf(self, merge_index=True, noise=True):
min_idy = 10000000000 min_idy = 10000000000
max_idy = -10000000000 max_idy = -10000000000
...@@ -158,10 +164,18 @@ class Paf: ...@@ -158,10 +164,18 @@ class Paf:
min_idy = min(min_idy, idy) min_idy = min(min_idy, idy)
max_idy = max(max_idy, idy) max_idy = max(max_idy, idy)
# x1, x2, y1, y2, idy # x1, x2, y1, y2, idy
y1 = int(parts[2]) + q_abs_start[v1] try:
y2 = int(parts[3]) + q_abs_start[v1] y1 = int(parts[2]) + q_abs_start[v1]
x1 = int(parts[7 if strand == 1 else 8]) + t_abs_start[v6] y2 = int(parts[3]) + q_abs_start[v1]
x2 = int(parts[8 if strand == 1 else 7]) + t_abs_start[v6] except KeyError as e:
self.error = self.keyerror_message(e, "query")
return False
try:
x1 = int(parts[7 if strand == 1 else 8]) + t_abs_start[v6]
x2 = int(parts[8 if strand == 1 else 7]) + t_abs_start[v6]
except KeyError as e:
self.error = self.keyerror_message(e, "target")
return False
len_m = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2)) len_m = sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2))
lines_lens.append(len_m) lines_lens.append(len_m)
if idy < self.limit_idy[0]: if idy < self.limit_idy[0]:
......
...@@ -4,5 +4,48 @@ Define tools parsers here ...@@ -4,5 +4,48 @@ Define tools parsers here
Each parser (main function) must have 2 and only 2 arguments: Each parser (main function) must have 2 and only 2 arguments:
- First argument: input file which is the tool raw output - First argument: input file which is the tool raw output
- Second argument: finale PAF file - Second argument: finale PAF file
Returns True if parse succeed, else False
""" """
import traceback
from Bio import AlignIO
def maf(in_maf, out_paf):
maf_f = None
try:
with open(out_paf, "w") as paf:
maf_f = AlignIO.parse(in_maf, "maf")
for grp in maf_f:
seqs = []
for seq in grp:
seqs.append(seq)
matches = 0
for i in range(0, len(seqs[0])):
if seqs[0][i] == seqs[1][i]:
matches += 1
tannots = seqs[0].annotations
qannots = seqs[1].annotations
paf.write("{qname}\t{qlen}\t{qstart}\t{qend}\t{strand}\t{tname}\t{tlen}\t{tstart}\t{tend}\t{matches}\t"
"{block_len}\t255\n".format(
tname=seqs[0].id,
tlen=tannots["srcSize"],
tstart=tannots["start"],
tend=tannots["start"] + tannots["size"],
qname=seqs[1].id,
qlen=qannots["srcSize"],
qstart=qannots["start"],
qend=qannots["start"] + qannots["size"],
strand="+" if tannots["strand"] == qannots["strand"] else "-",
matches=matches,
block_len=tannots["size"]
))
except:
traceback.print_exc()
if maf_f is not None:
maf_f.close()
return False
else:
maf_f.close()
return True
"""
Define formats validators here (for alignment files)
Each validator (main function) has a name which is exactly the name of the format in the aln-formats.yaml file.
Only 1 argument to this function:
- Input file to check
Secondary functions must start with _
Returns True if file is valid, else False
"""
from Bio import AlignIO
import shutil, os
def paf(in_file):
try:
with open(in_file, "r") as aln:
n = 0
for line in aln:
parts = line.rstrip().split("\t")
if len(parts) < 12:
return False
for i in (1, 2, 3, 6, 7, 8, 9, 10, 11):
if not parts[i].isdigit():
return False
if parts[4] not in ("+", "-"):
return False
n += 1
if n == 1000:
break
except:
return False
else:
return True
def _filter_maf(in_file):
new_file = in_file + ".new"
with open(in_file, "r") as inf, open(new_file, "w") as new:
for line in inf:
if len(line.rstrip()) == 0 or line[0] in ["#", "a", "s"]:
new.write(line)
os.remove(in_file)
shutil.move(new_file, in_file)
def maf(in_file):
_filter_maf(in_file)
try:
maf = AlignIO.parse(in_file, "maf")
for grp in maf:
if len(grp) != 2:
return False
except:
return False
else:
return True
\ No newline at end of file
...@@ -325,6 +325,42 @@ footer hr { ...@@ -325,6 +325,42 @@ footer hr {
margin-top: 0; margin-top: 0;
} }
h4.header-form {
text-align: center;
}
#tabs {
border-bottom: 2px solid black;
margin-bottom: 10px;
margin-top: 15px;
}
#tabs .tab {
display: inline-block;
background-color: #c8c8c8;
padding: 5px 25px 5px 25px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
cursor: pointer;
}
#tabs .tab.active {
background-color: #eeeeee;
font-weight: bold;
}
#tabs .tab:hover {
background-color: #f7f7f7;
}
div.buttons {
margin-top: 20px;
}
div.footnotes {
margin-top: 25px;
}
/* Notify.js */ /* Notify.js */
.notifyjs-corner { .notifyjs-corner {
top: 50px !important; top: 50px !important;
...@@ -548,6 +584,10 @@ div.in-label { ...@@ -548,6 +584,10 @@ div.in-label {
width: 300px; width: 300px;
} }
div.in-label.grp2 {
width: 365px;
}
div.submit-form table input[type=text], div.submit-form table input[type=email] { div.submit-form table input[type=text], div.submit-form table input[type=email] {
border: 1px solid #A9A9A9; border: 1px solid #A9A9A9;
border-image: none; border-image: none;
......
body{font-size:14px;font-family:sans-serif;padding-top:50px}#main-error{display:none;width:100%;min-height:60px;background:#ff351a;color:white;font-size:14pt;font-weight:bold;text-align:center}#main-error a{color:#fff75a}#main-error span.big{font-size:20pt}#body{max-width:850px}.navbar-brand{padding-left:45px;background:url(images/logo.svg) no-repeat 0 5px;background-size:40px 40px}#legend{width:100%;height:230px;border:none;margin-bottom:10px;margin-left:10px;margin-top:40px}label.input-checkbox-label input[type=checkbox]{position:relative;vertical-align:middle;bottom:1px}#main-bar-title{background-color:black;color:white;padding-left:10px;margin-bottom:5px}#main-bar-title h1{margin-top:0;margin-bottom:0;margin-left:10px;padding-top:10px;padding-bottom:10px}#main-bar-title h1,#main-bar-title img{display:inline-block;vertical-align:middle;width:auto}#legend .draw{width:100%;height:200px}#legend .title{width:60%;height:30px;text-align:center;font-size:12pt;font-weight:bold;font-family:sans-serif;text-decoration:underline}#legend .draw{width:60%}#draw,#sidebar{display:table-cell;vertical-align:top}#sidebar{min-width:120px;max-width:165px}#sidebar input[type=number]{width:100px}#sidebar label{font-weight:normal!important}#sidebar input[type=button],#sidebar input[type=range],#sidebar input[type=number],#sidebar label{width:100%!important}#supdraw{width:auto;height:auto;position:relative;margin-top:5px}#draw{width:850px}.mylabel{font-size:18pt;font-weight:bold;font-family:FreeSans,sans-serif;top:10pt;position:absolute}#restore-all{width:5%!important;height:5%!important;top:0;right:0;position:absolute;background:#fff url(images/reset.svg) no-repeat 6.5px 7.5px;background-size:65% 65%;cursor:pointer;border:solid 1px black;border-radius:0 15px 0 0}#restore-all:hover{background:#000 url(images/reset_hover.svg) no-repeat 6.5px 7.5px;background-size:65% 65%}#loading{position:absolute;left:calc(50% - 140px);top:calc(50% - 48px)}#loading .label{color:black;display:inline-block;padding-left:55px;padding-right:5px;margin-left:-30px;height:50px;width:180px;background:white;border:1px solid black;border-radius:25px;font-size:20pt;font-weight:bold;vertical-align:middle}.cssload-container{position:relative;display:inline-block;padding-top:-20px;vertical-align:middle}.cssload-whirlpool,.cssload-whirlpool::before,.cssload-whirlpool::after{position:absolute;top:50%;left:50%;border:1px solid rgb(204,204,204);border-left-color:rgb(0,0,0);border-radius:674px;-o-border-radius:674px;-ms-border-radius:674px;-webkit-border-radius:674px;-moz-border-radius:674px}.cssload-whirlpool{margin:-17px 0 0 -17px;height:34px;width:34px;animation:cssload-rotate 1150ms linear infinite;-o-animation:cssload-rotate 1150ms linear infinite;-ms-animation:cssload-rotate 1150ms linear infinite;-webkit-animation:cssload-rotate 1150ms linear infinite;-moz-animation:cssload-rotate 1150ms linear infinite}.cssload-whirlpool::before{content:"";margin:-16px 0 0 -16px;height:30px;width:30px;animation:cssload-rotate 1150ms linear infinite;-o-animation:cssload-rotate 1150ms linear infinite;-ms-animation:cssload-rotate 1150ms linear infinite;-webkit-animation:cssload-rotate 1150ms linear infinite;-moz-animation:cssload-rotate 1150ms linear infinite}.cssload-whirlpool::after{content:"";margin:-20px 0 0 -20px;height:38px;width:38px;animation:cssload-rotate 2300ms linear infinite;-o-animation:cssload-rotate 2300ms linear infinite;-ms-animation:cssload-rotate 2300ms linear infinite;-webkit-animation:cssload-rotate 2300ms linear infinite;-moz-animation:cssload-rotate 2300ms linear infinite}@keyframes cssload-rotate{100%{transform:rotate(360deg)}}@-o-keyframes cssload-rotate{100%{-o-transform:rotate(360deg)}}@-ms-keyframes cssload-rotate{100%{-ms-transform:rotate(360deg)}}@-webkit-keyframes cssload-rotate{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes cssload-rotate{100%{-moz-transform:rotate(360deg)}}@media screen and (-webkit-min-device-pixel-ratio:0){Body{font-size:16px}}.form-group,.form-group input{margin-bottom:5px!important}div.submit-form fieldset{margin-bottom:10px}h2.title-launch{margin-bottom:20px}.form-group input[type=text],.form-group input[type=email]{width:300px}#body{margin-left:15px;margin-top:10px}.errors-submit ul li{background-color:#ff756b;border:solid 2px #7c0000;margin-bottom:5px;padding:3px;list-style-type:none;font-weight:bold}.errors-submit ul{padding:0;width:460px}html,body{height:100%}#main-wrapper{position:relative;padding-bottom:55px;min-height:100%}footer{position:absolute;bottom:0;height:55px;background:white}footer hr{margin-top:0}.notifyjs-corner{top:50px!important}div.top-forms{position:relative;width:810px}form#select-zone{margin-bottom:5px;margin-left:40px}div.top-forms select,div.top-forms input{height:28px}form#select-zone div.chosen-widget,form#select-zone input[type=button]{display:inline-block;vertical-align:middle}form#select-zone input[type=button]{line-height:100%}div.chosen-container{width:200px!important}a.chosen-single{height:30px!important;line-height:30px!important;font-size:11pt!important}a.chosen-single div b{background-position-y:4px!important}form#form-parameters{margin-top:20px;margin-left:15px}form#export{position:absolute;top:0;right:0}span.tip{position:absolute;z-index:2;display:none;font-size:12pt;height:auto;padding:10px;border-radius:3px;box-shadow:0 1px 2px #666;background:#ededed}table.drawtooltip td.tt-label{padding-right:5px;vertical-align:middle;font-weight:bold}#body-container{max-width:100%!important}div.navbar{background-image:linear-gradient(to bottom,#2B3044 0,#141a30 100%)}div.submit-form table td{padding-bottom:8px;vertical-align:bottom}div.submit-form table td label{padding-right:20px}div.submit-form table input#id_job,div.submit-form table input#email{width:410px}.input-group{display:inline-block}.input-group .input-group-btn,.input-group input{display:inline-block!important;position:relative!important;float:none!important}.input-group button{padding-top:0}div.input-group{padding-left:15px!important}.upload-btn-wrapper{position:relative;height:30px;width:42px;overflow:hidden;display:inline-block}button.btn-file{height:30px;width:42px}div.in-label{position:relative;display:inline-block;width:300px;height:30px;vertical-align:middle}div.progress{width:300px;height:30px;position:absolute;top:0;left:0;z-index:5!important;background:white;margin-bottom:0!important;box-shadow:none}div.progress .bar{height:100%;background:#33b234;z-index:5!important}select.select-type-input,.input-group button,.input-group input{height:30px;line-height:30px}input.show-file{padding-left:2px;padding-right:2px;width:auto;z-index:10!important;background:none!important;color:black}div.hidden-input-files{display:none}label.error{color:red}div.loading-file{display:inline-block;vertical-align:middle;width:30px;height:30px;background:url(images/loading1.gif) no-repeat 0 0;background-size:30px 30px}div.upload-success{display:inline-block;vertical-align:middle;width:30px;height:30px;background:url(images/success.svg) no-repeat 0 0;background-size:30px 30px}div.file-size{display:inline-block;vertical-align:middle;margin-left:10px}div#uploading-loading{height:30px;line-height:30px;width:200px;font-size:14pt;font-weight:bold;text-align:center;color:black}div.progress,input.show-file{width:100%!important}div.in-label{width:300px}div.submit-form table input[type=text],div.submit-form table input[type=email]{border:1px solid #A9A9A9;border-image:none}div.submit-form table input,div.submit-form button,div.submit-form select{border-radius:5px!important;-moz-border-radius:5px!important;-webkit-border-radius:5px!important;height:30px;outline:none!important}div.submit-form select:hover{border-radius:5px 5px 0 0!important;-moz-border-radius:5px 5px 0 0!important;-webkit-border-radius:5px 5px 0 0!important;outline:none!important}.beta-warning{height:30px;line-height:30px;text-align:center;color:white;background-color:#6e0000}.beta-warning a{color:white;font-weight:bold}h2.status{font-size:18pt;margin-bottom:15px;margin-top:10px}.status-body{margin-top:25px;margin-bottom:30px}.progress-status{position:relative;width:500px;height:30px;border:solid 1px black;margin-left:55px;margin-bottom:100px}.progress-status-bar .inner{background:linear-gradient(90deg,rgb(255,254,80) 0%,rgba(16,128,6,1) 100%);width:500px;height:100%}.progress-status-bar{position:absolute;width:0;height:28px;top:0;left:0;overflow:hidden}.progress-status-bar.getfiles,.progress-status-bar.getfiles-waiting{width:3.7%}.progress-status-bar.waiting{width:7%}.progress-status-bar.preparing,.progress-status-bar.prepare-scheduled,.progress-status-bar.preparing-cluster{width:10.7%}.progress-status-bar.prepared{width:20.4%}.progress-status-bar.scheduled{width:30.3%}.progress-status-bar.starting,.progress-status-bar.scheduled-cluster{width:35.2%}.progress-status-bar.started{width:40.3%}.progress-status-bar.merging{width:80.4%}.progress-status-bar.success,.progress-status-bar.fail,.progress-status-bar.no-match{width:100%}.progress-status-bar.fail .inner{background:rgb(195,16,18)}.progress-status .tick{position:absolute;top:29px;width:1px;height:10px;border:solid 1px black}.progress-status .tick p{transform:rotate(-45deg);margin-left:-70px;margin-top:35px;text-align:right;display:block;width:80px;overflow:hidden}.progress-status .tick.submitted{left:-1px}.progress-status .tick.prepared{left:20%}.progress-status .tick.scheduled{left:30%}.progress-status .tick.started{left:40%}.progress-status .tick.merging{left:80%}.progress-status .tick.success{right:-1px}h2.status,div.status-body{margin-left:55px}div#sidebar{position:relative}div#sidebar p.bottom{position:absolute;bottom:0;right:0;width:100px}div#sidebar p.bottom input#delete-job{background:#ffbba8!important}ul.nav ul.dropdown-menu{max-height:300px;overflow-y:auto} body{font-size:14px;font-family:sans-serif;padding-top:50px}#main-error{display:none;width:100%;min-height:60px;background:#ff351a;color:white;font-size:14pt;font-weight:bold;text-align:center}#main-error a{color:#fff75a}#main-error span.big{font-size:20pt}#body{max-width:850px}.navbar-brand{padding-left:45px;background:url(images/logo.svg) no-repeat 0 5px;background-size:40px 40px}#legend{width:100%;height:230px;border:none;margin-bottom:10px;margin-left:10px;margin-top:40px}label.input-checkbox-label input[type=checkbox]{position:relative;vertical-align:middle;bottom:1px}#main-bar-title{background-color:black;color:white;padding-left:10px;margin-bottom:5px}#main-bar-title h1{margin-top:0;margin-bottom:0;margin-left:10px;padding-top:10px;padding-bottom:10px}#main-bar-title h1,#main-bar-title img{display:inline-block;vertical-align:middle;width:auto}#legend .draw{width:100%;height:200px}#legend .title{width:60%;height:30px;text-align:center;font-size:12pt;font-weight:bold;font-family:sans-serif;text-decoration:underline}#legend .draw{width:60%}#draw,#sidebar{display:table-cell;vertical-align:top}#sidebar{min-width:120px;max-width:165px}#sidebar input[type=number]{width:100px}#sidebar label{font-weight:normal!important}#sidebar input[type=button],#sidebar input[type=range],#sidebar input[type=number],#sidebar label{width:100%!important}#supdraw{width:auto;height:auto;position:relative;margin-top:5px}#draw{width:850px}.mylabel{font-size:18pt;font-weight:bold;font-family:FreeSans,sans-serif;top:10pt;position:absolute}#restore-all{width:5%!important;height:5%!important;top:0;right:0;position:absolute;background:#fff url(images/reset.svg) no-repeat 6.5px 7.5px;background-size:65% 65%;cursor:pointer;border:solid 1px black;border-radius:0 15px 0 0}#restore-all:hover{background:#000 url(images/reset_hover.svg) no-repeat 6.5px 7.5px;background-size:65% 65%}#loading{position:absolute;left:calc(50% - 140px);top:calc(50% - 48px)}#loading .label{color:black;display:inline-block;padding-left:55px;padding-right:5px;margin-left:-30px;height:50px;width:180px;background:white;border:1px solid black;border-radius:25px;font-size:20pt;font-weight:bold;vertical-align:middle}.cssload-container{position:relative;display:inline-block;padding-top:-20px;vertical-align:middle}.cssload-whirlpool,.cssload-whirlpool::before,.cssload-whirlpool::after{position:absolute;top:50%;left:50%;border:1px solid rgb(204,204,204);border-left-color:rgb(0,0,0);border-radius:674px;-o-border-radius:674px;-ms-border-radius:674px;-webkit-border-radius:674px;-moz-border-radius:674px}.cssload-whirlpool{margin:-17px 0 0 -17px;height:34px;width:34px;animation:cssload-rotate 1150ms linear infinite;-o-animation:cssload-rotate 1150ms linear infinite;-ms-animation:cssload-rotate 1150ms linear infinite;-webkit-animation:cssload-rotate 1150ms linear infinite;-moz-animation:cssload-rotate 1150ms linear infinite}.cssload-whirlpool::before{content:"";margin:-16px 0 0 -16px;height:30px;width:30px;animation:cssload-rotate 1150ms linear infinite;-o-animation:cssload-rotate 1150ms linear infinite;-ms-animation:cssload-rotate 1150ms linear infinite;-webkit-animation:cssload-rotate 1150ms linear infinite;-moz-animation:cssload-rotate 1150ms linear infinite}.cssload-whirlpool::after{content:"";margin:-20px 0 0 -20px;height:38px;width:38px;animation:cssload-rotate 2300ms linear infinite;-o-animation:cssload-rotate 2300ms linear infinite;-ms-animation:cssload-rotate 2300ms linear infinite;-webkit-animation:cssload-rotate 2300ms linear infinite;-moz-animation:cssload-rotate 2300ms linear infinite}@keyframes cssload-rotate{100%{transform:rotate(360deg)}}@-o-keyframes cssload-rotate{100%{-o-transform:rotate(360deg)}}@-ms-keyframes cssload-rotate{100%{-ms-transform:rotate(360deg)}}@-webkit-keyframes cssload-rotate{100%{-webkit-transform:rotate(360deg)}}@-moz-keyframes cssload-rotate{100%{-moz-transform:rotate(360deg)}}@media screen and (-webkit-min-device-pixel-ratio:0){Body{font-size:16px}}.form-group,.form-group input{margin-bottom:5px!important}div.submit-form fieldset{margin-bottom:10px}h2.title-launch{margin-bottom:20px}.form-group input[type=text],.form-group input[type=email]{width:300px}#body{margin-left:15px;margin-top:10px}.errors-submit ul li{background-color:#ff756b;border:solid 2px #7c0000;margin-bottom:5px;padding:3px;list-style-type:none;font-weight:bold}.errors-submit ul{padding:0;width:460px}html,body{height:100%}#main-wrapper{position:relative;padding-bottom:55px;min-height:100%}footer{position:absolute;bottom:0;height:55px;background:white}footer hr{margin-top:0}h4.header-form{text-align:center}#tabs{border-bottom:2px solid black;margin-bottom:10px;margin-top:15px}#tabs .tab{display:inline-block;background-color:#c8c8c8;padding:5px 25px;border-top-left-radius:10px;border-top-right-radius:10px;cursor:pointer}#tabs .tab.active{background-color:#eee;font-weight:bold}#tabs .tab:hover{background-color:#f7f7f7}div.buttons{margin-top:20px}div.footnotes{margin-top:25px}.notifyjs-corner{top:50px!important}div.top-forms{position:relative;width:810px}form#select-zone{margin-bottom:5px;margin-left:40px}div.top-forms select,div.top-forms input{height:28px}form#select-zone div.chosen-widget,form#select-zone input[type=button]{display:inline-block;vertical-align:middle}form#select-zone input[type=button]{line-height:100%}div.chosen-container{width:200px!important}a.chosen-single{height:30px!important;line-height:30px!important;font-size:11pt!important}a.chosen-single div b{background-position-y:4px!important}form#form-parameters{margin-top:20px;margin-left:15px}form#export{position:absolute;top:0;right:0}span.tip{position:absolute;z-index:2;display:none;font-size:12pt;height:auto;padding:10px;border-radius:3px;box-shadow:0 1px 2px #666;background:#ededed}table.drawtooltip td.tt-label{padding-right:5px;vertical-align:middle;font-weight:bold}#body-container{max-width:100%!important}div.navbar{background-image:linear-gradient(to bottom,#2B3044 0,#141a30 100%)}div.submit-form table td{padding-bottom:8px;vertical-align:bottom}div.submit-form table td label{padding-right:20px}div.submit-form table input#id_job,div.submit-form table input#email{width:410px}.input-group{display:inline-block}.input-group .input-group-btn,.input-group input{display:inline-block!important;position:relative!important;float:none!important}.input-group button{padding-top:0}div.input-group{padding-left:15px!important}.upload-btn-wrapper{position:relative;height:30px;width:42px;overflow:hidden;display:inline-block}button.btn-file{height:30px;width:42px}div.in-label{position:relative;display:inline-block;width:300px;height:30px;vertical-align:middle}div.progress{width:300px;height:30px;position:absolute;top:0;left:0;z-index:5!important;background:white;margin-bottom:0!important;box-shadow:none}div.progress .bar{height:100%;background:#33b234;z-index:5!important}select.select-type-input,.input-group button,.input-group input{height:30px;line-height:30px}input.show-file{padding-left:2px;padding-right:2px;width:auto;z-index:10!important;background:none!important;color:black}div.hidden-input-files{display:none}label.error{color:red}div.loading-file{display:inline-block;vertical-align:middle;width:30px;height:30px;background:url(images/loading1.gif) no-repeat 0 0;background-size:30px 30px}div.upload-success{display:inline-block;vertical-align:middle;width:30px;height:30px;background:url(images/success.svg) no-repeat 0 0;background-size:30px 30px}div.file-size{display:inline-block;vertical-align:middle;margin-left:10px}div#uploading-loading{height:30px;line-height:30px;width:200px;font-size:14pt;font-weight:bold;text-align:center;color:black}div.progress,input.show-file{width:100%!important}div.in-label{width:300px}div.in-label.grp2{width:365px}div.submit-form table input[type=text],div.submit-form table input[type=email]{border:1px solid #A9A9A9;border-image:none}div.submit-form table input,div.submit-form button,div.submit-form select{border-radius:5px!important;-moz-border-radius:5px!important;-webkit-border-radius:5px!important;height:30px;outline:none!important}div.submit-form select:hover{border-radius:5px 5px 0 0!important;-moz-border-radius:5px 5px 0 0!important;-webkit-border-radius:5px 5px 0 0!important;outline:none!important}.beta-warning{height:30px;line-height:30px;text-align:center;color:white;background-color:#6e0000}.beta-warning a{color:white;font-weight:bold}h2.status{font-size:18pt;margin-bottom:15px;margin-top:10px}.status-body{margin-top:25px;margin-bottom:30px}.progress-status{position:relative;width:500px;height:30px;border:solid 1px black;margin-left:55px;margin-bottom:100px}.progress-status-bar .inner{background:linear-gradient(90deg,rgb(255,254,80) 0%,rgba(16,128,6,1) 100%);width:500px;height:100%}.progress-status-bar{position:absolute;width:0;height:28px;top:0;left:0;overflow:hidden}.progress-status-bar.getfiles,.progress-status-bar.getfiles-waiting{width:3.7%}.progress-status-bar.waiting{width:7%}.progress-status-bar.preparing,.progress-status-bar.prepare-scheduled,.progress-status-bar.preparing-cluster{width:10.7%}.progress-status-bar.prepared{width:20.4%}.progress-status-bar.scheduled{width:30.3%}.progress-status-bar.starting,.progress-status-bar.scheduled-cluster{width:35.2%}.progress-status-bar.started{width:40.3%}.progress-status-bar.merging{width:80.4%}.progress-status-bar.success,.progress-status-bar.fail,.progress-status-bar.no-match{width:100%}.progress-status-bar.fail .inner{background:rgb(195,16,18)}.progress-status .tick{position:absolute;top:29px;width:1px;height:10px;border:solid 1px black}.progress-status .tick p{transform:rotate(-45deg);margin-left:-70px;margin-top:35px;text-align:right;display:block;width:80px;overflow:hidden}.progress-status .tick.submitted{left:-1px}.progress-status .tick.prepared{left:20%}.progress-status .tick.scheduled{left:30%}.progress-status .tick.started{left:40%}.progress-status .tick.merging{left:80%}.progress-status .tick.success{right:-1px}h2.status,div.status-body{margin-left:55px}div#sidebar{position:relative}div#sidebar p.bottom{position:absolute;bottom:0;right:0;width:100px}div#sidebar p.bottom input#delete-job{background:#ffbba8!important}ul.nav ul.dropdown-menu{max-height:300px;overflow-y:auto}
\ No newline at end of file \ No newline at end of file
...@@ -85,7 +85,7 @@ d3.boxplot.init = function (id_res=null, from_file=false) { ...@@ -85,7 +85,7 @@ d3.boxplot.init = function (id_res=null, from_file=false) {
d3.boxplot.launch(data); d3.boxplot.launch(data);
} }
else { else {
$("#supdraw").html($("<p>").html("This job does not exist!").css("margin-top", "15px")); $("#supdraw").html($("<p>").html("message" in data ? data["message"] : "This job does not exist!").css("margin-top", "15px"));
dgenies.result.remove_job_from_cookie(dgenies.result.id_res); dgenies.result.remove_job_from_cookie(dgenies.result.id_res);
} }
} }
......
This diff is collapsed.
...@@ -7,12 +7,13 @@ dgenies.run = {}; ...@@ -7,12 +7,13 @@ dgenies.run = {};
dgenies.run.s_id = null; dgenies.run.s_id = null;
dgenies.run.allowed_ext = []; dgenies.run.allowed_ext = [];
dgenies.run.max_upload_file_size = -1 dgenies.run.max_upload_file_size = -1
dgenies.run.files = [undefined, undefined]; dgenies.run.files = [undefined, undefined, undefined, undefined, undefined];
dgenies.run.allow_upload = false; dgenies.run.allow_upload = false;
dgenies.run.ping_interval = null; dgenies.run.ping_interval = null;
dgenies.run.target_example = ""; dgenies.run.target_example = "";
dgenies.run.query_example = ""; dgenies.run.query_example = "";
dgenies.run.tool_has_ava = {}; dgenies.run.tool_has_ava = {};
dgenies.run.enabled = true;
dgenies.run.init = function (s_id, allowed_ext, max_upload_file_size=1073741824, target_example="", query_example="", dgenies.run.init = function (s_id, allowed_ext, max_upload_file_size=1073741824, target_example="", query_example="",
tool_has_ava={}) { tool_has_ava={}) {
...@@ -28,8 +29,11 @@ dgenies.run.init = function (s_id, allowed_ext, max_upload_file_size=1073741824, ...@@ -28,8 +29,11 @@ dgenies.run.init = function (s_id, allowed_ext, max_upload_file_size=1073741824,
}; };
dgenies.run.restore_form = function () { dgenies.run.restore_form = function () {
dgenies.run.change_fasta_type("query", $("select.query").find(":selected").text().toLowerCase(), true); let ftypes = ["query", "target", "alignfile", "queryidx", "targetidx"];
dgenies.run.change_fasta_type("target", $("select.target").find(":selected").text().toLowerCase(), true); for (let f in ftypes) {
let ftype = ftypes[f];
dgenies.run.change_fasta_type(ftype, $(`select.${ftype}`).find(":selected").text().toLowerCase(), true);
}
}; };