Commit 8fb567c1 authored by Alexis Praga's avatar Alexis Praga
Browse files

multiqc: init at 1.26.

Update the work of dflores to latest version and official tests. All test pass.
Spectra has been added as dependencies in a previous commit.
parent 77d19d14
Loading
Loading
Loading
Loading
+117 −0
Original line number Diff line number Diff line
{
  lib,
  python3Packages,
  fetchFromGitHub,
  procps,
  stdenv,
  versionCheckHook,
}:

python3Packages.buildPythonApplication rec {
  pname = "multiqc";
  version = "1.26";

  # Two data sources. One for the code, another for the test data
  srcs = [
    (fetchFromGitHub {
      name = "multiqc";
      owner = "MultiQC";
      repo = "MultiQC";
      tag = "v${version}";
      hash = "sha256-MPAw6gG/3LzdskkDXOTDEM1NpG0sH9GvklYFQ1ZXWIs=";
    })
    (fetchFromGitHub {
      owner = "MultiQC";
      repo = "test-data";
      rev = "67435083a8bfa228dca3dda7d835facef15fc2c7";
      hash = "sha256-oYmPIJSy6dOKPcMr3B4foGoWcerA29x0XeGoU4dSYsA=";
      name = "test-data";
    })
  ];

  sourceRoot = "multiqc";

  dependencies = with python3Packages; [
    click
    humanize
    importlib-metadata
    jinja2
    kaleido
    markdown
    natsort
    numpy
    packaging
    requests
    pillow
    plotly
    pyyaml
    rich
    rich-click
    coloredlogs
    spectra
    pydantic
    typeguard
    tqdm
  ];

  optional-dependencies = {
    dev = with python3Packages; [
      pre-commit-hooks
      pdoc3
      pytest
      pytest-cov-stub
      pytest-xdist
      syrupy
      pygithub
      mypy
      types-pyyaml
      types-tqdm
      types-requests
      types-markdown
      types-beautifulsoup4
      types-pillow
    ];
  };

  # Some tests run subprocess.run() with "multiqc"
  preCheck = ''
    chmod -R u+w ../test-data
    ln -s ../test-data .
    export PATH=$out/bin:$PATH
  '';

  # Some tests run subprocess.run() with "ps"
  nativeCheckInputs = with python3Packages; [
    procps
    pytest-cov
    pytest-xdist
    pytestCheckHook
    syrupy
    pygithub
    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;
  };

}