Commit 0ec9ff23 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Merge master to exportsip

parents a88ebe18 94fcf64a
...@@ -4,15 +4,19 @@ import argparse ...@@ -4,15 +4,19 @@ import argparse
import wget import wget
import os import os
VERSION = "1.0.1"
parser = argparse.ArgumentParser(description="Split huge contigs") parser = argparse.ArgumentParser(description="Split huge contigs")
parser.add_argument('-d', '--dir', type=str, required=False, help="Folder into store files", default=".") parser.add_argument('-d', '--dir', type=str, required=False, help="Folder into store files", default=".")
args = parser.parse_args() args = parser.parse_args()
for file_dl in ["https://forgemia.inra.fr/genotoul-bioinfo/dgenies/raw/master/src/dgenies/bin/all_prepare.py", for file_dl in [
"https://forgemia.inra.fr/genotoul-bioinfo/dgenies/raw/master/src/dgenies/bin/filter_contigs.py", "https://raw.githubusercontent.com/genotoul-bioinfo/dgenies/v%s/src/dgenies/bin/all_prepare.py" % VERSION,
"https://forgemia.inra.fr/genotoul-bioinfo/dgenies/raw/master/src/dgenies/bin/index.py", "https://raw.githubusercontent.com/genotoul-bioinfo/dgenies/v%s/src/dgenies/bin/filter_contigs.py" % VERSION,
"https://forgemia.inra.fr/genotoul-bioinfo/dgenies/raw/master/src/dgenies/bin/split_fa.py"]: "https://raw.githubusercontent.com/genotoul-bioinfo/dgenies/v%s/src/dgenies/bin/index.py" % VERSION,
"https://raw.githubusercontent.com/genotoul-bioinfo/dgenies/v%s/src/dgenies/binsplit_fa.py" % VERSION
]:
d_file = os.path.join(args.dir, file_dl.rsplit("/", 1)[1]) d_file = os.path.join(args.dir, file_dl.rsplit("/", 1)[1])
print("Downloading %s..." % d_file) print("Downloading %s..." % d_file)
wget.download(file_dl, args.dir, None) wget.download(file_dl, args.dir, None)
......
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sys
from flask import Flask from flask import Flask
from .config_reader import AppConfigReader from .config_reader import AppConfigReader
from .lib.crons import Crons from .lib.crons import Crons
VERSION = "1.0.1"
app = None app = None
app_title = None app_title = None
APP_DATA = None APP_DATA = None
......
Install your own instance Install your own instance
========================= =========================
Linux Linux
----- -----
...@@ -16,22 +16,22 @@ Alternatively, you can install it manually: ...@@ -16,22 +16,22 @@ Alternatively, you can install it manually:
cd dgenies cd dgenies
pip3 install -r requirements.txt pip3 install -r requirements.txt
python3 setup.py install python3 setup.py install
### Upgrade ### Upgrade
#### Standalone mode #### Standalone mode
pip3 install dgenies --upgrade pip3 install dgenies --upgrade
#### Webserver mode #### Webserver mode
dgenies clear -c dgenies clear -c
pip3 install dgenies --upgrade pip3 install dgenies --upgrade
Then, you need to restart your webserver. Then, you need to restart your webserver.
### Requirements ### Requirements
D-Genies requires python >= 3.5 to run. D-Genies requires python >= 3.5 to run.
...@@ -52,32 +52,32 @@ Some python modules are required (will be automatically installed by the command ...@@ -52,32 +52,32 @@ Some python modules are required (will be automatically installed by the command
intervaltree==2.1.* intervaltree==2.1.*
argparse==1.4 argparse==1.4
Markdown==2.6.* Markdown==2.6.*
Additional modules for webserver mode: Additional modules for webserver mode:
Flask-Mail==0.9.* Flask-Mail==0.9.*
peewee==2.10.2 peewee==2.10.2
python-crontab==2.2.* python-crontab==2.2.*
And if you use a cluster (webserver mode): And if you use a cluster (webserver mode):
drmaa==0.7.* drmaa==0.7.*
In webserver mode, you must install `mysqlclient` python module (will not be installed automatically) if you use mysql as RDBM. In webserver mode, you must install `mysqlclient` python module (will not be installed automatically) if you use mysql as RDBM.
Windows Windows
------- -------
We provide an installer to install D-Genies. You can download it [here](https://github.com/genotoul-bioinfo/dgenies/releases/download/v1.0.1/dgenies-1.0.1_setup.exe). We provide an installer to install D-Genies. You can download it [here](https://github.com/genotoul-bioinfo/dgenies/releases/download/v1.0.1/dgenies-1.0.1_setup.exe).
All requirements are present inside the package, so you don't have to do anything else. All requirements are present inside the package, so you don't have to do anything else.
### System requirements ### System requirements
You need Windows 7 or newer, 64 bits architecture. You need Windows 7 or newer, 64 bits architecture.
How to start How to start
------------- -------------
...@@ -90,10 +90,10 @@ simultaneously or if you run it on a server, you must run it in webserver mode. ...@@ -90,10 +90,10 @@ simultaneously or if you run it on a server, you must run it in webserver mode.
Unix: start with the command below: Unix: start with the command below:
dgenies run dgenies run
Optional arguments: Optional arguments:
`-p <port>` run in a specified port (default: 5000) `-p <port>` run in a specified port (default: 5000)
`--no-browser` don't start the browser automatically `--no-browser` don't start the browser automatically
Windows: just click on the launcher in the desktop or into the install folder. Windows: just click on the launcher in the desktop or into the install folder.
...@@ -104,7 +104,7 @@ Windows: just click on the launcher in the desktop or into the install folder. ...@@ -104,7 +104,7 @@ Windows: just click on the launcher in the desktop or into the install folder.
#### Recommended method #### Recommended method
Flask webserver (which is used in standalone mode) is not recommended in production servers. Flask webserver (which is used in standalone mode) is not recommended in production servers.
So, we recommend using the WSGY module of Apache (or µWSGI + nginx, not documented here). So, we recommend using the WSGY module of Apache (or µWSGI + nginx, not documented here).
Once dgenies is installed, you just need to use the `/var/www/dgenies.wsgi` file into your apache Once dgenies is installed, you just need to use the `/var/www/dgenies.wsgi` file into your apache
...@@ -117,7 +117,7 @@ Here is an example of configuration file for apache: ...@@ -117,7 +117,7 @@ Here is an example of configuration file for apache:
WSGIDaemonProcess dgenies user=<user> group=<group> threads=8 WSGIDaemonProcess dgenies user=<user> group=<group> threads=8
WSGIScriptAlias / /var/www/dgenies/dgenies.wsgi WSGIScriptAlias / /var/www/dgenies/dgenies.wsgi
<Directory /var/www/dgenies> <Directory /var/www/dgenies>
WSGIProcessGroup dgenies WSGIProcessGroup dgenies
WSGIApplicationGroup %{GLOBAL} WSGIApplicationGroup %{GLOBAL}
...@@ -125,10 +125,10 @@ Here is an example of configuration file for apache: ...@@ -125,10 +125,10 @@ Here is an example of configuration file for apache:
Allow from all Allow from all
</Directory> </Directory>
</VirtualHost> </VirtualHost>
With: With:
`<url>`: the URL of your instance `<url>`: the URL of your instance
`<user>`: the user who launch the server `<user>`: the user who launch the server
`<group>`: the group who launch the server `<group>`: the group who launch the server
#### Debug method #### Debug method
...@@ -136,13 +136,13 @@ With: ...@@ -136,13 +136,13 @@ With:
For debug or for development only, you can launch dgenies through flask in webserver mode: For debug or for development only, you can launch dgenies through flask in webserver mode:
dgenies run -m webserver dgenies run -m webserver
Optional parameters: Optional parameters:
`-d` run in debug mode `-d` run in debug mode
`-o <IP>` specify the host into run the application (default: 127.0.0.1, set 0.0.0.0 for distant access) `-o <IP>` specify the host into run the application (default: 127.0.0.1, set 0.0.0.0 for distant access)
`-p <port>` run in a specified port (default: 5000) `-p <port>` run in a specified port (default: 5000)
`--no-crons` don't run the crons automatically `--no-crons` don't run the crons automatically
`--no-browser` don't start the browser automatically (always true if *-d* option is given) `--no-browser` don't start the browser automatically (always true if *-d* option is given)
...@@ -160,9 +160,9 @@ Also, scripts for preparing data must be moved in a location accessible by all n ...@@ -160,9 +160,9 @@ Also, scripts for preparing data must be moved in a location accessible by all n
To get these scripts, follow the commands below: To get these scripts, follow the commands below:
curl https://forgemia.inra.fr/genotoul-bioinfo/dgenies/raw/master/get_cluster_scripts.py > get_cluster_scripts.py curl https://raw.githubusercontent.com/genotoul-bioinfo/dgenies/v{{version}}/get_cluster_scripts.py > get_cluster_scripts.py
python get_cluster_scripts.py -d <dir> python get_cluster_scripts.py -d <dir>
With `<dir>`: the folder into save the scripts (must be accessible by cluster nodes). With `<dir>`: the folder into save the scripts (must be accessible by cluster nodes).
...@@ -178,7 +178,7 @@ To change this file, please copy it into `application.properties.local` (at the ...@@ -178,7 +178,7 @@ To change this file, please copy it into `application.properties.local` (at the
### Global ### Global
Main parameters are stored into this section: Main parameters are stored into this section:
* `config_dir`: where configuration file will be stored. * `config_dir`: where configuration file will be stored.
* `upload_folder`: where uploaded files will be stored. * `upload_folder`: where uploaded files will be stored.
...@@ -299,17 +299,17 @@ The `dgenies` command can be used to do some maintenance staff. ...@@ -299,17 +299,17 @@ The `dgenies` command can be used to do some maintenance staff.
**Clear all jobs:** **Clear all jobs:**
dgenies clear -j [--max-age <age>] dgenies clear -j [--max-age <age>]
`--max-age` (opt): set the max age of jobs to delete (default: 0, for all) `--max-age` (opt): set the max age of jobs to delete (default: 0, for all)
**Clear all log:** **Clear all log:**
dgenies clear -l dgenies clear -l
**Clear crons (webserver mode):** **Clear crons (webserver mode):**
dgenies clear -c dgenies clear -c
Gallery Gallery
------- -------
...@@ -318,22 +318,22 @@ Note: gallery is only available in webserver mode. ...@@ -318,22 +318,22 @@ Note: gallery is only available in webserver mode.
To add a job to the gallery, copy illustrating picture file into the *gallery* folder inside the data folder (*~/.dgenies/data/gallery* as default, create it if not exists). Then use the *dgenies* command: To add a job to the gallery, copy illustrating picture file into the *gallery* folder inside the data folder (*~/.dgenies/data/gallery* as default, create it if not exists). Then use the *dgenies* command:
dgenies gallery add -i <id_job> -n <name> -q <query_name> -t <target_name> -p <pict_filename> dgenies gallery add -i <id_job> -n <name> -q <query_name> -t <target_name> -p <pict_filename>
With: With:
`id_job`: the name of the job `id_job`: the name of the job
`name`: name of the job to show in the gallery `name`: name of the job to show in the gallery
`query_name`: name of the query `query_name`: name of the query
`target_name`: name of the target `target_name`: name of the target
`pict_filename`: filename added in the gallery folder (without path) `pict_filename`: filename added in the gallery folder (without path)
You can also delete an item from the gallery: You can also delete an item from the gallery:
dgenies gallery del -i <id_job> dgenies gallery del -i <id_job>
or: or:
dgenies gallery del -n <name> dgenies gallery del -n <name>
With `id_job` and `name` as described above. You can add the `--remove-pict` option to remove the picture file from the gallery folder. With `id_job` and `name` as described above. You can add the `--remove-pict` option to remove the picture file from the gallery folder.
Note: first item of the gallery will be shown on home page. Note: first item of the gallery will be shown on home page.
\ No newline at end of file
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
{% set fnote_tab = fnote %} {% set fnote_tab = fnote %}
<p class="afterworlff"><sup id="fn{{ fnote_tab }}"><a href="#fn{{ fnote_tab }}" id="ref{{ fnote_tab }}">{{ fnote_tab }}</a></sup> In PAF or MAF format.</p> <p class="afterworlff"><sup id="fn{{ fnote_tab }}"><a href="#fn{{ fnote_tab }}" id="ref{{ fnote_tab }}">{{ fnote_tab }}</a></sup> In PAF or MAF format.</p>
{% set fnote_tab = fnote_tab + 1 %} {% set fnote_tab = fnote_tab + 1 %}
<p class="afterworlff"><sup id="fn{{ fnote_tab }}"><a href="#fn{{ fnote_tab }}" id="ref{{ fnote_tab }}">{{ fnote_tab }}</a></sup> Fasta file or index built by <a href="#">our tool</a>.</p> <p class="afterworlff"><sup id="fn{{ fnote_tab }}"><a href="#fn{{ fnote_tab }}" id="ref{{ fnote_tab }}">{{ fnote_tab }}</a></sup> Fasta file or index built by <a href="https://raw.githubusercontent.com/genotoul-bioinfo/dgenies/v{{version}}/src/dgenies/bin/index.py" download="index.py">our tool</a>.</p>
{% set fnote_tab = fnote_tab + 1 %} {% set fnote_tab = fnote_tab + 1 %}
<p class="afterworlff"><sup id="fn{{ fnote_tab }}"><a href="#fn{{ fnote_tab }}" id="ref{{ fnote_tab }}">{{ fnote_tab }}</a></sup> From a previous run.</p> <p class="afterworlff"><sup id="fn{{ fnote_tab }}"><a href="#fn{{ fnote_tab }}" id="ref{{ fnote_tab }}">{{ fnote_tab }}</a></sup> From a previous run.</p>
{% set fnote_tab = fnote_tab + 1 %} {% set fnote_tab = fnote_tab + 1 %}
......
from dgenies import app, app_title, app_folder, config_reader, mailer, APP_DATA, MODE, DEBUG from dgenies import app, app_title, app_folder, config_reader, mailer, APP_DATA, MODE, DEBUG, VERSION
import os import os
import time import time
...@@ -18,6 +18,7 @@ from dgenies.tools import Tools ...@@ -18,6 +18,7 @@ from dgenies.tools import Tools
from markdown import Markdown from markdown import Markdown
from markdown.extensions.toc import TocExtension from markdown.extensions.toc import TocExtension
import tarfile import tarfile
from jinja2 import Environment
if MODE == "webserver": if MODE == "webserver":
from dgenies.database import Session, Gallery from dgenies.database import Session, Gallery
from peewee import DoesNotExist from peewee import DoesNotExist
...@@ -77,7 +78,7 @@ def run(): ...@@ -77,7 +78,7 @@ def run():
example=config_reader.example_target != "", example=config_reader.example_target != "",
target=os.path.basename(config_reader.example_target), target=os.path.basename(config_reader.example_target),
query=os.path.basename(config_reader.example_query), tools_names=tools_names, tools=tools, query=os.path.basename(config_reader.example_query), tools_names=tools_names, tools=tools,
tools_ava=tools_ava) tools_ava=tools_ava, version=VERSION)
@app.route("/run-test", methods=['GET']) @app.route("/run-test", methods=['GET'])
...@@ -320,7 +321,7 @@ def get_file(file, gzip=False): # pragma: no cover ...@@ -320,7 +321,7 @@ def get_file(file, gzip=False): # pragma: no cover
@app.route("/documentation/run", methods=['GET']) @app.route("/documentation/run", methods=['GET'])
def documentation_run(): def documentation_run():
with open(os.path.join(app_folder, "doc_run.md" if MODE == "webserver" else "doc_run_standalone.md"), "r", with open(os.path.join(app_folder, "md", "doc_run.md" if MODE == "webserver" else "doc_run_standalone.md"), "r",
encoding='utf-8') as install_instr: encoding='utf-8') as install_instr:
content = install_instr.read() content = install_instr.read()
md = Markdown(extensions=[TocExtension(baselevel=1)]) md = Markdown(extensions=[TocExtension(baselevel=1)])
...@@ -348,7 +349,7 @@ def documentation_run(): ...@@ -348,7 +349,7 @@ def documentation_run():
@app.route("/documentation/result", methods=['GET']) @app.route("/documentation/result", methods=['GET'])
def documentation_result(): def documentation_result():
with open(os.path.join(app_folder, "user_manual.md"), "r", with open(os.path.join(app_folder, "md", "user_manual.md"), "r",
encoding='utf-8') as install_instr: encoding='utf-8') as install_instr:
content = install_instr.read() content = install_instr.read()
md = Markdown(extensions=[TocExtension(baselevel=1)]) md = Markdown(extensions=[TocExtension(baselevel=1)])
...@@ -359,8 +360,11 @@ def documentation_result(): ...@@ -359,8 +360,11 @@ def documentation_result():
@app.route("/install", methods=['GET']) @app.route("/install", methods=['GET'])
def install(): def install():
with open(os.path.join(app_folder, "INSTALL.md"), "r", encoding='utf-8') as install_instr: with open(os.path.join(app_folder, "md", "INSTALL.md"), "r", encoding='utf-8') as install_instr:
content = install_instr.read() content = install_instr.read()
env = Environment()
template = env.from_string(content)
content = template.render(version=VERSION)
md = Markdown(extensions=[TocExtension(baselevel=1)]) md = Markdown(extensions=[TocExtension(baselevel=1)])
content = Markup(md.convert(content)) content = Markup(md.convert(content))
toc = Markup(md.toc) toc = Markup(md.toc)
......
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