Skip to content

Commit d15272d

Browse files
authored
add optional project column (#27)
1 parent 5a960cc commit d15272d

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ See [GitHub releases](https://github.com/mll-lab/php-utils/releases).
99

1010
## Unreleased
1111

12+
## v3.1.0
13+
14+
### Changed
15+
16+
- Add optional column `Project` to Illumina Sample Sheets (V2) for NovaSeq
17+
1218
## v3.0.0
1319

1420
### Changed

src/IlluminaSampleSheet/V2/BclConvert/BclSample.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class BclSample
2323

2424
public ?string $barcodeMismatchesIndex2 = null;
2525

26+
public ?string $project = null;
27+
2628
public function __construct(
2729
int $lane,
2830
string $sample_ID,
@@ -48,6 +50,7 @@ public function toArray(): array
4850
$this->adapterRead2,
4951
$this->barcodeMismatchesIndex1,
5052
$this->barcodeMismatchesIndex2,
53+
$this->project,
5154
]);
5255
}
5356
}

tests/IlluminaSampleSheet/V2/DataSectionTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,22 @@ public function testThrowsExceptionIfDataSectionIsEmpty(): void
3737
$this->expectExceptionMessage('At least one sample must be added to the DataSection.');
3838
$dataSection->convertSectionToString();
3939
}
40+
41+
public function testToStringWithProject(): void
42+
{
43+
$dataSection = new DataSection();
44+
$overrideCycles = new OverrideCycles($dataSection, 'Y130', 'I8', 'I10', 'Y100');
45+
$bclSample = new BclSample(100, 'Sample1', 'Index1', $overrideCycles);
46+
$bclSample->project = 'foo';
47+
$dataSection->addSample($bclSample);
48+
49+
$expected = <<<'CSV'
50+
[BCLConvert_Data]
51+
Lane,Sample_ID,Index,OverrideCycles,Project
52+
100,Sample1,Index1,Y130;I8;I10;Y100,foo
53+
54+
CSV;
55+
56+
self::assertSame($expected, $dataSection->convertSectionToString());
57+
}
4058
}

0 commit comments

Comments
 (0)