@@ -80,7 +80,9 @@ export class PolymerBond extends DrawingEntity {
80
80
public get isBackboneChainConnection ( ) : boolean {
81
81
// Variants:
82
82
// • Not RNA base [R2] — [R1] Not RNA base
83
+ // • Not RNA base [R1] — [R2] Not RNA base
83
84
// • Sugar [R3] — [R1] RNA base
85
+ // • [R1] RNA base — Sugar [R3]
84
86
if ( ! this . secondMonomer ) {
85
87
return true ;
86
88
}
@@ -95,21 +97,28 @@ export class PolymerBond extends DrawingEntity {
95
97
return true ;
96
98
}
97
99
98
- if (
99
- firstMonomerAttachmentPoint === AttachmentPointName . R2 &&
100
- secondMonomerAttachmentPoint === AttachmentPointName . R1 &&
101
- ! ( firstMonomer instanceof RNABase ) &&
102
- ! ( secondMonomer instanceof RNABase )
103
- ) {
100
+ const thereAreR1AndR2 =
101
+ ( firstMonomerAttachmentPoint === AttachmentPointName . R2 &&
102
+ secondMonomerAttachmentPoint === AttachmentPointName . R1 ) ||
103
+ ( firstMonomerAttachmentPoint === AttachmentPointName . R1 &&
104
+ secondMonomerAttachmentPoint === AttachmentPointName . R2 ) ;
105
+ const thereAreNotRNABase =
106
+ ! ( firstMonomer instanceof RNABase ) || ! ( secondMonomer instanceof RNABase ) ;
107
+ if ( thereAreR1AndR2 && thereAreNotRNABase ) {
104
108
return true ;
105
109
}
106
110
107
- return (
111
+ let thereAreSugarWithR3AndRNABaseWithR1 =
108
112
firstMonomer instanceof Sugar &&
109
113
firstMonomerAttachmentPoint === AttachmentPointName . R3 &&
110
114
secondMonomer instanceof RNABase &&
111
- secondMonomerAttachmentPoint === AttachmentPointName . R1
112
- ) ;
115
+ secondMonomerAttachmentPoint === AttachmentPointName . R1 ;
116
+ thereAreSugarWithR3AndRNABaseWithR1 ||=
117
+ secondMonomer instanceof Sugar &&
118
+ secondMonomerAttachmentPoint === AttachmentPointName . R3 &&
119
+ firstMonomer instanceof RNABase &&
120
+ firstMonomerAttachmentPoint === AttachmentPointName . R1 ;
121
+ return thereAreSugarWithR3AndRNABaseWithR1 ;
113
122
}
114
123
115
124
public get isSideChainConnection ( ) : boolean {
0 commit comments