samplesheet-parser 2.1.0__tar.gz → 2.2.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-2.1.0 → samplesheet_parser-2.2.0}/.gitignore +3 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/.zenodo.json +1 -1
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/CHANGELOG.md +16 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/CITATION.cff +2 -2
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/PKG-INFO +1 -1
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/pyproject.toml +1 -1
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/validators.py +6 -2
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/writer.py +20 -2
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_validators/test_hamming.py +49 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_writer.py +39 -1
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/.github/workflows/ci.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/.github/workflows/copilot-instructions.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/.pre-commit-config.yaml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/.readthedocs.yaml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/CONTRIBUTING.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/LICENSE +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/Makefile +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/README.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/api.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/changelog.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/ci.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/cli.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/contributing.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/examples.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/conversion.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/diffing.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/filtering.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/index_utils.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/merging.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/parsing.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/quickstart.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/splitting.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/validation.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/guide/writing.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/index.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/installation.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/docs/requirements.txt +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_converter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_diff.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_filter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_index_utils.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_merger.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_splitter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/demo_writer.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/parse_examples.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/ProjectAlpha_SampleSheet.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/ProjectBeta_SampleSheet.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/ProjectDelta_SampleSheet_collision.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/ProjectGamma_SampleSheet.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/README.md +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/combined_clean.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/combined_collision_forced.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/combined_mixed_formats.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_dual_index.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_multi_lane.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_single_index.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_with_lab_qc_settings.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_with_manifests.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_nextseq_single_index.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_novaseq_x_dual_index.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_with_cloud_settings.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_with_index_umi.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_with_pipeline_settings.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_with_read_umi.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/images/samplesheet_parser_arch_v03.png +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/images/samplesheet_parser_overview.png +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/mkdocs.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/convert/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/convert/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/convert/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/convert/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/diff/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/diff/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/diff/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/diff/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/diff/tests/main.nf.test.snap +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/filter/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/filter/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/filter/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/filter/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/filter/tests/nextflow.config +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/info/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/info/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/info/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/info/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/info/tests/main.nf.test.snap +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/merge/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/merge/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/merge/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/merge/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/split/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/split/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/split/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/split/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/validate/environment.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/validate/main.nf +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/validate/meta.yml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/validate/tests/main.nf.test +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/validate/tests/main.nf.test.snap +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/recipes/meta.yaml +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/__init__.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/cli.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/converter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/diff.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/enums.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/factory.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/filter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/index_utils.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/instruments.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/merger.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/parsers/__init__.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/parsers/v1.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/parsers/v2.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/protocol.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/py.typed +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/splitter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/scripts/demo_converter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/scripts/demo_diff.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/scripts/demo_writer.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/__init__.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/conftest.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/fixtures/SampleSheet_v1_dual_index.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/fixtures/SampleSheet_v2_dual_index.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/fixtures/SampleSheet_v2_modified.csv +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_cli.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_converter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_diff.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_factory.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_filter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_index_utils.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_instruments.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_merger.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_parsers/__init__.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_parsers/test_v1.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_parsers/test_v2.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_splitter.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_validators/__init__.py +0 -0
- {samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_validators/test_validators.py +0 -0
|
@@ -10,6 +10,22 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
10
10
|
|
|
11
11
|
_No unreleased changes._
|
|
12
12
|
|
|
13
|
+
## [2.2.0] - 2026-06-10
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **Index-free libraries are no longer dropped silently by the writer.** When
|
|
18
|
+
loading a parsed sheet with `SampleSheetWriter.from_sheet()`, a sample with a
|
|
19
|
+
valid `Sample_ID` but no index was skipped without notice (the writer
|
|
20
|
+
requires an index per sample). Such samples are still dropped, but now a
|
|
21
|
+
warning is logged naming the sample, so the loss is visible. This aligns the
|
|
22
|
+
writer with the validator, which treats index-free libraries as legitimate.
|
|
23
|
+
- **Index-distance check now accepts V2-style index keys.** The combined
|
|
24
|
+
index-distance check read only the lowercase `index`/`index2` keys, so
|
|
25
|
+
hand-built sample dicts (or the output of `normalize_index_lengths`) keyed
|
|
26
|
+
with `Index`/`Index2` were silently skipped. It now accepts both casings,
|
|
27
|
+
consistent with the duplicate-index and character checks.
|
|
28
|
+
|
|
13
29
|
## [2.1.0] - 2026-06-09
|
|
14
30
|
|
|
15
31
|
### Fixed
|
|
@@ -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: 2.
|
|
12
|
-
date-released: 2026-06-
|
|
11
|
+
version: 2.2.0
|
|
12
|
+
date-released: 2026-06-10
|
|
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: 2.
|
|
3
|
+
Version: 2.2.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
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "samplesheet-parser"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.2.0"
|
|
8
8
|
description = "Format-agnostic parser for Illumina SampleSheet.csv files — supports IEM V1 and BCLConvert V2"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -419,8 +419,12 @@ class SampleSheetValidator:
|
|
|
419
419
|
|
|
420
420
|
for sample in samples:
|
|
421
421
|
lane = sample.get("lane")
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
# Accept both V1-style (``index``/``index2``) and V2-style
|
|
423
|
+
# (``Index``/``Index2``) keys so hand-built dicts and the output of
|
|
424
|
+
# ``normalize_index_lengths`` are checked the same way the duplicate
|
|
425
|
+
# and character checks already handle them.
|
|
426
|
+
idx1 = (sample.get("index") or sample.get("Index") or "").upper()
|
|
427
|
+
idx2 = (sample.get("index2") or sample.get("Index2") or "").upper()
|
|
424
428
|
sid = sample.get("sample_id", "?")
|
|
425
429
|
|
|
426
430
|
if not idx1:
|
|
@@ -957,7 +957,16 @@ class SampleSheetWriter:
|
|
|
957
957
|
}
|
|
958
958
|
sid = std.get("Sample_ID", "")
|
|
959
959
|
idx = std.get("index", "")
|
|
960
|
-
if not sid
|
|
960
|
+
if not sid:
|
|
961
|
+
continue
|
|
962
|
+
if not idx:
|
|
963
|
+
logger.warning(
|
|
964
|
+
"Sample %r has no index; the writer requires an index per "
|
|
965
|
+
"sample, so this index-free library is dropped from the "
|
|
966
|
+
"output. Add an index or write the sheet by another means "
|
|
967
|
+
"to preserve it.",
|
|
968
|
+
sid,
|
|
969
|
+
)
|
|
961
970
|
continue
|
|
962
971
|
self._samples.append(
|
|
963
972
|
_SampleRecord(
|
|
@@ -1005,7 +1014,16 @@ class SampleSheetWriter:
|
|
|
1005
1014
|
for record in sheet.records or []:
|
|
1006
1015
|
sid = record.get("Sample_ID", "")
|
|
1007
1016
|
idx = record.get("Index", "")
|
|
1008
|
-
if not sid
|
|
1017
|
+
if not sid:
|
|
1018
|
+
continue
|
|
1019
|
+
if not idx:
|
|
1020
|
+
logger.warning(
|
|
1021
|
+
"Sample %r has no index; the writer requires an index per "
|
|
1022
|
+
"sample, so this index-free library is dropped from the "
|
|
1023
|
+
"output. Add an index or write the sheet by another means "
|
|
1024
|
+
"to preserve it.",
|
|
1025
|
+
sid,
|
|
1026
|
+
)
|
|
1009
1027
|
continue
|
|
1010
1028
|
extra = {k: v for k, v in record.items() if k not in std_cols}
|
|
1011
1029
|
self._samples.append(
|
|
@@ -874,3 +874,52 @@ Lane,Sample_ID,Index,Index2,Sample_Project
|
|
|
874
874
|
)
|
|
875
875
|
result = _validate(sheet)
|
|
876
876
|
assert _distance_warnings(result) == []
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
# ---------------------------------------------------------------------------
|
|
880
|
+
# Index-key casing: the distance check accepts V2-style capital-I keys too
|
|
881
|
+
# ---------------------------------------------------------------------------
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
class _StubSheet:
|
|
885
|
+
"""Minimal sheet exposing hand-built sample dicts to the validator.
|
|
886
|
+
|
|
887
|
+
The V1/V2 parsers always normalize index keys to lowercase, so
|
|
888
|
+
capital-I keys only reach the validator through hand-built dicts or the
|
|
889
|
+
output of ``normalize_index_lengths`` (whose documented examples use
|
|
890
|
+
``Index``/``Index2``). This stub lets us exercise that path directly.
|
|
891
|
+
"""
|
|
892
|
+
|
|
893
|
+
def __init__(self, samples: list[dict[str, Any]]) -> None:
|
|
894
|
+
self._samples = samples
|
|
895
|
+
self.adapters: list[str] = []
|
|
896
|
+
|
|
897
|
+
def samples(self) -> list[dict[str, Any]]:
|
|
898
|
+
return self._samples
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
class TestDistanceAcceptsCapitalIndexKeys:
|
|
902
|
+
def test_capital_index_keys_are_compared(self):
|
|
903
|
+
# Two dual-index samples differing by 1 on I7 and 1 on I5 (combined 2,
|
|
904
|
+
# below the default threshold). Keyed with V2-style Index/Index2, the
|
|
905
|
+
# distance check must still flag them rather than silently skip.
|
|
906
|
+
sheet = _StubSheet(
|
|
907
|
+
[
|
|
908
|
+
{"sample_id": "S1", "lane": "1", "Index": "ATTACTCG", "Index2": "TATAGCCT"},
|
|
909
|
+
{"sample_id": "S2", "lane": "1", "Index": "ATTACTCA", "Index2": "TATAGCCA"},
|
|
910
|
+
]
|
|
911
|
+
)
|
|
912
|
+
result = SampleSheetValidator().validate(sheet) # type: ignore[arg-type]
|
|
913
|
+
warnings = _distance_warnings(result)
|
|
914
|
+
assert len(warnings) == 1
|
|
915
|
+
assert warnings[0].context["distance"] == 2
|
|
916
|
+
|
|
917
|
+
def test_capital_index_keys_well_separated_no_warning(self):
|
|
918
|
+
sheet = _StubSheet(
|
|
919
|
+
[
|
|
920
|
+
{"sample_id": "S1", "lane": "1", "Index": "ATTACTCG"},
|
|
921
|
+
{"sample_id": "S2", "lane": "1", "Index": "GCTAGCTA"},
|
|
922
|
+
]
|
|
923
|
+
)
|
|
924
|
+
result = SampleSheetValidator().validate(sheet) # type: ignore[arg-type]
|
|
925
|
+
assert _distance_warnings(result) == []
|
|
@@ -795,7 +795,7 @@ class TestWriterFromV2SheetEdgeCases:
|
|
|
795
795
|
assert "Custom_Setting,foo" in out.read_text()
|
|
796
796
|
|
|
797
797
|
def test_incomplete_v2_record_skipped(self, tmp_path):
|
|
798
|
-
"""
|
|
798
|
+
"""A record missing Sample_ID or Index is skipped in from_sheet."""
|
|
799
799
|
src = tmp_path / "v2.csv"
|
|
800
800
|
src.write_text(
|
|
801
801
|
"[Header]\nFileFormatVersion,2\nRunName,T\n\n"
|
|
@@ -808,6 +808,44 @@ class TestWriterFromV2SheetEdgeCases:
|
|
|
808
808
|
assert len(w._samples) == 1
|
|
809
809
|
assert w._samples[0].sample_id == "S1"
|
|
810
810
|
|
|
811
|
+
def test_index_free_v2_sample_dropped_with_warning(self, tmp_path, caplog):
|
|
812
|
+
"""An index-free V2 sample (valid Sample_ID, empty Index) is dropped
|
|
813
|
+
from the writer, which requires an index, and a warning is logged so
|
|
814
|
+
the loss is not silent."""
|
|
815
|
+
src = tmp_path / "v2_indexfree.csv"
|
|
816
|
+
src.write_text(
|
|
817
|
+
"[Header]\nFileFormatVersion,2\nRunName,T\n\n"
|
|
818
|
+
"[BCLConvert_Data]\nSample_ID,Index\n"
|
|
819
|
+
"S1,ATTACTCG\n"
|
|
820
|
+
"WholeLane,\n" # valid Sample_ID, no index (legitimate library)
|
|
821
|
+
)
|
|
822
|
+
sheet = _parse(src)
|
|
823
|
+
with caplog.at_level("WARNING", logger="samplesheet_parser.writer"):
|
|
824
|
+
w = SampleSheetWriter.from_sheet(sheet, version=SampleSheetVersion.V2)
|
|
825
|
+
assert [s.sample_id for s in w._samples] == ["S1"]
|
|
826
|
+
assert "WholeLane" in caplog.text
|
|
827
|
+
assert "no index" in caplog.text
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
class TestWriterFromV1IndexFree:
|
|
831
|
+
|
|
832
|
+
def test_index_free_v1_sample_dropped_with_warning(self, tmp_path, caplog):
|
|
833
|
+
"""An index-free V1 sample (valid Sample_ID, empty index) is dropped
|
|
834
|
+
from the writer with a warning rather than silently."""
|
|
835
|
+
src = tmp_path / "v1_indexfree.csv"
|
|
836
|
+
src.write_text(
|
|
837
|
+
"[Header]\nIEMFileVersion,5\nExperiment Name,T\n\n"
|
|
838
|
+
"[Data]\nSample_ID,index\n"
|
|
839
|
+
"S1,ATTACTCG\n"
|
|
840
|
+
"WholeLane,\n" # valid Sample_ID, no index
|
|
841
|
+
)
|
|
842
|
+
sheet = _parse(src)
|
|
843
|
+
with caplog.at_level("WARNING", logger="samplesheet_parser.writer"):
|
|
844
|
+
w = SampleSheetWriter.from_sheet(sheet, version=SampleSheetVersion.V1)
|
|
845
|
+
assert [s.sample_id for s in w._samples] == ["S1"]
|
|
846
|
+
assert "WholeLane" in caplog.text
|
|
847
|
+
assert "no index" in caplog.text
|
|
848
|
+
|
|
811
849
|
|
|
812
850
|
class TestUpdateSampleLaneFilter:
|
|
813
851
|
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/.github/workflows/copilot-instructions.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/combined_clean.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_dual_index.csv
RENAMED
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_multi_lane.csv
RENAMED
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_single_index.csv
RENAMED
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v1_with_manifests.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_with_index_umi.csv
RENAMED
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/examples/sample_sheets/v2_with_read_umi.csv
RENAMED
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/images/samplesheet_parser_arch_v03.png
RENAMED
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/images/samplesheet_parser_overview.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/diff/main.nf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/modules/nf-core/samplesheetparser/info/main.nf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/samplesheet_parser/parsers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/fixtures/SampleSheet_v1_dual_index.csv
RENAMED
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/fixtures/SampleSheet_v2_dual_index.csv
RENAMED
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/fixtures/SampleSheet_v2_modified.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{samplesheet_parser-2.1.0 → samplesheet_parser-2.2.0}/tests/test_validators/test_validators.py
RENAMED
|
File without changes
|