7 #include "io_lib_header.h"
8 #include "util_lib_header.h"
9 #include "define_header.h"
12 void print_list(Constraint_list *CL)
15 fprintf ( stderr, "\nPRINT LIST");
16 output_list ( CL, stderr);
18 void save_full_list (Constraint_list *CL, char*fname)
21 fp=vfopen ( fname, "w");
22 fp=output_list ( CL, fp);
25 FILE * output_list ( Constraint_list *CL, FILE *fp)
29 fprintf ( fp, "\nPRINT LIST: %d Elements\n", CL->ne);
30 for ( a=0; a<CL->ne; a++)fp=output_pair(CL, a, fp);
34 FILE * output_pair (Constraint_list *CL,int p, FILE *fp)
38 for ( a=0; a<CL->entry_len; a++)
40 fprintf (fp, "%4d ", vread_clist(CL,p,a));
44 void print_pair (Constraint_list *CL,int p)
47 fprintf ( stderr, "\n");
48 for ( a=0; a<CL->entry_len; a++)
50 fprintf ( stderr, "%d ", vread_clist(CL,p,a));
52 fprintf ( stderr, "\n");
55 int** bin_list (Constraint_list *CL,int field, int Threshold)
62 max=return_max_constraint_list (CL, CONS);
64 bin_list=declare_int (max+1, 5);
65 for (c=0,a=0; a<(CL->ne); a++)
66 if ( vread_clist(CL,a,field)!=UNDEFINED && vread_clist(CL,a,field)>Threshold )
68 x=vread_clist(CL,a,CONS);
71 bin_list[x][2]+=vread_clist(CL, a, field);
75 for ( a=0; a<= max; a++)
79 bin_list[a][3]=bin_list[a][2]/bin_list[a][1];
80 bin_list[a][4]=(a==0)?0:(bin_list[a][3]/a);
87 /*********************************COPYRIGHT NOTICE**********************************/
88 /*© Centro de Regulacio Genomica */
91 /*Tue Oct 27 10:12:26 WEST 2009. */
92 /*All rights reserved.*/
93 /*This file is part of T-COFFEE.*/
95 /* T-COFFEE is free software; you can redistribute it and/or modify*/
96 /* it under the terms of the GNU General Public License as published by*/
97 /* the Free Software Foundation; either version 2 of the License, or*/
98 /* (at your option) any later version.*/
100 /* T-COFFEE is distributed in the hope that it will be useful,*/
101 /* but WITHOUT ANY WARRANTY; without even the implied warranty of*/
102 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the*/
103 /* GNU General Public License for more details.*/
105 /* You should have received a copy of the GNU General Public License*/
106 /* along with Foobar; if not, write to the Free Software*/
107 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
108 /*............................................... |*/
109 /* If you need some more information*/
110 /* cedric.notredame@europe.com*/
111 /*............................................... |*/
115 /*********************************COPYRIGHT NOTICE**********************************/