Commit 6ce3b7f3 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Remove docopt requirements + update requirements in doc + minor fixes

parent 06c0bc24
......@@ -2,7 +2,6 @@ flask==0.12.*
Flask-Mail==0.9.*
Jinja2==2.9.*
peewee==2.10.2
docopt==0.6.*
numpy
wget==3.2
requests==2.18.*
......
......@@ -81,6 +81,10 @@ def parse_args():
return "clear", args
if args.subparser_name == "gallery":
return "gallery_" + args.which, args
else:
parser.print_help()
print("\nYou must specify the command to launch")
return None, None
def start_browser(host, port):
......
......@@ -43,23 +43,29 @@ install your own from [their repository](https://github.com/lh3/minimap2).
Some python modules are required (will be automatically installed by the commands above):
flask==0.12.*
Flask-Mail==0.9.*
Jinja2==2.9.*
peewee==2.10.2
docopt==0.6.*
numpy
wget==3.2
requests==2.18.*
biopython==1.70
python-crontab==2.2.*
psutil==5.4.*
tendo==0.2.*
matplotlib==2.1.*
drmaa==0.7.*
intervaltree==2.1.*
argparse==1.4
Markdown==2.6.*
Additional modules for webserver mode:
Flask-Mail==0.9.*
peewee==2.10.2
python-crontab==2.2.*
And if you use a cluster (webserver mode):
drmaa==0.7.*
In webserver mode, you must install `mysqlclient` python module (will not be installed automatically) if you use mysql as RDBM.
How to start
......@@ -82,6 +88,8 @@ Optional arguments:
### Webserver mode
*Note: this mode is only available for Unix systems and will NOT work on MS Windows.*
#### Recommended method
Flask webserver (which is used in standalone mode) is not recommended in production servers.
......@@ -285,6 +293,8 @@ The `dgenies` command can be used to do some maintenance staff.
Gallery
-------
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:
dgenies gallery add -i <id_job> -n <name> -q <query_name> -t <target_name> -p <pict_filename>
......
......@@ -61,7 +61,7 @@ def parse_database(app_data, max_age, fake=False):
def parse_data_folders(app_data, now, max_age, gallery_jobs, fake=False):
for file in os.listdir(app_data):
if file not in gallery_jobs:
if file not in gallery_jobs and file not in ["gallery"]:
file = os.path.join(app_data, file)
create_date = os.path.getctime(file)
age = (now - create_date) / 86400 # Age in days
......
#!/usr/bin/env python3
"""Sort PAF file
Short desc: Sort PAF file with size of matches (DESC)
Details: Sort PAF file with size of matches (DESC)
Usage:
sort_paf.py -i PAF -o OUT
sort_paf.py -v | --version
Options:
-i --input=PAF Input PAF file
-o --output=OUT Output sorted PAF file
-h --help Show this screen
-v --version Show version
"""
import os
from math import sqrt
......@@ -125,13 +109,17 @@ class Sorter:
if __name__ == '__main__':
from docopt import docopt
import argparse
parser = argparse.ArgumentParser(description="Sort PAF file with size of matches (DESC)")
parser.add_argument('-i', '--input', type=str, required=True, help="Input PAF file")
parser.add_argument('-o', '--output', type=str, required=True, help="Output PAF file")
args = docopt(__doc__)
args = parser.parse_args()
if args["--version"]:
print(__NAME__, __VERSION__)
else:
if not os.path.exists(args["--input"]):
raise Exception("Input PAF file %s does not exists" % args["--input"])
sorter = Sorter(args["--input"], args["--output"])
if not os.path.exists(args.input):
raise Exception("Input PAF file %s does not exists" % args.input)
sorter = Sorter(args.input, args.output)
sorter.sort()
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