Commit 2e198433 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Extract profiles from config.yaml into own directory

parent 80842e5d
tools:
signalp: '/vol/biotools/bin/signalp'
ghostx: '/vol/biotools/bin/ghostx'
profiles:
- name: 'fast'
info: 'Profile that contains tools that give a fast result'
modules:
ghostx_swissprot:
signalp:
organism: 'euk'
- name: 'common'
info: 'Profile that uses commonly used tools'
modules:
include_sequence:
signalp:
blastp_swissprot:
hmmer_pfam_a:
- name: 'complete'
info: 'Profile that uses all available tools'
modules:
signalp:
blastp_swissprot:
alignment:
hmmer_pfam_a:
- name: 'debug'
info: 'Profile that runs all available tools'
modules:
include_sequence:
signalp:
blastp_swissprot:
ghostx_swissprot:
hmmer_pfam_a:
- name: 'custom'
info: 'Define which tools should be run'
name: 'common'
info: 'Profile that uses commonly used tools'
modules:
include_sequence:
signalp:
blastp_swissprot:
hmmer_pfam_a:
name: 'complete'
info: 'Profile that uses all available tools'
modules:
signalp:
blastp_swissprot:
alignment:
hmmer_pfam_a:
name: 'debug'
info: 'Profile that runs all available tools'
modules:
include_sequence:
signalp:
blastp_swissprot:
ghostx_swissprot:
hmmer_pfam_a:
name: 'fast'
info: 'Profile that contains tools that give a fast result'
modules:
ghostx_swissprot:
signalp:
organism: 'euk'
......@@ -34,11 +34,25 @@ def get_module_manifests():
mypath = get_modules_location()
return [os.path.join(mypath, f) for f in os.listdir(mypath) if os.path.isfile(os.path.join(mypath, f)) and not f.startswith('.')]
def get_profile_manifests():
mypath = get_profiles_location()
return [os.path.join(mypath, f) for f in os.listdir(mypath) if os.path.isfile(os.path.join(mypath, f)) and not f.startswith('.')]
def create_app_config():
config = {}
config['app_path'] = get_install_location()
config['bin_path'] = get_script_location()
return config
def load_profiles():
profiles = []
for manifest in get_profile_manifests():
with (open(manifest)) as f:
profile = yaml.load(f)
profiles.append(profile)
return profiles
def load_modules():
modules = {}
......@@ -82,6 +96,7 @@ def merge_modules_in_profiles(config):
def load_config():
config = load_config_file()
config['profiles'] = load_profiles()
config['modules'] = load_modules()
config['app'] = create_app_config()
normalize_profiles(config['profiles'])
......@@ -96,9 +111,11 @@ if __name__ == "__main__":
print('Install location: ' + config.get_install_location())
print('Script lcoation: ' + config.get_script_location())
print('Config location: ' + config.get_config_file())
print('Available profile manifests:\n\t' + '\n\t'.join(config.get_profile_manifests()) + '\n')
print('Available module manifests:\n\t' + '\n\t'.join(config.get_module_manifests()) + '\n')
print('Profile manifests content:\n' + pformat(config.load_profiles()) + '\n')
print('Module manifests content:\n' + pformat(config.load_modules()) + '\n')
print('Config content:\n' + pformat(config.load_config_file()) + '\n')
print('Manifest content:\n' + pformat(config.load_modules()) + '\n')
print('Aggregated config:\n' + pformat(config.load_config()) + '\n')
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