-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3475 - corrected logic for all types of monomers
- Loading branch information
chgayane
authored and
chgayane
committed
Nov 8, 2023
1 parent
ab84cf9
commit 0a42c9f
Showing
6 changed files
with
33 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
import { BaseMonomer } from './BaseMonomer'; | ||
|
||
export class Peptide extends BaseMonomer { | ||
|
||
public getValidSourcePoint(monomer: BaseMonomer) { | ||
if ( | ||
monomer.hasAttachmentPoint('R1') && | ||
!monomer.isAttachmentPointUsed('R1') | ||
) { | ||
return this.R1AttachmentPoint; | ||
} | ||
return this.R2AttachmentPoint; | ||
|
||
if (monomer.isAttachmentPointExistAndFree('R1') && this.isAttachmentPointExistAndFree('R2')) { | ||
|
||
return 'R2'; | ||
|
||
} | ||
if (this.isAttachmentPointExistAndFree('R1') && monomer.isAttachmentPointExistAndFree('R2') ) { | ||
return 'R1'; | ||
} | ||
|
||
return this.firstFreeAttachmentPoint; | ||
} | ||
|
||
public getValidTargetPoint(monomer: BaseMonomer) { | ||
if ( | ||
monomer.hasAttachmentPoint('R2') && | ||
!monomer.isAttachmentPointUsed('R2') | ||
) { | ||
return this.R2AttachmentPoint; | ||
} | ||
return this.R1AttachmentPoint; | ||
|
||
if (this.isAttachmentPointExistAndFree('R1') && monomer.isAttachmentPointExistAndFree('R2') ) { | ||
return 'R1'; | ||
} | ||
if (monomer.isAttachmentPointExistAndFree('R1') && this.isAttachmentPointExistAndFree('R2')) { | ||
return 'R2'; | ||
} | ||
|
||
return this.firstFreeAttachmentPoint; | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
import { BaseMonomer } from 'domain/entities/BaseMonomer'; | ||
import { Sugar } from './Sugar'; | ||
|
||
export class RNABase extends BaseMonomer { | ||
public getValidSourcePoint(monomer: BaseMonomer) { | ||
return monomer.firstFreeAttachmentPoint; | ||
} | ||
|
||
public getValidTargetPoint(monomer: BaseMonomer) { | ||
if (monomer instanceof Sugar) { | ||
return 'R3'; | ||
} | ||
return this.firstFreeAttachmentPoint; | ||
return monomer.firstFreeAttachmentPoint; | ||
} | ||
} |
This file contains 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