public static int [ ] setSteps ( Last [ ] [ ] [ ] traceback , int [ ] [ ] [ ] scores , List < Step > sx , List < Step > sy ) { int xMax = scores . length - 1 , yMax = scores [ xMax ] . length - 1 ; boolean linear = ( traceback [ xMax ] [ yMax ] . length == 1 ) ; Last last = linear ? traceback [ xMax ] [ yMax ] [ 0 ] : ( scores [ xMax ] [ yMax ] [ 1 ] > scores [ xMax ] [ yMax ] [ 0 ] && scores [ xMax ] [ yMax ] [ 1 ] > scores [ xMax ] [ yMax ] [ 2 ] ) ? Last . DELETION : ( scores [ xMax ] [ yMax ] [ 0 ] > scores [ xMax ] [ yMax ] [ 2 ] ) ? Last . SUBSTITUTION : Last . INSERTION ; return setSteps ( traceback , false , new int [ ] { xMax , yMax } , last , sx , sy ) ; }
Find global alignment path through traceback matrix