private boolean shrinkBlock ( ) throws StructureException , RefinerFailedException { // Let shrink moves only if the repeat is larger enough if ( repeatCore <= Lmin ) return false ; // Select column by maximum distance updateMultipleAlignment ( ) ; Matrix residueDistances = MultipleAlignmentTools . getAverageResidueDistances ( msa ) ; double maxDist = Double . MIN_VALUE ; double [ ] colDistances = new double [ length ] ; int res = 0 ; for ( int col = 0 ; col < length ; col ++ ) { int normalize = 0 ; for ( int s = 0 ; s < order ; s ++ ) { if ( residueDistances . get ( s , col ) != - 1 ) { colDistances [ col ] += residueDistances . get ( s , col ) ; normalize ++ ; } } colDistances [ col ] /= normalize ; if ( colDistances [ col ] > maxDist ) { // geometric distribution if ( rnd . nextDouble ( ) > 0.5 ) { maxDist = colDistances [ col ] ; res = col ; } } } for ( int su = 0 ; su < order ; su ++ ) { Integer residue = block . get ( su ) . get ( res ) ; block . get ( su ) . remove ( res ) ; if ( residue != null ) freePool . add ( residue ) ; Collections . sort ( freePool ) ; } length -- ; checkGaps ( ) ; return true ; }
Deletes an alignment column at a randomly selected position .