diff --git a/src/InterOp/RunResult.php b/src/InterOp/RunResult.php index 840f224..83f8e8c 100644 --- a/src/InterOp/RunResult.php +++ b/src/InterOp/RunResult.php @@ -10,10 +10,20 @@ class RunResult public SequencingQualityControl $sequencingQualityControl; - public function __construct(ClusterStatistic $clusterStatistic, SequencingQualityControl $sequencingQualityControl) + /** + * Share of flowcell wells occupied by a cluster, null on unpatterned flowcells. + * + * Patterned flowcells (NovaSeq X Plus, MiSeq i100) prescribe cluster locations, + * so occupancy replaces density as the measure of flowcell loading. + * Unpatterned flowcells report "nan". + */ + public ?float $percentOccupied; + + public function __construct(ClusterStatistic $clusterStatistic, SequencingQualityControl $sequencingQualityControl, ?float $percentOccupied) { $this->clusterStatistic = $clusterStatistic; $this->sequencingQualityControl = $sequencingQualityControl; + $this->percentOccupied = $percentOccupied; } /** @param array $nonIndexedRow */ @@ -35,6 +45,10 @@ public static function fromLaneResults(LaneResult $read1, LaneResult $read2, arr $aggregated->sequencingQualityControl->error ); - return new self($aggregated->clusterStatistic, $sequencingQualityControl); + return new self( + $aggregated->clusterStatistic, + $sequencingQualityControl, + SafeCast::tryFloat($nonIndexedRow['% Occupied'] ?? null) + ); } } diff --git a/tests/InterOp/MetaInfoTest.php b/tests/InterOp/MetaInfoTest.php index 4b0074d..dca794e 100644 --- a/tests/InterOp/MetaInfoTest.php +++ b/tests/InterOp/MetaInfoTest.php @@ -51,6 +51,7 @@ public function testParseMiSeq(): void self::assertSame(83.2, $runQC->q30); self::assertSame(6.11, $runQC->aligned->value); self::assertEqualsWithDelta(0.065, $runQC->phasing, 0.001); + self::assertNull($metaInfo->interOpResult->resultsForRun->percentOccupied); self::assertSame('example-server/miseq_active\\230421_M02074_0859_000000000-KT6CY\\meta-info.json', $metaInfo->uncPath); } @@ -91,6 +92,8 @@ public function testParseMiSeqI100(): void self::assertSame(3486, $metaInfo->interOpResult->resultsForRead2->intensityCycle); self::assertSame(1490000, $metaInfo->interOpResult->resultsForRead2->yield); + self::assertSame(74.22, $metaInfo->interOpResult->resultsForRun->percentOccupied); + self::assertSame('example-server/miseq_active\\miSeqi100\\20260205_SH01038_0007_ASC2139476-SC3\\meta-info.json', $metaInfo->uncPath); } }