public static void updateScore ( FatCatParameters params , AFPChain afpChain ) { int i , j , bknow , bkold , g1 , g2 ; afpChain . setConn ( 0d ) ; afpChain . setDVar ( 0d ) ; int blockNum = afpChain . getBlockNum ( ) ; int alignScoreUpdate = 0 ; double [ ] blockScore = afpChain . getBlockScore ( ) ; int [ ] blockGap = afpChain . getBlockGap ( ) ; int [ ] blockSize = afpChain . getBlockSize ( ) ; int [ ] afpChainList = afpChain . getAfpChainList ( ) ; List < AFP > afpSet = afpChain . getAfpSet ( ) ; int [ ] block2Afp = afpChain . getBlock2Afp ( ) ; double torsionPenalty = params . getTorsionPenalty ( ) ; bkold = 0 ; for ( i = 0 ; i < blockNum ; i ++ ) { blockScore [ i ] = 0 ; blockGap [ i ] = 0 ; for ( j = 0 ; j < blockSize [ i ] ; j ++ ) { bknow = afpChainList [ block2Afp [ i ] + j ] ; if ( j == 0 ) { blockScore [ i ] = afpSet . get ( bknow ) . getScore ( ) ; } else { AFPChainer . afpPairConn ( bkold , bknow , params , afpChain ) ; //note: j, i Double conn = afpChain . getConn ( ) ; blockScore [ i ] += afpSet . get ( bknow ) . getScore ( ) + conn ; g1 = afpSet . get ( bknow ) . getP1 ( ) - afpSet . get ( bkold ) . getP1 ( ) - afpSet . get ( bkold ) . getFragLen ( ) ; g2 = afpSet . get ( bknow ) . getP2 ( ) - afpSet . get ( bkold ) . getP2 ( ) - afpSet . get ( bkold ) . getFragLen ( ) ; blockGap [ i ] += ( g1 > g2 ) ? g1 : g2 ; } bkold = bknow ; } alignScoreUpdate += blockScore [ i ] ; } if ( blockNum >= 2 ) { alignScoreUpdate += ( blockNum - 1 ) * torsionPenalty ; } afpChain . setBlockGap ( blockGap ) ; afpChain . setAlignScoreUpdate ( alignScoreUpdate ) ; afpChain . setBlockScore ( blockScore ) ; afpChain . setBlockSize ( blockSize ) ; afpChain . setAfpChainList ( afpChainList ) ; afpChain . setBlock2Afp ( block2Afp ) ; }
to update the chaining score after block delete and merge processed the blockScore value is important for significance evaluation