Skip to content

Commit

Permalink
Merge pull request #58 from xtrojak/generate-job-options
Browse files Browse the repository at this point in the history
Generate conversion job options
  • Loading branch information
hechth authored Dec 16, 2021
2 parents 96b87aa + f06097d commit 110e6b4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [dev] - unreleased
### Added
- `generate_options()` function in `Galaxy` submodule to create all possible conversions supported by the tool in a format suitable for the galaxy tool form [#58](https://github.com/RECETOX/MSMetaEnhancer/pull/58)
### Changed
### Removed

Expand Down
2 changes: 1 addition & 1 deletion MSMetaEnhancer/libs/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from MSMetaEnhancer.libs.services.NLM import NLM
from MSMetaEnhancer.libs.services.PubChem import PubChem

__all__ = ['CIR', 'CTS', 'NLM', 'PubChem']
__all__ = ['PubChem', 'CTS', 'CIR', 'NLM']
Empty file added galaxy/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions galaxy/generate_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sys
import os

# this add to path the home dir, so it can be called from anywhere
sys.path.append(os.path.split(sys.path[0])[0])

from MSMetaEnhancer.libs.services import *
from MSMetaEnhancer.libs.services import __all__ as services


def generate_options():
jobs = []
for service in services:
jobs += (eval(service)(None).get_conversion_functions())

for job in jobs:
print(f'<option value="{job[0]} {job[1]} {job[2]}">{job[2]}: {job[0]} -> {job[1]}</option>')


if __name__ == '__main__':
generate_options()

0 comments on commit 110e6b4

Please sign in to comment.