Skip to content

Commit

Permalink
Merge pull request #10 from rabix/feature/update_definitions
Browse files Browse the repository at this point in the history
Feature/update definitions
  • Loading branch information
pavlemarinkovic authored Oct 30, 2024
2 parents d95137e + fb3d92d commit a491233
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions wrabbit/parser/nextflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ def init_config_files(self):
"""
self.nf_config_files = get_config_files(self.workflow_path) or []

def generate_sb_inputs(self):
def generate_sb_inputs(self, execution_mode=None):
"""
Generate SB inputs schema
"""
if execution_mode:
if isinstance(execution_mode, ExecMode):
execution_mode = execution_mode.value

# ## Add profiles to the input ## #

Expand Down Expand Up @@ -148,8 +151,13 @@ def generate_sb_inputs(self):
for p_key, p_value in nf_schema.get('properties', {}).items():
self.sb_wrapper.safe_add_input(
nf_to_sb_input_mapper(p_key, p_value))
for def_name, definition in nf_schema.get(
'definitions', {}).items():

definitions_dict = nf_schema.get(
'definitions', {})
definitions_dict.update(nf_schema.get(
'$defs', {}
))
for def_name, definition in definitions_dict.items():
# Nextflow inputs schema contains multiple definitions where
# each definition contains multiple properties
category = dict()
Expand Down Expand Up @@ -211,7 +219,10 @@ def generate_sb_inputs(self):
# Add the generic file array input - auxiliary files
self.sb_wrapper.safe_add_input(GENERIC_FILE_ARRAY_INPUT)
self.sb_wrapper.safe_add_input(NF_PARAMS_FILE_INPUT)
self.sb_wrapper.add_requirement(AUX_FILES_REQUIREMENT)

if execution_mode == ExecMode.single:
self.sb_wrapper.add_requirement(AUX_FILES_REQUIREMENT)

self.sb_wrapper.add_requirement(INLINE_JS_REQUIREMENT)

def generate_sb_outputs(self):
Expand Down Expand Up @@ -306,7 +317,7 @@ def generate_sb_app(

self.generate_app_data()
self.nf_schema_build()
self.generate_sb_inputs()
self.generate_sb_inputs(execution_mode)
self.generate_sb_outputs()

if sample_sheet_schema or self.sb_samplesheet_schema:
Expand Down
2 changes: 1 addition & 1 deletion wrabbit/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.3"
__version__ = "0.2.4"

0 comments on commit a491233

Please sign in to comment.