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 65536
15 //Importnat Values Affecting the Program Behavior
18 #define PAVIE_MAT_FACTOR 1000
20 #define CLEAN_FUNCTION NULL
21 #define MINSIM_4_TCOFFEE 25 //The minimum similarity between a sequence and its PDB template
22 #define MINCOV_4_TCOFFEE 25 //The minimum similarity between a sequence and its PDB template
25 #define TRACE_TYPE int
26 #define MAX_LEN_FOR_DP 600
29 #define GIVE_MEMORY_BACK 0
32 /*OUTPUT DEFINITIONS*/
33 #define NO_COLOR_RESIDUE 127
34 #define NO_COLOR_GAP 126
35 #define CLOSE_HTML_SPAN -1
69 #define KEEP_CASE 2 /*Hard set in several places*/
101 #define SWITCHCASE 21
104 #define NON_VECTOR 23
105 #define NON_PROFILE 24
111 #define VERY_VERBOSE 28
114 #define VERY_SHORT 31
117 #define NO_OVERLAP 33
123 #define DECLARE_ALN 37
124 #define EXTRACT_ALN 38
126 #define INTERACTIVE 40
127 #define NON_INTERACTIVE 41
164 #define DETERMINISTIC 1
170 #define IS_NOT_FATAL 0
173 #define INSTALL_OR_DIE 4
176 #define NON_OPTIONAL 0
178 #define GV_MAXIMISE 1
179 #define GV_MINIMISE 0
185 #define FORBIDEN -99999999
186 #define END_ARRAY -99999990
202 #define UNGAPED_POSITIONS 1
203 #define ALIGNED_POSITIONS 2
204 #define AVERAGE_POSITIONS 3
205 #define NOMATRIX NULL
210 #define SIZE_OF_INT 10
211 #define UNDEFINED FORBIDEN
212 #define UNDEFINED_INT UNDEFINED
213 #define UNDEFINED_FLOAT UNDEFINED
214 #define UNDEFINED_DOUBLE UNDEFINED
215 #define UNDEFINED_CHAR 125
216 #define UNDEFINED_SHORT -125
217 #define UNDEFINED_2 0
218 #define UNDEFINED_RESIDUE '>'
225 #define MAX_LEN_ALN 1
226 #define MAX_N_LIST 100
228 #define COMMENT_SIZE 1000
230 #define FILENAMELEN 500 /* Max. file name length */
231 #define MAX_N_PARAM 2000
232 #define MAX_PARAM_LEN 200
233 #define MAX_LINE_LENGTH 10000
234 #define ALN_LINE_LENGTH 60
235 #define SHORT_STRING 10
237 #define LONG_STRING 1000
238 #define VERY_LONG_STRING 10000
240 #define AA_ALPHABET "acdefghiklmnpqrstvwy-ACDEFGHIKLMNPQRSTVWY"
241 #define DNA_ALPHABET "AGCTUNRYMKSWHBVD-agctunrymkswhbvd"
242 #define RNAONLY_ALPHABET "Uu"
243 #define BLAST_AA_ALPHABET "arndcqeghilkmfpstwyvbzx*"
244 #define NAMES_ALPHABET "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_|�-!%@&#-+=."
246 #define SIZEOF_AA_MAT 60
247 #define GAP_LIST "-.#*~"
255 #define CODE4PROTEINS 10
258 #define STOCKHOLM_CHAR 'z'
259 #define STOCKHOLM_STRING "z"
264 /*1-COMMAND LINE PROCESSING*/
265 #define GET_COMMAND_LINE_INFO ((strncmp ( argv[1], "-h",2)==0)||(strncmp ( argv[1], "-man",4)==0)||(strncmp ( argv[1], "-",1)!=0))
266 #define NEXT_ARG_IS_FLAG ((argc<=(a+1)) ||(( argv[a+1][0]=='-') && !(is_number(argv[a+1]))))
270 #define BORDER(p1,l1,p2,l2) ((p1==0 || p2==0 || p1==l1 || p2==l2)?1:0)
271 #define GET_CASE(f,c) ((f==UPPER_CASE)?toupper(c):((f==LOWER_CASE)?tolower(c):c))
273 #define SWAP(x,y) {x=x+y;y=x+y; x=y-x; y=y-2*x;}
274 #define SWAPP(x,y,tp) {tp=y;y=x;x=tp;}
276 #define MAX(x, y) (((x) >(y)) ? (x):(y))
277 #define MAX2(x, y) (((x) >(y)) ? (x):(y))
278 #define MAX3(x,y,z) (MAX(MAX(x,y),z))
279 #define MAX4(a,b,c,d) (MAX(MAX(a,b),MAX(c,d)))
280 #define MAX5(a,b,c,d,e) (MAX2((MAX3(a,b,c)),(MAX2(d,e))))
281 #define MAX6(a,b,c,d,e,f) (MAX2((MAX3(a,b,c)),(MAX3(c,d,e))))
283 #define MIN(x, y) (((x) <(y)) ? (x):(y))
284 #define FABS(x) ((x<0)?(-x):(x))
285 #define is_defined(x) ((x==UNDEFINED)?0:1)
286 #define a_better_than_b(x,y,m) ((m==1)?(((x)>(y))?1:0):(((x)<(y))?1:0))
287 #define is_in_range(x,min,max) ((x>=min && x<=max)?1:0)
288 /*#define bod_a_b(x,y,m) ((m==1)?(MAX((x),(y))):(MIN((x),(y))))
289 #define bo_a_b(x,y,m) ((x==UNEFINED)?y:((y==UNDEFINED)?x:bod_a_b(y,y,m)))
290 #define best_of_a_b(x,y,m) ((x==UNDEFINED && y==UNDEFINED)?(UNDEFINED):(bo_a_b(x,y,m)))
294 #define DIE(x) HERE(x);exit(0);
295 #define best_of_a_b(x,y,m) ((m==1)?(MAX((x),(y))):(MIN((x),(y))))
297 #define strm(x,y) ((vstrcmp((x),(y))==0)?1:0)
298 #define strnm(x,y,n) ((vstrncmp((x),(y),(n))==0)?1:0)
299 #define strm2(a,b,c) (strm(a,b) || strm(a,c))
300 #define strm3(a,b,c,d) (strm2(a,b,c) || strm(a,d))
301 #define strm4(a,b,c,d,e) (strm2(a,b,c) || strm2(a,d,e))
302 #define strm5(a,b,c,d,e,f) (strm2(a,b,c) || strm3(a,d,e,f))
303 #define strm6(a,b,c,d,e,f,g) (strm3(a,b,c,d) || strm3(a,e,f,g))
304 #define declare_name(x) (x=vcalloc (MAX(FILENAMELEN,L_tmpnam)+1, sizeof (char)))
305 #define is_parameter(x) (x[0]=='-' && !isdigit(x[1]))
308 #define free_2(a, b) free(a);free(b)
309 #define free_1(a) free(a)
310 #define free_3(a, b, c) free_2(a,b);free_1(c)
311 #define free_4(a, b, c,d) free_2(a,b);free_2(c,d)
312 #define free_5(a, b, c,d,e) free_3(a,b,e);free_2(c,d)
313 #define free_6(a, b, c,d,e,f) free_3(a,b,e);free_3(c,d,f)
314 #define free_7(a, b, c,d,e,f,g) free_3(a,b,e);free_4(c,d,f,g)
316 #define SEPARATORS "\n \t,;"
317 #define LINE_SEPARATOR "\n#TC_LINE_SEPARATOR\n"
318 #define TC_REC_SEPARATOR "#### TC REC SEPARATOR ###"
323 /*WIDOWS/UNIX DISTINCTIONS
324 #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__) || defined(__MSDOS__) || defined(__DOS__) || defined(__NT__) || defined(__WIN32__)
326 #define TO_NULL_DEVICE " >nul"
327 #define NULL_DEVICE "nul"
330 #define TO_NULL_DEVICE " >/dev/null 2>&1"
331 #define NULL_DEVICE "/dev/null"
334 #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__) || defined(__MSDOS__) || defined(__DOS__) || defined(__NT__) || defined(__WIN32__)
336 #define TO_NULL_DEVICE " >>t_coffee.log"
337 #define NULL_DEVICE "t_coffee.log"
338 #define CWF "/" /*ClustalW Flag*/
340 #define TO_NULL_DEVICE " >>/dev/null 2>&1"
341 #define NULL_DEVICE "/dev/null"
344 #define CWF "-" /*ClustaW Flag*/
348 #define EMAIL "cedric.notredame@europe.com"
349 #define URL "http://www.tcoffee.org"
351 #define PERL_HEADER "#!/usr/bin/env perl"
353 //Optimize the Score Computation in DP
354 #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)
355 #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))
356 #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)))
358 #define NULL_2 NULL,NULL
359 #define NULL_3 NULL_2,NULL
360 #define NULL_4 NULL_2,NULL_2
361 #define NULL_5 NULL_3,NULL_2
362 #define NULL_6 NULL_4,NULL_2
363 #define NULL_7 NULL_5,NULL_2
390 char **file; /* file[Nseq][FILENAMELEN] name of the file that contributed each sequence*/
391 char **seq_comment; /* seq_comment[Nseq][LONG_STRING] comment read in the file */
392 char **aln_comment; /*id*/
393 char **seq; /*seq[Nseq][sequence] sequences*/
394 int *len; /*len[Nseq] length of each sequence*/
395 int max_len; /*Lenght of the longest seq */
396 int min_len; /*Length of the shortest seq*/
398 int max_nseq; /*Maximum number of sequences in the datastruct*/
399 char **name; /*name[Nseq][MAXNAMELEN]*/
400 int **dc; /*coordinates on the disk. Coordinates set if seq[i]==NULL
402 struct Constraint_list *CL;
403 int contains_gap; /*set to 1 if gaps are to be kept*/
404 char *type; /*PROTEIN, DNA*/
405 Weights *W; /*Associated weights*/
406 char template_file[FILENAMELEN+1];
410 typedef struct Sequence Sequence;
416 struct X_template *P;//PDB structure
417 struct X_template *F;//RNA secondary structure
418 struct X_template *S;//sequence
419 struct X_template *R;//Profile
420 struct X_template *G;//Genomic structure
421 struct X_template *T;//transmembrane
422 struct X_template *E;//secondary structure
423 struct X_template *U;//Unicode, strings
425 struct X_template *RB;
427 typedef struct Template Template;
431 char seq_name[FILENAMELEN+1];
432 char template_type[FILENAMELEN+1];
433 char template_format[100];
434 char template_name[FILENAMELEN+1];
435 char template_file[FILENAMELEN+1];
437 struct P_template *VP;
438 struct F_template *VF;
439 struct S_template *VS;
440 struct R_template *VR;
441 struct G_template *VG;
442 struct T_template *VT;
443 struct E_template *VE;
444 struct U_template *VU;
448 typedef struct X_template X_template;
455 typedef struct P_template P_template;
457 //RNA secondary Structure
462 typedef struct F_template F_template;
469 typedef struct S_template S_template;
471 //Prile associated with a sequence
476 typedef struct R_template R_template;
478 //Genomic Information
483 typedef struct G_template G_template;
490 typedef struct T_template T_template;
497 typedef struct E_template E_template;
503 typedef struct U_template U_template;
527 /*Generic Information*/
528 char *generic_comment;
529 /*Sequence Information*/
535 char **expanded_order;
542 struct Dp_Result *Dp_result;
543 struct Constraint_list *CL;
545 int **seq_cache; /*Contains the index of the residues:
546 The sequence Numbering is relative to the sequences, and not to the alignmnent
549 indicates that in the aln residue (0)1 corresponds to [order[0][0]][3]
553 int **cdna_cache; /*Contains the information about wheather a nucleotide is coding or not*/
554 /*Only defined if used */
567 /*Input/Output Options*/
569 int residue_case; /*1 for lower, 0 for Upper, 2 for keeping unchanged*/
571 /*Must Not be copied*/
576 struct Alignment * A;
582 typedef struct Alignment Alignment;
598 char previous_html_color[100];
609 char html_color_class[30];
615 Sequence * fill_sequence_struc ( int nseq, char **sequences, char **seq_name);
616 Sequence * cw_read_sequences ( char *seq_name);
617 Sequence * get_sequence_type (Sequence *S);
618 char * get_array_type (int n, char **s);
619 Alignment* get_aln_type (Alignment *A);
621 char * get_string_type (char *string);
623 char *store_mode (char *val);
624 char *retrieve_mode ();
626 char *set_mode (int mode, char *val);
628 char *store_seq_type (char *val);
629 char *retrieve_seq_type ();
630 char *unset_seq_type ();
631 char *set_seq_type (int mode, char *val);
633 void get_sequence (char *seq_file,int *NSEQ, char ***SEQ, char ***SN, int **sl, int *min, int *max);
635 int ** get_matrix ( char *name, char *format);
636 int ** read_matrice (char *mat_name);
637 int **neg_matrix2pos_matrix ( int **matrix);
640 void print_aln ( Alignment *B);
642 int output_reliability_ps ( Alignment *B,Alignment *S, char *name);
643 int output_reliability_pdf ( Alignment *B,Alignment *S, char *name);
644 int output_reliability_html ( Alignment *B,Alignment *S, char *name);
645 int output_color_ps ( Alignment *B,Alignment *S, char *name);
646 int output_color_pdf ( Alignment *B,Alignment *S, char *name);
647 int output_color_html ( Alignment *B,Alignment *S, char *name);
648 int output_hit_color_html (Alignment *B, float **ffPScoreTable, int nl, char *name); //JM_ADD
649 void output_hit_matrix(char *fileName, float **ffpHitScoreMatrix, int nl); //JM_ADD
650 void get_rgb_values(int val, Color *C);
651 int output_reliability_format ( Alignment *B,Alignment *S, char *name, \
652 FILE_format *(*vfopen_format) ( char *),\
653 FILE_format *(*print_format_string) ( char * ,Color *, Color *, FILE_format*),\
654 FILE_format *(*print_format_char) ( int ,Color *, Color *, FILE_format*),\
655 void (*get_rgb_values_format) ( int ,Color *),\
656 FILE_format* (*vfclose_format) ( FILE_format *));
657 int output_score_format ( Alignment *B,Alignment *S, char *name, \
658 FILE_format *(*vfopen_format) ( char *),\
659 FILE_format *(*print_format_string) ( char * ,Color *, Color *, FILE_format*),\
660 FILE_format *(*print_format_char) ( int ,Color *, Color *, FILE_format*),\
661 void (*get_rgb_values_format) ( int ,Color *),\
662 FILE_format* (*vfclose_format) ( FILE_format *));
665 FILE_format * print_ps_string ( char *s , Color *box, Color *ink, FILE_format *f);
666 FILE_format * print_ps_char ( int c, Color *box, Color *ink, FILE_format *f);
670 void get_rgb_values_ps ( int val, Color *C);
671 FILE_format* vfopen_ps ( char *name);
672 FILE_format* vfclose_ps ( FILE_format *fps);
674 FILE_format *print_html_string( char *s, Color *box, Color *ink, FILE_format *fhtml);
675 FILE_format * print_html_char ( int c, Color *box, Color *ink, FILE_format *f);
676 void get_rgb_values_html ( int val, Color *C);
677 FILE_format* vfopen_html ( char *name);
678 FILE_format* vfclose_html ( FILE_format *fhtml);
680 int output_reliability_ascii ( Alignment *B,Alignment *S, char *name);
681 int output_color_ascii ( Alignment *B,Alignment *S, char *name);
683 FILE_format *print_ascii_string( char *s, Color *box, Color *ink, FILE_format *fascii);
684 FILE_format * print_ascii_char ( int c, Color *box, Color *ink, FILE_format *f);
685 void get_rgb_values_ascii ( int val, Color *C);
687 FILE_format* vfopen_ascii ( char *name);
688 FILE_format* vfclose_ascii ( FILE_format *fascii);
689 int output_seq_reliability_ascii ( Alignment *B,Alignment *S, char *name);
690 /*********************CLUSTALW.H*********************************************/
691 /****************************************************************************/
694 Main header file for ClustalW. Uncomment ONE of the following 4 lines
695 depending on which compiler you wish to use.
698 #define VMS 1 /*VAX or ALPHA VMS */
700 /*#define MAC 1 Think_C for MacIntosh */
702 /*#define MSDOS 1 Turbo C for PC's */
704 /*#define UNIX 1 Ultrix/Decstation, Gnu C for
705 Sun, IRIX/SGI, OSF1/ALPHA */
707 /***************************************************************************/
708 /***************************************************************************/
714 #define MAXTITLES 60 /* Title length */
722 #define CLUSTAL 5 /* DES */
723 #define MSF 6 /* DES */
724 #define USER 7 /* DES */
726 #define PAGE_LEN 22 /* Number of lines of help sent to screen */
728 #ifdef VMS /* Defaults for VAX VMS */
729 #define DIRDELIM ']' /* Last character before file name in full file
731 #define SEQ_MAX_LEN 10000 /* Max Sequence Length */
732 #define MAXN 500 /* Max Number of Sequences */
733 #define FSIZE 25000 /* Work space for pairwise alignments */
734 #define MAXTREE 5000 /* Max Nodes for phylogenetic tree */
735 #define LINELENGTH 60 /* Output line length */
736 #define GCG_LINELENGTH 50 /* Output line length for GCG output */
740 #define SEQ_MAX_LEN 1000
744 #define LINELENGTH 50
745 #define GCG_LINELENGTH 50
749 #define DIRDELIM '\\'
750 #define SEQ_MAX_LEN 1300
754 #define LINELENGTH 50
755 #define GCG_LINELENGTH 50
759 #define SEQ_MAX_LEN 10000
763 #define LINELENGTH 60
764 #define GCG_LINELENGTH 50
767 #define NUMRES 26 /* max size of comparison matrix */
778 #define GAPCOL 32 /* position of gap open penalty in profile */
779 #define LENCOL 33 /* position of gap extension penalty in profile */
781 typedef struct node { /* phylogenetic tree structure */
791 void *ckalloc(size_t);
792 void * ckvrealloc(void *,size_t);
795 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 */
798 typedef struct treesim{
809 int nseq;// nseq in the common subset
813 typedef struct tnode *NT_node;
818 typedef struct tnode{
836 ///contains a list of the sequences
838 ///contains a coded version of the node: 10010101
840 ///contains distances to the root, in nodes
842 ///contains real distances *1000
849 ///Number of leave below the considered node
851 ///Number of nodes below the considered node
861 typedef struct split_struc Split;
863 typedef struct split_struc{
868 char **tlist;//Not used yet
873 NT_node main_prune_tree ( NT_node T, Sequence *S);
874 NT_node prune_tree ( NT_node T, Sequence *S);
875 /*********************************************************************/
877 /* dpa_tree_manipulation */
880 /*********************************************************************/
881 char *tree2Ngroup (Alignment *A, NT_node T, int max_n, char *fname, char *mat4dist);
882 int tree2group_file ( NT_node T,Sequence *S, int maxnseq, int minsim, char *name);
884 NT_node seq2dpa_tree (Sequence *S, char *align_mode);
885 NT_node tree2dpa_tree (NT_node T, Alignment *A, char *matrix4distance);
886 FILE * tree2group ( NT_node T,Sequence *S,int maxnseq, int mindist,char *name, FILE *fp);
889 NT_node tree2collapsed_tree (NT_node T, int n, char **string);
891 /*********************************************************************/
893 /* tree comparison */
896 /*********************************************************************/
897 int main_compare_cog_tree (NT_node T1, char *cogfile);
898 int main_compare_aln_tree (NT_node T1, Alignment *A, FILE *fp);
899 int compare_aln_tree (NT_node T, Alignment *A, int *n, FILE *fp);
901 int main_compare_splits (NT_node T1, NT_node T2, char *mode, FILE *fp);
902 Tree_sim * tree_cmp( NT_node T1, NT_node T2);
903 NT_node tree_scan (Alignment *A,NT_node RT, char *pscan, char *ptree);
906 NT_node main_compare_trees ( NT_node T1, NT_node T2, FILE *fp);
907 float compare_trees ( NT_node T1, NT_node T2, int nseq, int mode);
908 float search_node ( NT_node B, NT_node T, int nseq, int mode);
909 float evaluate_node_similarity ( NT_node B, NT_node T, int nseq, int mode);
911 int compare_node ( int *b1, int *b2, int n);
912 void display_node (NT_node N, char *string,int nseq);
913 NT_node index_tree_node (NT_node T);
914 NT_node simple_recode_tree (NT_node T, int nseq);
915 NT_node recode_tree ( NT_node T, Sequence *S);
916 int compare_branch2 ( int *b1, int *b2, int n);
918 /*********************************************************************/
920 /* FJ_tree Computation */
923 /*********************************************************************/
924 NT_node similarities_file2tree (char *mat);
925 NT_node tree_compute ( Alignment *A, int n, char ** arg_list);
926 static NT_node compute_std_tree (Alignment *A, int n, char **arg_list);
927 NT_node compute_std_tree_2 (Alignment *A, int **s, char *arg_list);
928 NT_node aln2fj_tree(NT_node T, Alignment *A, int limit,char* mode);
929 Alignment * filter_aln4tree (Alignment *A, int n,int fg,char* mode);
931 /*********************************************************************/
933 /* Tree Filters and MAnipulation */
936 /*********************************************************************/
937 int tree2star_nodes (NT_node R, int n_max);
938 NT_node aln2tree (Alignment *A);
939 NT_node reset_boot_tree ( NT_node R, int n);
940 NT_node tree_dist2normalized_tree_dist ( NT_node R, float max);
941 NT_node reset_dist_tree ( NT_node R, float n);
942 NT_node* free_treelist ( NT_node *R);
943 NT_node free_tree ( NT_node R);
944 NT_node realloc_tree( NT_node R, int n);
945 NT_node free_tree_node ( NT_node R);
947 Sequence * tree2seq (NT_node R, Sequence *S);
948 NT_node rename_seq_in_tree ( NT_node R, char ***list);
950 NT_node balance_tree (NT_node);
951 int tree2nseq ( NT_node R);
952 int tree_file2nseq ( char *file);
954 int tree2nleaf ( NT_node R);
955 int tree2nnode ( NT_node R);
956 int tree2_nnode_unresolved (NT_node R, int *l);
958 FILE* display_tree ( NT_node R, int n, FILE *fp);
959 void clear_tree (NT_node T);
960 int display_leaf ( NT_node T, FILE *fp);
961 int display_leaf_below_node ( NT_node T, FILE *fp);
962 NT_node display_leaf_nb (NT_node T, int n, FILE *fp, char *name);
963 NT_node display_splits (NT_node T,Sequence *S, FILE *fp);
964 int tree2split_list (NT_node T, int nseq, int **split_list, int *n);
966 NT_node reroot_tree ( NT_node TREE, NT_node T);
967 NT_node straighten_tree ( NT_node P, NT_node C, float new_dist);
968 NT_node unroot_tree ( NT_node T);
969 FILE* print_tree_list ( NT_node *T,char *format, FILE *fp);
970 FILE* print_tree ( NT_node T,char *format, FILE *fp);
971 char *tree2string (NT_node T);
972 char *tree2file (NT_node T, char *name, char *mode);
974 int print_newick_tree ( NT_node T, char *name);
975 FILE * rec_print_tree ( NT_node T, FILE *fp);
978 NT_node find_longest_branch ( NT_node T, NT_node L);
979 NT_node shift_root ( NT_node R);
981 int ** tree2cluster (NT_node T, float thres);
982 int ** make_sub_tree_list ( NT_node **T, int nseq, int n_node);
983 void make_all_sub_tree_list ( NT_node N, int **list, int *n);
984 void make_one_sub_tree_list ( NT_node T, int *list);
985 NT_node main_read_tree(char *treefile);
987 NT_node new_read_tree ( char *teefile);
988 NT_node new_get_node (NT_node T, FILE *fp);
991 NT_node** simple_read_tree(char *treefile);
992 void free_read_tree (NT_node **BT);
993 NT_node** read_tree(char *treefile, int *nnodes,int nseq, char **seq_names);
994 FILE * create_linear_tree ( char **name, int n, FILE *fp);
995 FILE * create_tree(NT_node ptree, NT_node parent,int *numseq,int *ntotal,int *nnodes,NT_node **lu, FILE *fp);
996 NT_node declare_tree_node (int nseq);
997 void set_info(NT_node p, NT_node parent, int pleaf, char *pname, float pdist, float bootstrap);
998 NT_node insert_tree_node(NT_node pptr);
999 FILE * skip_space(FILE *fd);
1000 void create_tree_node(NT_node pptr, NT_node parent);
1001 float calc_mean(NT_node nptr, float *maxdist, int nseq,NT_node **lu);
1002 NT_node insert_root(NT_node p, float diff);
1003 float calc_root_mean(NT_node root, float *maxdist, int neq, NT_node **lu);
1004 NT_node reroot(NT_node ptree, int nseq, int ntotal, int nnodes, NT_node **lu);
1007 Alignment *seq2seq_chain (Alignment *A,Alignment *B, char *arg);
1009 float display_avg_bootstrap ( NT_node T);
1010 float tree2tot_dist ( NT_node T, int mode);
1011 int tree2n_branches(NT_node T, int mode);
1012 int **display_tree_from_node (NT_node T, int up, int down, int **array);
1013 NT_node tree2node ( char *name, NT_node T);
1014 NT_node * tree2node_list (NT_node T, NT_node *L);
1015 NT_node tree2root ( NT_node T);
1016 int new_tree_sort ( char *name, NT_node T);
1019 NT_node split2tree ( NT_node RT,Sequence *LIST, char *param);
1020 NT_node * read_tree_list (Sequence *S);
1022 int count_groups( Sequence *S, char *s);
1024 Split ** count_splits( NT_node RT, Sequence *S, char *s);
1025 NT_node *treelist2prune_treelist (Sequence *S, Sequence *TS, FILE *out);
1026 int** treelist2groups (Sequence *S, Sequence *ST, char *depth, FILE *out);
1027 int treelist2splits (Sequence *S, Sequence *ST);
1028 int treelist2leafgroup ( Sequence *S, Sequence *TS, char *taxon);
1029 int ***tree2dist ( NT_node T, Sequence *S, int ***d);
1030 int treelist2frame (Sequence *S, Sequence *TS);
1031 int** treelist2lti ( Sequence *S, Sequence *TS, int nb, FILE *out);
1033 float simple_tree_cmp (NT_node T1, NT_node T2,Sequence *S, int mode);
1035 int treelist2dmat ( Sequence *S);
1036 NT_node new_declare_tree_node ();
1037 int count_tree_groups( Sequence *LIST, char *group_file);
1038 int node_sort ( char *name, NT_node T);
1039 int treelist2n (NT_node *L);
1040 int ** treelist2avg_treecmp (NT_node *L, char *file);
1041 NT_node treelist2bootstrap ( NT_node *L, char *file);
1042 NT_node treelist2filtered_bootstrap ( NT_node *L, char *file, int **score,float f);
1044 Sequence * treelist2seq ( Sequence *S);
1045 Sequence * treelist2sub_seq ( Sequence *S, int f);
1047 /* General purpose header file - rf 12/90 */
1054 #define pint int /* cast ints in printf statements as pint */
1055 typedef int Boolean; /* Is already defined in THINK_C */
1062 #define EOS '\0' /* End-Of-String */
1063 #define MAXLINE 512 /* Max. line length */
1066 #endif /* ifndef _H_general */
1067 /*********************************COPYRIGHT NOTICE**********************************/
1068 /*© Centro de Regulacio Genomica */
1070 /*Cedric Notredame */
1071 /*Tue Oct 27 10:12:26 WEST 2009. */
1072 /*All rights reserved.*/
1073 /*This file is part of T-COFFEE.*/
1075 /* T-COFFEE is free software; you can redistribute it and/or modify*/
1076 /* it under the terms of the GNU General Public License as published by*/
1077 /* the Free Software Foundation; either version 2 of the License, or*/
1078 /* (at your option) any later version.*/
1080 /* T-COFFEE is distributed in the hope that it will be useful,*/
1081 /* but WITHOUT ANY WARRANTY; without even the implied warranty of*/
1082 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the*/
1083 /* GNU General Public License for more details.*/
1085 /* You should have received a copy of the GNU General Public License*/
1086 /* along with Foobar; if not, write to the Free Software*/
1087 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
1088 /*............................................... |*/
1089 /* If you need some more information*/
1090 /* cedric.notredame@europe.com*/
1091 /*............................................... |*/
1095 /*********************************COPYRIGHT NOTICE**********************************/