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.
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/CHANGELOG.md +38 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/CITATION.cff +2 -2
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/PKG-INFO +4 -2
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/README.md +3 -1
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/api.md +39 -1
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/cli.md +14 -1
- samplesheet_parser-1.3.0/docs/guide/conversion.md +134 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/installation.md +4 -7
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_converter.py +6 -3
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/environment.yml +1 -1
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/main.nf +2 -2
- {samplesheet_parser-1.2.0/modules/nf-core/samplesheetparser/info → samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff}/environment.yml +1 -1
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/main.nf +45 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/meta.yml +69 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/tests/main.nf.test +79 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/diff/tests/tags.yml +4 -0
- {samplesheet_parser-1.2.0/modules/nf-core/samplesheetparser/validate → samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter}/environment.yml +1 -1
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/main.nf +48 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/meta.yml +74 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/main.nf.test +57 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/nextflow.config +5 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/filter/tests/tags.yml +4 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/info/environment.yml +6 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/main.nf +2 -2
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/environment.yml +6 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/main.nf +53 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/meta.yml +73 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/tests/main.nf.test +88 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/merge/tests/tags.yml +4 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/environment.yml +6 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/main.nf +56 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/meta.yml +73 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/tests/main.nf.test +79 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/split/tests/tags.yml +4 -0
- samplesheet_parser-1.3.0/modules/nf-core/samplesheetparser/validate/environment.yml +6 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/main.nf +2 -2
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/pyproject.toml +1 -1
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/recipes/meta.yaml +3 -3
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/cli.py +32 -3
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/converter.py +191 -47
- samplesheet_parser-1.3.0/samplesheet_parser/instruments.py +192 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_cli.py +6 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_converter.py +404 -48
- samplesheet_parser-1.3.0/tests/test_instruments.py +126 -0
- samplesheet_parser-1.2.0/docs/guide/conversion.md +0 -54
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.github/workflows/ci.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.github/workflows/copilot-instructions.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.gitignore +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.pre-commit-config.yaml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.readthedocs.yaml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/.zenodo.json +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/CONTRIBUTING.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/LICENSE +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/changelog.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/ci.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/contributing.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/examples.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/diffing.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/filtering.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/index_utils.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/merging.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/parsing.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/quickstart.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/splitting.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/validation.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/guide/writing.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/index.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/docs/requirements.txt +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_diff.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_filter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_index_utils.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_merger.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_splitter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/demo_writer.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/parse_examples.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectAlpha_SampleSheet.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectBeta_SampleSheet.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectDelta_SampleSheet_collision.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/ProjectGamma_SampleSheet.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/README.md +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/combined_clean.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/combined_collision_forced.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/combined_mixed_formats.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_dual_index.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_multi_lane.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_single_index.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_with_lab_qc_settings.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v1_with_manifests.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_nextseq_single_index.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_novaseq_x_dual_index.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_cloud_settings.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_index_umi.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_pipeline_settings.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/examples/sample_sheets/v2_with_read_umi.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/images/samplesheet_parser_arch_v03.png +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/images/samplesheet_parser_overview.png +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/mkdocs.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/meta.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/tests/main.nf.test +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/convert/tests/tags.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/meta.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/tests/main.nf.test +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/info/tests/tags.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/meta.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/tests/main.nf.test +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/modules/nf-core/samplesheetparser/validate/tests/tags.yml +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/__init__.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/diff.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/enums.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/factory.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/filter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/index_utils.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/merger.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/parsers/__init__.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/parsers/v1.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/parsers/v2.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/py.typed +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/splitter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/validators.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/samplesheet_parser/writer.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/scripts/demo_converter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/scripts/demo_diff.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/scripts/demo_writer.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/__init__.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/conftest.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/fixtures/SampleSheet_v1_dual_index.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/fixtures/SampleSheet_v2_dual_index.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/fixtures/SampleSheet_v2_modified.csv +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_diff.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_factory.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_filter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_index_utils.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_merger.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_parsers/__init__.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_parsers/test_v1.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_parsers/test_v2.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_splitter.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_validators/__init__.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_validators/test_hamming.py +0 -0
- {samplesheet_parser-1.2.0 → samplesheet_parser-1.3.0}/tests/test_validators/test_validators.py +0 -0
- {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.
|
|
12
|
-
date-released: 2026-
|
|
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.
|
|
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
|
[](https://pypi.org/project/samplesheet-parser/)
|
|
62
62
|
[](https://www.python.org/downloads/)
|
|
63
63
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
64
|
+
[](http://bioconda.github.io/recipes/samplesheet-parser/README.html)
|
|
65
|
+
|
|
64
66
|
[](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions)
|
|
65
67
|
[](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser)
|
|
66
|
-
[](https://doi.org/10.5281/zenodo.18989694)
|
|
67
68
|
[](https://illumina-samplesheet.readthedocs.io)
|
|
69
|
+
[](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
|
[](https://pypi.org/project/samplesheet-parser/)
|
|
8
8
|
[](https://www.python.org/downloads/)
|
|
9
9
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
10
|
+
[](http://bioconda.github.io/recipes/samplesheet-parser/README.html)
|
|
11
|
+
|
|
10
12
|
[](https://github.com/chaitanyakasaraneni/samplesheet-parser/actions)
|
|
11
13
|
[](https://codecov.io/gh/chaitanyakasaraneni/samplesheet-parser)
|
|
12
|
-
[](https://doi.org/10.5281/zenodo.18989694)
|
|
13
14
|
[](https://illumina-samplesheet.readthedocs.io)
|
|
15
|
+
[](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
|
-
|
|
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`, `
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
conda install -c bioconda samplesheet-parser
|
|
25
|
-
```
|
|
20
|
+
```bash
|
|
21
|
+
conda install -c bioconda samplesheet-parser
|
|
22
|
+
```
|
|
26
23
|
|
|
27
|
-
|
|
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
|
-
|
|
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)
|
|
@@ -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.
|
|
8
|
-
'biocontainers/samplesheet-parser:1.
|
|
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)
|
|
@@ -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,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
|
+
}
|