$darkmode
DENOPTIM
BridgeHeadFindingRule.java
Go to the documentation of this file.
1package denoptim.fragmenter;
2
10{
15 private String ruleName;
16
20 private String smarts;
21
26 private int[] bridgeHeadPositions;
27
33 private int[] allowedBridgeLength;
34
39 private int lengthInAtoms;
40
41
42//------------------------------------------------------------------------------
43
54 public BridgeHeadFindingRule(String name, String smarts,
56 int lengthInAtoms)
57 {
58 this.ruleName = name;
59 this.smarts = smarts;
60 this.bridgeHeadPositions = bridgeHeadPositions;
61 this.allowedBridgeLength = allowedBridgeLength;
62 this.lengthInAtoms = lengthInAtoms;
63 }
64
65//------------------------------------------------------------------------------
66
70 public String getName()
71 {
72 return ruleName;
73 }
74
75//------------------------------------------------------------------------------
76
80 public String getSMARTS()
81 {
82 return smarts;
83 }
84
85//------------------------------------------------------------------------------
86
92 {
94 }
95
96//------------------------------------------------------------------------------
97
104 {
105 return allowedBridgeLength;
106 }
107
108 //------------------------------------------------------------------------------
109
118 public int[] getAllowedBridgeLength(int maxRingSize)
119 {
120 if (allowedBridgeLength!=null)
121 return allowedBridgeLength;
122
123 // Any bridge length is allowed
124 int[] anyLength = new int[maxRingSize - lengthInAtoms];
125 for (int i=1; i<anyLength.length; i++) {
126 anyLength[i-1] = i;
127 }
128 return anyLength;
129 }
130
131//------------------------------------------------------------------------------
132
139 {
140 return lengthInAtoms;
141 }
142
143//------------------------------------------------------------------------------
144
145}
SMARTS-based rules to identify potential bridge head atoms for ring fusion operations.
int lengthInAtoms
Number of atoms in the existing bridge connecting the bridge-head atoms, including the bridge-head at...
BridgeHeadFindingRule(String name, String smarts, int[] bridgeHeadPositions, int[] allowedBridgeLength, int lengthInAtoms)
Constructs a new rule defined by the given arguments.
String smarts
SMARTS query matching the substructure of interest.
int[] bridgeHeadPositions
The indexes of the atoms that can be bridge head in the matches substructure.
int[] allowedBridgeLength
Allowed bridge length in number of atoms.
String getName()
Returns the name of this rule.