Skip to content

Refactor: modernize CLI routing, optimize MPA pipeline and taxonomic sorting#18

Merged
iliapopov17 merged 9 commits into
mainfrom
dev
May 31, 2026
Merged

Refactor: modernize CLI routing, optimize MPA pipeline and taxonomic sorting#18
iliapopov17 merged 9 commits into
mainfrom
dev

Conversation

@iliapopov17
Copy link
Copy Markdown
Member

Key Changes

1. CLI & Routing

  • Implemented a central step_map for granular module execution via the new --step flag.
  • Added backward compatibility for legacy flags (suppressed via argparse.SUPPRESS).
  • Added automated logging to krakenparser.log and user-friendly post-execution tips for rarefaction and relative abundance settings.
  • Enforced no_args_is_help=True in the CLI entry point for better usability.

2. Parsing Engine (transform2mpa.py)

  • Overhauled _parse_line to support multiple Kraken2 report formats.
  • Replaced stack-based logic with explicit curr_path hierarchy tracking, making taxonomic tree traversal significantly more robust.

3. Data Integrity & Formatting (mpa_table.py)

  • Implemented hierarchical sorting: combined tables are now generated in a tree-consistent order rather than random order.
  • Improved sample alignment logic to ensure consistent table structure even when specific samples are missing data for certain taxa.

4. Documentation

  • Updated README.md to reflect the new command-line syntax, updated examples, and the updated output directory structure (including the new log file).

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@iliapopov17 iliapopov17 merged commit 286e86f into main May 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant