Skip to content

Commit d4f99fc

Browse files
authored
Merge pull request #3460 from mirpedrol/edam-ontology-fixes
Linting: EDAM ontology fixes
2 parents b43cb98 + 3da314b commit d4f99fc

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
- Add linting for ifEmpty(null) ([#3411](https://github.com/nf-core/tools/pull/3411))
1313
- fix: linting with comments after the input directive ([#3458](https://github.com/nf-core/tools/pull/3458))
14+
- EDAM ontology fixes ([#3460](https://github.com/nf-core/tools/pull/3460))
1415

1516
### Modules
1617

nf_core/module-template/meta.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ input:
6262
pattern: {{ '"*.{bam,cram,sam}"' if not_empty_template else "" }}
6363
ontologies:
6464
{% if not_empty_template -%}
65-
- edam: "http://edamontology.org/format_25722" # BAM
65+
- edam: "http://edamontology.org/format_2572" # BAM
6666
- edam: "http://edamontology.org/format_2573" # CRAM
6767
- edam: "http://edamontology.org/format_3462" # SAM
6868
{% else -%}
@@ -112,7 +112,7 @@ output:
112112
pattern: {{ '"*.{bam,cram,sam}"' if not_empty_template else "" }}
113113
ontologies:
114114
{% if not_empty_template -%}
115-
- edam: "http://edamontology.org/format_25722" # BAM
115+
- edam: "http://edamontology.org/format_2572" # BAM
116116
- edam: "http://edamontology.org/format_2573" # CRAM
117117
- edam: "http://edamontology.org/format_3462" # SAM
118118
{% else -%}

nf_core/modules/lint/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ def update_meta_yml_file(self, mod):
394394
if "ontologies" in corrected_meta_yml["input"][i][j][element_name]:
395395
for ontology in corrected_meta_yml["input"][i][j][element_name]["ontologies"]:
396396
current_ontologies_i.append(ontology["edam"])
397+
elif corrected_meta_yml["input"][i][j][element_name]["type"] == "file":
398+
corrected_meta_yml["input"][i][j][element_name]["ontologies"] = []
397399
log.debug(f"expected ontologies for input: {expected_ontologies_i}")
398400
log.debug(f"current ontologies for input: {current_ontologies_i}")
399401
for ontology, ext in expected_ontologies_i:
@@ -404,7 +406,6 @@ def update_meta_yml_file(self, mod):
404406
corrected_meta_yml["input"][i][j][element_name]["ontologies"][-1].yaml_add_eol_comment(
405407
f"{edam_formats[ext][1]}", "edam"
406408
)
407-
print(f"added comment {edam_formats[ext][1]}")
408409
if "output" in meta_yml:
409410
for i, channel in enumerate(corrected_meta_yml["output"]):
410411
ch_name = list(channel.keys())[0]
@@ -420,6 +421,8 @@ def update_meta_yml_file(self, mod):
420421
if "ontologies" in corrected_meta_yml["output"][i][ch_name][j][element_name]:
421422
for ontology in corrected_meta_yml["output"][i][ch_name][j][element_name]["ontologies"]:
422423
current_ontologies_o.append(ontology["edam"])
424+
elif corrected_meta_yml["output"][i][ch_name][j][element_name]["type"] == "file":
425+
corrected_meta_yml["output"][i][ch_name][j][element_name]["ontologies"] = []
423426
log.debug(f"expected ontologies for output: {expected_ontologies_o}")
424427
log.debug(f"current ontologies for output: {current_ontologies_o}")
425428
for ontology, ext in expected_ontologies_o:

0 commit comments

Comments
 (0)