Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use coordination system in in base rack #32

Merged
merged 4 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
19 changes: 19 additions & 0 deletions src/Microplate/CoordinateSystem1x1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php declare(strict_types=1);

namespace MLL\Utils\Microplate;

class CoordinateSystem1x1 extends CoordinateSystem
{
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
public const POSITIONS_COUNT = 1;

public function rows(): array
{
return range('A', 'A');
}

public function columns(): array
{
return range(1, 1);
fischerl marked this conversation as resolved.
Show resolved Hide resolved
}
}
19 changes: 19 additions & 0 deletions src/Microplate/CoordinateSystem6x4.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php declare(strict_types=1);

namespace MLL\Utils\Microplate;

class CoordinateSystem6x4 extends CoordinateSystem
{
/** Duplicates @see CoordinateSystem::positionsCount() for static contexts. */
public const POSITIONS_COUNT = 24;

public function rows(): array
{
return range('A', 'D');
}

public function columns(): array
{
return range(1, 6);
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/AlublockA.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem6x4;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class AlublockA extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem6x4());
}

public function type(): string
{
return 'Eppis 24x0.5 ml Cooled';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'A';
}

public function positionCount(): int
{
return 24;
}
}
11 changes: 10 additions & 1 deletion src/Tecan/Rack/BaseRack.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace MLL\Utils\Tecan\Rack;

use Illuminate\Support\Collection;
use MLL\Utils\Microplate\CoordinateSystem;

/** @template TContent */
abstract class BaseRack implements Rack
Expand All @@ -12,8 +13,11 @@ abstract class BaseRack implements Rack
/** @var Collection<int, TContent|null> */
public Collection $positions;

public function __construct()
public CoordinateSystem $coordinateSystem;

public function __construct(CoordinateSystem $coordinateSystem)
spawnia marked this conversation as resolved.
Show resolved Hide resolved
{
$this->coordinateSystem = $coordinateSystem;
$this->positions = Collection::times($this->positionCount(), fn () => self::EMPTY_POSITION)
->mapWithKeys(fn ($content, int $position): array => [$position + 1 => $content]);
}
Expand Down Expand Up @@ -83,4 +87,9 @@ public function assignPosition($content, int $position): int

return $position;
}

public function positionCount(): int
{
return $this->coordinateSystem->positionsCount();
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/DestLC.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem96Well;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class DestLC extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem96Well());
}

public function type(): string
{
return '96 Well MP LightCycler480';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'DestLC';
}

public function positionCount(): int
{
return 96;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/DestPCR.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem96Well;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class DestPCR extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem96Well());
}

public function type(): string
{
return '96 Well PCR ABI semi-skirted';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'DestPCR';
}

public function positionCount(): int
{
return 96;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/DestTaqMan.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem96Well;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class DestTaqMan extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem96Well());
}

public function type(): string
{
return '96 Well PCR TaqMan';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'DestTaqMan';
}

public function positionCount(): int
{
return 96;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/FluidXRack.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem96Well;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class FluidXRack extends BaseRack implements ScannedRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem96Well());
}

public function type(): string
{
return '96FluidX';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'FluidX';
}

public function positionCount(): int
{
return 96;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/MPCDNA.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem96Well;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class MPCDNA extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem96Well());
}

public function type(): string
{
return 'MP cDNA';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'MPCDNA';
}

public function positionCount(): int
{
return 96;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/MPSample.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem96Well;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class MPSample extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem96Well());
}

public function type(): string
{
return 'MP Microplate';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'MPSample';
}

public function positionCount(): int
{
return 96;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/MPWater.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem1x1;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class MPWater extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem1x1());
}

public function type(): string
{
return 'Trough 300ml MCA Portrait';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'MPWasser';
}

public function positionCount(): int
{
return 1;
}
}
12 changes: 7 additions & 5 deletions src/Tecan/Rack/MasterMixRack.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

namespace MLL\Utils\Tecan\Rack;

use MLL\Utils\Microplate\CoordinateSystem2x16;

/**
* @template TContent
*
* @extends BaseRack<TContent>
*/
class MasterMixRack extends BaseRack
{
public function __construct()
{
parent::__construct(new CoordinateSystem2x16());
}

public function type(): string
{
return 'Eppis 32x1.5 ml Cooled';
Expand All @@ -18,9 +25,4 @@ public function name(): string
{
return 'MM';
}

public function positionCount(): int
{
return 32;
}
}