public static MultipleAlignment fromAFP ( AFPChain symm , Atom [ ] atoms ) throws StructureException { if ( ! symm . getAlgorithmName ( ) . contains ( "symm" ) ) { throw new IllegalArgumentException ( "The input alignment is not a symmetry alignment." ) ; } MultipleAlignmentEnsemble e = new MultipleAlignmentEnsembleImpl ( symm , atoms , atoms , false ) ; e . setAtomArrays ( new ArrayList < Atom [ ] > ( ) ) ; StructureIdentifier name = null ; if ( e . getStructureIdentifiers ( ) != null ) { if ( ! e . getStructureIdentifiers ( ) . isEmpty ( ) ) name = e . getStructureIdentifiers ( ) . get ( 0 ) ; } else name = atoms [ 0 ] . getGroup ( ) . getChain ( ) . getStructure ( ) . getStructureIdentifier ( ) ; e . setStructureIdentifiers ( new ArrayList < StructureIdentifier > ( ) ) ; MultipleAlignment result = new MultipleAlignmentImpl ( ) ; BlockSet bs = new BlockSetImpl ( result ) ; Block b = new BlockImpl ( bs ) ; b . setAlignRes ( new ArrayList < List < Integer > > ( ) ) ; int order = symm . getBlockNum ( ) ; for ( int su = 0 ; su < order ; su ++ ) { List < Integer > residues = e . getMultipleAlignment ( 0 ) . getBlock ( su ) . getAlignRes ( ) . get ( 0 ) ; b . getAlignRes ( ) . add ( residues ) ; e . getStructureIdentifiers ( ) . add ( name ) ; e . getAtomArrays ( ) . add ( atoms ) ; } e . getMultipleAlignments ( ) . set ( 0 , result ) ; result . setEnsemble ( e ) ; CoreSuperimposer imposer = new CoreSuperimposer ( ) ; imposer . superimpose ( result ) ; updateSymmetryScores ( result ) ; return result ; }
Converts a refined symmetry AFPChain alignment into the standard representation of symmetry in a MultipleAlignment that contains the entire Atom array of the strcuture and the symmetric repeats are orgaized in different rows in a single Block .