3 #define ENLARGEMENT_PER_STEP 50
4 #define PROFILE_ENLARGEMENT 550
6 // static char pos2aa[] = {'A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','V','W','Y'};
10 * \brief Struct to save all informations of a profile.
15 /// Number of sequences in this profile
17 /// number of the profile
19 ///0 = combination of two profiles, 1 = profile of a single sequence -> name1 = seq_name
21 ///length of the profile
23 ///weight of the sequence
25 ///saves the amount of allocated memory
27 ///the profile itself [alphabet_size][profile_length]
33 * \brief Struct to save all parameters for fastal.
38 /// size of alphabet_size
40 /// converting char2position (for profile)
42 /// converting pos2char (for profile)
46 /// gap extension costs
50 ///method to align profile
60 void generate_random_tree(int number);
63 Fastal_profile* make_profile_of_sequence(char *seq_name, char *sequence, int number);
69 //********************* input/output **********************************
70 void file2profile(FILE* profile_f, Fastal_profile *profile, int prf_number, Fastal_param *param_set);
71 void file_pos2profile(FILE *seq_file, long off_set, Fastal_profile *profile, int prf_number, Fastal_param *param_set);
72 void profile2file(Fastal_profile *profile, FILE* prf_f, Fastal_param *param_set);
75 int make_index_of_file(char *file_name, long **result);
78 //********************* pairwise alignment methods ************************
81 int prf_nw(Fastal_profile *profile1, Fastal_profile *profile2, double **prog_matrix, FILE *edit_file_name, int **sumup_prf, int *sumup_length, Fastal_param *param_set);
82 int nw_matrix2edit_file(double **prog_matrix, Fastal_profile *profile1, Fastal_profile *profile2, FILE *edit_f, int **prf_field, int *field_length, Fastal_param *param_set);
83 int** sumup_profile(Fastal_profile *profile, int **sumup_prf, Fastal_param *param_set);
84 void write2file(int **sumup_prf, int length, FILE *file, int number, Fastal_param *param_set);
87 //Sparse dynamic programming
88 int seq_pair2blast_diagonal(char *seq_file_name1, char *seq_file_name2, int **diagonals, int *dig_length, int l1, int l2, int is_dna);
97 //edit_files 2 alignment
98 void edit2alignment(FILE *sequence_file, long *seq_positions, FILE *edit_file, long *edit_positions, int node_number, int number_of_sequences, char *aligned_sequence, int alignment_length, FILE *edit_seq_file, int offset, FILE* alignment_file);
99 void edit_seq2aligned_seq(char *aligned_sequence, FILE *sequence_file, long sequence_position, FILE *alignment_file);
103 int fastal(int argc, char **argv);
106 void initiate_profile_files(FILE **profile_files);
107 void initiate_profiles(Fastal_profile **profiles, Fastal_param *param_set);
108 void free_fastal_profile(Fastal_profile *profile, int alphabet_size);
109 double **resize_dyn_matrix(double **dyn_matrix, int *old_length1, int *old_length2, int length1, int length2);
110 void free_dyn_matrix(int length1, double **dyn_matrix);
111 void fill_parameters(int is_dna, Fastal_param *param_set, char *method);
113 struct fastal_arguments
125 // static char fastal_doc[] = "Fastal -- a program to align sequences with little memory";
126 // // static char args_doc[] = "ARG1 ARG2";
127 // static void* fastal_options[]=
129 // {"in", 'i', "FILE", 0, "Sequence file (FASTA format)" },
130 // {"output", 'o', "FILE", 0, "Output to FILE" },
131 // {"tree", 't', "FILE", 0, "Tree file" },
132 // {"method", 'm', "METHOD", 0, "Methods:\n fast (sparse dynamic),\n nw (Needleman-Wunsch) "},
133 // {"is_dna", 'd', 0, 0, "Sequences are DNA"},
134 // {"is_aa", 'a', 0, 0, "Sequences are AminoAcids"},
135 // {"gop", 'g', "VALUE", 0, "Gap opening costs"},
136 // {"gep", 'e', "VALUE", 0, "Gap extension costs"},
146 fastal_parse_opt (int key, char *arg)
148 // struct fastal_arguments *arguments = state->input;
153 arguments->output_file = arg;
156 arguments->tree_file = arg;
159 arguments->sequence_file = arg;
162 arguments->method = arg;
165 arguments->gop = atoi(arg);
168 arguments->gep = atoi(arg);
171 arguments->is_dna = 1;
174 arguments->is_dna = 0;
177 printf("UNKNOWN OPTION key");
184 // static struct argp argp = { fastal_options, fastal_parse_opt,/* fastal_args_doc,*/ fastal_doc};
185 /*********************************COPYRIGHT NOTICE**********************************/
186 /*© Centro de Regulacio Genomica */
188 /*Cedric Notredame */
189 /*Tue Oct 27 10:12:26 WEST 2009. */
190 /*All rights reserved.*/
191 /*This file is part of T-COFFEE.*/
193 /* T-COFFEE is free software; you can redistribute it and/or modify*/
194 /* it under the terms of the GNU General Public License as published by*/
195 /* the Free Software Foundation; either version 2 of the License, or*/
196 /* (at your option) any later version.*/
198 /* T-COFFEE is distributed in the hope that it will be useful,*/
199 /* but WITHOUT ANY WARRANTY; without even the implied warranty of*/
200 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the*/
201 /* GNU General Public License for more details.*/
203 /* You should have received a copy of the GNU General Public License*/
204 /* along with Foobar; if not, write to the Free Software*/
205 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/
206 /*............................................... |*/
207 /* If you need some more information*/
208 /* cedric.notredame@europe.com*/
209 /*............................................... |*/
213 /*********************************COPYRIGHT NOTICE**********************************/