utils

Utility functions for pod5 tools

assert_inputs_exist(inputs: Iterable[Path])[source]

Assert all inputs exist. Raises FileExistsError otherwise

assert_no_duplicate_filenames(inputs: Collection[Path]) None[source]

Raises ValueError if there are duplicate filenames in the collection of Paths

collect_inputs(paths: Iterable[Path], recursive: bool, pattern: Union[str, Collection[str]], threads: int = 2) Set[Path][source]

Returns a set of path which match any of the given glob-style `pattern`s

If a path is a directory this will be globbed (optionally recursively). If a path is a file then it must also match any of the given `pattern`s.

Raises FileExistsError if any inputs do not exist

init_logging()[source]

Initialise logging only if POD5_DEBUG is true

is_disable_pbar() bool[source]

Check if POD5_PBAR is set returning true if PBAR should be disabled

is_pod5_debug() bool[source]

Check if POD5_DEBUG is set

logged(log_return: bool = False, log_args: bool = False, log_time: bool = False)[source]

Logging parameterised decorator

logged_all(func)
search_path(path: Path, recursive: bool, patterns: Collection[str]) Set[Path][source]

Search path matching pattern searching directories recursively if requested

search_paths(paths: Iterable[Path], recursive: bool, pattern: Union[str, Collection[str]], threads: int = 2) Set[Path][source]

Search all paths matching any of patterns searching directories recursively if requested

terminate_processes(processes: List[SpawnProcess]) None[source]

terminate all child processes

pl_format_empty_string(expr: Expr, subst: Optional[str]) Expr[source]

Empty strings are read as a pair of double-quotes which need to be removed

pl_format_read_id(read_id_col: Expr) Expr[source]

Format read ids to in UUID style