nixpkgs/pkgs/by-name/mu/multiqc/package.nix
2025-07-19 00:26:47 +02:00

131 lines
3.0 KiB
Nix

{
lib,
python3Packages,
fetchFromGitHub,
procps,
stdenv,
versionCheckHook,
addBinToPathHook,
}:
let
test-data = fetchFromGitHub {
name = "test-data";
owner = "MultiQC";
repo = "test-data";
rev = "d775b73c106d48726653f2fd02e473b7acbd93d8";
hash = "sha256-uxBpMx22gWJmnbF9tVuVIdYdiqUh7n51swzu5hnfZQ0=";
};
in
python3Packages.buildPythonApplication rec {
pname = "multiqc";
version = "1.29";
pyproject = true;
src = fetchFromGitHub {
name = "multiqc";
owner = "MultiQC";
repo = "MultiQC";
tag = "v${version}";
hash = "sha256-KKLdDNf889lEbCyNpJFZoE8rNO50CRzNP4hKpKHRAcE=";
};
# Multiqc cannot remove temporary directories in some case.
# Default is 10 retries, lower it to 2
postPatch = ''
substituteInPlace multiqc/utils/util_functions.py \
--replace-fail \
"max_retries: int = 10," \
"max_retries: int = 2,"
'';
build-system = with python3Packages; [ setuptools ];
dependencies = with python3Packages; [
boto3
click
humanize
importlib-metadata
jinja2
kaleido
markdown
numpy
packaging
requests
pillow
plotly
pyyaml
rich
rich-click
coloredlogs
spectra
pydantic
typeguard
tqdm
python-dotenv
natsort
tiktoken
jsonschema
polars
pyarrow
];
optional-dependencies = {
dev = with python3Packages; [
pre-commit-hooks
pdoc3
pytest
pytest-cov
pytest-xdist
syrupy
pygithub
mypy
types-pyyaml
types-tqdm
types-requests
types-markdown
types-beautifulsoup4
types-pillow
];
};
preCheck = ''
ln -s ${test-data} ./test-data
'';
nativeCheckInputs =
(with python3Packages; [
pytest-xdist
pytestCheckHook
])
++ [
addBinToPathHook # Some tests run subprocess.run() with "multiqc"
procps # Some tests run subprocess.run() with "ps"
versionCheckHook
];
versionCheckProgramArg = "--version";
disabledTests =
# On darwin, kaleido fails to starts
lib.optionals (stdenv.hostPlatform.isDarwin) [
"test_flat_plot"
];
meta = {
description = "Aggregates bioinformatics results from multiple samples into a unified report";
longDescription = ''
MultiQC is a tool to create a single report with interactive plots for multiple bioinformatics analyses across many samples.
Reports are generated by scanning given directories for recognised log files. These are parsed and a single HTML report is generated summarising the statistics for all logs found. MultiQC reports can describe multiple analysis steps and large numbers of samples within a single plot, and multiple analysis tools making it ideal for routine fast quality control.
'';
homepage = "https://multiqc.info";
changelog = "https://github.com/MultiQC/MultiQC/releases/tag/v${version}/";
license = [ lib.licenses.gpl3Plus ];
maintainers = [ lib.maintainers.apraga ];
mainProgram = "multiqc";
platforms = lib.platforms.unix;
};
}