samplesheet-parser 1.3.0__tar.gz → 2.0.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 (151) hide show
  1. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/.zenodo.json +1 -1
  2. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/CHANGELOG.md +61 -0
  3. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/CITATION.cff +2 -2
  4. samplesheet_parser-2.0.0/Makefile +81 -0
  5. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/PKG-INFO +31 -7
  6. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/README.md +26 -4
  7. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/parsing.md +31 -2
  8. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/index.md +1 -1
  9. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/installation.md +2 -2
  10. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/convert/environment.yml +1 -1
  11. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/convert/main.nf +4 -14
  12. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/convert/meta.yml +31 -15
  13. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/convert/tests/main.nf.test +10 -10
  14. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/diff/environment.yml +1 -1
  15. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/diff/main.nf +34 -0
  16. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/diff/meta.yml +28 -13
  17. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/diff/tests/main.nf.test +10 -10
  18. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/diff/tests/main.nf.test.snap +80 -0
  19. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/filter/environment.yml +1 -1
  20. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/filter/main.nf +5 -15
  21. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/filter/meta.yml +32 -15
  22. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/filter/tests/main.nf.test +5 -5
  23. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/info/environment.yml +1 -1
  24. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/info/main.nf +34 -0
  25. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/info/meta.yml +28 -13
  26. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/info/tests/main.nf.test +7 -7
  27. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/info/tests/main.nf.test.snap +80 -0
  28. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/merge/environment.yml +6 -0
  29. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/merge/main.nf +5 -15
  30. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/merge/meta.yml +32 -15
  31. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/merge/tests/main.nf.test +10 -10
  32. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/split/environment.yml +6 -0
  33. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/split/main.nf +5 -15
  34. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/split/meta.yml +32 -15
  35. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/split/tests/main.nf.test +7 -7
  36. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/validate/environment.yml +6 -0
  37. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/validate/main.nf +34 -0
  38. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/validate/meta.yml +28 -13
  39. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/validate/tests/main.nf.test +7 -7
  40. samplesheet_parser-2.0.0/modules/nf-core/samplesheetparser/validate/tests/main.nf.test.snap +80 -0
  41. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/pyproject.toml +15 -8
  42. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/__init__.py +4 -1
  43. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/converter.py +8 -3
  44. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/diff.py +44 -43
  45. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/enums.py +19 -15
  46. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/factory.py +75 -11
  47. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/filter.py +3 -2
  48. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/instruments.py +35 -4
  49. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/merger.py +5 -4
  50. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/parsers/v1.py +89 -93
  51. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/parsers/v2.py +178 -137
  52. samplesheet_parser-2.0.0/samplesheet_parser/protocol.py +102 -0
  53. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/splitter.py +3 -2
  54. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/validators.py +35 -28
  55. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/writer.py +6 -4
  56. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_parsers/test_v1.py +16 -19
  57. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_parsers/test_v2.py +20 -20
  58. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_validators/test_hamming.py +155 -70
  59. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/convert/tests/tags.yml +0 -4
  60. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/main.nf +0 -45
  61. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/tests/tags.yml +0 -4
  62. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/tags.yml +0 -4
  63. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/info/main.nf +0 -45
  64. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/info/tests/tags.yml +0 -4
  65. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/environment.yml +0 -6
  66. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/tests/tags.yml +0 -4
  67. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/environment.yml +0 -6
  68. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/tests/tags.yml +0 -4
  69. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/validate/environment.yml +0 -6
  70. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/validate/main.nf +0 -45
  71. samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/validate/tests/tags.yml +0 -4
  72. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/.github/workflows/ci.yml +0 -0
  73. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/.github/workflows/copilot-instructions.md +0 -0
  74. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/.gitignore +0 -0
  75. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/.pre-commit-config.yaml +0 -0
  76. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/.readthedocs.yaml +0 -0
  77. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/CONTRIBUTING.md +0 -0
  78. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/LICENSE +0 -0
  79. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/api.md +0 -0
  80. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/changelog.md +0 -0
  81. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/ci.md +0 -0
  82. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/cli.md +0 -0
  83. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/contributing.md +0 -0
  84. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/examples.md +0 -0
  85. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/conversion.md +0 -0
  86. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/diffing.md +0 -0
  87. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/filtering.md +0 -0
  88. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/index_utils.md +0 -0
  89. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/merging.md +0 -0
  90. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/quickstart.md +0 -0
  91. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/splitting.md +0 -0
  92. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/validation.md +0 -0
  93. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/guide/writing.md +0 -0
  94. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/docs/requirements.txt +0 -0
  95. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_converter.py +0 -0
  96. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_diff.py +0 -0
  97. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_filter.py +0 -0
  98. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_index_utils.py +0 -0
  99. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_merger.py +0 -0
  100. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_splitter.py +0 -0
  101. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/demo_writer.py +0 -0
  102. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/parse_examples.py +0 -0
  103. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/ProjectAlpha_SampleSheet.csv +0 -0
  104. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/ProjectBeta_SampleSheet.csv +0 -0
  105. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/ProjectDelta_SampleSheet_collision.csv +0 -0
  106. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/ProjectGamma_SampleSheet.csv +0 -0
  107. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/README.md +0 -0
  108. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/combined_clean.csv +0 -0
  109. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/combined_collision_forced.csv +0 -0
  110. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/combined_mixed_formats.csv +0 -0
  111. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v1_dual_index.csv +0 -0
  112. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v1_multi_lane.csv +0 -0
  113. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v1_single_index.csv +0 -0
  114. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v1_with_lab_qc_settings.csv +0 -0
  115. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v1_with_manifests.csv +0 -0
  116. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v2_nextseq_single_index.csv +0 -0
  117. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v2_novaseq_x_dual_index.csv +0 -0
  118. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v2_with_cloud_settings.csv +0 -0
  119. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v2_with_index_umi.csv +0 -0
  120. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v2_with_pipeline_settings.csv +0 -0
  121. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/examples/sample_sheets/v2_with_read_umi.csv +0 -0
  122. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/images/samplesheet_parser_arch_v03.png +0 -0
  123. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/images/samplesheet_parser_overview.png +0 -0
  124. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/mkdocs.yml +0 -0
  125. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/modules/nf-core/samplesheetparser/filter/tests/nextflow.config +0 -0
  126. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/recipes/meta.yaml +0 -0
  127. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/cli.py +0 -0
  128. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/index_utils.py +0 -0
  129. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/parsers/__init__.py +0 -0
  130. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/samplesheet_parser/py.typed +0 -0
  131. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/scripts/demo_converter.py +0 -0
  132. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/scripts/demo_diff.py +0 -0
  133. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/scripts/demo_writer.py +0 -0
  134. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/__init__.py +0 -0
  135. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/conftest.py +0 -0
  136. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/fixtures/SampleSheet_v1_dual_index.csv +0 -0
  137. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/fixtures/SampleSheet_v2_dual_index.csv +0 -0
  138. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/fixtures/SampleSheet_v2_modified.csv +0 -0
  139. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_cli.py +0 -0
  140. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_converter.py +0 -0
  141. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_diff.py +0 -0
  142. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_factory.py +0 -0
  143. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_filter.py +0 -0
  144. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_index_utils.py +0 -0
  145. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_instruments.py +0 -0
  146. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_merger.py +0 -0
  147. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_parsers/__init__.py +0 -0
  148. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_splitter.py +0 -0
  149. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_validators/__init__.py +0 -0
  150. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_validators/test_validators.py +0 -0
  151. {samplesheet_parser-1.3.0 → samplesheet_parser-2.0.0}/tests/test_writer.py +0 -0
