Commit 03d6f0af authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Add config files for dev

parent 9f5d7412
application-dev.properties.local
tools-dev.yaml.local
[global]
config_dir = ###USER###/.dgenies
upload_folder = /tmp/dgenies
data_folder = ###CONFIG###/data
# batch system type: local, sge, slurm
batch_system_type = local
web_url = http://localhost:5000
# Max size of uploaded files (also for files from URL, size uncompressed):
# Please set the unit: M for Megabyte or G for Gigabyte (-1 without unit to don't set a limit)
max_upload_size = 3G
# Max upload file size for all-vs-all (only target):
# Please set the unit: M for Megabyte or G for Gigabyte (-1 without unit to don't set a limit)
max_upload_size_ava = 1G
# Max upload file size (compressed or not, only for uploaded files, not from URL):
# Please set the unit: M for Megabyte or G for Gigabyte (-1 without unit to don't set a limit)
max_upload_file_size = 1G
[softwares]
minimap2 = ###DEFAULT###
minimap2_cluster = ###DEFAULT###
[debug]
# Debug (enable only for tests)
enable = False
log_dir = ###CONFIG###/logs
# List of allowed IPs for tests, comma separated:
allowed_ip_tests =
[cluster]
drmaa_lib_path = ###SET_IT###
#Native specs: options passed to the scheduler
### Slurm: --mem-per-cpu={0} --ntasks={1} --time={2}
### SGE: -l mem={0},h_vmem={0} -pe parallel_smp {1}
### Note: copy&paste specifications for your scheduler. You can customize it.
### Always use {0} for memory, {1} for number of CPUs ({2} for duration time if slurm). All are required.
### If you don't want to change anything, don't edit anything.
native_specs = ###DEFAULT###
# If batch_system_type is not local, small jobs can be still run locally.
# Set to 0 to run all jobs on the cluster
max_run_local = 10
max_wait_local = 5
# To run only big jobs on the cluster, set the min query and target size (if max_run_local is reached, these parameters are ignores):
# Default parameters is for jobs that runs in approx. more than 3-4 minutes and consume approx. more than 9 GO of RAM
# Please set the unit: M for Megabyte or G for Gigabyte
min_query_size = 500M
min_target_size = 700M
prepare_script = ###PROGRAM###/bin/all_prepare.py
python3_exec = python3
# Max memory:
memory = 32
# Max memory for all-vs-all mode:
memory_ava = 32
[database]
type = sqlite
url = ###USER###/.dgenies/database.sqlite
# Not used for sqlite:
port = 3306
db =
user =
password =
[mail]
status = mail@dgenies
reply = mail@dgenies
org = "Dgenies team"
send_mail_status = True
[cron]
### Menage
# Time to launch the cron:
clean_time = 1h00
# Frequency (days):
clean_freq = 1
[jobs]
# Number of parallel runs for local jobs:
run_local = 1
data_prepare = 2
max_concurrent_dl = 5
[example]
query =
target =
......@@ -32,6 +32,10 @@ class AppConfigReader:
for my_config_file in config_file_search:
if os.path.exists(my_config_file):
config_file.append(my_config_file)
config_file.append(os.path.join(self.app_dir, "application-dev.properties"))
config_file.append(os.path.join(self.app_dir, "application-dev.properties.local"))
if len(config_file) == 0:
raise FileNotFoundError("ERROR: application.properties not found.")
self.reader = RawConfigParser()
......
minimap2:
exec: default
command_line: "{exe} -t {threads} {target} {query} > {out}"
all_vs_all: "{exe} -t {threads} -X {target} {target} > {out}"
max_memory: 40
threads: 8
parser: !!null
split_before: True
help: "Better for low similar fasta files"
order: 0
mashmap:
exec: default
command_line: "{exe} -t {threads} -r {target} -q {query} -o {out}"
all_vs_all: !!null
max_memory: 20
threads: 8
parser: mashmap2paf
split_before: False
help: "Faster for high similar fasta files"
order: 1
......@@ -102,27 +102,31 @@ class Tools:
self.load_yaml()
def load_yaml(self):
config_file = []
yaml_file = None
config_file_search = [os.path.join(os.path.abspath(os.sep), "dgenies", "tools.yaml"),
"/etc/dgenies/tools.yaml",
"/etc/dgenies/tools.yaml.local",
os.path.join(str(Path.home()), ".dgenies", "tools.yaml.local")]
if os.name == "nt":
config_file.insert(1, os.path.join(sys.executable, '..', "tools.yaml"))
config_file.insert(1, os.path.join(sys.executable, '..', "tools.yaml.local"))
config_file_search.insert(1, os.path.join(sys.executable, '..', "tools.yaml"))
config_file_search.insert(1, os.path.join(sys.executable, '..', "tools.yaml.local"))
for my_config_file in config_file_search:
app_dir = os.path.dirname(inspect.getfile(self.__class__))
config_file_search.append(os.path.join(app_dir, "tools-dev.yaml"))
config_file_search.append(os.path.join(app_dir, "tools-dev.yaml.local"))
for my_config_file in reversed(config_file_search):
if os.path.exists(my_config_file):
config_file.append(my_config_file)
if len(config_file) == 0:
yaml_file = my_config_file
break
if yaml_file is None:
raise FileNotFoundError("ERROR: tools.yaml not found.")
for yaml_file in config_file:
with open(yaml_file, "r") as yml_f:
tools_dict = yaml.load(yml_f)
tools = {}
for name, props in tools_dict.items():
tools[name] = Tool(name=name, **props)
print(tools)
self.tools.update(tools)
with open(yaml_file, "r") as yml_f:
tools_dict = yaml.load(yml_f)
tools = {}
for name, props in tools_dict.items():
tools[name] = Tool(name=name, **props)
print(tools)
self.tools.update(tools)
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