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

Add Doc fur run a job

parent 54c62016
How to run a job?
-----------------
![illustrating](/static/images/D-GENIES-run.png)
### (1) Main menu
You just need to click on the *run* tab of the main menu, and follow the fields. All results will be stored in the result menu.
### (2) Updatable job name
Required field
An unique job name is set automatically. You could change it. Note that is a job already exists with this name, it will be automatically renamed.
### (3) User email
Required field
Please fill your email. When the mail will be finished, you will receive a mail to inform you that your job is done. Also, some features in the result page will send you a mail to this address.
### (4) Target file
Required field
With the selector at the left, you can choose giving a local file or an URL. For a local file, select it by clicking on the button at the right.
File must be in fasta format. We recommend using gzipped files to preserve bandwidth and faster job submission.
Allowed extensions: fa, fasta, fna, fa.gz, fasta.gz, fna.gz
Max file size: ###size### (###size_unc### once uncompressed, ###size_ava### in all-vs-all mode)
### (5) Query file
Optional field
Works like the target file. If not given, target file will be mapped to itself, in all-vs-all mode.
Max file size: ###size### (###size_unc### once uncompressed)
\ No newline at end of file
How to run a job?
-----------------
![illustrating](/static/images/D-GENIES-run-standalone.png)
### (1) Main menu
You just need to click on the *run* tab of the main menu, and follow the fields. All results will be stored in the result menu.
### (2) Updatable job name
Required field
An unique job name is set automatically. You could change it. Note that is a job already exists with this name, it will be automatically renamed.
### (3) Target file
Required field
With the selector at the left, you can choose giving a local file or an URL. For a local file, select it by clicking on the button at the right.
File must be in fasta format. We recommend using gzipped files to preserve bandwidth and faster job submission.
Allowed extensions: fa, fasta, fna, fa.gz, fasta.gz, fna.gz
Max file size: ###size### (###size_unc### once uncompressed, ###size_ava### in all-vs-all mode)
### (4) Query file
Optional field
Works like the target file. If not given, target file will be mapped to itself, in all-vs-all mode.
Max file size: ###size### (###size_unc### once uncompressed)
\ No newline at end of file
......@@ -196,13 +196,14 @@ class Functions:
Functions.send_fasta_ready(mailer, job_name, sample_name, compressed)
@staticmethod
def get_readable_size(size):
units = ["Kb", "Mb", "Gb"]
def get_readable_size(size, nb_after_coma=1):
print(size)
units = ["b", "Kb", "Mb", "Gb"]
i = 0
while size >= 1024 and i < 3:
size /= 1024.0
i += 1
return "%.1f %s" % (size, units[i])
return str("%." + str(nb_after_coma) + "f %s") % (size, units[i])
@staticmethod
def get_readable_time(seconds):
......
......@@ -66,9 +66,8 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation<span
class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Launch a job</a></li>
<li><a href="#">Zoom</a></li>
<li><a href="#">Filter data</a></li>
<li><a href="/documentation/run">Launch a job</a></li>
<li><a href="#">Results</a></li>
</ul>
</li>
<li class="{% if(menu == 'install') %}active{% endif %}"><a href="/install">Install</a></li>
......
......@@ -226,6 +226,34 @@ def get_file(file, gzip=False): # pragma: no cover
abort(500)
@app.route("/documentation/run", methods=['GET'])
def documentation_run():
with open(os.path.join(app_folder, "doc_run.md" if MODE == "webserver" else "doc_run_standalone.md"), "r",
encoding='utf-8') as install_instr:
content = install_instr.read()
md = Markdown(extensions=[TocExtension(baselevel=1)])
max_upload_file_size = config_reader.max_upload_file_size
if max_upload_file_size == -1:
max_upload_file_size = "no limit"
else:
max_upload_file_size = Functions.get_readable_size(max_upload_file_size, 0)
max_upload_size = config_reader.max_upload_size
if max_upload_size == -1:
max_upload_size = "no limit"
else:
max_upload_size = Functions.get_readable_size(max_upload_size, 0)
max_upload_size_ava = config_reader.max_upload_size_ava
if max_upload_size_ava == -1:
max_upload_size_ava = "no limit"
else:
max_upload_size_ava = Functions.get_readable_size(max_upload_size_ava, 0)
content = Markup(md.convert(content)).replace("###size###", max_upload_file_size)\
.replace("###size_unc###", max_upload_size)\
.replace("###size_ava###", max_upload_size_ava)
toc = Markup(md.toc)
return render_template("documentation.html", menu="documentation", title=app_title, content=content, toc=toc, mode=MODE)
@app.route("/install", methods=['GET'])
def install():
with open(os.path.join(app_folder, "INSTALL.md"), "r", encoding='utf-8') as install_instr:
......@@ -233,7 +261,7 @@ def install():
md = Markdown(extensions=[TocExtension(baselevel=1)])
content = Markup(md.convert(content))
toc = Markup(md.toc)
return render_template("install.html", menu="install", title=app_title, content=content, toc=toc, mode=MODE)
return render_template("documentation.html", menu="install", title=app_title, content=content, toc=toc, mode=MODE)
@app.route("/paf/<id_res>", methods=['GET'])
......
Markdown is supported
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