Skip to content

Commit

Permalink
Pyoverdin problem
Browse files Browse the repository at this point in the history
  • Loading branch information
privrja committed Apr 25, 2021
1 parent 3319f3b commit d911780
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Smiles/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ public function setDigits(array $arDigits): void {
* @param Digit $digit
*/
public function addDigit(Digit $digit): void {
foreach ($this->arDigits as $dig) {
if ($dig->getDigit() === $digit->getDigit()) {
return;
}
}
$this->arDigits[] = $digit;
}

Expand Down
6 changes: 6 additions & 0 deletions tests/Smiles/UniqueSmilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,10 @@ public function testCyclicAromatic2() {
$this->assertEquals('NC(CC1=CNC=N1)C(O)=O', $smiles);
}

public function testPyoverdinD() {
$graph = new Graph('CC(C1C(=O)NC(C(=O)NCCCCC(C(=O)NC(C(=O)N1)CCCN(C=O)O)NC(=O)C(CCCN(C=O)O)NC(=O)C(CO)NC(=O)C(CCCN=C(N)N)NC(=O)C(CO)NC(=O)C2CCNC3=C(C=C4C=C(C(=O)C=C4N23)O)NC(=O)CCC(=O)O)C(C)O)O');
$smiles = $graph->getUniqueSmiles();
$this->assertEquals('CC(O)C1NC(=O)C(NC(=O)C(CCCN(O)C=O)NC(=O)C(CCCCNC1=O)NC(=O)C(CCCN(O)C=O)NC(=O)C(CO)NC(=O)C(CCCN=C(N)N)NC(=O)C(CO)NC(=O)C2CCNC3=C(NC(=O)CCC(O)=O)C=C4C=C(O)C(=O)C=C4N23)C(C)O', $smiles);
}

}

0 comments on commit d911780

Please sign in to comment.