public static int afp2Res ( AFPChain afpChain , int afpn , int [ ] afpPositions , int listStart ) { int [ ] res1 = afpChain . getFocusRes1 ( ) ; int [ ] res2 = afpChain . getFocusRes2 ( ) ; int minLen = afpChain . getMinLen ( ) ; int n = 0 ; List < AFP > afpSet = afpChain . getAfpSet ( ) ; for ( int i = listStart ; i < listStart + afpn ; i ++ ) { int a = afpPositions [ i ] ; for ( int j = 0 ; j < afpSet . get ( a ) . getFragLen ( ) ; j ++ ) { if ( n >= minLen ) { throw new RuntimeException ( "Error: too many residues in AFPChainer.afp2Res!" ) ; } res1 [ n ] = afpSet . get ( a ) . getP1 ( ) + j ; res2 [ n ] = afpSet . get ( a ) . getP2 ( ) + j ; n ++ ; } } afpChain . setFocusRes1 ( res1 ) ; afpChain . setFocusRes2 ( res2 ) ; afpChain . setFocusResn ( n ) ; if ( n == 0 ) { logger . warn ( "n=0!!! + " + afpn + " " + listStart + " " + afpPositions . length ) ; } return n ; }
Set the list of equivalent residues in the two proteins given a list of AFPs