@@ -4,7 +4,7 @@
4
4
  "upload_type": "software",
5
5
  "access_right": "open",
6
6
  "license": "Apache-2.0",
7
- "version": "1.1.0",
7
+ "version": "2.0.0",
8
8
  "keywords": [
9
9
  "bioinformatics", "Illumina", "SampleSheet", "BCLConvert",
10
10
  "demultiplexing", "genomics", "sequencing", "Python"
@@ -8,6 +8,67 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ _No unreleased changes._
12
+
13
+ ---
14
+
15
+ ## [2.0.0] - 2026-06-06
16
+
17
+ ### Breaking changes
18
+
19
+ - **Python 3.10+ required** (was 3.12+). The `str, Enum` mixin replaces
20
+ `StrEnum` throughout `enums.py` and `instruments.py`, giving identical
21
+ behaviour on all supported versions.
22
+ - **`loguru` dependency removed.** The library now uses `logging.getLogger(__name__)`
23
+ in every module. Host applications retain full control of log configuration.
24
+ If you previously relied on `loguru` sinks seeing library log output, wire up
25
+ a standard `logging` handler instead.
26
+ - **`clean()` now returns the cleaned content as a `str` and never writes to
27
+ disk.** Previously `SampleSheetV1.clean()` and `SampleSheetV2.clean()` wrote
28
+ to the source file and created a `.backup` alongside it. The source file is
29
+ now untouched; the cleaned string is passed in-memory to `read()`. Callers
30
+ that relied on the side-effect (file written, `.backup` created) must adapt.
31
+ - **`samples()` deduplication key changed from `sample_id` to `(sample_id, lane)`.**
32
+ Multi-lane sheets where the same sample appears in multiple lanes now return
33
+ one record *per lane* rather than silently dropping all but the first row.
34
+ - **`SampleSheetFactory.create_parser()` return type is now `SampleSheetParser`**
35
+ (the new Protocol) rather than `SampleSheetV1 | SampleSheetV2`. Both concrete
36
+ types structurally satisfy the Protocol; the change only affects code with
37
+ explicit type annotations on the return value.
38
+ - **`_hamming_distance` renamed to `hamming_distance`** (underscore removed).
39
+ Import path: `from samplesheet_parser import hamming_distance` or
40
+ `from samplesheet_parser.validators import hamming_distance`.
41
+
42
+ ### Fixed
43
+
44
+ - **V2 `parse_data()` no longer silently drops keys with empty-string values.**
45
+ The `{k: v for k, v in ... if v}` filter was removing keys whose value was
46
+ `""`, making V2 record dicts structurally inconsistent with V1. All keys are
47
+ now preserved; values are stripped of surrounding whitespace only.
48
+ - **`converter.to_v1()` bare `assert` replaced with explicit `TypeError`.**
49
+ `assert isinstance(sheet, SampleSheetV2)` is stripped by `python -O`; the
50
+ guard now raises `TypeError` unconditionally when the wrong type is passed.
51
+
52
+ ### Added
53
+
54
+ - **`SampleSheetParser` Protocol** (`samplesheet_parser.protocol`) — a
55
+ `runtime_checkable` structural protocol satisfied by both `SampleSheetV1`
56
+ and `SampleSheetV2`. Third-party parsers that implement the same interface
57
+ can be registered with the factory without inheriting from any base class.
58
+ `isinstance(sheet, SampleSheetParser)` works at runtime.
59
+ - **`SampleSheetFactory.register(detector, parser_class, version)`** — class
60
+ method that registers a custom format detector. Registered detectors are
61
+ tried before the built-in V1/V2 detection in LIFO order. Useful for
62
+ supporting hypothetical V3 formats or vendor-specific variants.
63
+ - **`SampleSheetFactory.clear_registry()`** — removes all custom registrations.
64
+ Intended for use in tests to prevent cross-test contamination.
65
+ - **`detect_workflow()` accepts `extra_a` / `extra_b` keyword arguments** —
66
+ caller-supplied `frozenset[str]` of instrument names checked before the
67
+ built-in tables. Allows narrowing workflow classification without subclassing.
68
+ - **`hamming_distance` is now a public export** — available as
69
+ `from samplesheet_parser import hamming_distance` and documented in the API
70
+ reference.
71
+
11
72
  ---
12
73
 
13
74
  ## [1.3.0] - 2026-05-20
@@ -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.3.0
12
- date-released: 2026-05-20
11
+ version: 2.0.0
12
+ date-released: 2026-06-06
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"
@@ -0,0 +1,81 @@
1
+ # Makefile for samplesheet-parser
2
+ # Keeps the version in sync across pyproject.toml, CITATION.cff, and .zenodo.json.
3
+ # Portable to GNU Make 3.81 (macOS default) — recipes are single POSIX-sh lines.
4
+
5
+ PKG := samplesheet_parser
6
+ PYPROJECT := pyproject.toml
7
+ CITATION := CITATION.cff
8
+ ZENODO := .zenodo.json
9
+ CHANGELOG := CHANGELOG.md
10
+
11
+ CURRENT_VERSION := $(shell sed -n -E 's/^version = "([0-9]+\.[0-9]+\.[0-9]+)".*/\1/p' $(PYPROJECT) | head -1)
12
+
13
+ .DEFAULT_GOAL := help
14
+ .PHONY: help version major minor patch tag test lint build clean
15
+
16
+ help:
17
+ @echo "samplesheet-parser — current version: $(CURRENT_VERSION)"
18
+ @echo ""
19
+ @echo "Version bumping (syncs $(PYPROJECT), $(CITATION), $(ZENODO); rolls $(CHANGELOG)):"
20
+ @echo " make patch patch bump (x.y.Z)"
21
+ @echo " make minor minor bump (x.Y.0)"
22
+ @echo " make major major bump (X.0.0)"
23
+ @echo ""
24
+ @echo "Other targets:"
25
+ @echo " make version print the current version"
26
+ @echo " make tag create git tag v$(CURRENT_VERSION)"
27
+ @echo " make test run pytest"
28
+ @echo " make lint run ruff"
29
+ @echo " make build build sdist + wheel"
30
+ @echo " make clean remove build artifacts"
31
+
32
+ version:
33
+ @echo $(CURRENT_VERSION)
34
+
35
+ patch minor major:
36
+ @$(MAKE) --no-print-directory _bump PART=$@
37
+
38
+ # internal: bump the version part named by PART across all files (one shell line)
39
+ _bump:
40
+ @cur="$(CURRENT_VERSION)"; \
41
+ [ -n "$$cur" ] || { echo "error: could not read version from $(PYPROJECT)"; exit 1; }; \
42
+ MA=$${cur%%.*}; rest=$${cur#*.}; MI=$${rest%%.*}; PA=$${rest##*.}; \
43
+ case "$(PART)" in \
44
+ major) MA=$$((MA + 1)); MI=0; PA=0 ;; \
45
+ minor) MI=$$((MI + 1)); PA=0 ;; \
46
+ patch) PA=$$((PA + 1)) ;; \
47
+ *) echo "error: unknown bump part '$(PART)'"; exit 1 ;; \
48
+ esac; \
49
+ new="$$MA.$$MI.$$PA"; today="$$(date +%F)"; \
50
+ sed -E 's/^version = "[0-9]+\.[0-9]+\.[0-9]+"/version = "'"$$new"'"/' $(PYPROJECT) > $(PYPROJECT).tmp && mv $(PYPROJECT).tmp $(PYPROJECT); \
51
+ sed -E -e 's/^version: .*/version: '"$$new"'/' -e 's/^date-released: .*/date-released: '"$$today"'/' $(CITATION) > $(CITATION).tmp && mv $(CITATION).tmp $(CITATION); \
52
+ sed -E 's/("version": )"[0-9]+\.[0-9]+\.[0-9]+"/\1"'"$$new"'"/' $(ZENODO) > $(ZENODO).tmp && mv $(ZENODO).tmp $(ZENODO); \
53
+ cl_note=""; \
54
+ if [ -f $(CHANGELOG) ] && grep -q '^## \[Unreleased\]' $(CHANGELOG); then \
55
+ awk -v v="$$new" -v d="$$today" '!done && /^## \[Unreleased\]/ {print "## [Unreleased]"; print ""; print "_No unreleased changes._"; print ""; print "## [" v "] - " d; done=1; next} {print}' $(CHANGELOG) > $(CHANGELOG).tmp && mv $(CHANGELOG).tmp $(CHANGELOG); \
56
+ cl_note=", $(CHANGELOG)"; \
57
+ else \
58
+ cl_note=" (warning: no [Unreleased] section in $(CHANGELOG) — not rolled)"; \
59
+ fi; \
60
+ echo "Bumped $$cur -> $$new (date-released: $$today)"; \
61
+ echo " updated: $(PYPROJECT), $(CITATION), $(ZENODO)$$cl_note"; \
62
+ echo "Next: review $(CHANGELOG), then: git commit -am \"release v$$new\" && make tag && git push --follow-tags"
63
+
64
+ tag:
65
+ @v="$(CURRENT_VERSION)"; \
66
+ if git rev-parse "v$$v" >/dev/null 2>&1; then echo "tag v$$v already exists"; exit 1; fi; \
67
+ git tag -a "v$$v" -m "Release v$$v"; \
68
+ echo "created annotated tag v$$v (push with: git push --follow-tags)"
69
+
70
+ test:
71
+ @pytest
72
+
73
+ lint:
74
+ @ruff check $(PKG)/
75
+
76
+ build:
77
+ @python3 -m hatchling build
78
+
79
+ clean:
80
+ @rm -rf dist build *.egg-info
81
+ @find . -type d -name __pycache__ -prune -exec rm -rf {} +
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: samplesheet-parser
3
- Version: 1.3.0
3
+ Version: 2.0.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
@@ -33,11 +33,13 @@ Classifier: Intended Audience :: Developers
33
33
  Classifier: Intended Audience :: Science/Research
