Breaking changes
Docs / Development
Notes about major MultiQC updates
Updating after major changes
When releasing new versions of MultiQC we aim to maintain compatibility so that your existing modules and plugins will keep working. However, in some cases we have to make changes that require code to be modified. This section describes any major breaking changes in MultiQC releases.
GitHub Repo and Docker images moved
On December 18th 2023, just after the v1.19 release of MultiQC, the GitHub repo and Docker images were moved.
- GitHub source code:
- Repo name
ewels/MultiQC
becameMultiQC/MultiQC
- Default branch
master
was renamed tomain
- Repo name
- Docker images renamed:
- DockerHub:
ewels/multiqc
becamemultiqc/multiqc
- GitHub Packages:
ghcr.io/ewels/multiqc
becameghcr.io/multiqc/multiqc
- DockerHub:
GitHub repository name change
The repository https://github.com/MultiQC/MultiQC was moved to https://github.com/MultiQC/MultiQC. All issues, pull-requests and other GitHub metadata moved with it. In most cases, GitHub should automatically redirect to the new location and you should not notice any difference. However, if you have a local clone / fork of the repository it’s still a good idea to update the remote name.
Assuming that you have forked the repo and have a local clone, configured with a remote called upstream
with which you pull in new changes (with git pull upstream
), you can rename the remote with the following:
Default branch name changed
At the same time as moving the repo, we also changed the default branch name from master
to main
. This is inline with changing industry standards.
See github/renaming
and this software freedom conservancy blog post for more details.
If you maintain your own fork of MultiQC, it will be unaffected by this change. The branch name is only switched on the main MultiQC repository. All pull-requests have been automatically updated to point to the renamed branch.
If you wish to change the default branch name on your fork, you can do (probably a good idea so as not to get confusing). First, rename the branch on GitHub.com (Settings -> Default branch, see also the GitHub docs)
Once renamed on GitHub.com, you’ll need to rename the branch in your local clone and point to the renamed remote branch:
New Docker images
To coincide with the GitHub repository renaming, the official Docker images have also been renamed.
The previous ewels/multiqc
images have not been removed, so as not to hinder reproducibility.
However, they will no longer be updated and get no new pushes to :dev
, :latest
or releases after :v1.19
.
New docker images have been created at DockerHub (multiqc/multiqc
)
and at GitHub Packages (ghcr.io/multiqc/multiqc
).
These do not have old versions, but will be updated from now on with releases v1.20 and onwards.
v1.0 Updates
MultiQC v1.0 brings a few changes in the way that MultiQC modules and plugins are written. Most are backwards-compatible, but there are a couple that could break external plugins.
Module imports
New MultiQC module imports have been refactored to make them less inter-dependent and fragile. This has a bunch of advantages, notably allowing better, more modular, unit testing (and hopefully more reliable and maintainable code).
All MultiQC modules and plugins will need to change some of their import statements.
There are two things that you probably need to change in your plugin modules to make them work with the updated version of MultiQC, both to do with imports. Instead of this style of importing modules:
You now need this:
Modules that directly reference multiqc.BaseMultiqcModule
instead need to reference
multiqc.modules.base_module.BaseMultiqcModule
.
Secondly, modules that use import plots
now need to import the specific plots needed.
You will also need to update any plotting functions, removing the plot.
prefix.
For example, change this:
to this:
These changes have been made to simplify the module imports within MultiQC, allowing specific parts of the codebase to be imported into a Python script on their own. This enables small, atomic, clean unit testing.
If you have any questions, please open an issue.
Many thanks to @tbooth at @EdinburghGenomics for his patient work with this.
Searching for files
The core find_log_files
function has been rewritten and now works a little differently. Instead of searching all analysis files each time it’s called (by every module), all files are searched once at the start of the MultiQC execution. This makes MultiQC run much faster.
To use the new syntax, add your search pattern to config.sp
using the new before_config
plugin hook:
setup.py
:
mymodule.py
:
This will add in your search patterns to the default MultiQC config, before user config files are loaded (allowing people to overwrite your defaults as with other modules).
Now, you can find your files much as before, using the string specified above:
The old syntax (supplying a dict
instead of a string to the function without any previous config setup) will still work, but you will get a depreciation notice. This functionality may be removed in the future.
Adding report sections
Report sections can be added by the method called self.add_section()
. For example:
Text passed as description
and helptext
is wrapped in <p>
tags, and additional raw content can be provided with a content
or content_before_plot
string if required.
Updated number formatting
A couple of minor updates to how numbers are handled in tables may affect your configs. Firstly, format strings looking like {:.1f}
should now be {:,.1f}
(note the extra comma). This enables customisable number formatting with separated thousand groups. For example, {:,.2f}
will format 1234567.89
as 1,234,567.89
. For decimal numbers, use {:,d}
.
Secondly, any table columns reporting a read and base counts should use new config options to allow user-configurable multipliers. For example, instead of this:
you should now use this:
Not as pretty, but allows users to view low depth coverage.
Similarly, for base counts: