7272 * <p>
7373 * Methods include: blank out regions of DP Matrix, build symmetry graphs, get
7474 * rotation symmetry angles, split repeats in quaternary structure chains,
75- * convert between symmetry formats (full, repeats, rotations), determine if
76- * two symmetry axes are equivalent, get groups from representative Atoms.
75+ * convert between symmetry formats (full, repeats, rotations), determine if two
76+ * symmetry axes are equivalent, get groups from representative Atoms.
7777 *
7878 * @author Spencer Bliven
7979 * @author Aleix Lafita
@@ -517,7 +517,7 @@ public static Structure getQuaternaryStructure(CeSymmResult symmetry) {
517517
518518 // Create new structure containing the repeat atoms
519519 for (int i = 0 ; i < symmetry .getSymmOrder (); i ++) {
520-
520+
521521 Chain newCh = new ChainImpl ();
522522
523523 Block align = symmetry .getMultipleAlignment ().getBlock (0 );
@@ -526,16 +526,16 @@ public static Structure getQuaternaryStructure(CeSymmResult symmetry) {
526526 int res1 = align .getStartResidue (i );
527527 int res2 = align .getFinalResidue (i );
528528
529- Atom [] repeat = Arrays .copyOfRange (atoms , res1 , res2 + 1 );
530-
529+ Atom [] repeat = Arrays .copyOfRange (atoms , res1 , res2 + 1 );
530+
531531 for (int k = 0 ; k < repeat .length ; k ++) {
532532 Group g = (Group ) repeat [k ].getGroup ().clone ();
533533 newCh .addGroup (g );
534534 }
535535 newCh .setChainID (chainID + "" );
536536 chainID ++;
537537 symm .addChain (newCh );
538-
538+
539539 }
540540 return symm ;
541541 }
@@ -629,8 +629,8 @@ public static MultipleAlignment toRepeatsAlignment(CeSymmResult result)
629629 /**
630630 * Converts a refined symmetry AFPChain alignment into the standard
631631 * representation of symmetry in a MultipleAlignment, that contains the
632- * entire Atom array of the strcuture and the symmetric repeats are
633- * orgaized in different rows in a single Block.
632+ * entire Atom array of the strcuture and the symmetric repeats are orgaized
633+ * in different rows in a single Block.
634634 *
635635 * @param symm
636636 * AFPChain created with a symmetry algorithm and refined
@@ -678,7 +678,7 @@ public static MultipleAlignment fromAFP(AFPChain symm, Atom[] atoms)
678678
679679 CoreSuperimposer imposer = new CoreSuperimposer ();
680680 imposer .superimpose (result );
681- MultipleAlignmentScorer . calculateScores (result );
681+ updateSymmetryScores (result );
682682
683683 return result ;
684684 }
@@ -737,8 +737,8 @@ public static QuatSymmetryResults getQuaternarySymmetry(CeSymmResult result)
737737 // Obtain the clusters of aligned Atoms and repeat variables
738738 MultipleAlignment repeats = SymmetryTools .toRepeatsAlignment (result );
739739 List <Atom []> alignedCA = repeats .getAtomArrays ();
740- List <Integer > corePos = MultipleAlignmentTools
741- .getCorePositions ( repeats . getBlock (0 ));
740+ List <Integer > corePos = MultipleAlignmentTools . getCorePositions ( repeats
741+ .getBlock (0 ));
742742
743743 List <Point3d []> caCoords = new ArrayList <Point3d []>();
744744 List <Integer > folds = new ArrayList <Integer >();
@@ -884,15 +884,16 @@ public static List<Group> getGroups(Atom[] rAtoms) {
884884 }
885885 return groups ;
886886 }
887-
887+
888888 /**
889889 * Calculates the set of symmetry operation Matrices (transformations) of
890890 * the new alignment, based on the symmetry relations in the SymmetryAxes
891- * object. It sets the transformations to the input MultipleAlignment and
892- * SymmetryAxes objects.
891+ * object. It sets the transformations to the input MultipleAlignment and
892+ * SymmetryAxes objects. If the SymmetryAxes object is null, the
893+ * superposition of the repeats is done without symmetry constraints.
893894 * <p>
894- * If the SymmetryAxes object is null, the superposition of the repeats is
895- * done without symmetry constraints .
895+ * This method also sets the scores (RMSD and TM-score) after the new
896+ * superposition has been updated .
896897 *
897898 * @param axes
898899 * SymmetryAxes object. It will be modified.
@@ -941,7 +942,7 @@ public static void updateSymmetryTransformation(SymmetryAxes axes,
941942 axis = svd .getTransformation ();
942943 axes .updateAxis (t , axis );
943944 }
944-
945+
945946 // Get the transformations from the SymmetryAxes
946947 List <Matrix4d > transformations = new ArrayList <Matrix4d >();
947948 for (int su = 0 ; su < msa .size (); su ++) {
@@ -953,6 +954,27 @@ public static void updateSymmetryTransformation(SymmetryAxes axes,
953954 MultipleSuperimposer imposer = new CoreSuperimposer ();
954955 imposer .superimpose (msa );
955956 }
957+ updateSymmetryScores (msa );
958+ }
959+
960+ /**
961+ * Update the scores (TM-score and RMSD) of a symmetry multiple alignment.
962+ * This method does not redo the superposition of the alignment.
963+ *
964+ * @param symm
965+ * Symmetry Multiple Alignment of Repeats
966+ * @throws StructureException
967+ */
968+ public static void updateSymmetryScores (MultipleAlignment symm )
969+ throws StructureException {
970+
971+ // Multiply by the order of symmetry to normalize score
972+ double tmScore = MultipleAlignmentScorer .getAvgTMScore (symm )
973+ * symm .size ();
974+ double rmsd = MultipleAlignmentScorer .getRMSD (symm );
975+
976+ symm .putScore (MultipleAlignmentScorer .AVGTM_SCORE , tmScore );
977+ symm .putScore (MultipleAlignmentScorer .RMSD , rmsd );
956978 }
957-
979+
958980}
0 commit comments