34
34
  Classifier: License :: OSI Approved :: Apache Software License
35
35
  Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
36
38
  Classifier: Programming Language :: Python :: 3.12
39
+ Classifier: Programming Language :: Python :: 3.13
37
40
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
38
41
  Classifier: Typing :: Typed
39
- Requires-Python: >=3.12
40
- Requires-Dist: loguru>=0.7
42
+ Requires-Python: >=3.10
41
43
  Provides-Extra: cli
42
44
  Requires-Dist: typer>=0.12; extra == 'cli'
43
45
  Provides-Extra: dev
@@ -59,7 +61,7 @@ Description-Content-Type: text/markdown
59
61
  Supports both the classic IEM V1 format (bcl2fastq era) and the modern BCLConvert V2 format (NovaSeq X series) — with automatic format detection, bidirectional conversion, index validation, Hamming distance checking, diff comparison, multi-sheet merging, programmatic sheet creation, and a full-featured CLI.
60
62
 
61
63
  [![PyPI version](https://img.shields.io/pypi/v/samplesheet-parser.svg)](https://pypi.org/project/samplesheet-parser/)
62
- [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
64
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
63
65
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-yellow.svg)](https://opensource.org/licenses/Apache-2.0)
64
66
  [![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
67
 
@@ -94,7 +96,7 @@ pip install samplesheet-parser
94
96
  pip install "samplesheet-parser[cli]"
95
97
  ```
96
98
 
97
- Requires Python 3.12+. No mandatory runtime dependencies beyond `loguru`.
99
+ Requires Python 3.10+. No mandatory runtime dependencies.
98
100
 
99
101
  ---
100
102
 
@@ -464,10 +466,21 @@ sheet.get_read_structure() # → ReadStructure dataclass
464
466
 
465
467
  | Method / attribute | Returns | Description |
466
468
  |---|---|---|
467
- | `create_parser(path, *, clean, experiment_id, parse)` | `SampleSheetV1 \| SampleSheetV2` | Auto-detect format and return appropriate parser |
469
+ | `create_parser(path, *, clean, experiment_id, parse)` | `SampleSheetParser` | Auto-detect format and return appropriate parser |
470
+ | `register(detector, parser_class, version)` | `None` | Register a custom format detector (class method, LIFO) |
471
+ | `clear_registry()` | `None` | Remove all custom registrations (class method) |
468
472
  | `get_umi_length()` | `int` | UMI length from the current parser |
469
473
  | `.version` | `SampleSheetVersion` | Detected format version |
470
474
 
475
+ ### `SampleSheetParser` (Protocol)
476
+
477
+ A `runtime_checkable` structural protocol satisfied by both `SampleSheetV1` and `SampleSheetV2`. Third-party parsers that implement the same methods and attributes can be registered with `SampleSheetFactory.register()` without inheriting from any base class.
478
+
479
+ ```python
480
+ from samplesheet_parser import SampleSheetParser, SampleSheetV1
481
+ assert isinstance(SampleSheetV1("sheet.csv"), SampleSheetParser)
482
+ ```
483
+
471
484
  ### `SampleSheetV1` / `SampleSheetV2` (shared interface)
472
485
 
473
486
  | Method / attribute | Returns | Description |
@@ -498,6 +511,17 @@ sheet.get_read_structure() # → ReadStructure dataclass
498
511
  | `validate(sheet)` | `ValidationResult` | Run all checks; returns structured result |
499
512
  | `_check_index_distances(samples, result, min_distance=3)` | `None` | Hamming distance check (callable directly for custom thresholds) |
500
513
 
514
+ ### `hamming_distance`
515
+
516
+ ```python
517
+ from samplesheet_parser import hamming_distance
518
+
519
+ hamming_distance("ATTACTCG", "ATTACTCA") # → 1
520
+ hamming_distance("ATTACTCG", "GCTAGCTA") # → 6
521
+ ```
522
+
523
+ Public helper for computing the Hamming distance between two index sequences. Sequences of unequal length are compared up to the shorter length.
524
+
501
525
  ### `SampleSheetWriter`
502
526
 
503
527
  | Method / attribute | Returns | Description |
@@ -593,7 +617,7 @@ jobs:
593
617
 
594
618
  - uses: actions/setup-python@v5
595
619
  with:
596
- python-version: '3.12'
620
+ python-version: '3.10'
597
621
 
598
622
  - run: pip install "samplesheet-parser[cli]"
599
623
 
@@ -5,7 +5,7 @@
5
5
  Supports both the classic IEM V1 format (bcl2fastq era) and the modern BCLConvert V2 format (NovaSeq X series) — with automatic format detection, bidirectional conversion, index validation, Hamming distance checking, diff comparison, multi-sheet merging, programmatic sheet creation, and a full-featured CLI.
6
6
 
7
7
  [![PyPI version](https://img.shields.io/pypi/v/samplesheet-parser.svg)](https://pypi.org/project/samplesheet-parser/)
8
- [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
8
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-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
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
11
 
@@ -40,7 +40,7 @@ pip install samplesheet-parser
40
40
  pip install "samplesheet-parser[cli]"
41
41
  ```
42
42
 
43
- Requires Python 3.12+. No mandatory runtime dependencies beyond `loguru`.
43
+ Requires Python 3.10+. No mandatory runtime dependencies.
44
44
 
45
45
  ---
46
46
 
@@ -410,10 +410,21 @@ sheet.get_read_structure() # → ReadStructure dataclass
410
410
 
411
411
  | Method / attribute | Returns | Description |
412
412
  |---|---|---|
413
- | `create_parser(path, *, clean, experiment_id, parse)` | `SampleSheetV1 \| SampleSheetV2` | Auto-detect format and return appropriate parser |
413
+ | `create_parser(path, *, clean, experiment_id, parse)` | `SampleSheetParser` | Auto-detect format and return appropriate parser |
414
+ | `register(detector, parser_class, version)` | `None` | Register a custom format detector (class method, LIFO) |
415
+ | `clear_registry()` | `None` | Remove all custom registrations (class method) |
414
416
  | `get_umi_length()` | `int` | UMI length from the current parser |
415
417
  | `.version` | `SampleSheetVersion` | Detected format version |
416
418
 
419
+ ### `SampleSheetParser` (Protocol)
420
+
421
+ A `runtime_checkable` structural protocol satisfied by both `SampleSheetV1` and `SampleSheetV2`. Third-party parsers that implement the same methods and attributes can be registered with `SampleSheetFactory.register()` without inheriting from any base class.
422
+
423
+ ```python
424
+ from samplesheet_parser import SampleSheetParser, SampleSheetV1
425
+ assert isinstance(SampleSheetV1("sheet.csv"), SampleSheetParser)
426
+ ```
427
+
417
428
  ### `SampleSheetV1` / `SampleSheetV2` (shared interface)
418
429
 
419
430
  | Method / attribute | Returns | Description |
@@ -444,6 +455,17 @@ sheet.get_read_structure() # → ReadStructure dataclass
444
455
  | `validate(sheet)` | `ValidationResult` | Run all checks; returns structured result |
445
456
  | `_check_index_distances(samples, result, min_distance=3)` | `None` | Hamming distance check (callable directly for custom thresholds) |
446
457
 
458
+ ### `hamming_distance`
459
+
460
+ ```python
461
+ from samplesheet_parser import hamming_distance
462
+
463
+ hamming_distance("ATTACTCG", "ATTACTCA") # → 1
464
+ hamming_distance("ATTACTCG", "GCTAGCTA") # → 6
465
+ ```
466
+
467
+ Public helper for computing the Hamming distance between two index sequences. Sequences of unequal length are compared up to the shorter length.
468
+
447
469
  ### `SampleSheetWriter`
448
470
 
449
471
  | Method / attribute | Returns | Description |
@@ -539,7 +561,7 @@ jobs:
539
561
 
540
562
  - uses: actions/setup-python@v5
541
563
  with:
542
- python-version: '3.12'
564
+ python-version: '3.10'
543
565
 
544
566
  - run: pip install "samplesheet-parser[cli]"
545
567
 
@@ -73,12 +73,41 @@ print(rs.read_structure)
73
73
 
74
74
  ## Shared interface
75
75
 
76
- Both `SampleSheetV1` and `SampleSheetV2` expose:
76
+ Both `SampleSheetV1` and `SampleSheetV2` satisfy the `SampleSheetParser` Protocol and expose:
77
77
 
78
78
  | Method / attribute | Returns | Description |
79
79
  |---|---|---|
80
80
  | `parse(do_clean=True)` | `None` | Parse all sections |
81
- | `samples()` | `list[dict]` | One record per unique sample |
81
+ | `clean()` | `str` | Return cleaned content as a string — source file is **never** modified |
82
+ | `samples()` | `list[dict]` | One record per unique `(sample_id, lane)` pair |
82
83
  | `index_type()` | `str` | `"dual"`, `"single"`, or `"none"` |
84
+ | `parse_custom_section(name, *, required=False)` | `dict[str, str]` | Parse any non-standard section as key/value pairs |
83
85
  | `.adapters` | `list[str]` | Adapter sequences |
84
86
  | `.experiment_name` | `str \| None` | Run/experiment name |
87
+
88
+ ### In-memory cleaning
89
+
90
+ `parse(do_clean=True)` (the default) cleans the file content in memory before parsing — stripping BOM, quotes, stray whitespace, and normalising V2 section names. **The source file on disk is never modified and no `.backup` files are created.**
91
+
92
+ ```python
93
+ # Access the cleaned content directly
94
+ cleaned = sheet.clean() # returns str, no file I/O side-effects
95
+
96
+ # Parse with cleaning (default)
97
+ sheet.parse()
98
+
99
+ # Parse without cleaning (raw file)
100
+ sheet.parse(do_clean=False)
101
+ ```
102
+
103
+ ### Multi-lane deduplication
104
+
105
+ `samples()` deduplicates by `(sample_id, lane)` pair, not by `sample_id` alone. A sample appearing across multiple lanes produces one record per lane.
106
+
107
+ ```python
108
+ sheet.parse()
109
+ samples = sheet.samples()
110
+ # Multi-lane sheet with Sample1 in lanes 1 and 2 → two records:
111
+ # [{"sample_id": "Sample1", "lane": "1", ...},
112
+ # {"sample_id": "Sample1", "lane": "2", ...}]
113
+ ```
@@ -5,7 +5,7 @@
5
5
  Supports both the classic IEM V1 format (bcl2fastq era) and the modern BCLConvert V2 format (NovaSeq X series) — with automatic format detection, bidirectional conversion, index validation, Hamming distance checking, diff comparison, multi-sheet merging, splitting, filtering, programmatic sheet creation, and a full-featured CLI.
6
6
 
7
7
  [![PyPI version](https://img.shields.io/pypi/v/samplesheet-parser.svg)](https://pypi.org/project/samplesheet-parser/)
8
- [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
8
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-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
10
  [![Tests](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions)
11
11
  [![codecov](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser/branch/main/graph/badge.svg?token=CODECOV_TOKEN)](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser)
@@ -2,8 +2,8 @@
2
2
 
3
3
  ## Requirements
4
4
 
5
- - Python 3.12 or higher
6
- - No mandatory runtime dependencies beyond [`loguru`](https://github.com/Delgan/loguru)
5
+ - Python 3.10 or higher
6
+ - No mandatory runtime dependencies
7
7
 
8
8
  ## pip (recommended)
9
9
 
@@ -3,4 +3,4 @@ channels:
3
3
  - bioconda
4
4
  - defaults
5
5
  dependencies:
6
- - bioconda::samplesheet-parser=1.2.0
6
+ - bioconda::samplesheet-parser=1.3.0
@@ -3,9 +3,9 @@ process SAMPLESHEETPARSER_CONVERT {
3
3
  label 'process_single'
4
4
 
5
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' }"
6
+ container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
7
+ 'https://depot.galaxyproject.org/singularity/samplesheet-parser:1.3.0--pyhdfd78af_0' :
8
+ 'quay.io/biocontainers/samplesheet-parser:1.3.0--pyhdfd78af_0' }"
9
9
 
10
10
  input:
11
11
  tuple val(meta), path(samplesheet)
@@ -13,7 +13,7 @@ process SAMPLESHEETPARSER_CONVERT {
13
13
 
14
14
  output:
15
15
  tuple val(meta), path("*.converted.csv"), emit: samplesheet
16
- path "versions.yml", emit: versions
16
+ tuple val("${task.process}"), val('samplesheet-parser'), eval("samplesheet --version | sed 's/samplesheet-parser //'"), topic: versions, emit: versions_samplesheetparser
17
17
 
18
18
  when:
19
19
  task.ext.when == null || task.ext.when
@@ -30,21 +30,11 @@ process SAMPLESHEETPARSER_CONVERT {
30
30
  --output ${prefix}.converted.csv \\
31
31
  ${args} \\
32
32
  ${samplesheet}
33
-
34
- cat <<-END_VERSIONS > versions.yml
35
- "${task.process}":
36
- samplesheet-parser: \$(samplesheet --version | sed 's/samplesheet-parser //')
37
- END_VERSIONS
38
33
  """
39
34
 
40
35
  stub:
41
36
  def prefix = task.ext.prefix ?: "${meta.id}"
42
37
  """
43
38
  touch ${prefix}.converted.csv
44
-
45
- cat <<-END_VERSIONS > versions.yml
46
- "${task.process}":
47
- samplesheet-parser: \$(samplesheet --version | sed 's/samplesheet-parser //')
48
- END_VERSIONS
49
39
  """
50
40
  }
@@ -2,8 +2,9 @@ name: samplesheetparser_convert
2
2
  description: |
3
3
  Convert an Illumina SampleSheet.csv between IEM V1 (bcl2fastq) and
4
4
  BCLConvert V2 formats. Format of the input is auto-detected.
5
- V2 → V1 conversion is lossy: V2-only fields (OverrideCycles,
6
- InstrumentPlatform, etc.) are dropped with a warning.
5
+ V2 → V1 conversion is lossy: V2-only fields (OverrideCycles, etc.)
6
+ are dropped with a warning. InstrumentPlatform / InstrumentType is
7
+ preserved across both directions.
7
8
  keywords:
8
9
  - illumina
9
10
  - samplesheet
@@ -11,10 +12,9 @@ keywords:
11
12
  - bclconvert
12
13
  - bcl2fastq
13
14
  - genomics
14
-
15
15
  tools:
16
16
  - samplesheet-parser:
17
- description: >
17
+ description: |
18
18
  Format-agnostic parser for Illumina SampleSheet.csv files.
19
19
  Supports IEM V1 (bcl2fastq) and BCLConvert V2 with auto-detection,
20
20
  bidirectional conversion, index validation, and Hamming distance checking.
@@ -22,9 +22,9 @@ tools:
22
22
  documentation: https://illumina-samplesheet.readthedocs.io
23
23
  tool_dev_url: https://github.com/chaitanyakasaraneni/samplesheet-parser
24
24
  doi: "10.5281/zenodo.18989694"
25
- licence: ["Apache-2.0"]
25
+ licence:
26
+ - "Apache-2.0"
26
27
  identifier: biotools:samplesheet-parser
27
-
28
28
  input:
29
29
  - - meta:
30
30
  type: map
@@ -40,22 +40,38 @@ input:
40
40
  - - target_version:
41
41
  type: string
42
42
  description: Target format — either 'v1' or 'v2'
43
-
44
43
  output:
45
- - samplesheet:
46
- - meta:
44
+ samplesheet:
45
+ - - meta:
47
46
  type: map
48
47
  description: Groovy Map containing sample information
49
48
  - "*.converted.csv":
50
49
  type: file
51
50
  description: Converted SampleSheet.csv in the requested format
52
51
  pattern: "*.converted.csv"
53
- - versions:
54
- - "versions.yml":
55
- type: file
56
- description: File containing software versions
57
- pattern: "versions.yml"
58
-
52
+ ontologies:
53
+ - edam: "http://edamontology.org/format_3752"
54
+ versions_samplesheetparser:
55
+ - - ${task.process}:
56
+ type: string
57
+ description: The name of the process
58
+ - samplesheet-parser:
59
+ type: string
60
+ description: The name of the tool
61
+ - samplesheet --version | sed 's/samplesheet-parser //':
62
+ type: eval
63
+ description: The expression to obtain the version of the tool
64
+ topics:
65
+ versions:
66
+ - - ${task.process}:
67
+ type: string
68
+ description: The name of the process
69
+ - samplesheet-parser:
70
+ type: string
71
+ description: The name of the tool
72
+ - samplesheet --version | sed 's/samplesheet-parser //':
73
+ type: eval
74
+ description: The expression to obtain the version of the tool
59
75
  authors:
60
76
  - "@chaitanyakasaraneni"
61
77
  maintainers:
@@ -5,18 +5,18 @@ nextflow_process {
5
5
  process "SAMPLESHEETPARSER_CONVERT"
6
6
 
7
7
  tag "samplesheetparser"
8
- tag "samplesheetparser_convert"
8
+ tag "samplesheetparser/convert"
9
9
  tag "modules"
10
10
  tag "modules_nfcore"
11
11
 
12
- test("V1 → V2 conversion") {
12
+ test("V1 to V2 conversion") {
13
13
 
14
14
  when {
15
15
  process {
16
16
  """
17
17
  input[0] = [
18
18
  [ id: 'test_v1_to_v2' ],
19
- file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true)
19
+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bcl/flowcell_samplesheet.v1.csv', checkIfExists: true)
20
20
  ]
21
21
  input[1] = 'v2'
22
22
  """
@@ -26,19 +26,19 @@ nextflow_process {
26
26
  then {
27
27
  assertAll(
28
28
  { assert process.success },
29
- { assert snapshot(process.out).match() }
29
+ { assert snapshot(sanitizeOutput(process.out)).match() }
30
30
  )
31
31
  }
32
32
  }
33
33
 
34
- test("V2 → V1 conversion") {
34
+ test("V2 to V1 conversion") {
35
35
 
36
36
  when {
37
37
  process {
38
38
  """
39
39
  input[0] = [
40
40
  [ id: 'test_v2_to_v1' ],
41
- file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v2.csv', checkIfExists: true)
41
+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bcl/flowcell_samplesheet.v2.csv', checkIfExists: true)
42
42
  ]
43
43
  input[1] = 'v1'
44
44
  """
@@ -48,12 +48,12 @@ nextflow_process {
48
48
  then {
49
49
  assertAll(
50
50
  { assert process.success },
51
- { assert snapshot(process.out).match() }
51
+ { assert snapshot(sanitizeOutput(process.out)).match() }
52
52
  )
53
53
  }
54
54
  }
55
55
 
56
- test("V1 → V2 conversion - stub") {
56
+ test("V1 to V2 conversion - stub") {
57
57
 
58
58
  options "-stub"
59
59
 
@@ -62,7 +62,7 @@ nextflow_process {
62
62
  """
63
63
  input[0] = [
64
64
  [ id: 'test_stub' ],
65
- file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/samplesheets/samplesheet.v1.csv', checkIfExists: true)
65
+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bcl/flowcell_samplesheet.v1.csv', checkIfExists: true)
66
66
  ]
67
67
  input[1] = 'v2'
68
68
  """
@@ -72,7 +72,7 @@ nextflow_process {
72
72
  then {
73
73
  assertAll(
74
74
  { assert process.success },
75
- { assert snapshot(process.out).match() }
75
+ { assert snapshot(sanitizeOutput(process.out)).match() }
76
76
  )
77
77
  }
78
78
  }
@@ -3,4 +3,4 @@ channels:
3
3
  - bioconda
4
4
  - defaults
5
5
  dependencies:
6
- - bioconda::samplesheet-parser=1.2.0
6
+ - bioconda::samplesheet-parser=1.3.0
@@ -0,0 +1,34 @@
1
+ process SAMPLESHEETPARSER_DIFF {
2
+ tag "$meta.id"
3
+ label 'process_single'
4
+
5
+ conda "${moduleDir}/environment.yml"
6
+ container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
7
+ 'https://depot.galaxyproject.org/singularity/samplesheet-parser:1.3.0--pyhdfd78af_0' :
8
+ 'quay.io/biocontainers/samplesheet-parser:1.3.0--pyhdfd78af_0' }"
9
+
10
+ input:
11
+ tuple val(meta), path(old_sheet, stageAs: "old/*"), path(new_sheet, stageAs: "new/*")
12
+
13
+ output:
14
+ tuple val(meta), path("*.diff.json"), emit: json
15
+ tuple val("${task.process}"), val('samplesheet-parser'), eval("samplesheet --version | sed 's/samplesheet-parser //'"), topic: versions, emit: versions_samplesheetparser
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
+ ${args} \\
26
+ ${old_sheet} ${new_sheet} > ${prefix}.diff.json || true
27
+ """
28
+
29
+ stub:
30
+ def prefix = task.ext.prefix ?: "${meta.id}"
31
+ """
32
+ touch ${prefix}.diff.json
33
+ """
34
+ }