2 /*#include "mshell.h"*/
5 #define MY_EPS 1000*DBL_EPSILON
6 //Maximum number of tries for interactibve things
9 //Maximum CACHE and Temporary file size and age (Mb and days, 0: unlimited)
10 #define TMP_MAX_SIZE 0
11 #define TMP_MAX_KEEP 10
12 #define CACHE_MAX_SIZE 2000
13 #define CACHE_MAX_KEEP 180
14 #define MAX_N_PID 260000
15 //Importnat Values Affecting the Program Behavior
19 #define PAVIE_MAT_FACTOR 1000
21 #define CLEAN_FUNCTION NULL
22 #define MINSIM_4_TCOFFEE 25 //The minimum similarity between a sequence and its PDB template
23 #define MINCOV_4_TCOFFEE 25 //The minimum similarity between a sequence and its PDB template
26 #define TRACE_TYPE int
27 #define MAX_LEN_FOR_DP 600
30 #define GIVE_MEMORY_BACK 0
33 /*OUTPUT DEFINITIONS*/
34 #define NO_COLOR_RESIDUE 127
35 #define NO_COLOR_GAP 126
36 #define CLOSE_HTML_SPAN -1
70 #define KEEP_CASE 2 /*Hard set in several places*/
103 #define SWITCHCASE 21
106 #define NON_VECTOR 23
107 #define NON_PROFILE 24
113 #define VERY_VERBOSE 28
116 #define VERY_SHORT 31
119 #define NO_OVERLAP 33
125 #define DECLARE_ALN 37
126 #define EXTRACT_ALN 38
128 #define INTERACTIVE 40
129 #define NON_INTERACTIVE 41
149 #define RETURN_ON_FAILURE 61
150 #define EXIT_ON_FAILURE 62
151 #define IGNORE_FAILURE 63
181 #define DETERMINISTIC 1
187 #define IS_NOT_FATAL 0
190 #define INSTALL_OR_DIE 4
193 #define NON_OPTIONAL 0
195 #define GV_MAXIMISE 1
196 #define GV_MINIMISE 0
202 #define FORBIDEN -99999999
203 #define END_ARRAY -99999990
219 #define UNGAPED_POSITIONS 1
220 #define ALIGNED_POSITIONS 2
221 #define AVERAGE_POSITIONS 3
222 #define NOMATRIX NULL
227 #define SIZE_OF_INT 10
228 #define UNDEFINED FORBIDEN
229 #define UNDEFINED_INT UNDEFINED
230 #define UNDEFINED_FLOAT UNDEFINED
231 #define UNDEFINED_DOUBLE UNDEFINED
232 #define UNDEFINED_CHAR 125
233 #define UNDEFINED_SHORT -125
234 #define UNDEFINED_2 0
235 #define UNDEFINED_RESIDUE '>'
242 #define MAX_LEN_ALN 1
243 #define MAX_N_LIST 100
245 #define COMMENT_SIZE 1000
247 #define FILENAMELEN 500 /* Max. file name length */
248 #define MAX_N_PARAM 2000
249 #define MAX_PARAM_LEN 200
250 #define MAX_LINE_LENGTH 10000
251 #define ALN_LINE_LENGTH 50
252 #define SHORT_STRING 10
254 #define LONG_STRING 1000
255 #define VERY_LONG_STRING 10000
257 #define AA_ALPHABET "acdefghiklmnpqrstvwy-ACDEFGHIKLMNPQRSTVWY"
258 #define DNA_ALPHABET "AGCTUNRYMKSWHBVD-agctunrymkswhbvd"
259 #define RNAONLY_ALPHABET "Uu"
260 #define BLAST_AA_ALPHABET "arndcqeghilkmfpstwyvbzx*"
261 #define NAMES_ALPHABET "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_|�-!%@&#-+=."
263 #define SIZEOF_AA_MAT 60
264 #define GAP_LIST "-.#*~"
272 #define CODE4PROTEINS 10
275 #define STOCKHOLM_CHAR 'z'
276 #define STOCKHOLM_STRING "z"
281 /*1-COMMAND LINE PROCESSING*/
282 #define GET_COMMAND_LINE_INFO ((strncmp ( argv[1], "-h",2)==0)||(strncmp ( argv[1], "-man",4)==0)||(strncmp ( argv[1], "-",1)!=0))
283 #define NEXT_ARG_IS_FLAG ((argc<=(a+1)) ||(( argv[a+1][0]=='-') && !(is_number(argv[a+1]))))
287 #define BORDER(p1,l1,p2,l2) ((p1==0 || p2==0 || p1==l1 || p2==l2)?1:0)
288 #define GET_CASE(f,c) ((f==UPPER_CASE)?toupper(c):((f==LOWER_CASE)?tolower(c):c))
290 #define SWAP(x,y) {x=x+y;y=x+y; x=y-x; y=y-2*x;}
291 #define SWAPP(x,y,tp) {tp=y;y=x;x=tp;}
293 #define MAX(x, y) (((x) >(y)) ? (x):(y))
294 #define MAX2(x, y) (((x) >(y)) ? (x):(y))
295 #define MAX3(x,y,z) (MAX(MAX(x,y),z))
296 #define MAX4(a,b,c,d) (MAX(MAX(a,b),MAX(c,d)))
297 #define MAX5(a,b,c,d,e) (MAX2((MAX3(a,b,c)),(MAX2(d,e))))
298 #define MAX6(a,b,c,d,e,f) (MAX2((MAX3(a,b,c)),(MAX3(c,d,e))))
300 #define MIN(x, y) (((x) <(y)) ? (x):(y))
301 #define FABS(x) ((x<0)?(-x):(x))
302 #define is_defined(x) ((x==UNDEFINED)?0:1)
303 #define a_better_than_b(x,y,m) ((m==1)?(((x)>(y))?1:0):(((x)<(y))?1:0))
304 #define is_in_range(x,min,max) ((x>=min && x<=max)?1:0)
305 /*#define bod_a_b(x,y,m) ((m==1)?(MAX((x),(y))):(MIN((x),(y))))
306 #define bo_a_b(x,y,m) ((x==UNEFINED)?y:((y==UNDEFINED)?x:bod_a_b(y,y,m)))
307 #define best_of_a_b(x,y,m) ((x==UNDEFINED && y==UNDEFINED)?(UNDEFINED):(bo_a_b(x,y,m)))
311 #define DIE(x) HERE(x);exit(0);
312 #define best_of_a_b(x,y,m) ((m==1)?(MAX((x),(y))):(MIN((x),(y))))
314 #define strm(x,y) ((vstrcmp((x),(y))==0)?1:0)
315 #define strnm(x,y,n) ((vstrncmp((x),(y),(n))==0)?1:0)
316 #define strm2(a,b,c) (strm(a,b) || strm(a,c))
317 #define strm3(a,b,c,d) (strm2(a,b,c) || strm(a,d))
318 #define strm4(a,b,c,d,e) (strm2(a,b,c) || strm2(a,d,e))
319 #define strm5(a,b,c,d,e,f) (strm2(a,b,c) || strm3(a,d,e,f))
320 #define strm6(a,b,c,d,e,f,g) (strm3(a,b,c,d) || strm3(a,e,f,g))
321 #define declare_name(x) (x=vcalloc (MAX(FILENAMELEN,L_tmpnam)+1, sizeof (char)))
322 #define is_parameter(x) (x[0]=='-' && !isdigit(x[1]))
325 #define free_2(a, b) free(a);free(b)
326 #define free_1(a) free(a)
327 #define free_3(a, b, c) free_2(a,b);free_1(c)
328 #define free_4(a, b, c,d) free_2(a,b);free_2(c,d)
329 #define free_5(a, b, c,d,e) free_3(a,b,e);free_2(c,d)
330 #define free_6(a, b, c,d,e,f) free_3(a,b,e);free_3(c,d,f)
331 #define free_7(a, b, c,d,e,f,g) free_3(a,b,e);free_4(c,d,f,g)
333 #define SEPARATORS "\n \t,;"
334 #define LINE_SEPARATOR "\n#TC_LINE_SEPARATOR\n"
335 #define TC_REC_SEPARATOR "#### TC REC SEPARATOR ###"
340 /*WIDOWS/UNIX DISTINCTIONS
341 #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__) || defined(__MSDOS__) || defined(__DOS__) || defined(__NT__) || defined(__WIN32__)
343 #define TO_NULL_DEVICE " >nul"
344 #define NULL_DEVICE "nul"
347 #define TO_NULL_DEVICE " >/dev/null 2>&1"
348 #define NULL_DEVICE "/dev/null"
351 #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__) || defined(__MSDOS__) || defined(__DOS__) || defined(__NT__) || defined(__WIN32__)
353 #define TO_NULL_DEVICE " >>t_coffee.log"
354 #define NULL_DEVICE "t_coffee.log"
355 #define CWF "/" /*ClustalW Flag*/
357 #define TO_NULL_DEVICE " >>/dev/null 2>&1"
358 #define NULL_DEVICE "/dev/null"
361 #define CWF "-" /*ClustaW Flag*/
365 #define EMAIL "cedric.notredame@europe.com"
366 #define URL "http://www.tcoffee.org"
368 #define PERL_HEADER "#!/usr/bin/env perl"
370 //Optimize the Score Computation in DP
371 #define TC_SCORE_2(x,y) (SCORE_K*CL->M[Aln->seq_al[l_s[0][0]][x]-'A'][Aln->seq_al[l_s[1][0]][y]-'A']-SCORE_K*CL->nomatch)
372 #define TC_SCORE_N(x,y) ((CL->get_dp_cost)(Aln, pos, ns[0], l_s[0], x, pos, ns[1], l_s[1], y, CL))
373 #define TC_SCORE(x,y) ((CL->get_dp_cost==slow_get_dp_cost && CL->evaluate_residue_pair==evaluate_matrix_score && ns[0]+ns[1]==2 && x>=0 && j>=0)? (TC_SCORE_2(x,y)):(TC_SCORE_N(x,y)))
375 #define NULL_2 NULL,NULL
376 #define NULL_3 NULL_2,NULL
377 #define NULL_4 NULL_2,NULL_2
378 #define NULL_5 NULL_3,NULL_2
379 #define NULL_6 NULL_4,NULL_2
380 #define NULL_7 NULL_5,NULL_2
407 char **file; /* file[Nseq][FILENAMELEN] name of the file that contributed each sequence*/
408 char **seq_comment; /* seq_comment[Nseq][LONG_STRING] comment read in the file */
409 char **aln_comment; /*id*/
410 char **seq; /*seq[Nseq][sequence] sequences*/
411 int *len; /*len[Nseq] length of each sequence*/
412 int max_len; /*Lenght of the longest seq */
413 int min_len; /*Length of the shortest seq*/
415 int max_nseq; /*Maximum number of sequences in the datastruct*/
416 char **name; /*name[Nseq][MAXNAMELEN]*/
417 int **dc; /*coordinates on the disk. Coordinates set if seq[i]==NULL*/
419 struct Constraint_list *CL;
420 int contains_gap; /*set to 1 if gaps are to be kept*/
421 char *type; /*PROTEIN, DNA*/
422 Weights *W; /*Associated weights*/
423 char template_file[FILENAMELEN+1];
428 typedef struct Sequence Sequence;
434 struct X_template *P;//PDB structure
435 struct X_template *F;//RNA secondary structure
436 struct X_template *S;//sequence
437 struct X_template *R;//Profile
438 struct X_template *G;//Genomic structure
439 struct X_template *T;//transmembrane
440 struct X_template *E;//secondary structure
441 struct X_template *U;//Unicode, strings
443 struct X_template *RB;
445 typedef struct Template Template;
449 char seq_name[FILENAMELEN+1];
450 char template_type[FILENAMELEN+1];
451 char template_format[100];
452 char template_name[FILENAMELEN+1];
453 char template_file[FILENAMELEN+1];
455 struct P_template *VP;
456 struct F_template *VF;
457 struct S_template *VS;
458 struct R_template *VR;
459 struct G_template *VG;
460 struct T_template *VT;
461 struct E_template *VE;
462 struct U_template *VU;
466 typedef struct X_template X_template;
473 typedef struct P_template P_template;
475 //RNA secondary Structure
480 typedef struct F_template F_template;
487 typedef struct S_template S_template;
489 //Prile associated with a sequence
494 typedef struct R_template R_template;
496 //Genomic Information
501 typedef struct G_template G_template;
508 typedef struct T_template T_template;
515 typedef struct E_template E_template;
521 typedef struct U_template U_template;
545 /*Generic Information*/
546 char *generic_comment;
547 /*Sequence Information*/
553 char **expanded_order;
560 struct Dp_Result *Dp_result;
561 struct Constraint_list *CL;
563 int **seq_cache; /*Contains the index of the residues:
564 The sequence Numbering is relative to the sequences, and not to the alignmnent
567 indicates that in the aln residue (0)1 corresponds to [order[0][0]][3]
571 int **cdna_cache; /*Contains the information about wheather a nucleotide is coding or not*/
572 /*Only defined if used */
588 /*Input/Output Options*/
590 int residue_case; /*1 for lower, 0 for Upper, 2 for keeping unchanged*/
593 /*Must Not be copied*/
598 struct Alignment * A;
604 typedef struct Alignment Alignment;
620 char previous_html_color[100];
631 char html_color_class[30];
637 Sequence * fill_sequence_struc ( int nseq, char **sequences, char **seq_name);
638 Sequence * cw_read_sequences ( char *seq_name);
639 Sequence * get_sequence_type (Sequence *S);
640 char * get_array_type (int n, char **s);
641 Alignment* get_aln_type (Alignment *A);
643 char * get_string_type (char *string);
645 char *store_mode (char *val);
646 char *retrieve_mode ();
648 char *set_mode (int mode, char *val);
650 char *store_seq_type (char *val);
651 char *retrieve_seq_type ();
652 char *unset_seq_type ();
653 char *set_seq_type (int mode, char *val);
655 void get_sequence (char *seq_file,int *NSEQ, char ***SEQ, char ***SN, int **sl, int *min, int *max);
657 int ** get_matrix ( char *name, char *format);
658 int ** read_matrice (char *mat_name);
659 int **neg_matrix2pos_matrix ( int **matrix);
662 void print_aln ( Alignment *B);
664 int output_reliability_ps ( Alignment *B,Alignment *S, char *name);
665 int output_reliability_pdf ( Alignment *B,Alignment *S, char *name);
666 int output_reliability_html ( Alignment *B,Alignment *S, char *name);
667 int output_color_ps ( Alignment *B,Alignment *S, char *name);
668 int output_color_pdf ( Alignment *B,Alignment *S, char *name);
669 int output_color_html ( Alignment *B,Alignment *S, char *name);
670 int output_hit_color_html (Alignment *B, float **ffPScoreTable, int nl, char *name); //JM_ADD
671 void output_hit_matrix(char *fileName, float **ffpHitScoreMatrix, int nl); //JM_ADD
672 void get_rgb_values(int val, Color *C);
673 int output_reliability_format ( Alignment *B,Alignment *S, char *name, \
674 FILE_format *(*vfopen_format) ( char *),\
675 FILE_format *(*print_format_string) ( char * ,Color *, Color *, FILE_format*),\
676 FILE_format *(*print_format_char) ( int ,Color *, Color *, FILE_format*),\
677 void (*get_rgb_values_format) ( int ,Color *),\
678 FILE_format* (*vfclose_format) ( FILE_format *));
679 int output_score_format ( Alignment *B,Alignment *S, char *name, \
680 FILE_format *(*vfopen_format) ( char *),\
681 FILE_format *(*print_format_string) ( char * ,Color *, Color *, FILE_format*),\
682 FILE_format *(*print_format_char) ( int ,Color *, Color *, FILE_format*),\
683 void (*get_rgb_values_format) ( int ,Color *),\
684 FILE_format* (*vfclose_format) ( FILE_format *));
687 FILE_format * print_ps_string ( char *s , Color *box, Color *ink, FILE_format *f);
688 FILE_format * print_ps_char ( int c, Color *box, Color *ink, FILE_format *f);
692 void get_rgb_values_ps ( int val, Color *C);
693 FILE_format* vfopen_ps ( char *name);
694 FILE_format* vfclose_ps ( FILE_format *fps);
696 FILE_format *print_html_string( char *s, Color *box, Color *ink, FILE_format *fhtml);
697 FILE_format * print_html_char ( int c, Color *box, Color *ink, FILE_format *f);
698 void get_rgb_values_html ( int val, Color *C);
699 FILE_format* vfopen_html ( char *name);
700 FILE_format* vfclose_html ( FILE_format *fhtml);
702 int output_reliability_ascii ( Alignment *B,Alignment *S, char *name);
703 int output_color_ascii ( Alignment *B,Alignment *S, char *name);
705 FILE_format *print_ascii_string( char *s, Color *box, Color *ink, FILE_format *fascii);
706 FILE_format * print_ascii_char ( int c, Color *box, Color *ink, FILE_format *f);
707 void get_rgb_values_ascii ( int val, Color *C);
709 FILE_format* vfopen_ascii ( char *name);
710 FILE_format* vfclose_ascii ( FILE_format *fascii);
711 int output_seq_reliability_ascii ( Alignment *B,Alignment *S, char *name);
712 /*********************CLUSTALW.H*********************************************/
713 /****************************************************************************/
716 Main header file for ClustalW. Uncomment ONE of the following 4 lines
717 depending on which compiler you wish to use.
720 #define VMS 1 /*VAX or ALPHA VMS */
722 /*#define MAC 1 Think_C for MacIntosh */
724 /*#define MSDOS 1 Turbo C for PC's */
726 /*#define UNIX 1 Ultrix/Decstation, Gnu C for
727 Sun, IRIX/SGI, OSF1/ALPHA */
729 /***************************************************************************/
730 /***************************************************************************/
736 #define MAXTITLES 60 /* Title length */
744 #define CLUSTAL 5 /* DES */
745 #define MSF 6 /* DES */
746 #define USER 7 /* DES */
748 #define PAGE_LEN 22 /* Number of lines of help sent to screen */
750 #ifdef VMS /* Defaults for VAX VMS */
751 #define DIRDELIM ']' /* Last character before file name in full file
753 #define SEQ_MAX_LEN 10000 /* Max Sequence Length */
754 #define MAXN 500 /* Max Number of Sequences */
755 #define FSIZE 25000 /* Work space for pairwise alignments */
756 #define MAXTREE 5000 /* Max Nodes for phylogenetic tree */
757 #define LINELENGTH 60 /* Output line length */
758 #define GCG_LINELENGTH 50 /* Output line length for GCG output */
762 #define SEQ_MAX_LEN 1000
766 #define LINELENGTH 50
767 #define GCG_LINELENGTH 50
771 #define DIRDELIM '\\'
772 #define SEQ_MAX_LEN 1300
776 #define LINELENGTH 50
777 #define GCG_LINELENGTH 50
781 #define SEQ_MAX_LEN 10000
785 #define LINELENGTH 60
786 #define GCG_LINELENGTH 50
789 #define NUMRES 26 /* max size of comparison matrix */
800 #define GAPCOL 32 /* position of gap open penalty in profile */
801 #define LENCOL 33 /* position of gap extension penalty in profile */
803 typedef struct node { /* phylogenetic tree structure */
813 void *ckalloc(size_t);
814 void * ckvrealloc(void *,size_t);
817 int readseqs(char *saga_file,char ***SAGA_SEQ, char*** SAGA_NAMES, int ***SAGA_LEN) ;/*first_seq is the #no. of the first seq. to read */
820 typedef struct treesim{
831 int nseq;// nseq in the common subset
835 typedef struct tnode *NT_node;
840 typedef struct tnode{
858 ///contains a list of the sequences
860 ///contains a coded version of the node: 10010101
862 ///contains distances to the root, in nodes
864 ///contains real distances *1000
871 ///Number of leave below the considered node
873 ///Number of nodes below the considered node
883 typedef struct split_struc Split;
885 typedef struct split_struc{
890 char **tlist;//Not used yet
895 NT_node main_prune_tree ( NT_node T, Sequence *S);
896 NT_node prune_tree ( NT_node T, Sequence *S);
897 /*********************************************************************/
899 /* dpa_tree_manipulation */
902 /*********************************************************************/
903 char *tree2Ngroup (Alignment *A, NT_node T, int max_n, char *fname, char *mat4dist);
904 int tree2group_file ( NT_node T,Sequence *S, int maxnseq, int minsim, char *name);
906 NT_node seq2dpa_tree (Sequence *S, char *align_mode);
907 NT_node tree2dpa_tree (NT_node T, Alignment *A, char *matrix4distance);
908 FILE * tree2group ( NT_node T,Sequence *S,int maxnseq, int mindist,char *name, FILE *fp);
911 NT_node tree2collapsed_tree (NT_node T, int n, char **string);
913 /*********************************************************************/
915 /* tree comparison */
918 /*********************************************************************/
919 int main_compare_cog_tree (NT_node T1, char *cogfile);
920 int main_compare_aln_tree (NT_node T1, Alignment *A, FILE *fp);
921 int compare_aln_tree (NT_node T, Alignment *A, int *n, FILE *fp);
923 int main_compare_splits (NT_node T1, NT_node T2, char *mode, FILE *fp);
924 Tree_sim * tree_cmp( NT_node T1, NT_node T2);
925 NT_node tree_scan (Alignment *A,NT_node RT, char *pscan, char *ptree);
927 int print_node_list (NT_node T, Sequence *S);
928 NT_node main_compare_trees ( NT_node T1, NT_node T2, FILE *fp);
929 NT_node main_compare_trees_list ( NT_node T1, Sequence *S, FILE *fp);
931 float compare_trees ( NT_node T1, NT_node T2, int nseq, int mode);
932 float search_node ( NT_node B, NT_node T, int nseq, int mode);
933 float evaluate_node_similarity ( NT_node B, NT_node T, int nseq, int mode);
935 int compare_node ( int *b1, int *b2, int n);
936 void display_node (NT_node N, char *string,int nseq);
937 NT_node index_tree_node (NT_node T);
938 NT_node simple_recode_tree (NT_node T, int nseq);
939 NT_node recode_tree ( NT_node T, Sequence *S);
940 int compare_branch2 ( int *b1, int *b2, int n);
942 /*********************************************************************/
944 /* FJ_tree Computation */
947 /*********************************************************************/
948 NT_node similarities_file2tree (char *mat);
949 NT_node tree_compute ( Alignment *A, int n, char ** arg_list);
950 static NT_node compute_std_tree (Alignment *A, int n, char **arg_list);
951 NT_node compute_std_tree_2 (Alignment *A, int **s, char *arg_list);
952 NT_node aln2fj_tree(NT_node T, Alignment *A, int limit,char* mode);
953 Alignment * filter_aln4tree (Alignment *A, int n,int fg,char* mode);
955 /*********************************************************************/
957 /* Tree Filters and MAnipulation */
960 /*********************************************************************/
961 int tree2star_nodes (NT_node R, int n_max);
962 NT_node aln2tree (Alignment *A);
963 NT_node reset_boot_tree ( NT_node R, int n);
964 NT_node tree_dist2normalized_tree_dist ( NT_node R, float max);
965 NT_node reset_dist_tree ( NT_node R, float n);
966 NT_node* free_treelist ( NT_node *R);
967 NT_node free_tree ( NT_node R);
968 NT_node realloc_tree( NT_node R, int n);
969 NT_node free_tree_node ( NT_node R);
971 Sequence * tree2seq (NT_node R, Sequence *S);
972 NT_node rename_seq_in_tree ( NT_node R, char ***list);
974 NT_node balance_tree (NT_node);
975 int tree2nseq ( NT_node R);
976 int tree_file2nseq ( char *file);
978 int tree2nleaf ( NT_node R);
979 int tree2nnode ( NT_node R);
980 int tree2_nnode_unresolved (NT_node R, int *l);
982 FILE* display_tree ( NT_node R, int n, FILE *fp);
983 void clear_tree (NT_node T);
984 int display_leaf ( NT_node T, FILE *fp);
985 int display_leaf_below_node ( NT_node T, FILE *fp);
986 NT_node display_leaf_nb (NT_node T, int n, FILE *fp, char *name);
987 NT_node display_splits (NT_node T,Sequence *S, FILE *fp);
988 int tree2split_list (NT_node T, int nseq, int **split_list, int *n);
990 NT_node reroot_tree ( NT_node TREE, NT_node T);
991 NT_node straighten_tree ( NT_node P, NT_node C, float new_dist);
992 NT_node unroot_tree ( NT_node T);
993 FILE* print_tree_list ( NT_node *T,char *format, FILE *fp);
994 FILE* print_tree ( NT_node T,char *format, FILE *fp);
995 char *tree2string (NT_node T);
996 char *tree2file (NT_node T, char *name, char *mode);
998 int print_newick_tree ( NT_node T, char *name);
999 FILE * rec_print_tree ( NT_node T, FILE *fp);
1002 NT_node find_longest_branch ( NT_node T, NT_node L);
1003 NT_node shift_root ( NT_node R);
1005 int ** tree2cluster (NT_node T, float thres);
1006 int ** make_sub_tree_list ( NT_node **T, int nseq, int n_node);
1007 void make_all_sub_tree_list ( NT_node N, int **list, int *n);
1008 void make_one_sub_tree_list ( NT_node T, int *list);
1009 NT_node main_read_tree(char *treefile);
1011 NT_node new_read_tree ( char *teefile);
1012 NT_node new_get_node (NT_node T, FILE *fp);
1015 NT_node** simple_read_tree(char *treefile);
1016 void free_read_tree (NT_node **BT);
1017 NT_node** read_tree(char *treefile, int *nnodes,int nseq, char **seq_names);
1018 FILE * create_linear_tree ( char **name, int n, FILE *fp);
1019 FILE * create_tree(NT_node ptree, NT_node parent,int *numseq,int *ntotal,int *nnodes,NT_node **lu, FILE *fp);
1020 NT_node declare_tree_node (int nseq);
1021 void set_info(NT_node p, NT_node parent, int pleaf, char *pname, float pdist, float bootstrap);
1022 NT_node insert_tree_node(NT_node pptr);
1023 FILE * skip_space(FILE *fd);
1024 void create_tree_node(NT_node pptr, NT_node parent);
1025 float calc_mean(NT_node nptr, float *maxdist, int nseq,NT_node **lu);
1026 NT_node insert_root(NT_node p, float diff);
1027 float calc_root_mean(NT_node root, float *maxdist, int neq, NT_node **lu);
1028 NT_node reroot(NT_node ptree, int nseq, int ntotal, int nnodes, NT_node **lu);
1031 Alignment *seq2seq_chain (Alignment *A,Alignment *B, char *arg);
1033 float display_avg_bootstrap ( NT_node T);
1034 float tree2tot_dist ( NT_node T, int mode);
1035 int tree2n_branches(NT_node T, int mode);
1036 int **display_tree_from_node (NT_node T, int up, int down, int **array);
1037 NT_node tree2node ( char *name, NT_node T);
1038 NT_node * tree2node_list (NT_node T, NT_node *L);
1039 NT_node tree2root ( NT_node T);
1040 int new_tree_sort ( char *name, NT_node T);
1043 NT_node split2tree ( NT_node RT,Sequence *LIST, char *param);
1044 NT_node * read_tree_list (Sequence *S);
1046 int count_groups( Sequence *S, char *s);
1048 Split ** count_splits( NT_node RT, Sequence *S, char *s);
1049 NT_node *treelist2prune_treelist (Sequence *S, Sequence *TS, FILE *out);
1050 int** treelist2groups (Sequence *S, Sequence *ST, char *depth, FILE *out);
1051 int treelist2splits (Sequence *S, Sequence *ST);
1052 int treelist2leafgroup ( Sequence *S, Sequence *TS, char *taxon);
1053 int ***tree2dist ( NT_node T, Sequence *S, int ***d);
1054 int treelist2frame (Sequence *S, Sequence *TS);
1055 int** treelist2lti ( Sequence *S, Sequence *TS, int nb, FILE *out);
1057 float simple_tree_cmp (NT_node T1, NT_node T2,Sequence *S, int mode);
1059 int treelist2dmat ( Sequence *S);
1060 NT_node new_declare_tree_node ();
1061 int count_tree_groups( Sequence *LIST, char *group_file);
1062 int node_sort ( char *name, NT_node T);
1063 int treelist2n (NT_node *L);
1064 int ** treelist2avg_treecmp (NT_node *L, char *file);
1065 NT_node treelist2bootstrap ( NT_node *L, char *file);
1066 NT_node treelist2filtered_bootstrap ( NT_node *L, char *file, int **score,float f);
1068 Sequence * treelist2seq ( Sequence *S);
1069 Sequence * treelist2sub_seq ( Sequence *S, int f);
1071 int treelist_file2consense (char *tree_file, char *outtree, char *outfile);
1072 /* General purpose header file - rf 12/90 */
1079 #define pint int /* cast ints in printf statements as pint */
1080 typedef int Boolean; /* Is already defined in THINK_C */
1087 #define EOS '\0' /* End-Of-String */
1088 #define MAXLINE 512 /* Max. line length */
1091 #endif /* ifndef _H_general */
1092 /******************************COPYRIGHT NOTICE*******************************/
1093 /*© Centro de Regulacio Genomica */
1095 /*Cedric Notredame */
1096 /*Fri Feb 18 08:27:45 CET 2011 - Revision 596. */
1097 /*All rights reserved.*/
1098 /*This file is part of T-COFFEE.*/
1100 /* T-COFFEE is free software; you can redistribute it and/or modify*/
1101 /* it under the terms of the GNU General Public License as published by*/
1102 /* the Free Software Foundation; either version 2 of the License, or*/
1103 /* (at your option) any later version.*/
1105 /* T-COFFEE is distributed in the hope that it will be useful,*/
1106 /* but WITHOUT ANY WARRANTY; without even the implied warranty of*/
1107 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the*/
1108 /* GNU General Public License for more details.*/
1110 /* You should have received a copy of the GNU General Public License*/
1111 /* along with Foobar; if not, write to the Free Software*/
1112 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
1113 /*............................................... |*/
1114 /* If you need some more information*/
1115 /* cedric.notredame@europe.com*/
1116 /*............................................... |*/
1120 /******************************COPYRIGHT NOTICE*******************************/