public static AFPChain deleteHighestDistanceColumn ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws StructureException { int [ ] [ ] [ ] optAln = afpChain . getOptAln ( ) ; int maxBlock = 0 ; int maxPos = 0 ; double maxDistance = Double . MIN_VALUE ; for ( int b = 0 ; b < optAln . length ; b ++ ) { for ( int p = 0 ; p < optAln [ b ] [ 0 ] . length ; p ++ ) { Atom ca2clone = ca2 [ optAln [ b ] [ 1 ] [ p ] ] ; Calc . rotate ( ca2clone , afpChain . getBlockRotationMatrix ( ) [ b ] ) ; Calc . shift ( ca2clone , afpChain . getBlockShiftVector ( ) [ b ] ) ; double distance = Calc . getDistance ( ca1 [ optAln [ b ] [ 0 ] [ p ] ] , ca2clone ) ; if ( distance > maxDistance ) { maxBlock = b ; maxPos = p ; maxDistance = distance ; } } } return deleteColumn ( afpChain , ca1 , ca2 , maxBlock , maxPos ) ; }
Find the alignment position with the highest atomic distance between the equivalent atomic positions of the arrays and remove it from the alignment .