Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting: EDAM ontology fixes #3460

Merged
merged 5 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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

### Modules

Expand Down
4 changes: 2 additions & 2 deletions nf_core/module-template/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ input:
pattern: {{ '"*.{bam,cram,sam}"' if not_empty_template else "" }}
ontologies:
{% if not_empty_template -%}
- edam: "http://edamontology.org/format_25722" # BAM
- edam: "http://edamontology.org/format_2572" # BAM
- edam: "http://edamontology.org/format_2573" # CRAM
- edam: "http://edamontology.org/format_3462" # SAM
{% else -%}
Expand Down Expand Up @@ -112,7 +112,7 @@ output:
pattern: {{ '"*.{bam,cram,sam}"' if not_empty_template else "" }}
ontologies:
{% if not_empty_template -%}
- edam: "http://edamontology.org/format_25722" # BAM
- edam: "http://edamontology.org/format_2572" # BAM
- edam: "http://edamontology.org/format_2573" # CRAM
- edam: "http://edamontology.org/format_3462" # SAM
{% else -%}
Expand Down
5 changes: 4 additions & 1 deletion nf_core/modules/lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ def update_meta_yml_file(self, mod):
if "ontologies" in corrected_meta_yml["input"][i][j][element_name]:
for ontology in corrected_meta_yml["input"][i][j][element_name]["ontologies"]:
current_ontologies_i.append(ontology["edam"])
elif corrected_meta_yml["input"][i][j][element_name]["type"] == "file":
corrected_meta_yml["input"][i][j][element_name]["ontologies"] = []
log.debug(f"expected ontologies for input: {expected_ontologies_i}")
log.debug(f"current ontologies for input: {current_ontologies_i}")
for ontology, ext in expected_ontologies_i:
Expand All @@ -404,7 +406,6 @@ def update_meta_yml_file(self, mod):
corrected_meta_yml["input"][i][j][element_name]["ontologies"][-1].yaml_add_eol_comment(
f"{edam_formats[ext][1]}", "edam"
)
print(f"added comment {edam_formats[ext][1]}")
if "output" in meta_yml:
for i, channel in enumerate(corrected_meta_yml["output"]):
ch_name = list(channel.keys())[0]
Expand All @@ -420,6 +421,8 @@ def update_meta_yml_file(self, mod):
if "ontologies" in corrected_meta_yml["output"][i][ch_name][j][element_name]:
for ontology in corrected_meta_yml["output"][i][ch_name][j][element_name]["ontologies"]:
current_ontologies_o.append(ontology["edam"])
elif corrected_meta_yml["output"][i][ch_name][j][element_name]["type"] == "file":
corrected_meta_yml["output"][i][ch_name][j][element_name]["ontologies"] = []
log.debug(f"expected ontologies for output: {expected_ontologies_o}")
log.debug(f"current ontologies for output: {current_ontologies_o}")
for ontology, ext in expected_ontologies_o:
Expand Down
Loading