Skip to content

Commit

Permalink
Merge branch 'CW-4123' into 'dev'
Browse files Browse the repository at this point in the history
Add new models and new container [CW-4123]

Closes CW-4123

See merge request epi2melabs/workflows/wf-basecalling!68
  • Loading branch information
RenzoTale88 committed May 23, 2024
2 parents 7463e69 + 76a73c0 commit 6f1d246
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]
## [v1.1.9]
### Fixed
- Report crashing when no data are present in the input pod5
- Reconciled workflow with wf-template v5.1.2
- Report crashing when no data are present in the input pod5.
- Reconciled workflow with wf-template v5.1.3.
- Updated Dorado to v0.7.0 (see https://github.com/nanoporetech/dorado/releases/tag/v0.7.0)
- Added new DNA and RNA 5.0.0 models.

## [v1.1.8]
### Changed
Expand Down
32 changes: 21 additions & 11 deletions bin/workflow_glue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import glob
import importlib
import os
import sys

from .util import _log_level, get_main_logger # noqa: ABS101

Expand All @@ -11,15 +12,17 @@
_package_name = "workflow_glue"


def get_components():
def get_components(allowed_components=None):
"""Find a list of workflow command scripts."""
logger = get_main_logger(_package_name)
path = os.path.dirname(os.path.abspath(__file__))
components = list()
components = dict()
for fname in glob.glob(os.path.join(path, "*.py")):
name = os.path.splitext(os.path.basename(fname))[0]
if name in ("__init__", "util"):
continue
if allowed_components is not None and name not in allowed_components:
continue

# leniently attempt to import module
try:
Expand All @@ -34,14 +37,16 @@ def get_components():
try:
req = "main", "argparser"
if all(callable(getattr(mod, x)) for x in req):
components.append(name)
components[name] = mod
except Exception:
pass
return components


def cli():
"""Run workflow entry points."""
logger = get_main_logger(_package_name)
logger.info("Bootstrapping CLI.")
parser = argparse.ArgumentParser(
'wf-glue',
parents=[_log_level()],
Expand All @@ -56,16 +61,21 @@ def cli():
help='additional help', dest='command')
subparsers.required = True

# all component demos, plus some others
components = [
f'{_package_name}.{comp}' for comp in get_components()]
for module in components:
mod = importlib.import_module(module)
# importing everything can take time, try to shortcut
if len(sys.argv) > 1:
components = get_components(allowed_components=[sys.argv[1]])
if not sys.argv[1] in components:
logger.warn("Importing all modules, this may take some time.")
components = get_components()
else:
components = get_components()

# add all module parsers to main CLI
for name, module in components.items():
p = subparsers.add_parser(
module.split(".")[-1], parents=[mod.argparser()])
p.set_defaults(func=mod.main)
name.split(".")[-1], parents=[module.argparser()])
p.set_defaults(func=module.main)

logger = get_main_logger(_package_name)
args = parser.parse_args()

logger.info("Starting entrypoint.")
Expand Down
4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ params {

wf {
basecaller_container = "ontresearch/dorado"
container_sha = "shaa5cd803bdb5f3cac5c612e47ea6391b882861b8b"
container_sha = "shac2d8bc91ca2d043fed84d06cca92aaeb62bcc1cd"
bonito_container = "ontresearch/bonito"
bonito_sha = "shaea43ca2333f91fa78a823f640ba158e4268f1f98"
common_sha = "sha91cd87900c86f05bf36d8c77b841b8fda5ecf3aa"
Expand All @@ -83,7 +83,7 @@ manifest {
description = 'Helper workflow for basecalling ONT reads.'
mainScript = 'main.nf'
nextflowVersion = '>=23.04.2'
version = '1.1.8'
version = '1.1.9'
}

epi2melabs {
Expand Down
22 changes: 20 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,25 @@
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"rna002_70bps_fast@v3",
"rna002_70bps_hac@v3",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
"[email protected]",
"[email protected]",
"[email protected]"
]
},
"duplex": {
Expand All @@ -124,17 +130,29 @@
"[email protected]_5mCG_5hmCG@v1",
"[email protected]_5mC_5hmC@v1",
"[email protected]_6mA@v2",
"[email protected]_4mC_5mC@v1",
"[email protected]_5mCG_5hmCG@v1",
"[email protected]_5mC_5hmC@v1",
"[email protected]_6mA@v1",
"[email protected]_5mCG_5hmCG@v2",
"[email protected]_5mCG_5hmCG@v1",
"[email protected]_5mC_5hmC@v1",
"[email protected]_6mA@v2",
"[email protected]_4mC_5mC@v1",
"[email protected]_5mCG_5hmCG@v1",
"[email protected]_5mC_5hmC@v1",
"[email protected]_6mA@v1",
"[email protected][email protected]",
"[email protected]_5mCG_5hmCG@v0",
"[email protected][email protected]",
"[email protected]_5mCG_5hmCG@v0",
"[email protected][email protected]",
"[email protected]_5mCG_5hmCG@v0",
"[email protected]_m6A_DRACH@v1"
"[email protected]_m6A@v1",
"[email protected]_pseU@v1",
"[email protected]_m6A_DRACH@v1",
"[email protected]_m6A@v1",
"[email protected]_pseU@v1"
]
},
"dorado_ext": {
Expand Down

0 comments on commit 6f1d246

Please sign in to comment.