Skip to content

Commit

Permalink
Merge branch 'dev' into fix/1927
Browse files Browse the repository at this point in the history
* dev:
  only add entry to files
  remove remaining print
  [automated] Update CHANGELOG.md
  fix edam BAM link on modules template
  add ontologies to meta.yml if not present
  [automated] Update CHANGELOG.md
  [automated] Update CHANGELOG.md
  docs: fix contributing link in the main README
  fix: linting with comments after the input directive
  • Loading branch information
jvfe committed Feb 20, 2025
2 parents 04b26bb + d4f99fc commit b6c038c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
### Linting

- 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 All @@ -26,6 +28,7 @@
- Update prettier to 3.5.0 ([#3448](https://github.com/nf-core/tools/pull/3448))
- chore(deps): update python:3.12-slim docker digest to 34656cd ([#3450](https://github.com/nf-core/tools/pull/3450))
- Remove Twitter from README ([#3454](https://github.com/nf-core/tools/pull/3454))
- docs: fix contributing link in the main README ([#3459](https://github.com/nf-core/tools/pull/3459))
- Continuation of #3083 ([#3456](https://github.com/nf-core/tools/pull/3456))

## [v3.2.0 - Pewter Pangolin](https://github.com/nf-core/tools/releases/tag/3.2.0) - [2025-01-27]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pip install --upgrade -r requirements-dev.txt -e .

## Contributions and Support

If you would like to contribute to this package, please see the [contributing guidelines](.github/CONTRIBUTING.md).
If you would like to contribute to this package, please see the [contributing guidelines](CONTRIBUTING.md).

For further information or help, don't hesitate to get in touch on the [Slack `#tools` channel](https://nfcore.slack.com/channels/tools) (you can join with [this invite](https://nf-co.re/join/slack)).

Expand Down
1 change: 1 addition & 0 deletions nf_core/components/nfcore_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def get_inputs_from_main_nf(self) -> None:
input_data = data.split("input:")[1].split("output:")[0]
for line in input_data.split("\n"):
channel_elements: Any = []
line = line.split("//")[0] # remove any trailing comments
regex = r"(val|path)\s*(\(([^)]+)\)|\s*([^)\s,]+))"
matches = re.finditer(regex, line)
for _, match in enumerate(matches, start=1):
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

0 comments on commit b6c038c

Please sign in to comment.