Skip to content

Commit 26c520a

Browse files
authored
Ae 347 mm coordinate system (#38)
fix: coordinate system for mm block in tecan has no J column
1 parent e142060 commit 26c520a

File tree

6 files changed

+90
-2
lines changed

6 files changed

+90
-2
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+
## v5.5.2
13+
14+
### Fixed
15+
16+
- Changed coordinate system for `MLL\Utils\Tecan\Rack\MasterMixRack`
17+
1218
## v5.5.1
1319

1420
### Fixed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace MLL\Utils\Microplate;
4+
5+
class CoordinateSystem2x16NoJ extends CoordinateSystem
6+
{
7+
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
8+
public const POSITIONS_COUNT = 32;
9+
10+
/** The Tecan MM block has no J on its rows */
11+
public function rows(): array
12+
{
13+
return [...range('A', 'I'), ...range('K', 'Q')];
14+
}
15+
16+
public function columns(): array
17+
{
18+
return range(1, 2);
19+
}
20+
}

src/Microplate/Scalars/Row16NoJ.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace MLL\Utils\Microplate\Scalars;
4+
5+
use MLL\GraphQLScalars\Regex;
6+
7+
class Row16NoJ extends Regex
8+
{
9+
public ?string $description = 'Represents a row in a coordinate system with 16 rows without the letter J';
10+
11+
public static function regex(): string
12+
{
13+
return '/^[A-IK-Q]$/';
14+
}
15+
}

src/Tecan/Rack/MasterMixRack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace MLL\Utils\Tecan\Rack;
44

5-
use MLL\Utils\Microplate\CoordinateSystem2x16;
5+
use MLL\Utils\Microplate\CoordinateSystem2x16NoJ;
66

77
/**
88
* @template TContent
@@ -13,7 +13,7 @@ class MasterMixRack extends BaseRack
1313
{
1414
public function __construct()
1515
{
16-
parent::__construct(new CoordinateSystem2x16());
16+
parent::__construct(new CoordinateSystem2x16NoJ());
1717
}
1818

1919
public function type(): string

tests/Microplate/CoordinateSystemTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use MLL\Utils\Microplate\CoordinateSystem12x8;
77
use MLL\Utils\Microplate\CoordinateSystem1x1;
88
use MLL\Utils\Microplate\CoordinateSystem2x16;
9+
use MLL\Utils\Microplate\CoordinateSystem2x16NoJ;
910
use MLL\Utils\Microplate\CoordinateSystem4x3;
1011
use MLL\Utils\Microplate\CoordinateSystem6x4;
1112
use MLL\Utils\Microplate\CoordinateSystem6x8;
@@ -33,6 +34,7 @@ public static function firstLast(): iterable
3334
{
3435
yield '1x1' => [new CoordinateSystem1x1(), 'A1', 'A1'];
3536
yield '2x16' => [new CoordinateSystem2x16(), 'A1', 'P2'];
37+
yield '2x16NoJ' => [new CoordinateSystem2x16NoJ(), 'A1', 'Q2'];
3638
yield '4x3' => [new CoordinateSystem4x3(), 'A1', 'C4'];
3739
yield '6x4' => [new CoordinateSystem6x4(), 'A1', 'D6'];
3840
yield '6x8' => [new CoordinateSystem6x8(), 'A1', 'H6'];
@@ -44,6 +46,7 @@ public function testPositionsCount(): void
4446
{
4547
self::assertSame(CoordinateSystem1x1::POSITIONS_COUNT, (new CoordinateSystem1x1())->positionsCount());
4648
self::assertSame(CoordinateSystem2x16::POSITIONS_COUNT, (new CoordinateSystem2x16())->positionsCount());
49+
self::assertSame(CoordinateSystem2x16NoJ::POSITIONS_COUNT, (new CoordinateSystem2x16NoJ())->positionsCount());
4750
self::assertSame(CoordinateSystem4x3::POSITIONS_COUNT, (new CoordinateSystem4x3())->positionsCount());
4851
self::assertSame(CoordinateSystem6x4::POSITIONS_COUNT, (new CoordinateSystem6x4())->positionsCount());
4952
self::assertSame(CoordinateSystem6x8::POSITIONS_COUNT, (new CoordinateSystem6x8())->positionsCount());

tests/Microplate/CoordinatesTest.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use MLL\Utils\Microplate\CoordinateSystem;
77
use MLL\Utils\Microplate\CoordinateSystem12x8;
88
use MLL\Utils\Microplate\CoordinateSystem2x16;
9+
use MLL\Utils\Microplate\CoordinateSystem2x16NoJ;
910
use MLL\Utils\Microplate\CoordinateSystem4x3;
1011
use MLL\Utils\Microplate\CoordinateSystem6x8;
1112
use MLL\Utils\Microplate\CoordinateSystem8x6;
@@ -213,6 +214,7 @@ public static function dataProviderPaddedWells(): iterable
213214
public static function dataProviderWells(): iterable
214215
{
215216
yield '2x16' => [new CoordinateSystem2x16(), self::data2x16()];
217+
yield '2x16NoJ' => [new CoordinateSystem2x16NoJ(), self::data2x16NoJ()];
216218
yield '4x3' => [new CoordinateSystem4x3(), self::data4x3()];
217219
yield '8x6' => [new CoordinateSystem8x6(), self::data8x6()];
218220
yield '12x8' => [new CoordinateSystem12x8(), self::data12x8()];
@@ -236,6 +238,7 @@ public function testThrowsOnInvalidRowsOrColumns(CoordinateSystem $coordinateSys
236238
public static function invalidRowsOrColumns(): iterable
237239
{
238240
yield '2x16' => [new CoordinateSystem2x16(), [['X', 2], ['B', 0], ['B', 3], ['B', -1], ['B', 1000], ['rolf', 2]]];
241+
yield '2x16NoJ' => [new CoordinateSystem2x16NoJ(), [['J', 1], ['J', 2]]];
239242
yield '4x3' => [new CoordinateSystem4x3(), [['X', 2], ['B', 0], ['B', 4], ['B', -1], ['B', 1000], ['rolf', 2], ['D', 1]]];
240243
yield '8x6' => [new CoordinateSystem8x6(), [['X', 2], ['B', 0], ['B', 4], ['B', -1], ['B', 1000], ['rolf', 2], ['G', 1]]];
241244
yield '12x8' => [new CoordinateSystem12x8(), [['X', 2], ['B', 0], ['B', 13], ['B', -1], ['B', 1000], ['rolf', 2]]];
@@ -259,6 +262,7 @@ public function testThrowsOnInvalidPositions(CoordinateSystem $coordinateSystem,
259262
public static function invalidPositions(): iterable
260263
{
261264
yield '2x16' => [new CoordinateSystem2x16(), [0, -1, 33, 10000]];
265+
yield '2x16NoJ' => [new CoordinateSystem2x16NoJ(), [0, -1, 33, 10000]];
262266
yield '4x3' => [new CoordinateSystem4x3(), [0, -1, 13, 10000]];
263267
yield '8x6' => [new CoordinateSystem8x6(), [0, -1, 49, 10000]];
264268
yield '12x8' => [new CoordinateSystem12x8(), [0, -1, 97, 10000]];
@@ -282,6 +286,7 @@ public function testThrowsOnInvalidCoordinates(CoordinateSystem $coordinateSyste
282286
public static function invalidCoordinates(): iterable
283287
{
284288
yield '2x16' => [new CoordinateSystem2x16(), ['A0', 'A01', 'D3', 'C5', 'X3', 'rolf', 'a1']];
289+
yield '2x16NoJ' => [new CoordinateSystem2x16NoJ(), ['J1', 'J2']];
285290
yield '8x6' => [new CoordinateSystem8x6(), ['A0', 'A01', 'G3', 'C9', 'rolf', 'a1']];
286291
yield '12x8' => [new CoordinateSystem12x8(), ['A0', 'A001', 'X3', 'rolf', 'a1']];
287292
}
@@ -325,6 +330,45 @@ public static function data2x16(): array
325330
];
326331
}
327332

333+
/** @return array<WellData> */
334+
public static function data2x16NoJ(): array
335+
{
336+
return [
337+
['row' => 'A', 'column' => 1, 'rowFlowPosition' => 1, 'columnFlowPosition' => 1],
338+
['row' => 'B', 'column' => 1, 'rowFlowPosition' => 3, 'columnFlowPosition' => 2],
339+
['row' => 'C', 'column' => 1, 'rowFlowPosition' => 5, 'columnFlowPosition' => 3],
340+
['row' => 'D', 'column' => 1, 'rowFlowPosition' => 7, 'columnFlowPosition' => 4],
341+
['row' => 'E', 'column' => 1, 'rowFlowPosition' => 9, 'columnFlowPosition' => 5],
342+
['row' => 'F', 'column' => 1, 'rowFlowPosition' => 11, 'columnFlowPosition' => 6],
343+
['row' => 'G', 'column' => 1, 'rowFlowPosition' => 13, 'columnFlowPosition' => 7],
344+
['row' => 'H', 'column' => 1, 'rowFlowPosition' => 15, 'columnFlowPosition' => 8],
345+
['row' => 'I', 'column' => 1, 'rowFlowPosition' => 17, 'columnFlowPosition' => 9],
346+
['row' => 'K', 'column' => 1, 'rowFlowPosition' => 19, 'columnFlowPosition' => 10],
347+
['row' => 'L', 'column' => 1, 'rowFlowPosition' => 21, 'columnFlowPosition' => 11],
348+
['row' => 'M', 'column' => 1, 'rowFlowPosition' => 23, 'columnFlowPosition' => 12],
349+
['row' => 'N', 'column' => 1, 'rowFlowPosition' => 25, 'columnFlowPosition' => 13],
350+
['row' => 'O', 'column' => 1, 'rowFlowPosition' => 27, 'columnFlowPosition' => 14],
351+
['row' => 'P', 'column' => 1, 'rowFlowPosition' => 29, 'columnFlowPosition' => 15],
352+
['row' => 'Q', 'column' => 1, 'rowFlowPosition' => 31, 'columnFlowPosition' => 16],
353+
['row' => 'A', 'column' => 2, 'rowFlowPosition' => 2, 'columnFlowPosition' => 17],
354+
['row' => 'B', 'column' => 2, 'rowFlowPosition' => 4, 'columnFlowPosition' => 18],
355+
['row' => 'C', 'column' => 2, 'rowFlowPosition' => 6, 'columnFlowPosition' => 19],
356+
['row' => 'D', 'column' => 2, 'rowFlowPosition' => 8, 'columnFlowPosition' => 20],
357+
['row' => 'E', 'column' => 2, 'rowFlowPosition' => 10, 'columnFlowPosition' => 21],
358+
['row' => 'F', 'column' => 2, 'rowFlowPosition' => 12, 'columnFlowPosition' => 22],
359+
['row' => 'G', 'column' => 2, 'rowFlowPosition' => 14, 'columnFlowPosition' => 23],
360+
['row' => 'H', 'column' => 2, 'rowFlowPosition' => 16, 'columnFlowPosition' => 24],
361+
['row' => 'I', 'column' => 2, 'rowFlowPosition' => 18, 'columnFlowPosition' => 25],
362+
['row' => 'K', 'column' => 2, 'rowFlowPosition' => 20, 'columnFlowPosition' => 26],
363+
['row' => 'L', 'column' => 2, 'rowFlowPosition' => 22, 'columnFlowPosition' => 27],
364+
['row' => 'M', 'column' => 2, 'rowFlowPosition' => 24, 'columnFlowPosition' => 28],
365+
['row' => 'N', 'column' => 2, 'rowFlowPosition' => 26, 'columnFlowPosition' => 29],
366+
['row' => 'O', 'column' => 2, 'rowFlowPosition' => 28, 'columnFlowPosition' => 30],
367+
['row' => 'P', 'column' => 2, 'rowFlowPosition' => 30, 'columnFlowPosition' => 31],
368+
['row' => 'Q', 'column' => 2, 'rowFlowPosition' => 32, 'columnFlowPosition' => 32],
369+
];
370+
}
371+
328372
/** @return array<WellData> */
329373
public static function data4x3(): array
330374
{

0 commit comments

Comments
 (0)