#include #include #include #include #include "scio.h" #include "switches.h" #include "likelihood.h" #include "sc.h" #include "scconst.h" #include "options.h" #include "compute_like.h" #include "interface.h" #include "stats.h" void PairCoilDifferDimension(int mode, Sequence sequence, char lib[MAXFUNCTNUM], double *maxscore, char preproc_offsets[MAXSEQLEN], double preproc_scores[MAXSEQLEN][POSNUM+1], double all_scores[MAX_NUM_SCORE_DIM][MAXSEQLEN][POSNUM+1], char all_offsets[MAX_NUM_SCORE_DIM][MAXSEQLEN], int dimension, int offset_to_use, int number_differ_score_dim, double bound) { int i,j, pass,pos; double sc2scores[MAXSEQLEN][POSNUM]; char diff_offsets[MAXSEQLEN]; extern int which_differentiator; extern int differ_window_length; int number_passes=1; int start_coil =-1; double coil_score[POSNUM]; /** which_differentiator = 1 means do window score starting at residue**/ /** If it is 2 means find both max and min window. ******/ /** Passing 1 into scseqadj makes it return residue scores so the **/ /** residue gets the window score for the window starting at that **/ /** residue. 2 returns the max window score containing the residue **/ /** and 3 returns the min window score. **/ WINDOW = differ_window_length; /** TEMPORARY. **/ if (which_differentiator ==2) number_passes=2; else number_passes=1; for ( pass=0; pass= 0) && ( (i==sequence.seqlen) || (preproc_scores[i][7]<=bound) || /* End coil */ ( (i>0) && (preproc_offsets[i] != preproc_offsets[i-1])) )) { /*regshift*/ /* WINDOW= i-start_coil; */ /******* scseqadj(lib, &(sequence.seq[start_coil]), i-start_coil, &(sc2scores[start_coil][0]), &(diff_offsets[start_coil]), maxscore, mode, 1); *******/ /** score_differentiator_window(lib, &(sequence.seq[start_coil]), i-start_coil, coil_score,mode, 1); **/ score_differentiator_window(lib, &(sequence.seq[start_coil]), i-start_coil, coil_score,mode, 1); /* fprintf(stderr,"\n start_coil = %d, end_coil =%d",start_coil, i-1); */ for(j=start_coil; j bound) && (start_coil ==-1)) start_coil =i; i++; } } else scseqadj(lib, sequence.seq, sequence.seqlen, sc2scores, diff_offsets, maxscore, mode, pass + which_differentiator); /* Get differentiator score.*/ /* pass + which_diff = 2 is max_window_score **/ /* 3 is min_window_score **/ for (i=0; i bound) all_scores[olig][res][reg] = all_scores[olig+3][res][reg]; else all_scores[olig][res][reg] =0; } void zero_out_bad_windows(int differ_window_length, double all_scores[MAX_NUM_SCORE_DIM][MAXSEQLEN][POSNUM+1], double preproc_like[MAXSEQLEN][POSNUM+1], int seqlen, double bound) { int i,j; int last_bad_window_start=-1; int olig_state, pos; /*** For now just look at score of first and last residue in window to **/ /** see if they are above bound. To really do it right should look at */ /** min score in window (using min_over_windows on preproc_like), but */ /** the format expected by min_over_windows would require the POSNUM+1 */ /** indice of preproc_like be in the first, not second position.... */ for (i=0; i