Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/InterOp/RunResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> $nonIndexedRow */
Expand All @@ -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)
);
}
}
3 changes: 3 additions & 0 deletions tests/InterOp/MetaInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
}
Loading