feat: Implement logic for Chromosome.php, GenomicPosition.php and Gen…#76
Open
KingKong1213 wants to merge 9 commits intomasterfrom
Open
feat: Implement logic for Chromosome.php, GenomicPosition.php and Gen…#76KingKong1213 wants to merge 9 commits intomasterfrom
KingKong1213 wants to merge 9 commits intomasterfrom
Conversation
simbig
reviewed
Mar 3, 2026
Contributor
simbig
left a comment
There was a problem hiding this comment.
Gutes Fundament — die Value Objects sind sauber aufgebaut. Ein paar fachliche Punkte die ich vor dem Merge klären würde.
| && ( | ||
| $this->positionIsBetweenStartAndEnd($genomicRegion->start) | ||
| || $this->positionIsBetweenStartAndEnd($genomicRegion->end) | ||
| ); |
Contributor
There was a problem hiding this comment.
Bug: Falsch bei vollständiger Überlappung
Wenn Region B die Region A komplett umschließt (z.B. A=chr11:20-30, B=chr11:10-40), liefert die Methode fälschlich false, weil weder B.start noch B.end innerhalb von A liegt.
Fix — die kanonische Intervall-Formel:
return $this->chromosome->equals($other->chromosome)
&& $this->start <= $other->end
&& $other->start <= $this->end;
src/Chromosome.php
Outdated
| ? new ReferenzGenome(ReferenzGenome::HG_19) | ||
| : new ReferenzGenome(ReferenzGenome::GRCH_37); | ||
|
|
||
| $this->value = $matches[2]; |
Contributor
There was a problem hiding this comment.
Case und M/MT normalisieren
- Die Regex ist case-insensitive, aber der gespeicherte Wert behält die Original-Schreibweise →
chrxundchrXwären bei Vergleichen ungleich. Fix:strtoupper($matches[2]) MundMTbezeichnen beide das Mitochondrien-Chromosom, werden aber als unterschiedliche Werte gespeichert.chrMTist zudem kein gültiger UCSC-Bezeichner (korrekt:chrM). Fix:MT→Mnormalisieren.
simbig
reviewed
Mar 3, 2026
src/GenomicRegion.php
Outdated
| return $position >= $this->start && $position <= $this->end; | ||
| } | ||
|
|
||
| public function toString(?ReferenzGenome $referenceGenome = null): string |
Contributor
There was a problem hiding this comment.
to NamingConvention mit UCSC/ENSEMBL. also es geht ja drum mittels welcher namingConvention es serialisiert werden soll, oder?
Fix example
…WithGenomicRegion and isCoveredByGenomicRegion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GenomicRegion.php
Changes
Implement logic for Chromosome.php, GenomicPosition.php and GenomicRegion.php
Breaking changes