@@ -98,9 +98,9 @@ public static QsAlignResult align(List<Subunit> s1, List<Subunit> s2,
9898 for (int i = 0 ; i < c1 .size (); i ++) {
9999 for (int j = 0 ; j < c2 .size (); j ++) {
100100
101- if (clusterMap .keySet (). contains (i ))
101+ if (clusterMap .containsKey (i ))
102102 break ;
103- if (clusterMap .values (). contains (j ))
103+ if (clusterMap .containsValue (j ))
104104 continue ;
105105
106106 // Use structural alignment to match the subunit clusters
@@ -154,9 +154,9 @@ public static QsAlignResult align(List<Subunit> s1, List<Subunit> s2,
154154 for (int i = 0 ; i < index2 ; i ++) {
155155 for (int j = index2 ; j < clust1 .size (); j ++) {
156156
157- if (subunitMap .keySet (). contains (i ))
157+ if (subunitMap .containsKey (i ))
158158 break ;
159- if (subunitMap .values (). contains (j ))
159+ if (subunitMap .containsValue (j ))
160160 continue ;
161161
162162 // Obtain cumulative transformation matrix
@@ -294,8 +294,7 @@ public static QsAlignResult align(List<Subunit> s1, List<Subunit> s2,
294294 if (result .getAlignment () == null ) {
295295 result .setSubunitMap (subunitMap );
296296 result .setAlignment (msa );
297- } else if (msa .getScore (MultipleAlignmentScorer .RMSD ) < result
298- .getRmsd ()) {
297+ } else if (msa .getScore (MultipleAlignmentScorer .RMSD ) < result .getRmsd ()) {
299298 result .setSubunitMap (subunitMap );
300299 result .setAlignment (msa );
301300 logger .info ("Better result found: " + result .toString ());
@@ -324,8 +323,8 @@ private static Pair<Atom[]> getAlignedAtomsForClusterSubunitMap(
324323 List <SubunitCluster > clusters ,
325324 Map <Integer , Map <Integer , Integer >> clusterSubunitMap ) {
326325
327- List <Atom > atomArray1 = new ArrayList <Atom >();
328- List <Atom > atomArray2 = new ArrayList <Atom >();
326+ List <Atom > atomArray1 = new ArrayList <>();
327+ List <Atom > atomArray2 = new ArrayList <>();
329328
330329 // For each cluster of subunits
331330 for (int key : clusterSubunitMap .keySet ()) {
@@ -348,9 +347,9 @@ private static Pair<Atom[]> getAlignedAtomsForClusterSubunitMap(
348347 }
349348
350349 }
351- return new Pair <Atom [] >(
352- atomArray1 .toArray (new Atom [atomArray1 . size () ]),
353- atomArray2 .toArray (new Atom [atomArray2 . size () ]));
350+ return new Pair <>(
351+ atomArray1 .toArray (new Atom [0 ]),
352+ atomArray2 .toArray (new Atom [0 ]));
354353 }
355354
356355 /**
@@ -364,12 +363,10 @@ private static Pair<Atom[]> getAlignedAtomsForClusterSubunitMap(
364363 * @param clusterSubunitMap
365364 * map from cluster id to subunit matching
366365 * @return transformation matrix
367- * @throws StructureException
368366 */
369367 private static Matrix4d getTransformForClusterSubunitMap (
370368 List <SubunitCluster > clusters ,
371- Map <Integer , Map <Integer , Integer >> clusterSubunitMap )
372- throws StructureException {
369+ Map <Integer , Map <Integer , Integer >> clusterSubunitMap ) {
373370
374371 Pair <Atom []> pair = getAlignedAtomsForClusterSubunitMap (clusters ,
375372 clusterSubunitMap );
0 commit comments