Skip to content

Commit ede5cee

Browse files
committed
Tidying up
1 parent ddeb759 commit ede5cee

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/asa/AsaCalculator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public AsaCalculator(Point3d[] atomCoords, double probe, int nSpherePoints, int
221221
*/
222222
public GroupAsa[] getGroupAsas() {
223223

224-
TreeMap<ResidueNumber, GroupAsa> asas = new TreeMap<ResidueNumber, GroupAsa>();
224+
TreeMap<ResidueNumber, GroupAsa> asas = new TreeMap<>();
225225

226226
double[] asasPerAtom = calculateAsas();
227227

biojava-structure/src/test/java/org/biojava/nbio/structure/asa/TestAsaCalc.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,18 @@ public void testPerformance() throws StructureException, IOException {
141141
// that's because it depends on the order on how tests were run - JD 2018-03-10
142142
ChemCompGroupFactory.setChemCompProvider(new DownloadChemCompProvider());
143143

144-
Structure structure = StructureIO.getStructure("4F5X");
145-
Chain c = structure.getPolyChainByPDB("W");
146-
Atom[] atoms = StructureTools.getAllAtomArray(c);
144+
Structure structure = StructureIO.getStructure("3HBX");
145+
Atom[] atoms = StructureTools.getAllAtomArray(structure);
147146
System.out.printf("Total of %d atoms. n(n-1)/2= %d \n", atoms.length, atoms.length*(atoms.length-1)/2);
148147

149148
int nThreads = 1;
150-
// 1. WITH SPATIAL HASHING
149+
int nSpherePoints = 100;
151150

151+
// 1. WITH SPATIAL HASHING
152152
long start = System.currentTimeMillis();
153153
AsaCalculator asaCalc = new AsaCalculator(atoms,
154154
AsaCalculator.DEFAULT_PROBE_SIZE,
155-
100, nThreads);
155+
nSpherePoints, nThreads);
156156
asaCalc.setUseSpatialHashingForNeighbors(true);
157157

158158
double[] asas = asaCalc.calculateAsas();
@@ -166,14 +166,12 @@ public void testPerformance() throws StructureException, IOException {
166166
double withSH = totAtoms;
167167
System.out.printf("Total ASA is %6.2f \n", totAtoms);
168168

169-
//System.out.println("Distances calculated: " + asaCalc.distancesCalculated);
170-
171169

172170
// 2. WITHOUT SPATIAL HASHING
173171
start = System.currentTimeMillis();
174172
asaCalc = new AsaCalculator(atoms,
175173
AsaCalculator.DEFAULT_PROBE_SIZE,
176-
100, nThreads);
174+
nSpherePoints, nThreads);
177175
asaCalc.setUseSpatialHashingForNeighbors(false);
178176

179177
asas = asaCalc.calculateAsas();
@@ -187,7 +185,6 @@ public void testPerformance() throws StructureException, IOException {
187185
double withoutSH = totAtoms;
188186
System.out.printf("Total ASA is %6.2f \n", totAtoms);
189187

190-
//System.out.println("Distances calculated: " + asaCalc.distancesCalculated);
191188

192189
assertEquals(withoutSH, withSH, 0.000001);
193190

0 commit comments

Comments
 (0)