samplesheet-parser 1.2.0__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/CHANGELOG.md +38 -0
  2. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/CITATION.cff +2 -2
  3. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/PKG-INFO +4 -2
  4. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/README.md +3 -1
  5. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/api.md +39 -1
  6. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/cli.md +14 -1
  7. samplesheet_parser-1.3.0/docs/guide/conversion.md +134 -0
  8. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/installation.md +4 -7
  9. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_converter.py +6 -3
  10. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/environment.yml +1 -1
  11. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/main.nf +2 -2
  12. {samplesheet_parser-1.2.0/modules/nf-core/samplesheetparser/info → samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff}/environment.yml +1 -1
  13. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/main.nf +45 -0
  14. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/meta.yml +69 -0
  15. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/tests/main.nf.test +79 -0
  16. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/tests/tags.yml +4 -0
  17. {samplesheet_parser-1.2.0/modules/nf-core/samplesheetparser/validate → samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter}/environment.yml +1 -1
  18. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/main.nf +48 -0
  19. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/meta.yml +74 -0
  20. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/main.nf.test +57 -0
  21. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/nextflow.config +5 -0
  22. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/tags.yml +4 -0
  23. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/info/environment.yml +6 -0
  24. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/main.nf +2 -2
  25. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/environment.yml +6 -0
  26. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/main.nf +53 -0
  27. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/meta.yml +73 -0
  28. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/tests/main.nf.test +88 -0
  29. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/tests/tags.yml +4 -0
  30. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/environment.yml +6 -0
  31. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/main.nf +56 -0
  32. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/meta.yml +73 -0
  33. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/tests/main.nf.test +79 -0
  34. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/tests/tags.yml +4 -0
  35. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/validate/environment.yml +6 -0
  36. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/main.nf +2 -2
  37. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/pyproject.toml +1 -1
  38. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/recipes/meta.yaml +3 -3
  39. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/cli.py +32 -3
  40. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/converter.py +191 -47
  41. samplesheet_parser-1.3.0/samplesheet_parser/instruments.py +192 -0
  42. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_cli.py +6 -0
  43. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_converter.py +404 -48
  44. samplesheet_parser-1.3.0/tests/test_instruments.py +126 -0
  45. samplesheet_parser-1.2.0/docs/guide/conversion.md +0 -54
  46. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.github/workflows/ci.yml +0 -0
  47. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.github/workflows/copilot-instructions.md +0 -0
  48. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.gitignore +0 -0
  49. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.pre-commit-config.yaml +0 -0
  50. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.readthedocs.yaml +0 -0
  51. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.zenodo.json +0 -0
  52. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/CONTRIBUTING.md +0 -0
  53. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/LICENSE +0 -0
  54. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/changelog.md +0 -0
  55. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/ci.md +0 -0
  56. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/contributing.md +0 -0
  57. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/examples.md +0 -0
  58. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/diffing.md +0 -0
  59. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/filtering.md +0 -0
  60. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/index_utils.md +0 -0
  61. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/merging.md +0 -0
  62. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/parsing.md +0 -0
  63. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/quickstart.md +0 -0
  64. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/splitting.md +0 -0
  65. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/validation.md +0 -0
  66. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/writing.md +0 -0
  67. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/index.md +0 -0
  68. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/requirements.txt +0 -0
  69. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_diff.py +0 -0
  70. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_filter.py +0 -0
  71. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_index_utils.py +0 -0
  72. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_merger.py +0 -0
  73. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_splitter.py +0 -0
  74. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_writer.py +0 -0
  75. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/parse_examples.py +0 -0
  76. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectAlpha_SampleSheet.csv +0 -0
  77. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectBeta_SampleSheet.csv +0 -0
  78. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectDelta_SampleSheet_collision.csv +0 -0
  79. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectGamma_SampleSheet.csv +0 -0
  80. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/README.md +0 -0
  81. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/combined_clean.csv +0 -0
  82. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/combined_collision_forced.csv +0 -0
  83. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/combined_mixed_formats.csv +0 -0
  84. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_dual_index.csv +0 -0
  85. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_multi_lane.csv +0 -0
  86. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_single_index.csv +0 -0
  87. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_with_lab_qc_settings.csv +0 -0
  88. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_with_manifests.csv +0 -0
  89. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_nextseq_single_index.csv +0 -0
  90. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_novaseq_x_dual_index.csv +0 -0
  91. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_cloud_settings.csv +0 -0
  92. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_index_umi.csv +0 -0
  93. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_pipeline_settings.csv +0 -0
  94. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_read_umi.csv +0 -0
  95. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/images/samplesheet_parser_arch_v03.png +0 -0
  96. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/images/samplesheet_parser_overview.png +0 -0
  97. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/mkdocs.yml +0 -0
  98. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/meta.yml +0 -0
  99. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/tests/main.nf.test +0 -0
  100. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/tests/tags.yml +0 -0
  101. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/meta.yml +0 -0
  102. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/tests/main.nf.test +0 -0
  103. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/tests/tags.yml +0 -0
  104. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/meta.yml +0 -0
  105. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/tests/main.nf.test +0 -0
  106. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/tests/tags.yml +0 -0
  107. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/__init__.py +0 -0
  108. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/diff.py +0 -0
  109. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/enums.py +0 -0
  110. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/factory.py +0 -0
  111. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/filter.py +0 -0
  112. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/index_utils.py +0 -0
  113. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/merger.py +0 -0
  114. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/parsers/__init__.py +0 -0
  115. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/parsers/v1.py +0 -0
  116. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/parsers/v2.py +0 -0
  117. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/py.typed +0 -0
  118. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/splitter.py +0 -0
  119. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/validators.py +0 -0
  120. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/writer.py +0 -0
  121. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/scripts/demo_converter.py +0 -0
  122. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/scripts/demo_diff.py +0 -0
  123. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/scripts/demo_writer.py +0 -0
  124. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/__init__.py +0 -0
  125. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/conftest.py +0 -0
  126. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/fixtures/SampleSheet_v1_dual_index.csv +0 -0
  127. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/fixtures/SampleSheet_v2_dual_index.csv +0 -0
  128. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/fixtures/SampleSheet_v2_modified.csv +0 -0
  129. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_diff.py +0 -0
  130. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_factory.py +0 -0
  131. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_filter.py +0 -0
  132. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_index_utils.py +0 -0
  133. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_merger.py +0 -0
  134. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_parsers/__init__.py +0 -0
  135. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_parsers/test_v1.py +0 -0
  136. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_parsers/test_v2.py +0 -0
  137. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_splitter.py +0 -0
  138. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_validators/__init__.py +0 -0
  139. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_validators/test_hamming.py +0 -0
  140. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_validators/test_validators.py +0 -0
  141. {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_writer.py +0 -0
@@ -10,6 +10,44 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
10
10
 
11
11
  ---
12
12
 
13
+ ## [1.3.0] - 2026-05-20
14
+
15
+ ### Fixed
16
+
17
+ - **`SampleSheetConverter` now reverse-complements `Index2` for workflow-B
18
+ instruments** (NovaSeq X / X Plus, NextSeq 500/550/1000/2000, iSeq 100,
19
+ MiniSeq, HiSeq 3000/4000) on V1 ↔ V2 conversion. `bcl2fastq` records i5 as
20
+ read on the chip (reverse-complemented for workflow-B instruments) while
21
+ `BCLConvert` expects i5 in the forward orientation; previously the
22
+ converter passed `Index2` through verbatim, silently producing V2 sheets
23
+ that demultiplexed to the wrong samples ([#30]).
24
+ - The workflow is auto-detected from `[Header] Instrument Type` (V1) or
25
+ `InstrumentPlatform` / `InstrumentType` (V2). When the sheet has a
26
+ non-empty `Index2` column and the workflow cannot be determined, the
27
+ converter raises `ValueError` and the CLI exits non-zero rather than
28
+ guessing. **Behavior change:** dual-index sheets with no recognised
29
+ instrument header that previously converted (with silently wrong `Index2`)
30
+ will now fail loudly until `workflow=` / `--workflow` is supplied.
31
+ - V2 → V1 conversion now preserves the instrument as `Instrument Type` in
32
+ the V1 `[Header]` so the workflow signal survives a round trip.
33
+
34
+ ### Added
35
+
36
+ - **`samplesheet_parser.instruments`** — public module exposing
37
+ `Workflow` (StrEnum: `A` / `B`), `WORKFLOW_A_INSTRUMENTS` /
38
+ `WORKFLOW_B_INSTRUMENTS` / `AMBIGUOUS_INSTRUMENTS` tables,
39
+ `detect_workflow()`, `parse_workflow()`, and `reverse_complement()`.
40
+ - **`SampleSheetConverter(path, *, workflow=...)`** — explicit workflow
41
+ override accepting `"a"`, `"b"`, or a `Workflow` enum value. Required for
42
+ ambiguous instruments such as `NovaSeq 6000` (workflow depends on v1.0
43
+ vs v1.5 chemistry).
44
+ - **`samplesheet convert --workflow {a,b}` / `-w`** — CLI override that
45
+ takes precedence over auto-detection.
46
+
47
+ [#30]: https://github.com/chaitanyakasaraneni/samplesheet-parser/issues/30
48
+
49
+ ---
50
+
13
51
  ## [1.2.0] - 2026-04-14
14
52
 
15
53
  ### Changed
@@ -8,8 +8,8 @@ abstract: >
8
8
  Provides format auto-detection, bidirectional V1/V2 conversion,
9
9
  structural and index validation, sheet diffing, and cross-project
10
10
  merging with Hamming-distance collision detection.
11
- version: 1.1.0
12
- date-released: 2026-04-05
11
+ version: 1.3.0
12
+ date-released: 2026-05-20
13
13
  license: Apache-2.0
14
14
  url: "https://github.com/chaitanyakasaraneni/samplesheet-parser"
15
15
  repository-code: "https://github.com/chaitanyakasaraneni/samplesheet-parser"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: samplesheet-parser
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Format-agnostic parser for Illumina SampleSheet.csv files — supports IEM V1 and BCLConvert V2
5
5
  Project-URL: Homepage, https://github.com/chaitanyakasaraneni/samplesheet-parser
6
6
  Project-URL: Documentation, https://illumina-samplesheet.readthedocs.io
@@ -61,10 +61,12 @@ Supports both the classic IEM V1 format (bcl2fastq era) and the modern BCLConver
61
61
  [![PyPI version](https://img.shields.io/pypi/v/samplesheet-parser.svg)](https://pypi.org/project/samplesheet-parser/)
62
62
  [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
63
63
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-yellow.svg)](https://opensource.org/licenses/Apache-2.0)
64
+ [![Install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/samplesheet-parser/README.html)
65
+
64
66
  [![Tests](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions)
65
67
  [![codecov](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser/branch/main/graph/badge.svg?token=CODECOV_TOKEN)](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser)
66
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18989694.svg)](https://doi.org/10.5281/zenodo.18989694)
67
68
  [![Docs](https://readthedocs.org/projects/illumina-samplesheet/badge/)](https://illumina-samplesheet.readthedocs.io)
69
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18989694.svg)](https://doi.org/10.5281/zenodo.18989694)
68
70
 
69
71
  **Docs:** https://illumina-samplesheet.readthedocs.io/ | **PyPI:** https://pypi.org/project/samplesheet-parser/
70
72
 
@@ -7,10 +7,12 @@ Supports both the classic IEM V1 format (bcl2fastq era) and the modern BCLConver
7
7
  [![PyPI version](https://img.shields.io/pypi/v/samplesheet-parser.svg)](https://pypi.org/project/samplesheet-parser/)
8
8
  [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
9
9
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-yellow.svg)](https://opensource.org/licenses/Apache-2.0)
10
+ [![Install with bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat)](http://bioconda.github.io/recipes/samplesheet-parser/README.html)
11
+
10
12
  [![Tests](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions)
11
13
  [![codecov](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser/branch/main/graph/badge.svg?token=CODECOV_TOKEN)](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser)
12
- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18989694.svg)](https://doi.org/10.5281/zenodo.18989694)
13
14
  [![Docs](https://readthedocs.org/projects/illumina-samplesheet/badge/)](https://illumina-samplesheet.readthedocs.io)
15
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18989694.svg)](https://doi.org/10.5281/zenodo.18989694)
14
16
 
15
17
  **Docs:** https://illumina-samplesheet.readthedocs.io/ | **PyPI:** https://pypi.org/project/samplesheet-parser/
16
18
 
@@ -51,11 +51,49 @@ from samplesheet_parser import (
51
51
 
52
52
  ## SampleSheetConverter
53
53
 
54
- | Method | Returns | Description |
54
+ ```python
55
+ SampleSheetConverter(path, *, workflow: Workflow | str | None = None)
56
+ ```
57
+
58
+ | Method / attribute | Returns | Description |
55
59
  |---|---|---|
56
60
  | `to_v2(output_path)` | `Path` | Convert IEM V1 → BCLConvert V2 |
57
61
  | `to_v1(output_path)` | `Path` | Convert BCLConvert V2 → IEM V1 (lossy) |
58
62
  | `.source_version` | `SampleSheetVersion \| None` | Auto-detected format of the input |
63
+ | `.workflow_override` | `Workflow \| None` | Resolved workflow override, if any |
64
+
65
+ The `workflow` parameter accepts `"a"`, `"b"`, or a `Workflow` enum value
66
+ and overrides auto-detection of the i5 orientation workflow from the
67
+ instrument header. See
68
+ [Conversion → Index 2 orientation](guide/conversion.md#index-2-i5-orientation).
69
+
70
+ ---
71
+
72
+ ## samplesheet_parser.instruments
73
+
74
+ i5 orientation workflow classification helpers.
75
+
76
+ ```python
77
+ from samplesheet_parser.instruments import (
78
+ Workflow,
79
+ detect_workflow,
80
+ parse_workflow,
81
+ reverse_complement,
82
+ WORKFLOW_A_INSTRUMENTS,
83
+ WORKFLOW_B_INSTRUMENTS,
84
+ AMBIGUOUS_INSTRUMENTS,
85
+ )
86
+ ```
87
+
88
+ | Name | Kind | Description |
89
+ |---|---|---|
90
+ | `Workflow` | `StrEnum` | `Workflow.A` (i5 forward) / `Workflow.B` (i5 RC'd on chip) |
91
+ | `detect_workflow(name)` | `Workflow \| None` | Classify an instrument name; `None` for unknown or ambiguous (e.g. `NovaSeq 6000`) |
92
+ | `parse_workflow(value)` | `Workflow \| None` | Coerce a CLI string (`"a"` / `"b"`) to `Workflow` |
93
+ | `reverse_complement(seq)` | `str` | Reverse-complement a DNA sequence (preserves `N`, case-preserving) |
94
+ | `WORKFLOW_A_INSTRUMENTS` | `frozenset[str]` | Normalised names of workflow-A instruments |
95
+ | `WORKFLOW_B_INSTRUMENTS` | `frozenset[str]` | Normalised names of workflow-B instruments |
96
+ | `AMBIGUOUS_INSTRUMENTS` | `frozenset[str]` | Instruments whose workflow depends on chemistry and require an explicit override |
59
97
 
60
98
  ---
61
99
 
@@ -100,6 +100,7 @@ Convert between V1 (IEM/bcl2fastq) and V2 (BCLConvert) formats.
100
100
  samplesheet convert SampleSheet_v1.csv --to v2 --output SampleSheet_v2.csv
101
101
  samplesheet convert SampleSheet_v2.csv --to v1 --output SampleSheet_v1.csv
102
102
  samplesheet convert SampleSheet_v1.csv --to v2 --output out.csv --format json
103
+ samplesheet convert NovaSeq6000.v1.csv --to v2 --workflow b --output out.csv
103
104
  ```
104
105
 
105
106
  **Options:**
@@ -109,9 +110,21 @@ samplesheet convert SampleSheet_v1.csv --to v2 --output out.csv --format json
109
110
  | `--to` | `v2` | Target format: `v1` or `v2` |
110
111
  | `--output` / `-o` | `SampleSheet_converted.csv` | Output file path |
111
112
  | `--format` / `-f` | `text` | Output format: `text` or `json` |
113
+ | `--workflow` / `-w` | auto-detect | i5 orientation: `a` (MiSeq, HiSeq 2000/2500, NovaSeq 6000 v1.0) or `b` (NovaSeq X/X Plus, NextSeq, iSeq, MiniSeq, HiSeq 3000/4000, NovaSeq 6000 v1.5). Overrides header auto-detection. |
112
114
 
113
115
  !!! warning "V2 → V1 is lossy"
114
- V2-only fields (`OverrideCycles`, `InstrumentPlatform`, etc.) are dropped with a warning.
116
+ V2-only fields (`OverrideCycles`, `FileFormatVersion`, etc.) are dropped with a warning. `InstrumentPlatform` is preserved as `Instrument Type` in the V1 header.
117
+
118
+ !!! info "Index 2 (i5) orientation"
119
+ For workflow-B instruments, `Index2` is reverse-complemented to
120
+ match the target demultiplexer's expected orientation. The workflow
121
+ is auto-detected from the instrument header; pass `--workflow` to
122
+ override (required for `NovaSeq 6000`, which is chemistry-dependent).
123
+
124
+ If the sheet has dual indexes and the workflow cannot be determined
125
+ and no override is given, `convert` exits non-zero with a clear
126
+ error rather than producing a silently-wrong sheet. See
127
+ [Conversion → Index 2 orientation](guide/conversion.md#index-2-i5-orientation).
115
128
 
116
129
  **JSON output:**
117
130
  ```json
@@ -0,0 +1,134 @@
1
+ # Conversion
2
+
3
+ ## V1 → V2
4
+
5
+ ```python
6
+ from samplesheet_parser import SampleSheetConverter
7
+
8
+ converter = SampleSheetConverter("SampleSheet_v1.csv")
9
+ out = converter.to_v2("SampleSheet_v2.csv")
10
+
11
+ print(out) # Path("SampleSheet_v2.csv")
12
+ print(converter.source_version) # SampleSheetVersion.V1
13
+ ```
14
+
15
+ The converter maps IEM V1 fields to BCLConvert V2 equivalents:
16
+
17
+ | V1 field | V2 field |
18
+ |---|---|
19
+ | `IEMFileVersion` | `FileFormatVersion: 2` |
20
+ | `[Data]` section | `[BCLConvert_Data]` section |
21
+ | `Sample_ID` | `Sample_ID` |
22
+ | `index` | `Index` |
23
+ | `index2` | `Index2` |
24
+ | `[Reads]` lengths | `Read1Cycles` / `Read2Cycles` in `[Reads]` |
25
+ | `Adapter` in `[Settings]` | `AdapterRead1` in `[BCLConvert_Settings]` |
26
+
27
+ ## V2 → V1 (lossy)
28
+
29
+ ```python
30
+ converter = SampleSheetConverter("SampleSheet_v2.csv")
31
+ out = converter.to_v1("SampleSheet_v1.csv")
32
+ ```
33
+
34
+ !!! warning "Lossy conversion"
35
+ V2-only fields are dropped during V2 → V1 conversion:
36
+
37
+ - `OverrideCycles`
38
+ - `FileFormatVersion` (replaced by `IEMFileVersion`)
39
+ - `SoftwareVersion` and other `[BCLConvert_Settings]` keys with no V1 equivalent
40
+ - `[Cloud_Data]` / `[Cloud_Settings]` sections
41
+
42
+ A warning is logged for each dropped field.
43
+
44
+ !!! info "Instrument is preserved"
45
+ `InstrumentPlatform` and `InstrumentType` are **not** dropped —
46
+ their value is written to the V1 `[Header]` as `Instrument Type`
47
+ so the workflow signal survives a round trip. The original V2
48
+ header key itself is not kept (V1 uses a different key name).
49
+
50
+ ## Round-trip
51
+
52
+ ```python
53
+ converter = SampleSheetConverter("SampleSheet_v1.csv")
54
+ converter.to_v2("temp_v2.csv")
55
+
56
+ converter2 = SampleSheetConverter("temp_v2.csv")
57
+ converter2.to_v1("roundtrip_v1.csv")
58
+ ```
59
+
60
+ Sample IDs survive a V1 → V2 → V1 round-trip. V2-only fields do not survive a V2 → V1 → V2 round-trip.
61
+
62
+ ## Index 2 (i5) orientation
63
+
64
+ `bcl2fastq` and `BCLConvert` disagree on the orientation of `Index2`
65
+ (i5) for some instruments. Conversion handles this automatically when
66
+ the source sheet declares an instrument; for ambiguous cases pass
67
+ `workflow=` (Python) or `--workflow` (CLI).
68
+
69
+ ### Workflow split
70
+
71
+ | Workflow | i5 on the chip | Instruments |
72
+ |---|---|---|
73
+ | **A** (i5 forward) | as written | MiSeq, HiSeq 2000, HiSeq 2500, NovaSeq 6000 (v1.0 chemistry) |
74
+ | **B** (i5 RC'd on chip) | reverse-complemented | NovaSeq X / X Plus, NextSeq 500/550/1000/2000, iSeq 100, MiniSeq, HiSeq 3000/4000, NovaSeq 6000 (v1.5 chemistry) |
75
+
76
+ - **Workflow A** — both demultiplexers expect i5 in the forward
77
+ orientation, so V1 ↔ V2 conversion leaves `Index2` unchanged.
78
+ - **Workflow B** — `bcl2fastq` (V1) records i5 reverse-complemented as
79
+ it was read; `BCLConvert` (V2) always expects the forward orientation.
80
+ The converter reverse-complements `Index2` in both directions so the
81
+ output is correct for the target demultiplexer.
82
+
83
+ ### Auto-detection
84
+
85
+ The workflow is auto-detected from:
86
+
87
+ - V1 `[Header]` → `Instrument Type` (e.g. `NovaSeq X Plus`)
88
+ - V2 `[Header]` → `InstrumentPlatform` (e.g. `NovaSeqXSeries`),
89
+ falling back to `InstrumentType`
90
+
91
+ ```python
92
+ # V1 sheet declares "Instrument Type,NovaSeq X Plus"
93
+ # → workflow B detected; Index2 is reverse-complemented in the V2 output
94
+ SampleSheetConverter("novaseq_xplus.v1.csv").to_v2("novaseq_xplus.v2.csv")
95
+ ```
96
+
97
+ V2 → V1 conversion preserves the instrument as `Instrument Type` in the
98
+ V1 `[Header]`, so a V1 → V2 → V1 round-trip restores the original
99
+ `Index2` exactly.
100
+
101
+ ### Explicit override
102
+
103
+ Pass `workflow="a"` or `workflow="b"` to skip auto-detection. This is
104
+ **required** for `NovaSeq 6000`, whose i5 orientation depends on
105
+ chemistry (v1.0 = workflow A, v1.5 = workflow B) and cannot be inferred
106
+ from the instrument name alone.
107
+
108
+ ```python
109
+ # NovaSeq 6000 with v1.5 chemistry → workflow B
110
+ SampleSheetConverter("novaseq6000.csv", workflow="b").to_v2("out.csv")
111
+ ```
112
+
113
+ CLI:
114
+
115
+ ```bash
116
+ samplesheet convert novaseq6000.v1.csv --to v2 --workflow b --output out.csv
117
+ ```
118
+
119
+ ### Failure mode
120
+
121
+ If the sheet has a non-empty `Index2` column **and** the workflow
122
+ cannot be determined **and** no override is given, conversion fails
123
+ loudly:
124
+
125
+ ```text
126
+ V1 → V2: cannot determine i5 orientation workflow for instrument <missing>.
127
+ The sheet has dual indexes, and workflow-A vs workflow-B instruments
128
+ record Index2 in opposite orientations. Pass workflow='a' or
129
+ workflow='b' explicitly (CLI: --workflow {a,b}).
130
+ ```
131
+
132
+ This is intentional — silently passing i5 through would produce a V2
133
+ sheet that runs but quietly misassigns reads. Single-index sheets and
134
+ sheets whose `Index2` column is entirely empty are unaffected.
@@ -17,14 +17,11 @@ pip install "samplesheet-parser[cli]"
17
17
 
18
18
  ## conda / Bioconda
19
19
 
20
- !!! note "Bioconda package pending"
21
- The Bioconda recipe has been submitted and is awaiting review. Once merged, install with:
22
-
23
- ```bash
24
- conda install -c bioconda samplesheet-parser
25
- ```
20
+ ```bash
21
+ conda install -c bioconda samplesheet-parser
22
+ ```
26
23
 
27
- The Bioconda package includes the `samplesheet` CLI by default.
24
+ The Bioconda package includes the `samplesheet` CLI by default.
28
25
 
29
26
  ## Development install
30
27
 
@@ -52,7 +52,10 @@ print("=" * 60)
52
52
  src_v1 = SHEETS / "v1_dual_index.csv"
53
53
  out_v2 = OUT / "converted_v1_to_v2.csv"
54
54
 
55
- converter = SampleSheetConverter(str(src_v1))
55
+ # v1_dual_index.csv declares Instrument Type=NovaSeq 6000, whose i5
56
+ # orientation depends on chemistry (v1.0 = workflow A, v1.5 = workflow B).
57
+ # Pass an explicit workflow so the converter doesn't have to guess.
58
+ converter = SampleSheetConverter(str(src_v1), workflow="a")
56
59
  result_path = converter.to_v2(str(out_v2))
57
60
 
58
61
  print(f" Input : {src_v1.name} ({converter.source_version.value})")
@@ -93,8 +96,8 @@ print("=" * 60)
93
96
  tmp_v2 = OUT / "roundtrip_v2.csv"
94
97
  tmp_v1 = OUT / "roundtrip_v1.csv"
95
98
 
96
- SampleSheetConverter(str(src_v1)).to_v2(str(tmp_v2))
97
- SampleSheetConverter(str(tmp_v2)).to_v1(str(tmp_v1))
99
+ SampleSheetConverter(str(src_v1), workflow="a").to_v2(str(tmp_v2))
100
+ SampleSheetConverter(str(tmp_v2), workflow="a").to_v1(str(tmp_v1))
98
101
 
99
102
  factory_orig = SampleSheetFactory()
100
103
  sheet_orig = factory_orig.create_parser(src_v1, parse=True)
@@ -3,4 +3,4 @@ channels:
3
3
  - bioconda
4
4
  - defaults
5
5
  dependencies:
6
- - bioconda::samplesheet-parser=1.1.0
6
+ - bioconda::samplesheet-parser=1.2.0
@@ -4,8 +4,8 @@ process SAMPLESHEETPARSER_CONVERT {
4
4
 
5
5
  conda "${moduleDir}/environment.yml"
6
6
  container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7
- 'https://depot.galaxyproject.org/singularity/samplesheet-parser:1.1.0--pyhdfd78af_0' :
8
- 'biocontainers/samplesheet-parser:1.1.0--pyhdfd78af_0' }"
7
+ 'https://depot.galaxyproject.org/singularity/samplesheet-parser:1.2.0--pyhdfd78af_0' :
8
+ 'biocontainers/samplesheet-parser:1.2.0--pyhdfd78af_0' }"
9
9
 
10
10
  input:
11
11
  tuple val(meta), path(samplesheet)
@@ -3,4 +3,4 @@ channels:
3
3
  - bioconda
4
4
  - defaults
5
5
  dependencies:
6
- - bioconda::samplesheet-parser=1.1.0
6
+ - bioconda::samplesheet-parser=1.2.0
@@ -0,0 +1,45 @@
1
+ process SAMPLESHEETPARSER_DIFF {
2
+ tag "$meta.id"
3
+ label 'process_single'
4
+
5
+ conda "${moduleDir}/environment.yml"
6
+ container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7
+ 'https://depot.galaxyproject.org/singularity/samplesheet-parser:1.2.0--pyhdfd78af_0' :
8
+ 'biocontainers/samplesheet-parser:1.2.0--pyhdfd78af_0' }"
9
+
10
+ input:
11
+ tuple val(meta), path(old_sheet), path(new_sheet)
12
+
13
+ output:
14
+ tuple val(meta), path("*.diff.json"), emit: json
15
+ path "versions.yml", emit: versions
16
+
17
+ when:
18
+ task.ext.when == null || task.ext.when
19
+
20
+ script:
21
+ def args = task.ext.args ?: ''
22
+ def prefix = task.ext.prefix ?: "${meta.id}"
23
+ """
24
+ samplesheet diff \\
25
+ --format json \\
26
+ ${args} \\
27
+ ${old_sheet} ${new_sheet} > ${prefix}.diff.json || true
28
+
29
+ cat <<-END_VERSIONS > versions.yml
30
+ "${task.process}":
31
+ samplesheet-parser: \$(samplesheet --version | sed 's/samplesheet-parser //')
32
+ END_VERSIONS
33
+ """
34
+
35
+ stub:
36
+ def prefix = task.ext.prefix ?: "${meta.id}"
37
+ """
38
+ echo '{"has_changes": false, "header_changes": [], "samples_added": [], "samples_removed": [], "sample_changes": []}' > ${prefix}.diff.json
39
+
40
+ cat <<-END_VERSIONS > versions.yml
41
+ "${task.process}":
42
+ samplesheet-parser: \$(samplesheet --version | sed 's/samplesheet-parser //')
43
+ END_VERSIONS
44
+ """
45
+ }
@@ -0,0 +1,69 @@
1
+ name: samplesheetparser_diff
2
+ description: |
3
+ Compare two Illumina SampleSheet.csv files (any combination of V1 and V2)
4
+ and emit a structured JSON diff covering header changes, added/removed
5
+ samples, and per-sample field changes. Exits 0 if identical, 1 if
6
+ differences are detected — useful as a CI pre-run guard.
7
+ keywords:
8
+ - illumina
9
+ - samplesheet
10
+ - diff
11
+ - comparison
12
+ - bclconvert
13
+ - bcl2fastq
14
+ - genomics
15
+
16
+ tools:
17
+ - samplesheet-parser:
18
+ description: >
19
+ Format-agnostic parser for Illumina SampleSheet.csv files.
20
+ Supports IEM V1 (bcl2fastq) and BCLConvert V2 with auto-detection,
21
+ bidirectional conversion, index validation, and Hamming distance checking.
22
+ homepage: https://github.com/chaitanyakasaraneni/samplesheet-parser
23
+ documentation: https://illumina-samplesheet.readthedocs.io
24
+ tool_dev_url: https://github.com/chaitanyakasaraneni/samplesheet-parser
25
+ doi: "10.5281/zenodo.18989694"
26
+ licence: ["Apache-2.0"]
27
+ identifier: biotools:samplesheet-parser
28
+
29
+ input:
30
+ - - meta:
31
+ type: map
32
+ description: |
33
+ Groovy Map containing sample information.
34
+ Use [ id:'run_id' ] to identify the sheet pair.
35
+ - old_sheet:
36
+ type: file
37
+ description: Original (reference) SampleSheet.csv (V1 or V2)
38
+ pattern: "*.{csv,CSV}"
39
+ ontologies:
40
+ - edam: "http://edamontology.org/format_3752"
41
+ - new_sheet:
42
+ type: file
43
+ description: Updated SampleSheet.csv to compare against the original (V1 or V2)
44
+ pattern: "*.{csv,CSV}"
45
+ ontologies:
46
+ - edam: "http://edamontology.org/format_3752"
47
+
48
+ output:
49
+ - json:
50
+ - meta:
51
+ type: map
52
+ description: Groovy Map containing sample information
53
+ - "*.diff.json":
54
+ type: file
55
+ description: |
56
+ Structured JSON diff report with has_changes, source_version,
57
+ target_version, header_changes, samples_added, samples_removed,
58
+ and sample_changes fields.
59
+ pattern: "*.diff.json"
60
+ - versions:
61
+ - "versions.yml":
62
+ type: file
63
+ description: File containing software versions
64
+ pattern: "versions.yml"
65
+
66
+ authors:
67
+ - "@chaitanyakasaraneni"
68
+ maintainers:
69
+ - "@chaitanyakasaraneni"
@@ -0,0 +1,79 @@
1
+ nextflow_process {
2
+
3
+ name "Test Process SAMPLESHEETPARSER_DIFF"
4
+ script "../main.nf"
5
+ process "SAMPLESHEETPARSER_DIFF"
6
+
7
+ tag "samplesheetparser"
8
+ tag "samplesheetparser_diff"
9
+ tag "modules"
10
+ tag "modules_nfcore"
11
+
12
+ test("V1 vs V1 - identical sheets") {
13
+
14
+ when {
15
+ process {
16
+ """
17
+ input[0] = [
18
+ [ id: 'test_identical' ],
19
+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true),
20
+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true)
21
+ ]
22
+ """
23
+ }
24
+ }
25
+
26
+ then {
27
+ assertAll(
28
+ { assert process.success },
29
+ { assert snapshot(process.out).match() }
30
+ )
31
+ }
32
+ }
33
+
34
+ test("V1 vs V2 - cross-format diff") {
35
+
36
+ when {
37
+ process {
38
+ """
39
+ input[0] = [
40
+ [ id: 'test_cross_format' ],
41
+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true),
42
+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v2.csv', checkIfExists: true)
43
+ ]
44
+ """
45
+ }
46
+ }
47
+
48
+ then {
49
+ assertAll(
50
+ { assert process.success },
51
+ { assert snapshot(process.out).match() }
52
+ )
53
+ }
54
+ }
55
+
56
+ test("V1 vs V1 - identical sheets - stub") {
57
+
58
+ options "-stub"
59
+
60
+ when {
61
+ process {
62
+ """
63
+ input[0] = [
64
+ [ id: 'test_stub' ],
65
+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true),
66
+ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true)
67
+ ]
68
+ """
69
+ }
70
+ }
71
+
72
+ then {
73
+ assertAll(
74
+ { assert process.success },
75
+ { assert snapshot(process.out).match() }
76
+ )
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,4 @@
1
+ samplesheetparser:
2
+ - modules/nf-core/samplesheetparser/**
3
+ samplesheetparser_diff:
4
+ - modules/nf-core/samplesheetparser/diff/**
@@ -3,4 +3,4 @@ channels:
3
3
  - bioconda
4
4
  - defaults
5
5
  dependencies:
6
- - bioconda::samplesheet-parser=1.1.0
6
+ - bioconda::samplesheet-parser=1.2.0
@@ -0,0 +1,48 @@
1
+ process SAMPLESHEETPARSER_FILTER {
2
+ tag "$meta.id"
3
+ label 'process_single'
4
+
5
+ conda "${moduleDir}/environment.yml"
6
+ container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7
+ 'https://depot.galaxyproject.org/singularity/samplesheet-parser:1.2.0--pyhdfd78af_0' :
8
+ 'biocontainers/samplesheet-parser:1.2.0--pyhdfd78af_0' }"
9
+
10
+ input:
11
+ tuple val(meta), path(samplesheet)
12
+
13
+ output:
14
+ tuple val(meta), path("*.filtered.csv"), emit: samplesheet, optional: true
15
+ tuple val(meta), path("*.filter.json"), emit: json
16
+ path "versions.yml", emit: versions
17
+
18
+ when:
19
+ task.ext.when == null || task.ext.when
20
+
21
+ script:
22
+ def args = task.ext.args ?: ''
23
+ def prefix = task.ext.prefix ?: "${meta.id}"
24
+ """
25
+ samplesheet filter \\
26
+ --output ${prefix}.filtered.csv \\
27
+ --format json \\
28
+ ${args} \\
29
+ ${samplesheet} > ${prefix}.filter.json || true
30
+
31
+ cat <<-END_VERSIONS > versions.yml
32
+ "${task.process}":
33
+ samplesheet-parser: \$(samplesheet --version | sed 's/samplesheet-parser //')
34
+ END_VERSIONS
35
+ """
36
+
37
+ stub:
38
+ def prefix = task.ext.prefix ?: "${meta.id}"
39
+ """
40
+ touch ${prefix}.filtered.csv
41
+ echo '{"matched_count": 0, "total_count": 0, "output_path": null, "criteria": {}}' > ${prefix}.filter.json
42
+
43
+ cat <<-END_VERSIONS > versions.yml
44
+ "${task.process}":
45
+ samplesheet-parser: \$(samplesheet --version | sed 's/samplesheet-parser //')
46
+ END_VERSIONS
47
+ """
48
+ }