Skip to content

Commit d0b957f

Browse files
wleepangLee Pang
andauthored
workflow configuration (#157)
* only check for nextflow_schema.json or nextflow.config * add trailing slash to configurator app url * ignore interactive validation for output_dir * handle nextflow schema use of allOf and definitions --------- Co-authored-by: Lee Pang <[email protected]>
1 parent 1cdd169 commit d0b957f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

cirro/cli/interactive/create_pipeline_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def ask_output_directory(input_value: str) -> str:
4646
'type': 'path',
4747
'name': 'output_dir',
4848
'message': 'Enter the output directory for the pipeline configuration files',
49-
'validate': utils.DirectoryValidator,
50-
'default': input_value or '',
49+
'default': input_value or str(Path.cwd()),
5150
'complete_style': CompleteStyle.READLINE_LIKE,
5251
'only_directories': True
5352
}

cirro/models/process/nextflow.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ def get_nextflow_json_schema(workflow_dir: str, logger: Optional[logging.Logger]
5858
logger.error(msg)
5959
raise FileNotFoundError(msg)
6060

61-
_all_of = {}
61+
# ignore the 'allOf' attribute if it exists
62+
# merge 'definitions' or '$defs' attribute with 'properties'
6263
if contents.get('allOf'):
63-
# this is typically a root attribute in nextflow_schema.json files and a list of $ref
64-
# convert this to an object
65-
_all_of = {item["$ref"].split('/')[-1]: item for item in contents['allOf']}
6664
del contents['allOf']
6765

68-
contents['properties'] = contents.get('properties', {}) | _all_of
66+
contents['properties'] = (
67+
contents.get('properties', {})
68+
| contents.get('$defs', {})
69+
| contents.get('definitions', {})
70+
)
6971

7072
return contents

cirro/models/process/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from referencing import Resource, Registry
99

1010

11-
CONFIG_APP_URL = "https://app.cirro.bio/tools/pipeline-configurator"
11+
CONFIG_APP_URL = "https://app.cirro.bio/tools/pipeline-configurator/"
1212

1313

1414
class ConfigAppStatus(Enum):
@@ -51,7 +51,7 @@ def parameter_schema(self) -> Resource:
5151
# look for a nextflow_schema.json file at the root of the workflow directory
5252
is_nextflow = (
5353
('nextflow_schema.json' in filenames)
54-
or ('main.nf' in filenames and 'nextflow.config' in filenames)
54+
or ('nextflow.config' in filenames)
5555
)
5656
if is_nextflow:
5757
# lazy load nextflow dependencies

0 commit comments

Comments
 (0)