implementing-new-modules

Create new MultiQC modules that parse bioinformatics tool outputs into report sections.

1.5k|684|Updated Aug 4, 2015
One-click install
npx skills add https://github.com/MultiQC/MultiQC --skill implementing-new-modules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-new-modules
Source: https://github.com/MultiQC/MultiQC/tree/main/.claude/skills/implementing-new-modules
Command: npx skills add https://github.com/MultiQC/MultiQC --skill implementing-new-modules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding support for a new bioinformatics tool to MultiQC requires many coordinated steps: writing a parser, registering search patterns and entry points, adding general stats columns, building plots, writing tests, and passing lint checks. This Skill guides the full implementation so nothing is missed.

Core Features & Use Cases

  • End-to-end module workflow: Research the tool, choose single-tool or multi-subtool architecture, build the parser, register in search_patterns.yaml and pyproject.toml, test, and open a PR.
  • Ready-made templates and patterns: Class skeletons, parsing patterns (key-value, JSON), general stats headers, table/bargraph/linegraph plot snippets, and test file templates.
  • Pitfall prevention: Enforces required calls like add_software_version() and write_data_file(), correct use of ModuleNoSamplesFound, human-readable labels, and section alerts.
  • Use Case: A module: new GitHub issue asks to support a new QC tool. Use this Skill to scaffold the module, parse its output format, register it, and pass pytest tests/test_modules_run.py -k "toolname" plus lint checks.

Quick Start

Implement a new MultiQC module for the bioinformatics tool described in issue #XXXX, following the implementation checklist and module structure templates.

Frequently Asked Questions about implementing-new-modules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new module to MultiQC?

Create a directory under multiqc/modules/toolname with an __init__.py and a parser class extending BaseMultiqcModule, then register a search pattern in search_patterns.yaml and an entry point in pyproject.toml. Finish with unit tests, an integration test via pytest tests/test_modules_run.py, and lint checks.

How do I parse a bioinformatics tool output in a MultiQC module?

Iterate over self.find_log_files("toolname"), parse each file into a per-sample data dict, and call add_data_source and add_software_version for every sample. After filtering with ignore_samples, raise ModuleNoSamplesFound if empty, then add sections and call write_data_file last.

When should a MultiQC module use a multi-subtool structure?

Use a multi-subtool structure when the tool has distinct subcommands emitting different output formats, like samtools or picard. Each subtool gets its own parser file with a parse_toolname_subtool function, coordinated by an orchestrator class that raises ModuleNoSamplesFound only if all subtools return zero samples.

Why does my MultiQC module fail lint checks?

Common causes are missing add_software_version calls, calling write_data_file before all sections are added, or raising UserWarning instead of ModuleNoSamplesFound. Run python .github/workflows/code_checks.py plus ruff and mypy to identify the exact violation.

How do I write a search pattern for a new MultiQC module?

Add an entry to search_patterns.yaml using fn for standard filenames, contents for exact string matches, or contents_re for regexes, with num_lines to cap scanning. Audit the tool's upstream source for version and flag-dependent output variations before finalizing the pattern.