Fixes for failed test cases (most was due to the data being used or problems with...
[jabaws.git] / binaries / src / tcoffee / t_coffee_source / io_func.c
index 44ff9e4..d9816e9 100644 (file)
@@ -96,7 +96,7 @@ char *    get_string_type   (char *S)
              sprintf ( type, "PROTEIN");
            
          }
-       else if ( dna>98 && rna>10)sprintf ( type, "RNA");
+       else if ( dna>98 && rna>0)sprintf ( type, "RNA");
        else if ( dna>98)sprintf ( type, "DNA");
        else sprintf ( type, "PROTEIN");
        
@@ -268,13 +268,15 @@ int ** read_matrice (char *mat_name_in)
        {
        int a,b,c, l;
 
-       char AA[]="abcdefghiklmnpqrstvwxyz";
+       char *AA;
         FILE *fp;
        int **matrice;
        int **matrix2;
        char mat_name[200];
        int *vector=NULL;
        
+       AA=vcalloc (256, sizeof (char));
+       sprintf (AA, "abcdefghiklmnpqrstvwxyz");
        l=strlen(AA);
 
        
@@ -330,6 +332,9 @@ int ** read_matrice (char *mat_name_in)
        else if (strm(mat_name, "ralpha_mat" ))vector=ralpha_mat;
        else if (strm(mat_name, "rcoil_mat" ))vector=rcoil_mat;
        else if (strm (mat_name, "jtttm250mt"))vector=jtttm250mt;
+       
+       else if (strm (mat_name, "promoter_tf1"))vector=promoter_tf1;
+       else if (strm (mat_name, "blosumR"))vector=blosumR;
 
        /*Header Matrices*/
        if(vector)
@@ -655,6 +660,23 @@ void get_rgb_values ( int val, Color *C)
 
     
      }
+
+// void output_tm_mark(FILE_format *fps)
+// {
+//    Color *box_c=vcalloc ( 1, sizeof (Color));
+//    Color *ink;
+//    get_rgb_values_format (INK_COLOR,     (ink  =vcalloc ( 1, sizeof (Color))));
+// 
+//    get_rgb_values_format ( 5, box_c);
+//    fps=print_format_char ( " IN ", box_c,ink,fps);
+// 
+//    get_rgb_values_format ( 9, box_c);
+//    fps=print_format_char ( " HEL ", box_c,ink,fps);
+// 
+//    get_rgb_values_format ( 0, box_c);
+//    fps=print_format_char ( "OUT", box_c,ink,fps);
+// }
+
 int output_color_format ( Alignment *B,Alignment *Sin,char *name, \
 FILE_format *(*vfopen_format)          ( char *),\
 FILE_format *(*print_format_string)    ( char * ,Color *, Color *, FILE_format*),\
@@ -736,6 +758,19 @@ FILE_format* (*vfclose_format)         ( FILE_format *))
    sprintf (buf, "\n%s, %s(%s)\n%s\n",PROGRAM,VERSION,DATE, AUTHOR);     
    fps=print_format_string ( buf,white, ink, fps);
 
+   if(B->output_tm == 1)
+   {
+       fps=print_format_char ( '\n', white, ink, fps);
+       get_rgb_values_format ( 5, box_c);
+       fps=print_format_string ( " IN ", box_c,ink,fps);
+       
+       get_rgb_values_format ( 9, box_c);
+       fps=print_format_string ( " HEL ", box_c,ink,fps);
+       
+       get_rgb_values_format ( 0, box_c);
+       fps=print_format_string ( " OUT ", box_c,ink,fps);
+   }
+
    fps=print_format_string ( "\n\n",white,ink, fps);
    
    fps->line-=max_len;
@@ -1153,7 +1188,12 @@ void output_hit_matrix(char *fileName, float **ffpHitScoreMatrix, int nl)
        }
        vfclose(fp);
 }
-
+int output_hit_color_format (Alignment *B, float **ffPScoreTable, int nl, char *name, \
+FILE_format *(*vfopen_format)          ( char *),\
+FILE_format *(*print_format_string)    ( char * ,Color *, Color *, FILE_format*),\
+FILE_format *(*print_format_char)      ( int    ,Color *, Color *, FILE_format*),\
+void         (*get_rgb_values_format)  ( int    ,Color *),\
+FILE_format* (*vfclose_format)         ( FILE_format *));
 int output_hit_color_html (Alignment *B, float **ffPScoreTable, int nl, char *name)
 {
    output_hit_color_format (B, ffPScoreTable, nl, name, vfopen_html,print_html_string,print_html_char,get_rgb_values_html, vfclose_html);
@@ -1330,7 +1370,7 @@ FILE_format* vfopen_html ( char *name)
 
       fprintf(fhtml->fp,"<html>\n<style>\n");
      
-      fprintf(fhtml->fp,"SPAN { font-family: courier new, courier-new, courier; font-weight: bold; font-size: %dpt;}\n", fhtml->font);
+      fprintf(fhtml->fp,"SPAN { font-family: courier new, courier-new, courier, monospace; font-weight: bold; font-size: %dpt;}\n", fhtml->font);
       fprintf(fhtml->fp,"SPAN { line-height:100%%}\n");
       fprintf(fhtml->fp,"SPAN {        white-space: pre}\n");
       
@@ -1461,11 +1501,11 @@ int       output_seq_reliability_ascii     ( Alignment *B,Alignment *S, char *na
   return 1;
 }
   
-/*********************************COPYRIGHT NOTICE**********************************/
+/******************************COPYRIGHT NOTICE*******************************/
 /*© Centro de Regulacio Genomica */
 /*and */
 /*Cedric Notredame */
-/*Tue Oct 27 10:12:26 WEST 2009. */
+/*Fri Feb 18 08:27:45 CET 2011 - Revision 596. */
 /*All rights reserved.*/
 /*This file is part of T-COFFEE.*/
 /**/
@@ -1489,4 +1529,4 @@ int       output_seq_reliability_ascii     ( Alignment *B,Alignment *S, char *na
 /**/
 /**/
 /*     */
-/*********************************COPYRIGHT NOTICE**********************************/
+/******************************COPYRIGHT NOTICE*******************************/