aevol-4.4/0000755000000000000000000000000012365454434007450 500000000000000aevol-4.4/examples/0000755000175000017500000000000012365454377011326 500000000000000aevol-4.4/examples/workflow/0000755000175000017500000000000012365454377013200 500000000000000aevol-4.4/examples/workflow/wild_type/0000755000175000017500000000000012365454377015200 500000000000000aevol-4.4/examples/workflow/wild_type/param.in0000644000175000017500000000241512364050651016534 00000000000000################################### # AEVOL PARAMATERS # ################################### ##### 1. Initial setup ############ SEED 486343 INIT_POP_SIZE 1000 INIT_METHOD ONE_GOOD_GENE CLONE MAX_TRIANGLE_WIDTH 0.01 CHROMOSOME_INITIAL_LENGTH 5000 ##### 2. Selection ################ SELECTION_SCHEME exponential_ranking 0.998 ##### 3. Mutation rates ########### POINT_MUTATION_RATE 5e-6 SMALL_INSERTION_RATE 5e-6 SMALL_DELETION_RATE 5e-6 MAX_INDEL_SIZE 6 ##### 4. Rearrangement rates (w/o alignements) DUPLICATION_RATE 5e-6 DELETION_RATE 5e-6 TRANSLOCATION_RATE 5e-6 INVERSION_RATE 5e-6 ##### 5. Population Structure ##### ##### 6. Target function ########## ENV_SAMPLING 300 ENV_GAUSSIAN 0.5 0.2 0.05 ENV_GAUSSIAN 0.5 0.6 0.05 ENV_GAUSSIAN 0.5 0.8 0.05 ##### 7. Recording ################ RECORD_TREE true TREE_MODE normal TREE_STEP 100 MORE_STATS false DUMP_STEP 0 BACKUP_STEP 500 ##### 8. Environment variation #### ENV_VARIATION autoregressive_height_variation 0.05 5000 7687534 ##### 9. Phenotypic axis ########## ENV_AXIS_FEATURES METABOLISM aevol-4.4/examples/workflow/README.txt0000644000175000017500000001415312364202505014601 00000000000000############################################################################### # The Workflow example ############################################################################### # This is the workflow example. It provides an example of one of the many # different workflows that can be used for experiments with Aevol. # # The main idea underlying this workflow is to parallel wet lab experiments, # which are conducted on evolved organisms. # To use already evolved organisms for Aevol experiments, one can either use # an evolved genome provided by the community or evolve his own. # This example does the latter (more complete) case. # # ################### # RECOMMENDATIONS # ################### # # It is strongly recommended you read the corresponding section in the user # manual while following this example since it contains an explanation for # each step of the example. # # The following set of commands should work as is if you have installed aevol # with make install, which is recommended. # # If you haven't installed aevol, you will need to specify where to find the # executables, which should be in /src for the 4 main executables # and in /src/post_treatments for the rest, being the # main aevol directory you have downloaded. # E.g. if your is /home/login/aevol, then the command # aevol_run -n 5000 will become /home/login/aevol/src/aevol_run -n 5000 # and ae_misc_lineage -e 10000 will become # /home/login/aevol/src/post_treatments/ae_misc_lineage -e 10000 # ############################################################################### # ========== Wild-Type generation ========== # #mkdir wild_type cd wild_type aevol_create aevol_run_X11 -n 5000 # or aevol_run -n 5000 depending on whether you compiled with graphical output enabled or not # ========== Experimental setup ========== # cd .. # Propagate the experiment, meaning prepare directories for different # runs starting from the wild type mydirnamesA="line01 line02 line03 line04 line05" mydirnamesB="line06 line07 line08 line09 line10" for mydir in $mydirnamesA $mydirnamesB do echo $mydir aevol_propagate -g 5000 -i wild_type -o $mydir -S $RANDOM done # For each experiment, create a file with the parameters to change echo "# New environment ENV_GAUSSIAN 0.5 0.2 0.05 ENV_GAUSSIAN 0.5 0.4 0.05 ENV_GAUSSIAN 0.5 0.8 0.05 ENV_VARIATION none" > newparam-groupA.in echo "# New environment ENV_GAUSSIAN 0.5 0.2 0.05 ENV_GAUSSIAN 0.5 0.4 0.05 ENV_GAUSSIAN 0.5 0.8 0.05 ENV_VARIATION none # New rearrangement rates DUPLICATION_RATE 1e-5 DELETION_RATE 1e-5 TRANSLOCATION_RATE 1e-5 INVERSION_RATE 1e-5" > newparam-groupB.in # Apply these modifications # for mydir in $mydirnamesA do cd $mydir echo $mydir aevol_modify --gener 0 --file ../newparam-groupA.in cd .. done for mydir in $mydirnamesB do cd $mydir echo $mydir aevol_modify --gener 0 --file ../newparam-groupB.in cd .. done # ========== Run the simulations ========== # for mydir in $mydirnamesA $mydirnamesB do cd mydir aevol_run_X11 -n 20000 cd .. done # ========== Analyse the outcome ========== # # A set of post-treatment tools is available to help analyse the outcome. # # ---------- aevol_misc_view_generation ---------- # # The simplest miscellaneous tool is view_generation. It allows one to # visualize a generation using the exact same graphical outputs used in # aevol_run. # However, since it relies on graphics, it is only available when aevol is # compiled with x enabled (which is the default). # aevol_misc_view_generation -g 10000 # ---------- aevol_misc_create_eps ---------- # # Similarly, one can obtain eps outputs for a given generation with the # create_eps tool. Files will be outputted in eps_files_xxxxxx (with # xxxxxx the generation number) # aevol_misc_create_eps -g 10000 # ---------- aevol_misc_robustness ---------- # # The robustness tool computes the replication statistics of all the # individuals of a given generation, like the proportion of neutral, beneficial, # deleterious offsprings. This is done by simulating nbchildren replications # for each individual (1000 replications by default), with its mutation, # rearrangement and transfer rates. Depending on those rates and genome # size, there can be several mutations per replication. Those global statistics # are written in stat/robustness_numgener.out, with one line per individual # in the specified generation. # The program also outputs detailed statistics for one of the individuals (the # best one by default). The detailed statistics for this individual are written in # stats/replication_numgener.out, with one line per simulated child of this # particular individual. # aevol_misc_robustness -g 10000 # ---------- aevol_misc_lineage ---------- # # One can reconstruct the lineage of an evolved individual. # This will generate a lineage file whose name will look like # lineage-b000000-e010000-i999-r1000.ae containing the complete mutational # history of a given individual of a given generation. # This file can then be used as the input for subsequent post-treatments. # aevol_misc_lineage -e 10000 # ---------- aevol_misc_ancstats ---------- # # Statistics of a lineage can be obtained with this tool. # The generated stats are outputted in stats/ancstats/ # aevol_misc_ancstats -f lineage-b000000-e010000-i*-r1000.ae # ---------- aevol_misc_fixed_mutations ---------- # # This tool outputs the list of mutational events that occurred # on the lineage given as input. # The generated list is outputted in stats/ # aevol_misc_fixed_mutations -f lineage-b000000-e010000-i*-r1000.ae # ---------- aevol_misc_gene_families ---------- # # This tool outputs the history of each gene family in the lineage # given as input. # The generated gene trees are outputted in gene_trees/ # This analysis can be longer than ancstats or fixed_mutations, # it can take from a few minutes to a few hours depending on # gene number evolution in the lineage. aevol_misc_gene_families -f lineage-b000000-e010000-i*-r1000.ae aevol-4.4/examples/lateral-transfer-by-replacement/0000755000175000017500000000000012365454377017501 500000000000000aevol-4.4/examples/lateral-transfer-by-replacement/README0000644000175000017500000000273412271700772020274 00000000000000In this example, when an individual reproduces, there is a 50% probability that a lateral transfer is attempted. If yes, a donor individual is randomly chosen in the population. A segment of its chromosome is copied and transferred in the recipient individual (the one which was reproducing). This foreign DNA then replaces the homologous segment in the recipient chromosome. This is a way to perform allelic recombination. To run this example for 200 generations, type the following commands: aevol_create aevol_run_X11 -n 200 Then you can look at all the transfer events that took place by typing: more log_transfer.out You can also reconstruct the ancestral lineage of the final best individual and the mutations that occurred on this lineage, to see whether some transfer events were selected: aevol_misc_lineage -b 0 -e 200 aevol_misc_fixed_mutations -f lineage-b000000-e000200-i...-r...ae more stats/fixedmut-b000000-e000200-i...-r...out Details: A transfer attempt starts by searching for a short region of strong sequence similarity between the recipient chromosome and the donor chromosome. If none is found, there will be no transfer. If on the contrary an alignment is found with a sufficient score, this initial alignment is extended until there is no sequence similarity anymore or until a random event stops the extension -- at each extension step, there is a probability called REPL_TRANSFER_DETACH_RATE to stop the extension even if there is some sequence similarity. aevol-4.4/examples/lateral-transfer-by-replacement/param.in0000644000175000017500000000500412362227455021040 00000000000000################################### # AEVOL PARAMATERS # ################################### ##### 1. Initial setup ############ SEED 7250909 INIT_POP_SIZE 500 INIT_METHOD ONE_GOOD_GENE CLONE CHROMOSOME_INITIAL_LENGTH 5000 ##### 2. Selection ################ SELECTION_SCHEME fitness 750 ##### 3. Mutation rates ########### POINT_MUTATION_RATE 5e-6 SMALL_INSERTION_RATE 5e-6 SMALL_DELETION_RATE 1e-5 MAX_INDEL_SIZE 6 ##### 4. Rearrangement rates (w/o alignements) DUPLICATION_RATE 5e-5 DELETION_RATE 5e-5 TRANSLOCATION_RATE 5e-5 INVERSION_RATE 5e-5 ##### 5. Population Structure ##### ##### 6. Target function ########## ENV_SAMPLING 300 ENV_ADD_GAUSSIAN 0.5 0.2 0.05 ENV_ADD_GAUSSIAN 0.5 0.6 0.05 ENV_ADD_GAUSSIAN 0.5 0.8 0.05 MAX_TRIANGLE_WIDTH 0.005 ##### 7. Recording ################ RECORD_TREE true TREE_MODE normal TREE_STEP 50 MORE_STATS false DUMP_STEP 0 BACKUP_STEP 100 LOG BARRIER TRANSFER ##### 8. Environment variation #### ENV_VARIATION autoregressive_height_variation 0.05 5000 123840 ##### 9. Phenotypic axis ########## ENV_AXIS_FEATURES METABOLISM ##### 10. Secretion ############### ##### 11. Plasmids ################ ALLOW_PLASMIDS false WITH_TRANSFER true TRANSFER_REPL_RATE 0.1 REPL_TRANSFER_WITH_CLOSE_POINTS true REPL_TRANSFER_DETACH_RATE 0.3 ##### 12. Alignment ############### ALIGN_FUNCTION SIGMOID 0 40 ALIGN_W_ZONE_H_LEN 50 ALIGN_MAX_SHIFT 20 ALIGN_MATCH_BONUS 1 ALIGN_MISMATCH_COST 2 WITH_ALIGNMENTS false # MIN_ALIGN_SCORE 40 # MAX_ALIGN_SCORE 100 # MAX_SHIFT 20 # W_ZONE_H_LEN 50 ##### 13. Rearrangement rates (w/ alignements) NEIGHBOURHOOD_RATE 1e-1 DUPLICATION_PROPORTION 5e-5 DELETION_PROPORTION 5e-5 TRANSLOCATION_PROPORTION 5e-5 INVERSION_PROPORTION 5e-5 ##### 14. Regulation ############## # HILL_SHAPE_N 4 # HILL_SHAPE_THETA 0.5 # DEGRADATION_RATE 1 # DEGRADATION_STEP 0.1 # INDIVIDUAL_EVALUATION_DATES NULL # INDIVIDUAL_LIFE_TIME 0 # BINDING_ZEROS_PERCENTAGE 0.75 # WITH_HEREDITY false # PROTEIN_PRESENCE_LIMIT 1e-5 ##### 15. Random, to be (fully) implemented TRANSLATION_COST 0 aevol-4.4/examples/with_space/0000755000175000017500000000000012365454377013454 500000000000000aevol-4.4/examples/with_space/param.in0000644000175000017500000000370712363430565015022 00000000000000################################### # AEVOL PARAMATERS # ################################### ##### 1. Initial setup ############ SEED 7250909 INIT_POP_SIZE 1000 INIT_METHOD ONE_GOOD_GENE CLONE CHROMOSOME_INITIAL_LENGTH 5000 ##### 2. Selection ################ SELECTION_SCHEME fittest ##### 3. Mutation rates ########### POINT_MUTATION_RATE 5e-5 SMALL_INSERTION_RATE 5e-5 SMALL_DELETION_RATE 5e-5 MAX_INDEL_SIZE 6 ##### 4. Rearrangement rates (w/o alignements) DUPLICATION_RATE 5e-5 DELETION_RATE 5e-5 TRANSLOCATION_RATE 5e-5 INVERSION_RATE 5e-5 ##### 5. Population Structure ##### POP_STRUCTURE grid 25 40 MIGRATION_NUMBER 0 ##### 6. Target function ########## ENV_SAMPLING 300 ENV_ADD_GAUSSIAN 0.2 0.3 0.04 ENV_ADD_GAUSSIAN 0.3 0.2 0.02 ENV_ADD_GAUSSIAN 0.2 0.7 0.02 ENV_ADD_GAUSSIAN 0.3 0.8 0.04 ##### 7. Recording ################ RECORD_TREE false TREE_MODE normal MORE_STATS false DUMP_STEP 0 BACKUP_STEP 100 ##### 8. Environment variation #### ENV_VARIATION none ##### 9. Phenotypic axis ########## ENV_AXIS_FEATURES SECRETION 0.50 METABOLISM ##### 10. Secretion ############### SECRETION_CONTRIB_TO_FITNESS 1 SECRETION_INITIAL 0 SECRETION_DIFFUSION_PROP 0.01 SECRETION_DEGRADATION_PROP 0.1 SECRETION_COST 0 ##### 11. Plasmids ################ ALLOW_PLASMIDS false WITH_TRANSFER false ##### 12. Alignment ############### WITH_ALIGNMENTS false # MIN_ALIGN_SCORE 40 # MAX_ALIGN_SCORE 100 # MAX_SHIFT 20 # W_ZONE_H_LEN 50 ##### 13. Rearrangement rates (w/ alignements) NEIGHBOURHOOD_RATE 5e-5 DUPLICATION_PROPORTION 5e-5 DELETION_PROPORTION 5e-5 TRANSLOCATION_PROPORTION 5e-5 INVERSION_PROPORTION 5e-5 aevol-4.4/examples/README0000644000175000017500000000431212230016363012102 00000000000000############################################################################### # # Aevol - An in silico experimental evolution platform # ############################################################################### # # Aevol is a digital genetics model: populations of digital organisms are # subjected to a process of selection and variation, which creates a # Darwinian dynamics. # . # By modifying the characteristics of selection (e.g. population size, # type of environment, environmental variations) or variation (e.g. # mutation rates, chromosomal rearrangement rates, types of # rearrangements, horizontal transfer), one can study experimentally the # impact of these parameters on the structure of the evolved organisms. # In particular, since Aevol integrates a precise and realistic model of # the genome, it allows for the study of structural variations of the # genome (e.g. number of genes, synteny, proportion of coding sequences). # . # The simulation platform comes along with a set of tools for analysing # phylogenies and measuring many characteristics of the organisms and # populations along evolution. # ############################################################################### The complete documentation being quite heavy, it is not included in basic distributions. Please visit www.aevol.fr To take a quick tour, please take the following steps: 1) install aevol cd into the main dir ./configure make sudo make install (see INSTALL in the main dir or run ./configure --help for more information) NOTE: If you don't have sudo rights or simply don't want to install aevol just yet, skip the "sudo make install" step and run the executables "locally" with ../../src/aevol_create and ../../src/aevol_run_X11 2) To run an example, cd into it then run: aevol_create aevol_run_X11 The first command will create an experiment with the parameters contained in the "param.in" file The second command will launch the simulation for 1000 generations (use --nbgener XXX or -n XXX to run for XXX generations) For more information, please see the manpages (e.g. man aevol_create), run any executable with the -h option (e.g. aevol_create -h) and ultimately visit www.aevol.fr aevol-4.4/examples/basic/0000755000175000017500000000000012365454377012407 500000000000000aevol-4.4/examples/basic/param.in0000644000175000017500000000257312364240744013754 00000000000000################################### # AEVOL PARAMATERS # ################################### ##### 1. Initial setup ############ STRAIN_NAME basic_example SEED 7250909 INIT_POP_SIZE 1000 INIT_METHOD ONE_GOOD_GENE CLONE CHROMOSOME_INITIAL_LENGTH 5000 ##### 2. Selection ################ SELECTION_SCHEME exponential_ranking 0.998 ##### 3. Mutation rates ########### POINT_MUTATION_RATE 5e-5 SMALL_INSERTION_RATE 5e-5 SMALL_DELETION_RATE 5e-5 MAX_INDEL_SIZE 6 ##### 4. Rearrangement rates (w/o alignements) WITH_ALIGNMENTS false DUPLICATION_RATE 5e-5 DELETION_RATE 5e-5 TRANSLOCATION_RATE 5e-5 INVERSION_RATE 5e-5 ##### 5. Population Structure ##### ##### 6. Target function ########## ENV_SAMPLING 300 ENV_ADD_GAUSSIAN 1.2 0.52 0.12 ENV_ADD_GAUSSIAN -1.4 0.5 0.07 ENV_ADD_GAUSSIAN 0.3 0.8 0.03 MAX_TRIANGLE_WIDTH 0.033333333 ##### 7. Recording ################ BACKUP_STEP 100 RECORD_TREE false MORE_STATS false ##### 8. Environment variation #### ENV_VARIATION none ##### 9. Phenotypic axis ########## ENV_AXIS_FEATURES METABOLISM ##### 10. Secretion ############### ##### 11. Plasmids ################ ALLOW_PLASMIDS false WITH_TRANSFER false aevol-4.4/src/0000755000000000000000000000000012365454434010237 500000000000000aevol-4.4/src/libaevol/0000755000000000000000000000000012365454434012034 500000000000000aevol-4.4/src/libaevol/ae_environment.cpp0000644000175000017500000006472512364050651015531 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include //############################################################################## // # // Class ae_environment # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_environment::ae_environment( void ) : #ifdef __NO_X ae_fuzzy_set() #elif defined __X11 ae_fuzzy_set_X11() #else #error You must specify a graphic option #endif { // Environment "shape" _initial_gaussians = NULL; _gaussians = NULL; _sampling = 0; _custom_points = NULL; _total_area = 0.0; // Environment segmentation _nb_segments = 1; _segments = new ae_env_segment* [1]; _segments[0] = new ae_env_segment( X_MIN, X_MAX, METABOLISM ); _area_by_feature = new double [NB_FEATURES]; // Variation management _var_prng = NULL; _var_method = NO_VAR; _var_sigma = 0.0; _var_tau = 0; // Noise management _cur_noise = NULL; _noise_method = NO_NOISE; _noise_prng = NULL; _noise_prob = 0.0; _noise_alpha = 0.0; _noise_sigma = 0.0; _noise_sampling_log = 8; } ae_environment::ae_environment( const ae_environment &model ) : #ifdef __NO_X ae_fuzzy_set(model) #elif defined __X11 ae_fuzzy_set_X11(model) #else #error You must specify a graphic option #endif { // Environment "shape" _sampling = model._sampling; if (model._initial_gaussians == NULL) { _initial_gaussians = NULL; } else { _initial_gaussians = new ae_list; ae_list_node * node = model._initial_gaussians->get_first(); ae_gaussian * gaussian = NULL; while (node != NULL) { gaussian = node->get_obj(); _initial_gaussians->add( new ae_gaussian(*gaussian)); node = node->get_next(); } } if (model._gaussians == NULL) { _gaussians = NULL; } else { _gaussians = new ae_list; ae_list_node * node = model._gaussians->get_first(); ae_gaussian * gaussian = NULL; while (node != NULL) { gaussian = node->get_obj(); _gaussians->add( new ae_gaussian(*gaussian)); node = node->get_next(); } } if (model._custom_points == NULL) { _custom_points = NULL; } else { _custom_points = new ae_list; ae_list_node * node = model._custom_points->get_first(); ae_point_2d * point = NULL; while (node != NULL) { point = node->get_obj(); _custom_points->add( new ae_point_2d(*point)); node = node->get_next(); } } _total_area = model._total_area; // Environment segmentation _nb_segments = model._nb_segments; if (_nb_segments == 0) { _segments = NULL; } else { _segments = new ae_env_segment* [_nb_segments]; for(int32_t i = 0; i < _nb_segments; i++) { _segments[i] = new ae_env_segment( *(model._segments[i]) ); } } _area_by_feature = new double [NB_FEATURES]; for (int32_t i = 0; i < NB_FEATURES; i++) { _area_by_feature[i] = model._area_by_feature[i]; } // Variation management _var_method = model._var_method; if (model._var_prng == NULL) { _var_prng = NULL; } else { _var_prng = new ae_jumping_mt( *(model._var_prng) ); } _var_sigma = model._var_sigma; _var_tau = model._var_tau; // Noise management _noise_method = model._noise_method; if (model._cur_noise == NULL) { _cur_noise = NULL; } else { _cur_noise = new ae_fuzzy_set( *(model._cur_noise) ); } if (model._noise_prng == NULL) { _noise_prng = NULL; } else { _noise_prng = new ae_jumping_mt( *(model._noise_prng) ); } _noise_prob = model._noise_prob; _noise_alpha = model._noise_alpha; _noise_sigma = model._noise_sigma; _noise_sampling_log = model._noise_sampling_log; }; // ================================================================= // Destructors // ================================================================= ae_environment::~ae_environment( void ) { if ( _gaussians != NULL ) { _gaussians->erase( true ); delete _gaussians; } if ( _initial_gaussians != NULL ) { _initial_gaussians->erase( true ); delete _initial_gaussians; } if ( _custom_points != NULL ) { _custom_points->erase( true ); delete _custom_points; } if (_var_prng != NULL) delete _var_prng; if (_noise_prng != NULL) delete _noise_prng; if ( _segments != NULL ) { for ( int16_t i = 0 ; i < _nb_segments; i++ ) { delete _segments[i]; } delete [] _segments; } delete [] _area_by_feature; delete _cur_noise; } // ================================================================= // Public Methods // ================================================================= void ae_environment::save( gzFile backup_file ) const { // --------------------- // Write gaussians // --------------------- int16_t nb_gaussians = ( _gaussians == NULL ) ? 0 : _gaussians->get_nb_elts(); gzwrite( backup_file, &nb_gaussians, sizeof(nb_gaussians) ); if ( _gaussians != NULL ) { ae_list_node* gaussian_node = _gaussians->get_first(); ae_gaussian* gaussian; for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { gaussian = gaussian_node->get_obj(); gaussian->save( backup_file ); gaussian_node = gaussian_node->get_next(); } } // --------------------- // Write sampling // --------------------- gzwrite( backup_file, &_sampling, sizeof(_sampling) ); // --------------------- // Write custom points // --------------------- int16_t nb_custom_points = (_custom_points == NULL) ? 0 : _custom_points->get_nb_elts(); gzwrite( backup_file, &nb_custom_points, sizeof(nb_custom_points) ); if ( _custom_points != NULL ) { ae_list_node* custom_point_node = _custom_points->get_first(); ae_point_2d* custom_point; for ( int16_t i = 0 ; i < nb_custom_points ; i++ ) { custom_point = custom_point_node->get_obj(); custom_point->save( backup_file ); custom_point_node = custom_point_node->get_next(); } } // ------------------------------- // Write x-axis segmentation // ------------------------------- gzwrite( backup_file, &_nb_segments, sizeof(_nb_segments) ); for ( int16_t i = 0 ; i < _nb_segments; i++ ) { _segments[i]->save( backup_file ); } // ----------------------------------- // Write environmental variation data // ----------------------------------- int8_t tmp_var_method = _var_method; gzwrite( backup_file, &tmp_var_method, sizeof(tmp_var_method) ); if ( _var_method != NO_VAR ) { _var_prng->save( backup_file ); gzwrite( backup_file, &_var_sigma, sizeof(_var_sigma) ); gzwrite( backup_file, &_var_tau, sizeof(_var_tau) ); } // --------------------- // Write noise data // --------------------- int8_t tmp_noise_method = _noise_method; gzwrite( backup_file, &tmp_noise_method, sizeof(tmp_noise_method) ); if ( _noise_method != NO_NOISE ) { int8_t tmp_save_cur_noise = ( _cur_noise != NULL ); gzwrite( backup_file, &tmp_save_cur_noise, sizeof(tmp_save_cur_noise) ); if ( tmp_save_cur_noise ) _cur_noise->save( backup_file ); _noise_prng->save( backup_file ); gzwrite( backup_file, &_noise_alpha, sizeof(_noise_alpha) ); gzwrite( backup_file, &_noise_sigma, sizeof(_noise_sigma) ); gzwrite( backup_file, &_noise_prob, sizeof(_noise_prob) ); gzwrite( backup_file, &_noise_sampling_log, sizeof(_noise_sampling_log) ); } // --------------------------------------------------------------- // If needed, keep a copy of the initial state of the gaussians // --------------------------------------------------------------- if ( _var_method != NO_VAR || is_noise_allowed() ) { int16_t nb_gaussians = ( _initial_gaussians == NULL ) ? 0 : _initial_gaussians->get_nb_elts(); gzwrite( backup_file, &nb_gaussians, sizeof(nb_gaussians) ); if ( _initial_gaussians != NULL ) { ae_list_node* gaussian_node = _initial_gaussians->get_first(); ae_gaussian* gaussian; for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { gaussian = gaussian_node->get_obj(); gaussian->save( backup_file ); gaussian_node = gaussian_node->get_next(); } } } } void ae_environment::load( gzFile backup_file ) { // --------------------- // Retreive gaussians // --------------------- int16_t nb_gaussians; gzread( backup_file, &nb_gaussians, sizeof(nb_gaussians) ); if ( nb_gaussians > 0 ) _gaussians = new ae_list(); for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { _gaussians->add( new ae_gaussian( backup_file ) ); } // ------------------------------ // Retrieve sampling // ------------------------------ gzread( backup_file, &_sampling, sizeof(_sampling) ); // ------------------------- // Retreive custom points // ------------------------- int16_t nb_custom_points; gzread( backup_file, &nb_custom_points, sizeof(nb_custom_points) ); if ( nb_custom_points > 0 ) _custom_points = new ae_list(); for ( int16_t i = 0 ; i < nb_custom_points ; i++ ) { _custom_points->add( new ae_point_2d( backup_file ) ); } // ------------------------------- // Retrieve x-axis segmentation // ------------------------------- // Delete old data for ( int16_t i = 0 ; i < _nb_segments ; i++ ) { delete _segments[i]; } delete [] _segments; // Replace by data from the backup gzread( backup_file, &_nb_segments, sizeof(_nb_segments) ); _segments = new ae_env_segment* [_nb_segments]; for ( int16_t i = 0 ; i < _nb_segments; i++ ) { _segments[i] = new ae_env_segment( backup_file ); //~ _segments[i] = new ae_env_segment( ae_common::init_params->get_env_axis_segment_boundaries()[i], //~ ae_common::init_params->get_env_axis_segment_boundaries()[i+1], //~ ae_common::init_params->get_env_axis_features()[i] ); } // ---------------------------------------- // Retrieve environmental variation data // ---------------------------------------- int8_t tmp_var_method; gzread( backup_file, &tmp_var_method, sizeof(tmp_var_method) ); _var_method = (ae_env_var) tmp_var_method; if ( _var_method != NO_VAR ) { _var_prng = new ae_jumping_mt( backup_file ); gzread( backup_file, &_var_sigma, sizeof(_var_sigma) ); gzread( backup_file, &_var_tau, sizeof(_var_tau) ); } // ------------------------------------ // Retrieve environmental noise data // ------------------------------------); int8_t tmp_noise_method; gzread( backup_file, &tmp_noise_method, sizeof(tmp_noise_method) ); _noise_method = (ae_env_noise) tmp_noise_method; if ( _noise_method != NO_NOISE ) { int8_t tmp_cur_noise_saved; gzread( backup_file, &tmp_cur_noise_saved, sizeof(tmp_cur_noise_saved) ); if ( tmp_cur_noise_saved ) { _cur_noise = new ae_fuzzy_set( backup_file ); } _noise_prng = new ae_jumping_mt( backup_file ); gzread( backup_file, &_noise_alpha, sizeof(_noise_alpha) ); gzread( backup_file, &_noise_sigma, sizeof(_noise_sigma) ); gzread( backup_file, &_noise_prob, sizeof(_noise_prob) ); gzread( backup_file, &_noise_sampling_log, sizeof(_noise_sampling_log) ); } // -------------------------------------------------------------------- // If needed, retreive the copy of the initial state of the gaussians // -------------------------------------------------------------------- if ( _var_method != NO_VAR || is_noise_allowed() ) { int16_t nb_gaussians; gzread( backup_file, &nb_gaussians, sizeof(nb_gaussians) ); if ( nb_gaussians > 0 ) _initial_gaussians = new ae_list(); for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { _initial_gaussians->add( new ae_gaussian( backup_file ) ); } } // ------------------------------ // Build // ------------------------------ build(); } void ae_environment::add_gaussian( double a, double b, double c ) { _gaussians->add( new ae_gaussian( a, b, c ) ); } void ae_environment::add_initial_gaussian( double a, double b, double c ) { _initial_gaussians->add( new ae_gaussian( a, b, c ) ); } void ae_environment::add_custom_point( double x, double y ) { _custom_points->add(new ae_point_2d(x, y)); } void ae_environment::build( void ) { // NB : Extreme points (at abscissa MIN_X and MAX_X) will be generated, we need to erase the list first _points->erase( true ); // ---------------------------------------- // 1) Generate sample points from gaussians // ---------------------------------------- if ( _gaussians != NULL) { ae_list_node* node = NULL; for ( int16_t i = 0 ; i <= _sampling ; i++ ) { ae_point_2d* new_point = new ae_point_2d( X_MIN + (double)i * (X_MAX - X_MIN) / (double)_sampling, 0.0 ); node = _gaussians->get_first(); while ( node ) { new_point->y += node->get_obj()->compute_y( new_point->x ); node = node->get_next(); } _points->add( new_point ); } } // -------------------- // 2) Add custom points // -------------------- if ( _custom_points != NULL) { ae_list_node* pt_node = _custom_points->get_first(); ae_point_2d *custom_point = pt_node->get_obj(); ae_point_2d *new_point; if ( custom_point->x > X_MIN) { // Add the point (X_MIN, Y_MIN) in front of the list of points new_point = new ae_point_2d( X_MIN, Y_MIN ); _points->add_front( new_point ); } while ( pt_node != NULL ) { custom_point = pt_node->get_obj(); new_point = new ae_point_2d( *custom_point ); _points->add( new_point ); pt_node = pt_node->get_next(); } if ( custom_point->x < X_MAX ) { // Add the point (X_MAX, Y_MIN) at the end of the list of points new_point = new ae_point_2d( X_MAX, Y_MIN ); _points->add( new_point ); } } // --------------------------------------- // 3) Simplify (get rid of useless points) // --------------------------------------- add_lower_bound( Y_MIN ); add_upper_bound( Y_MAX ); simplify(); // --------------------------------------- // 4) Compute areas (total and by feature) // --------------------------------------- _compute_area(); // ------------------------------------------------------------------- // 5) If needed, create a copy of the initial state of the gaussians // ------------------------------------------------------------------- if ( _initial_gaussians == NULL && (_var_method != NO_VAR || is_noise_allowed()) ) { _initial_gaussians = new ae_list(); int32_t nb_gaussians = _gaussians->get_nb_elts(); ae_list_node* gaussian_node = _gaussians->get_first(); ae_gaussian* gaussian = NULL; for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { gaussian = gaussian_node->get_obj(); _initial_gaussians->add( new ae_gaussian( *gaussian ) ); gaussian_node = gaussian_node->get_next(); } } } /*! Apply a gaussian noise to the set of points with a variance sigma and a coefficient alpha : alpha = [ -1.0 ------------------ 0.0 -------------------- 1.0 ] white noise uniform fractal unique draw noise */ void ae_environment::apply_noise( void ) { if ( _noise_method != NO_NOISE && _noise_prng->random() < _noise_prob && _noise_sampling_log > 0 ) { // ===================================================================================== // Compute a fractal noise in a new fuzzy set and apply it to the (unnoised) environment // ===================================================================================== // Clear previous noise (get an unnoised state of th ecurrent environment) build(); // Initialize the cur_noise (current noise) fuzzy set to a set of points with y=0 // The number of points is determined by _noise_sampling_log (2^_noise_sampling_log) if ( _cur_noise == NULL ) { _cur_noise = new ae_fuzzy_set(); // Add points to reflect the sampling int32_t nb_points = 1 << (_noise_sampling_log - 1); double interval = (X_MAX - X_MIN) / (nb_points - 1); double half_interval = interval / 2; double cur_x = interval; while ( cur_x - X_MAX < -half_interval ) // while (cur_x < X_MAX) but precision-problems-proof { printf("infinite loop\n"); _cur_noise->create_interpolated_point( cur_x ); cur_x += interval; } } else // _cur_noise has already been created -> reinitialize all its points to 0 { ae_list_node* point_node = _cur_noise->get_points()->get_first(); while ( point_node != NULL ) { point_node->get_obj()->y = 0; point_node = point_node->get_next(); } } // Compute a fractal noise: // Add a random noise to the whole fuzzy set, then cut it in 2 and add // another noise to each half and so on (apply noise to the 4 quarters...) // until each zone contains only one single point. int8_t fractal_step = 0; while ( fractal_step < _noise_sampling_log ) { int32_t num_zone; int32_t nb_zones = 1 << fractal_step; int32_t nb_points_in_each_zone = _cur_noise->get_points()->get_nb_elts() / nb_zones; // Compute current noise intensity // We first test the trivial (most common) cases, then the general (positive or negative) cases double noise_intensity; if (_noise_alpha == 0.0) { noise_intensity = _noise_sigma; } //~ else if (_noise_alpha == 1.0) //~ { //~ noise_intensity = _noise_sigma * ( 1 << (fractal_step - 1) ); //~ } //~ else if (_noise_alpha == -1.0) //~ { //~ noise_intensity = _noise_sigma * ( 1 << (_noise_sampling_log - fractal_step - 1) ); //~ } else if ( _noise_alpha > 0.0 ) { noise_intensity = _noise_sigma * pow( 1.0 - _noise_alpha, fractal_step ); } else // ( _noise_alpha < 0.0 ) { noise_intensity = _noise_sigma * pow( 1.0 + _noise_alpha, _noise_sampling_log - fractal_step ); } //~ printf( "_noise_sigma %e\tfractal_step : %"PRId8"\tnoise_intensity : %e\n", _noise_sigma, fractal_step, noise_intensity ); // For each zone in the current fractal step, compute a random noise to // be applied to all the points in the zone double* noise_component = new double[nb_zones]; for ( num_zone = 0 ; num_zone < nb_zones ; num_zone++ ) { // Compute noise component for the current region noise_component[num_zone] = _noise_prng->gaussian_random() * noise_intensity; } // For each point in the noise fuzzy set, apply the noise computed for the corresponding zone ae_list_node* point_node = _cur_noise->get_points()->get_first(); ae_point_2d* point = NULL; int32_t point_index = 0; while ( point_node != NULL ) { point = point_node->get_obj(); num_zone = floor( point_index++ / nb_points_in_each_zone ); point->y += noise_component[num_zone]; point_node = point_node->get_next(); } delete noise_component; fractal_step++; } // //~ ae_list_node* point_node = _cur_noise->get_points()->get_first(); //~ ae_point_2d* point = NULL; //~ while ( point_node != NULL ) //~ { //~ point = point_node->get_obj(); //~ printf( " x: %f\ty: %e\n", point->x, point->y ); //~ point_node = point_node->get_next(); //~ } // // Apply the fractal noise to the environment this->add( _cur_noise ); // Bind Y values in [Y_MIN, Y_MAX] add_lower_bound( Y_MIN ); add_upper_bound( Y_MAX ); // Environment has changed, recompute its area _compute_area(); } } // ================================================================= // Protected Methods // ================================================================= void ae_environment::_apply_autoregressive_mean_variation( void ) { // For each gaussian : // current_mean = ref_mean + delta_m, where // delta_m follows an autoregressive stochastic process // with the parameters _var_sigma and _var_tau int16_t nb_gaussians = _gaussians->get_nb_elts(); ae_list_node* gaussian_node = _gaussians->get_first(); ae_gaussian* gaussian; ae_list_node* ref_gaussian_node = _initial_gaussians->get_first(); ae_gaussian* ref_gaussian; for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { gaussian = gaussian_node->get_obj(); ref_gaussian = ref_gaussian_node->get_obj(); // Find the current delta_mean = current_mean - ref_mean double delta_mean = gaussian->get_mean() - ref_gaussian->get_mean(); //double delta_height = gaussian->get_height() - ref_gaussian->get_height(); // Compute the next value : // Dm(t+1) = Dm(t)*(1-1/tau) + ssd/tau*sqrt(2*tau-1)*normal_random() delta_mean = delta_mean * (1.0 - 1.0/_var_tau) + (_var_sigma/_var_tau) * sqrt(2*_var_tau- 1.0) * _var_prng->gaussian_random(); //delta_height = delta_height * (1.0 - 1.0/_var_tau) + (_var_sigma/_var_tau) * sqrt(2*_var_tau- 1.0) * _var_prng->gaussian_random(); // Deduce the new value of the mean : ref_mean + delta_m gaussian->set_mean( ref_gaussian->get_mean() + delta_mean ); //gaussian->set_height( ref_gaussian->get_height() + delta_height ); gaussian_node = gaussian_node->get_next(); ref_gaussian_node = ref_gaussian_node->get_next(); } build(); } void ae_environment::_apply_autoregressive_height_variation( void ) { // For each gaussian : // current_height = ref_height + delta_h, where // delta_m follows an autoregressive stochastic process // with the parameters _var_sigma and _var_tau int16_t nb_gaussians = _gaussians->get_nb_elts(); ae_list_node* gaussian_node = _gaussians->get_first(); ae_gaussian* gaussian; ae_list_node* ref_gaussian_node = _initial_gaussians->get_first(); ae_gaussian* ref_gaussian; for ( int16_t i = 0 ; i < nb_gaussians ; i++ ) { gaussian = gaussian_node->get_obj(); ref_gaussian = ref_gaussian_node->get_obj(); // Find the current delta_height = current_height - ref_height double delta_height = gaussian->get_height() - ref_gaussian->get_height(); // Compute the next value : // Dh(t+1) = Dh(t)*(1-1/tau) + ssd/tau*sqrt(2*tau-1)*normal_random() delta_height = delta_height * (1.0 - 1.0/_var_tau) + (_var_sigma/_var_tau) * sqrt(2*_var_tau- 1.0) * _var_prng->gaussian_random(); // Deduce the new value of the height : ref_height + delta_h gaussian->set_height( ref_gaussian->get_height() + delta_height ); gaussian_node = gaussian_node->get_next(); ref_gaussian_node = ref_gaussian_node->get_next(); } build(); } void ae_environment::_apply_local_gaussian_variation( void ) { printf( "ERROR, _apply_local_gaussian_variation has not yet been implemented. in file %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } void ae_environment::_compute_area( void ) { _total_area = 0.0; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _area_by_feature[i] = 0.0; } // TODO : We should take into account that we compute the areas in a specific order (from the leftmost segment, rightwards) // => We shouldn't parse the whole list of points on the left of the segment we are considering (we have // already been through them!) for ( int16_t i = 0 ; i < _nb_segments ; i++ ) { _area_by_feature[_segments[i]->feature] += get_geometric_area( _segments[i]->start, _segments[i]->stop ); _total_area += _area_by_feature[_segments[i]->feature]; } } aevol-4.4/src/libaevol/ae_protein.h0000644000175000017500000001660012231437075014301 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_PROTEIN_H__ #define __AE_PROTEIN_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_individual; class ae_rna; class ae_protein : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_protein( ae_genetic_unit* gen_unit, const ae_protein &model ); ae_protein( ae_genetic_unit* gen_unit, ae_list* codon_list, ae_strand strand, int32_t shine_dal, ae_rna* rna ); //ae_protein( ae_protein* parent ); ae_protein( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_protein( void ); // ================================================================= // Accessors // ================================================================= inline ae_strand get_strand( void ) const; inline ae_list* get_rna_list( void ) const; inline int32_t get_shine_dal_pos( void ) const; inline int32_t get_first_translated_pos( void ) const; inline int32_t get_last_translated_pos( void ) const; int32_t get_last_STOP_base_pos( void ) const; inline double get_mean( void ) const; inline double get_width( void ) const; // returns the half-width inline double get_height( void ) const; inline int32_t get_length( void ) const; // Number of Amino-Acids (not including START and STOP) inline double get_concentration( void ) const; inline bool get_is_functional( void ) const; ae_individual* get_indiv( void ) const; // ================================================================= // Public Methods // ================================================================= void add_RNA( ae_rna* rna ); char* get_AA_sequence( void ) const; // WARNING : creates a new char[...] (up to you to delete it!) virtual void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_protein( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_protein( const ae_protein &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_genetic_unit* _gen_unit; ae_strand _strand; ae_list* _rna_list; // RNAs transcribing this protein int32_t _shine_dal_pos; // Index of the corresponding shine dalgarno sequence in the genome int32_t _first_translated_pos; // Index of the first base following the START codon int32_t _last_translated_pos; // Index of the last base before the STOP codon int32_t _length; // Number of Amino-Acids (START and STOP codon do NOT produce AAs) double _concentration; bool _is_functional; ae_list* _AA_list; // Phenotypic contribution (triangle) parameters double _mean; double _width; // in fact, half-width double _height; }; // ===================================================================== // Accessors definitions // ===================================================================== inline ae_strand ae_protein::get_strand( void ) const { return _strand; } inline ae_list* ae_protein::get_rna_list( void ) const { return _rna_list; } int32_t ae_protein::get_shine_dal_pos( void ) const { return _shine_dal_pos; } int32_t ae_protein::get_first_translated_pos( void ) const { return _first_translated_pos; } int32_t ae_protein::get_last_translated_pos( void ) const { return _last_translated_pos; } double ae_protein::get_mean( void ) const { return _mean; } double ae_protein::get_width( void ) const { return _width; } double ae_protein::get_height( void ) const { return _height; } int32_t ae_protein::get_length( void ) const { return _length; } double ae_protein::get_concentration( void ) const { return _concentration; } bool ae_protein::get_is_functional( void ) const { return _is_functional; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_PROTEIN_H__ aevol-4.4/src/libaevol/ae_logs.cpp0000644000175000017500000003522612344343143014122 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_logs # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_logs::ae_logs( void ) { _logs = 0; _transfer_log = NULL; _rear_log = NULL; _barrier_log = NULL; //_param_modification_log = NULL; } // ================================================================= // Destructors // ================================================================= ae_logs::~ae_logs( void ) { if ( _logs & LOG_TRANSFER ) { fclose( _transfer_log ); } if ( _logs & LOG_REAR ) { fclose( _rear_log ); } if ( _logs & LOG_BARRIER ) { fclose( _barrier_log ); } /*if ( _logs & LOG_LOADS ) { fclose( _param_modification_log ); }*/ } // ================================================================= // Public Methods // ================================================================= /*void ae_logs::save( gzFile setup_file ) const { gzwrite( backup_file, &_logs, sizeof(_logs) ); }*/ void ae_logs::load( int8_t logs, int32_t num_gener ) { char* line = new char[500]; char* ret; _logs = logs; // Prepare required log files if ( _logs & LOG_TRANSFER ) { rename ( "log_transfer.out", "log_transfer.out.old" ); FILE* old_transfer_log = fopen( "log_transfer.out.old", "r" ); if ( old_transfer_log == NULL ) { printf( "Error: Failed to open file \"log_transfer.out.old\"\n" ); exit( EXIT_FAILURE ); } _transfer_log = fopen( "log_transfer.out", "w" ); if ( _transfer_log == NULL ) { printf( "Error: Failed to open file \"log_transfer.out\"\n" ); exit( EXIT_FAILURE ); } // Copy file headers ret = fgets( line, 500, old_transfer_log ); while ( !feof( old_transfer_log ) && line[0] == '#' ) { fputs( line, _transfer_log ); ret = fgets( line, 500, old_transfer_log ); } // This is the empty line between the header and the values //fputs( line, _transfer_log ); // Copy log entries until num_gener (excluded) while ( (int32_t)atol(line) < num_gener && !feof(old_transfer_log) ) { fputs( line, _transfer_log ); ret = fgets( line, 500, old_transfer_log ); while(!feof(old_transfer_log) & (line[0] == '\t' || line[0] == ' ')) { fputs( line, _transfer_log ); ret = fgets( line, 500, old_transfer_log ); } } fclose( old_transfer_log ); remove( "log_transfer.out.old" ); } if ( _logs & LOG_REAR ) { rename ( "log_rear.out", "log_rear.out.old" ); FILE* old_rear_log = fopen( "log_rear.out.old", "r" ); if ( old_rear_log == NULL ) { printf( "Error: Failed to open file \"log_rear.out.old\"\n" ); exit( EXIT_FAILURE ); } _rear_log = fopen( "log_rear.out", "w" ); if ( _rear_log == NULL ) { printf( "Error: Failed to open file \"log_rear.out\"\n" ); exit( EXIT_FAILURE ); } // Copy file headers ret = fgets( line, 500, old_rear_log ); while ( !feof( old_rear_log ) && line[0] == '#' ) { fputs( line, _rear_log ); ret = fgets( line, 500, old_rear_log ); } // This is the empty line between the header and the values //fputs( line, _rear_log ); // Copy log entries until num_gener (excluded) while ( (int32_t)atol(line) < num_gener && !feof(old_rear_log) ) { fputs( line, _rear_log ); ret = fgets( line, 500, old_rear_log ); } fclose( old_rear_log ); remove( "log_rear.out.old" ); } if ( _logs & LOG_BARRIER ) { rename ( "log_barrier.out", "log_barrier.out.old" ); FILE* old_barrier_log = fopen( "log_barrier.out.old", "r" ); if ( old_barrier_log == NULL ) { printf( "Error: Failed to open file \"log_barrier.out.old\"\n" ); exit( EXIT_FAILURE ); } _barrier_log = fopen( "log_barrier.out", "w" ); if ( _barrier_log == NULL ) { printf( "Error: Failed to open file \"log_barrier.out\"\n" ); exit( EXIT_FAILURE ); } // Copy file headers ret = fgets( line, 500, old_barrier_log ); while ( !feof( old_barrier_log ) && line[0] == '#' ) { fputs( line, _barrier_log ); ret = fgets( line, 500, old_barrier_log ); } // This is the empty line between the header and the values //fputs( line, _barrier_log ); // Copy log entries until num_gener (excluded) while ( (int32_t)atol(line) < num_gener && !feof(old_barrier_log) ) { fputs( line, _barrier_log ); ret = fgets( line, 500, old_barrier_log ); } fclose( old_barrier_log ); remove( "log_barrier.out.old" ); } /*if ( _logs & LOG_LOADS ) { rename ( "log_param_modification.out", "log_param_modification.out.old" ); FILE* old_param_modification_log = fopen( "log_param_modification.out.old", "r" ); if ( old_param_modification_log == NULL ) { printf( "Error: Failed to open file \"log_param_modification.out.old\"\n" ); exit( EXIT_FAILURE ); } _param_modification_log = fopen( "log_param_modification.out", "w" ); if ( _param_modification_log == NULL ) { printf( "Error: Failed to open file \"log_param_modification.out\"\n" ); exit( EXIT_FAILURE ); } //Copy file headers ret = fgets( line, 500, old_param_modification_log ); while ( !feof( old_param_modification_log ) && line[0] == '#' ) { fputs( line, _param_modification_log ); ret = fgets( line, 500, old_param_modification_log ); } // This is the empty line between the header and the values //fputs( line, _param_modification_log ); // Copy log entries until num_gener (excluded) while ( (int32_t)atol(line) < num_gener && !feof(old_param_modification_log) ) { fputs( line, _param_modification_log ); ret = fgets( line, 500, old_param_modification_log ); } fclose( old_param_modification_log ); remove( "log_param_modification.out.old" ); }*/ delete [] line; } void ae_logs::print_to_file( FILE* file ) const { fprintf( file, "logs : %"PRId8"\n", _logs ); } void ae_logs::set_logs( int8_t logs ) { _logs = logs; // Open required log files if ( _logs & LOG_TRANSFER ) { _transfer_log = fopen( "log_transfer.out", "w" ); if ( _transfer_log == NULL ) { printf( "Error: Failed to open file \"log_transfer.out\"\n" ); exit( EXIT_FAILURE ); } } if ( _logs & LOG_REAR ) { _rear_log = fopen( "log_rear.out", "w" ); if ( _rear_log == NULL ) { printf( "Error: Failed to open file \"log_rear.out\"\n" ); exit( EXIT_FAILURE ); } } if ( _logs & LOG_BARRIER ) { _barrier_log = fopen( "log_barrier.out", "w" ); if ( _barrier_log == NULL ) { printf( "Error: Failed to open file \"log_barrier.out\"\n" ); exit( EXIT_FAILURE ); } } /*if ( _logs & LOG_LOADS ) { _param_modification_log = fopen( "log_param_modification.out", "w" ); if ( _param_modification_log == NULL ) { printf( "Error: Failed to open file \"log_param_modification.out\"\n" ); exit( EXIT_FAILURE ); } }*/ this->write_headers(); } void ae_logs::flush( void ) { if ( _logs & LOG_TRANSFER ) { fflush( _transfer_log ); } if ( _logs & LOG_REAR ) { fflush( _rear_log ); } if ( _logs & LOG_BARRIER ) { fflush( _barrier_log ); } /*if ( _logs & LOG_LOADS ) { fflush( _param_modification_log ); }*/ } // ================================================================= // Protected Methods // ================================================================= void ae_logs::write_headers( void ) const { // ========== TRANSFER LOG ========== if ( _logs & LOG_TRANSFER ) { fprintf( _transfer_log, "######################################################################\n" ); fprintf( _transfer_log, "# Horizontal transfer log\n" ); fprintf( _transfer_log, "#\n" ); fprintf( _transfer_log, "# Log of every horizontal transfer that occured during the simulation\n" ); fprintf( _transfer_log, "#\n" ); fprintf( _transfer_log, "# 1. Generation\n" ); fprintf( _transfer_log, "# 2. Index of the recepient\n" ); fprintf( _transfer_log, "# 3. Index of the donor (generation n-1)\n" ); fprintf( _transfer_log, "# 4. Type of transfer\n" ); fprintf( _transfer_log, "# 5. Length of the transferred segment\n" ); fprintf( _transfer_log, "# 6. Length of the replaced segment (if any)\n" ); fprintf( _transfer_log, "# 7. Size of the genome before the transfer\n" ); fprintf( _transfer_log, "# 8. Size of the genome after the transfer\n" ); fprintf( _transfer_log, "# 9. Alignment 1 point 1\n" ); fprintf( _transfer_log, "# 10. Alignment 1 point 2\n" ); fprintf( _transfer_log, "# 11. Alignment 1 score\n" ); fprintf( _transfer_log, "# 12. Alignment 2 point 1\n" ); fprintf( _transfer_log, "# 13. Alignment 2 point 2\n" ); fprintf( _transfer_log, "# 14. Alignment 2 score\n" ); fprintf( _transfer_log, "#\n" ); fprintf( _transfer_log, "######################################################################\n" ); fprintf( _transfer_log, "#\n" ); fprintf( _transfer_log, "# Header for R\n" ); fprintf( _transfer_log, "gener recepient donor t_type seg_len replaced_len size_before size_after align1_pt1 align1_pt2 score1 align2_pt1 align2_pt2 score2\n" ); fprintf( _transfer_log, "#\n" ); } // ========== REAR LOG ========== if ( _logs & LOG_REAR ) { fprintf( _rear_log, "######################################################################\n" ); fprintf( _rear_log, "# Chromosomal rearrangement log\n" ); fprintf( _rear_log, "#\n" ); fprintf( _rear_log, "# Log of every rearrangement that occured during the simulation\n" ); fprintf( _rear_log, "# (not just one lineage)\n" ); fprintf( _rear_log, "#\n" ); fprintf( _rear_log, "# 1. Generation\n" ); fprintf( _rear_log, "# 2. Index of the individual that has undergone the rearrangement\n" ); fprintf( _rear_log, "# 3. Type of rearrangement\n" ); fprintf( _rear_log, "# 4. Length of the rearranged segment\n" ); fprintf( _rear_log, "# 5. Size of the genome before the rearrangement\n" ); fprintf( _rear_log, "# 6. Alignment score that was needed for this rearrangement to occur\n" ); fprintf( _rear_log, "# 7. Second alignment score (translocation only)\n" ); fprintf( _rear_log, "#\n" ); fprintf( _rear_log, "######################################################################\n" ); fprintf( _rear_log, "#\n" ); fprintf( _rear_log, "# Header for R\n" ); fprintf( _rear_log, "gener indiv r_type seg_len genome_size score1 score2\n" ); fprintf( _rear_log, "#\n" ); } // ========== BARRIER LOG ========== if ( _logs & LOG_BARRIER ) { fprintf( _barrier_log, "######################################################################\n" ); fprintf( _barrier_log, "# Genome size limits log\n" ); fprintf( _barrier_log, "#\n" ); fprintf( _barrier_log, "# An entry is written whenever a mutation would have produced a\n" ); fprintf( _barrier_log, "# genome whose size wouldn't lie in [min, max].\n" ); fprintf( _barrier_log, "# The corresponding mutation is \"cancelled\"\n" ); fprintf( _barrier_log, "#\n" ); fprintf( _barrier_log, "# 1. Generation\n" ); fprintf( _barrier_log, "# 2. Index of the individual\n" ); fprintf( _barrier_log, "# 3. Type of event\n" ); fprintf( _barrier_log, "# 4. Segment length\n" ); fprintf( _barrier_log, "# 5. Replaced segment length\n" ); fprintf( _barrier_log, "# 6. GU size (before the event)\n" ); fprintf( _barrier_log, "# 7. Genome size (before the event)\n" ); fprintf( _barrier_log, "#\n" ); fprintf( _barrier_log, "######################################################################\n" ); } // ========== LOADS LOG ========== /*if ( _logs & LOG_LOADS ) { fprintf( _param_modification_log, "######################################################################\n" ); fprintf( _param_modification_log, "# Parameter modification log\n" ); fprintf( _param_modification_log, "#\n" ); fprintf( _param_modification_log, "# An entry is written whenever a parameter is modified by aevol_modify.\n" ); fprintf( _param_modification_log, "######################################################################\n" ); }*/ } aevol-4.4/src/libaevol/ae_spatial_structure.cpp0000644000175000017500000001707712364414135016741 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_spatial_structure # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_spatial_structure::ae_spatial_structure( void ) { _prng = NULL; _grid_width = -1; _grid_height = -1; _pop_grid = NULL; _migration_number = -1; _secretion_diffusion_prop = -1; _secretion_degradation_prop = -1; } ae_spatial_structure::ae_spatial_structure( gzFile backup_file ) { _prng = new ae_jumping_mt( backup_file ); gzread( backup_file, &_grid_width, sizeof(_grid_width) ); gzread( backup_file, &_grid_height, sizeof(_grid_height) ); _pop_grid = new ae_grid_cell** [_grid_width]; for ( int16_t x = 0 ; x < _grid_width ; x++ ) { _pop_grid[x] = new ae_grid_cell* [_grid_height]; for ( int16_t y = 0 ; y < _grid_height ; y++ ) { _pop_grid[x][y] = new ae_grid_cell( backup_file ); } } gzread( backup_file, &_migration_number, sizeof(_migration_number) ); gzread( backup_file, &_secretion_diffusion_prop, sizeof(_secretion_diffusion_prop) ); gzread( backup_file, &_secretion_degradation_prop, sizeof(_secretion_degradation_prop) ); } // ================================================================= // Destructors // ================================================================= ae_spatial_structure::~ae_spatial_structure( void ) { if ( _pop_grid != NULL ) { for ( int16_t i = 0 ; i < _grid_width ; i++ ) { for ( int16_t j = 0 ; j < _grid_height ; j++ ) { delete _pop_grid[i][j]; } delete [] _pop_grid[i]; } delete [] _pop_grid; } delete _prng; } // ================================================================= // Public Methods // ================================================================= void ae_spatial_structure::update_secretion_grid ( void ) { int16_t cur_x, cur_y; double ** new_secretion = new double*[_grid_width]; for ( int16_t x = 0 ; x < _grid_width ; x++ ) { new_secretion[x] = new double[_grid_height]; for ( int16_t y = 0 ; y < _grid_height ; y++ ) { new_secretion[x][y] = _pop_grid[x][y]->get_compound_amount(); } } for ( int16_t x = 0 ; x < _grid_width ; x++ ) { for ( int16_t y = 0 ; y < _grid_height ; y++ ) { // look at the entire neighborhood for ( int8_t i = -1 ; i < 2 ; i++ ) { for ( int8_t j = -1 ; j < 2 ; j ++ ) { cur_x = (x + i + _grid_width) % _grid_width; cur_y = (y + j + _grid_height) % _grid_height; // add the diffusion from the neighboring cells new_secretion[x][y] += _pop_grid[cur_x][cur_y]->get_compound_amount() * _secretion_diffusion_prop; } } } } // substract what has diffused from each cell, and calculate the compound degradation for ( int16_t x = 0 ; x < _grid_width ; x++ ) { for ( int16_t y = 0 ; y < _grid_height ; y++ ) { _pop_grid[x][y]->set_compound_amount( new_secretion[x][y] - 9 * _pop_grid[x][y]->get_compound_amount() * _secretion_diffusion_prop ); _pop_grid[x][y]->set_compound_amount( _pop_grid[x][y]->get_compound_amount() * (1 - _secretion_degradation_prop) ); } } for ( int16_t x = 0 ; x < _grid_width ; x++ ) { delete [] new_secretion[x]; } delete [] new_secretion; } void ae_spatial_structure::do_random_migrations ( void ) { ae_individual * tmp_swap; int16_t old_x; int16_t old_y; int16_t new_x; int16_t new_y; for ( int16_t i = 0 ; i < _migration_number ; i++ ) { old_x = (int16_t) (_prng->random() * _grid_width); old_y = (int16_t) (_prng->random() * _grid_height); new_x = (int16_t) (_prng->random() * _grid_width); new_y = (int16_t) (_prng->random() * _grid_height); // swap the individuals in these grid cells... tmp_swap = _pop_grid[old_x][old_y]->get_individual(); _pop_grid[old_x][old_y]->set_individual( _pop_grid[new_x][new_y]->get_individual() ); _pop_grid[new_x][new_y]->set_individual( tmp_swap ); } } void ae_spatial_structure::save( gzFile backup_file ) const { if ( _prng == NULL ) { printf( "%s:%d: error: PRNG not initialized.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } if ( _pop_grid == NULL ) { printf( "%s:%d: error: grid not initialized.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } _prng->save( backup_file ); gzwrite( backup_file, &_grid_width, sizeof(_grid_width) ); gzwrite( backup_file, &_grid_height, sizeof(_grid_height) ); for ( int16_t x = 0 ; x < _grid_width ; x++ ) { for ( int16_t y = 0 ; y < _grid_height ; y++ ) { _pop_grid[x][y]->save( backup_file ); } } gzwrite( backup_file, &_migration_number, sizeof(_migration_number) ); gzwrite( backup_file, &_secretion_diffusion_prop, sizeof(_secretion_diffusion_prop) ); gzwrite( backup_file, &_secretion_degradation_prop, sizeof(_secretion_degradation_prop) ); } // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Non inline accessors // ================================================================= aevol-4.4/src/libaevol/ae_X11_window.cpp0000644000175000017500000005205612231437075015121 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Basic X11/Xlib notions // ================================================================= // // THE DISPLAY // // The major notion of using Xlib is the X display. This is a structure // representing the connection we have open with a given X server. It // hides a queue of messages coming from the server, and a queue of // pending requests that our client intends to send to the server. // In Xlib, this structure is named 'Display'. When we open a connection // to an X server, the library returns a pointer to such a structure. // Later, we supply this pointer to any Xlib function that should send // messages to the X server or receive messages from this server. // // // THE WINDOWS // // X11 relies on a hierarchical model of rectangular areas called "Windows". // // 1. Each Window can be included in another Window (its parent) and may include // other Windows (its children). Windows sharing the same owner are called // siblings. // 2. The screen itself is a Window (the Root Window) that contains all Windows. // 3. A window can be above or behind a sibling Window. The Window which is above // hides partly or completely the other one. // 4. Any drawing made in a Window is automatically "cut", meaning that only the // part of the drawing which is inside the Window is drawn. // 5. A Window can be hidden or displayed ("mapped"). The drawing instructions // made on an unmapped Window are ignored. By default, newly created windows // are not mapped on the screen - they are invisible. In order to make a // window visible, we must use the XMapWindow() function. // 6. Each event (keyboard, mouse) is aimed at a specific Window. // 7. A Window does not memorize its content. Each time it must be re-displayed, // it gets an Expose event, and the content must be redrawn as a response to // this event. // // // THE GC (GRAPHICS CONTEXT) // // When we perform various drawing operations (graphics, text, etc), we may // specify various options for controlling how the data will be drawn - what // foreground and background colors to use, how line edges will be connected, // what font to use when drawing some text, etc). In order to avoid the need // to supply zillions of parameters to each drawing function, a graphical context // structure, of type 'GC' is used. We set the various drawing options in this // structure, and then pass a pointer to this structure to any drawing routines. // This is rather handy, as we often needs to perform several drawing requests // with the same options. Thus, we would initialize a graphical context, set the // desired options, and pass this GC structure to all drawing functions. // Allocating a new GC is done using the XCreateGC() function. // GC XCreateGC( Display *display, Drawable d, uint32_t valuemask, // XGCValues *values ) // Since a graphics context has zillions of attributes, and since often we want // to define only few of them, we need to be able to tell the XCreateGC() which // attributes we want to set. This is what the "valuemask" variable is for. // We then use the "values" variable to specify actual values for the attributes // we defined in the "valuesmask". The rest of the attributes of this GC will // be set to their default values. Once we created a graphics context, we can // use it in drawing functions. We can also modify its parameters using various // functions (e.g. XSetForeground to change the foreground color of the GC). // // // THE EVENTS // // A structure of type 'XEvent' is used to pass events received from the X server. // Xlib supports a large amount of event types. The XEvent structure contains the // type of event received, as well as the data associated with the event (e.g. // position on the screen where the event was generated, mouse button associated // with the event, region of screen associated with a 'redraw' event, etc). The way // to read the event's data depends on the event type. Thus, an XEvent structure // contains a C language union of all possible event types (if you're not sure what // C unions are, it is time to check your favourite C language manual...). Thus, // we could have an XExpose event, an XButton event, an XMotion event, etc. // After a program creates a window (or several windows), it should tell the X // server what types of events it wishes to receive for this window. By default, // no events are sent to the program. This is done for optimizing the server-to-client // connection (i.e. why send a program (that might even be running at the other // side of the globe) an event it is not interested in?). It may register for // various mouse (also called "pointer") events, keyboard events, expose events, etc. // In Xlib, we use the XSelectInput() function to register for events. This function // accepts 3 parameters - the display structure, an ID of a window, and a mask of // the event types it wishes to get. //############################################################################## // # // Class ae_X11_window # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_X11_window::ae_X11_window( void ) { } ae_X11_window::ae_X11_window( Display* display, int8_t screen, Atom* atoms, uint16_t x, uint16_t y, uint16_t width, uint16_t height, const char* caption ) { _width = width; _height = height; _display = display; _screen = screen; XSetWindowAttributes win_attributes; win_attributes.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask; win_attributes.background_pixel = XBlackPixel( _display, _screen ); _window = XCreateWindow( _display, DefaultRootWindow(_display), x, y, _width, _height, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWEventMask, &win_attributes ); // NB: the 7th parameter is the width of the window's border, it has nothing to do with // the border appended by the window manager, so this is most often set to zero. // Define the title & iconname of the window XSetStandardProperties( _display, _window, caption, caption, None, NULL, 0, NULL ); // We want to get MapNotify events, KeyPress events... XSelectInput( _display, _window, StructureNotifyMask | ExposureMask | KeyPressMask ); // Create graphical contexts uint32_t whiteColor = WhitePixel( _display, _screen ); XGCValues values; values.line_width = 1; values.foreground = get_pixel( _display, _screen, (char*)"white", whiteColor ); values.background = get_pixel( _display, _screen, (char*)"black", whiteColor ); _gcWhite = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"black",whiteColor ); values.background = get_pixel( _display, _screen, (char*)"white",whiteColor ); _gcBlack = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"red", whiteColor ); values.background = get_pixel( _display, _screen, (char*)"black",whiteColor ); _gcRed = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"green",whiteColor ); values.background = get_pixel( _display, _screen, (char*)"green",whiteColor ); _gcGreen = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"blue", whiteColor ); values.background = get_pixel( _display, _screen, (char*)"black",whiteColor ); _gcBlue = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"orange",whiteColor ); values.background = get_pixel( _display, _screen, (char*)"orange",whiteColor ); _gcOrange = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"yellow",whiteColor ); values.background = get_pixel( _display, _screen, (char*)"yellow",whiteColor ); _gcYellow = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"lightgrey",whiteColor ); values.background = get_pixel( _display, _screen, (char*)"lightgrey",whiteColor ); _gcLightGrey = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"darkgrey", whiteColor ); values.background = get_pixel( _display, _screen, (char*)"darkgrey", whiteColor ); _gcDarkGrey = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"grey15", whiteColor ); values.background = get_pixel( _display, _screen, (char*)"grey15", whiteColor ); _gcDarkerGrey = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); values.foreground = get_pixel( _display, _screen, (char*)"grey",whiteColor ); values.background = get_pixel( _display, _screen, (char*)"grey",whiteColor ); _gcGrey = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); XMapWindow( _display, _window ); XMoveWindow( _display, _window, x, y ); XFlush( _display ); // Necessary to handle window closing XSetWMProtocols( _display, _window, atoms, 2 ); } // ================================================================= // Destructors // ================================================================= ae_X11_window::~ae_X11_window( void ) { XFreeGC( _display, _gcWhite ); XFreeGC( _display, _gcBlack ); XFreeGC( _display, _gcRed ); XFreeGC( _display, _gcGreen ); XFreeGC( _display, _gcBlue ); XFreeGC( _display, _gcOrange ); XFreeGC( _display, _gcYellow ); XFreeGC( _display, _gcGrey ); XFreeGC( _display, _gcLightGrey ); XFreeGC( _display, _gcDarkGrey ); XFreeGC( _display, _gcDarkerGrey ); XDestroyWindow( _display, _window ); } // ================================================================= // Public Methods // ================================================================= void ae_X11_window::resize( unsigned int width, unsigned int height ) { _width = width; _height = height; } void ae_X11_window::draw_string( int16_t x, int16_t y, char * str ) { XDrawImageString( _display, _window, _gcWhite, x, y, str, strlen(str) ); } void ae_X11_window::draw_line( int16_t x1, int16_t y1, int16_t x2, int16_t y2, color_map color, bool bold /*= false*/ ) { GC* gc = NULL; // Determine which GC to use switch ( color ) { case WHITE : gc = &_gcWhite; break; case BLACK : gc = & _gcBlack; break; case RED : gc = & _gcRed; break; case GREEN : gc = & _gcGreen; break; case BLUE : gc = & _gcBlue; break; case ORANGE : gc = & _gcOrange; break; case YELLOW : gc = & _gcYellow; break; case GREY : gc = & _gcGrey; break; case LIGHT_GREY : gc = & _gcLightGrey; break; case DARK_GREY : gc = & _gcDarkGrey; break; case DARKER_GREY : gc = & _gcDarkerGrey; break; } // Draw line (lines if bold) XDrawLine( _display, _window, *gc, x1, y1, x2, y2 ); if ( bold ) { XDrawLine( _display, _window, *gc, x1-1, y1, x2-1, y2 ); XDrawLine( _display, _window, *gc, x1+1, y1, x2+1, y2 ); } } void ae_X11_window::draw_line( int16_t x1, int16_t y1, int16_t x2, int16_t y2, char* color, bool bold /*= false*/ ) { // Create custom GC XGCValues values; values.foreground = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); values.background = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); GC tmp_gc = XCreateGC( _display, _window, GCForeground|GCBackground, &values ); // Draw line (lines if bold) XDrawLine( _display, _window, tmp_gc, x1, y1, x2, y2 ); if ( bold ) { XDrawLine( _display, _window, tmp_gc, x1-1, y1, x2-1, y2 ); XDrawLine( _display, _window, tmp_gc, x1+1, y1, x2+1, y2 ); } XFreeGC( _display, tmp_gc ); } void ae_X11_window::draw_circle( int16_t x, int16_t y, int16_t diam ) { XDrawArc( _display, _window, _gcWhite, x, y, diam, diam, 0, 64*360 ); } void ae_X11_window::draw_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ) { XDrawArc( _display, _window, _gcWhite, x, y, diam, diam, 64*angle1, 64*angle2 ); } void ae_X11_window::draw_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ) { XGCValues values; values.line_width = 2; values.foreground = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); values.background = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); GC tmp_gc = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); XDrawArc( _display, _window, tmp_gc, x, y, diam, diam, 64*angle1, 64*angle2 ); XFreeGC( _display, tmp_gc ); } void ae_X11_window::draw_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ) { XDrawArc( _display, _window, _gcWhite, x, y, diam, diam, angle1, angle2 ); } void ae_X11_window::draw_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ) { XGCValues values; values.line_width = 2; values.foreground = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); values.background = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); GC tmp_gc = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); XDrawArc( _display, _window, tmp_gc, x, y, diam, diam, angle1, angle2 ); XFreeGC( _display, tmp_gc ); } void ae_X11_window::fill_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ) { XFillArc( _display, _window, _gcWhite, x, y, diam, diam, 64*angle1, 64*angle2 ); } void ae_X11_window::fill_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ) { XGCValues values; values.line_width = 2; values.foreground = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); values.background = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); GC tmp_gc = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); XFillArc( _display, _window, tmp_gc, x, y, diam, diam, 64*angle1, 64*angle2 ); XFreeGC( _display, tmp_gc ); } void ae_X11_window::fill_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ) { XFillArc( _display, _window, _gcWhite, x, y, diam, diam, angle1, angle2 ); } void ae_X11_window::fill_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ) { XGCValues values; values.line_width = 2; values.foreground = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); values.background = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); GC tmp_gc = XCreateGC( _display, _window, GCForeground|GCBackground|GCLineWidth, &values ); XFillArc( _display, _window, tmp_gc, x, y, diam, diam, angle1, angle2 ); XFreeGC( _display, tmp_gc ); } void ae_X11_window::fill_rectangle( int16_t x, int16_t y, int16_t width, int16_t height, color_map color ) { switch ( color ) { case WHITE : XFillRectangle( _display, _window, _gcWhite, x, y, width, height ); break; case BLACK : XFillRectangle( _display, _window, _gcBlack, x, y, width, height ); break; case RED : XFillRectangle( _display, _window, _gcRed, x, y, width, height ); break; case GREEN : XFillRectangle( _display, _window, _gcGreen, x, y, width, height ); break; case BLUE : XFillRectangle( _display, _window, _gcBlue, x, y, width, height ); break; case ORANGE : XFillRectangle( _display, _window, _gcOrange, x, y, width, height ); break; case YELLOW : XFillRectangle( _display, _window, _gcYellow, x, y, width, height ); break; case GREY : XFillRectangle( _display, _window, _gcGrey, x, y, width, height ); break; case LIGHT_GREY : XFillRectangle( _display, _window, _gcLightGrey, x, y, width, height ); break; case DARK_GREY : XFillRectangle( _display, _window, _gcDarkGrey, x, y, width, height ); break; case DARKER_GREY : XFillRectangle( _display, _window, _gcDarkerGrey, x, y, width, height ); break; } } void ae_X11_window::fill_rectangle( int16_t x, int16_t y, int16_t width, int16_t height, char* color ) { XGCValues values; values.foreground = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); values.background = get_pixel( _display, _screen, color, WhitePixel(_display,_screen) ); GC tmp_gc = XCreateGC( _display, _window, GCForeground|GCBackground, &values ); XFillRectangle( _display, _window, tmp_gc, x, y, width, height ); XFreeGC( _display, tmp_gc ); } char* ae_X11_window::get_color( double mean ) { int16_t red, green, blue; double mean_range = X_MAX - X_MIN; double mean_range_5 = X_MIN + mean_range / 5; double mean_range_2_5 = X_MIN + 2 * mean_range / 5; double mean_range_3_5 = X_MIN + 3 * mean_range / 5; double mean_range_4_5 = X_MIN + 4 * mean_range / 5; if ( mean < mean_range_5 ) { red = 0; green = 255 * ( 1.0 - ( (mean_range_5 - mean) / mean_range_5 ) ); blue = 255; } else if ( mean < mean_range_2_5 ) { red = 0; green = 255; blue = 255 * ( (mean_range_2_5 - mean) / mean_range_5 ); } else if ( mean < mean_range_3_5 ) { red = 255 * ( 1.0 - ( (mean_range_3_5 - mean) / mean_range_5 ) ); green = 255; blue = 0; } else if ( mean < mean_range_4_5 ) { red = 255; green = 255 * ( (mean_range_4_5 - mean) / mean_range_5 ); blue = 0; } else { red = 255; green = 0; blue = 255 * ( 1.0 - ( (mean_range - mean) / mean_range_5 ) ); } char* color = new char[8]; sprintf( color, "#%02x%02x%02x", red, green, blue ); return color; } // ================================================================= // Protected Methods // ================================================================= uint32_t ae_X11_window::get_pixel( Display *display, int8_t screen, char *color_name, uint32_t default_color ) { XColor color; if ( XParseColor( display, DefaultColormap(display,screen), color_name, &color ) == 0 ) { fprintf( stderr, "Invalid colour : %s\n", color_name ); return default_color; } if ( XAllocColor( display, DefaultColormap(display,screen), &color ) == 0 ) { fprintf( stderr, "Could not allocate colour %s\n", color_name ); return default_color; } return color.pixel; } aevol-4.4/src/libaevol/ae_codon.h0000644000175000017500000001163512231437075013726 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_CODON_H__ #define __AE_CODON_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_codon : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_codon( void ); ae_codon( const ae_codon &model ); ae_codon( int8_t value ); ae_codon( ae_dna* genome, ae_strand strand, int32_t index ); ae_codon( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_codon( void ); // ================================================================= // Accessors // ================================================================= inline int8_t get_value( void ); // ================================================================= // Public Methods // ================================================================= inline bool is_start( void ); inline bool is_stop( void ); inline ae_codon* copy( void ); void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_codon( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; //~ ae_codon( const ae_codon &model ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= int8_t _value; }; // ===================================================================== // Accessors' definitions // ===================================================================== int8_t ae_codon::get_value( void ) { return _value; } bool ae_codon::is_start( void ) { return _value == CODON_START; } bool ae_codon::is_stop( void ) { return _value == CODON_STOP; } // ===================================================================== // Inline functions' definition // ===================================================================== ae_codon* ae_codon::copy( void ) { return new ae_codon( _value ); } #endif // __AE_CODON_H__ aevol-4.4/src/libaevol/ae_gene_mutation.cpp0000644000175000017500000002553712357231707016026 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /** \class * \brief */ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include //############################################################################## // # // Class ae_gene_mutation # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= // Creates a copy of the mutation mut, but enriched with the generation when it occured // and the position where it occurred in the RNA, relative to the first bp of the promoter ae_gene_mutation::ae_gene_mutation(ae_mutation const & mut, int32_t gener, int32_t cdsPosBefore, ae_strand strandBefore, ae_gene_mutation_region region ) : ae_mutation(mut) { _generation = gener; _impact_on_metabolic_error = 0.0; /* should be set to its real value when known */ _region = region; /* Compute _position_relative_to_shine_dal */ switch ( _mut_type ) { case SWITCH : _position_relative_to_shine_dal = new int32_t; if ( strandBefore == LEADING ) {_position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore;} else {_position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0];} break; case S_INS : _position_relative_to_shine_dal = new int32_t; if ( strandBefore == LEADING ) {_position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore;} else {_position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0];} break; case S_DEL : _position_relative_to_shine_dal = new int32_t; if ( strandBefore == LEADING ) {_position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore;} else {_position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0];} break; case DUPL : /* A duplication can affect a gene in two ways: 1) The reinsertion point of the duplicated segment is located within the gene => stored 2) The gene is partly or completely duplicated, but this does not change its sequence => nothing to store */ /* We should enter here only in case (1). Note that in this case, the relative positions for beginseg and endseg may be outside the gene */ _position_relative_to_shine_dal = new int32_t[3]; if ( strandBefore == LEADING ) { _position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore; _position_relative_to_shine_dal[1] = _pos[1] - cdsPosBefore; _position_relative_to_shine_dal[2] = _pos[2] - cdsPosBefore; } else { _position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0]; _position_relative_to_shine_dal[1] = cdsPosBefore - _pos[1]; _position_relative_to_shine_dal[2] = cdsPosBefore - _pos[2]; } break; case DEL : _position_relative_to_shine_dal = new int32_t[2]; if ( strandBefore == LEADING ) { _position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore; _position_relative_to_shine_dal[1] = _pos[1] - cdsPosBefore; } else { _position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0]; _position_relative_to_shine_dal[1] = cdsPosBefore - _pos[1]; } break; case TRANS : _position_relative_to_shine_dal = new int32_t[4]; if ( strandBefore == LEADING ) { _position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore; _position_relative_to_shine_dal[1] = _pos[1] - cdsPosBefore; _position_relative_to_shine_dal[2] = _pos[2] - cdsPosBefore; _position_relative_to_shine_dal[3] = _pos[3] - cdsPosBefore; } else { _position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0]; _position_relative_to_shine_dal[1] = cdsPosBefore - _pos[1]; _position_relative_to_shine_dal[2] = cdsPosBefore - _pos[2]; _position_relative_to_shine_dal[3] = cdsPosBefore - _pos[3]; } break; case INV : _position_relative_to_shine_dal = new int32_t[2]; if ( strandBefore == LEADING ) { _position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore; _position_relative_to_shine_dal[1] = _pos[1] - cdsPosBefore; } else { _position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0]; _position_relative_to_shine_dal[1] = cdsPosBefore - _pos[1]; } break; case INSERT : _position_relative_to_shine_dal = new int32_t; if ( strandBefore == LEADING ) _position_relative_to_shine_dal[0] = _pos[0] - cdsPosBefore; else _position_relative_to_shine_dal[0] = cdsPosBefore - _pos[0]; break; default : fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } // ================================================================= // Destructors // ================================================================= ae_gene_mutation::~ae_gene_mutation() { /* ae_mutation::~ae_mutation() will be called automatically by the compiler for the other attributes */ switch ( _mut_type ) { case SWITCH : delete _position_relative_to_shine_dal; break; case S_INS : delete _position_relative_to_shine_dal; break; case S_DEL : delete _position_relative_to_shine_dal; break; case DUPL : delete [] _position_relative_to_shine_dal; break; case DEL : delete [] _position_relative_to_shine_dal; break; case TRANS : delete [] _position_relative_to_shine_dal; break; case INV : delete [] _position_relative_to_shine_dal; break; case INSERT : delete _position_relative_to_shine_dal; break; default : fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } ; // ================================================================= // Public methods // ================================================================= // 0 if local mut, 1 if rearrangement, 2 if transfer int8_t ae_gene_mutation::type_of_event() { if ((_mut_type == SWITCH) || (_mut_type == S_INS) || (_mut_type == S_DEL)) return 0; else if ((_mut_type == DUPL) || (_mut_type == DEL) || (_mut_type == TRANS) || (_mut_type == INV)) return 1; else return 2; } // str must be at least of size 60 void ae_gene_mutation::get_description_string_for_gene_mut(char * str) { switch ( _mut_type ) { case SWITCH : { sprintf( str, "%"PRId32" SWITCH %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _impact_on_metabolic_error ); break; } case S_INS : { sprintf( str, "%"PRId32" SMALL_INS %"PRId32" %"PRId32" %s %.10f ", _generation, _position_relative_to_shine_dal[0], _length[0], _seq, _impact_on_metabolic_error ); break; } case S_DEL : { sprintf( str, "%"PRId32" SMALL_DEL %"PRId32" %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _length[0], _impact_on_metabolic_error ); break; } case DUPL : { sprintf( str, "%"PRId32" INSERTION_OF_DUPLICATED_DNA %"PRId32" %"PRId32" %"PRId32" %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _position_relative_to_shine_dal[1], _position_relative_to_shine_dal[2], _length[0], _impact_on_metabolic_error); break; } case DEL : { sprintf( str, "%"PRId32" LARGE_DEL %"PRId32" %"PRId32" %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _position_relative_to_shine_dal[1], _length[0], _impact_on_metabolic_error ); break; } case TRANS : { sprintf( str, "%"PRId32" TRANSLOC %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _position_relative_to_shine_dal[1], _position_relative_to_shine_dal[2], _position_relative_to_shine_dal[3], _length[0], _impact_on_metabolic_error ); break; } case INV : { sprintf( str, "%"PRId32" INV %"PRId32" %"PRId32" %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _position_relative_to_shine_dal[1], _length[0], _impact_on_metabolic_error ); break; } case INSERT : { sprintf( str, "%"PRId32" INSERTION_OF_FOREIGN_DNA %"PRId32" %"PRId32" %.10f ", _generation, _position_relative_to_shine_dal[0], _length[0], _impact_on_metabolic_error ); break; } default : { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } if (_region == CDS) strcat(str, "CDS "); else if (_region == UPSTREAM) strcat(str, "UPSTREAM "); else if (_region == BOTH) strcat(str, "BOTH "); } aevol-4.4/src/libaevol/ae_list.h0000644000175000017500000005431412364737455013614 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef AE_LIST_H #define AE_LIST_H #include #include #include #include #include template class ae_list; template class ae_list_node { friend class ae_list; public : inline ae_list_node( T obj, ae_list_node* prev = NULL, ae_list_node* next = NULL ); // Make a new node sharing the same object as 'model' // The created node is unlinked inline ae_list_node( const ae_list_node &model ); virtual inline ~ae_list_node( void ); inline T& get_obj( void ); inline ae_list_node* get_prev( void ); inline ae_list_node* get_next( void ); inline void set_obj( T obj ); protected : ae_list_node( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; T _obj; ae_list_node* _prev; ae_list_node* _next; }; template class ae_list { public : inline ae_list(); //~ inline ae_list( ae_list* parent ); /*inline ae_list( const ae_list &model );*/ inline virtual ~ae_list(); // Add obj in a newly created node at the end (resp beginning) of the list // => syntaxic sugar for add_after( obj, _last ); // (resp add_before( obj, _first );) inline ae_list_node* add( T obj ); inline ae_list_node* add_front( T obj ); // Link a node at the end (resp beginning) of the list. The node must be unlinked // => syntaxic sugar for insert_after( node, _last ); // (resp insert_before( obj, _first );) inline void add( ae_list_node* node ); inline void add_front( ae_list_node* node ); // Add obj in a newly created node before (resp after) node n inline ae_list_node* add_before( T obj, ae_list_node* n ); inline ae_list_node* add_after( T obj, ae_list_node* n ); // Insert node n1 before (resp after) node n2 inline void insert_before( ae_list_node* n1, ae_list_node* n2 ); // TODO add au lieu de insert inline void insert_after( ae_list_node* n1, ae_list_node* n2 ); // Invert nodes n1 and n2 inline void invert( ae_list_node* n1, ae_list_node* n2 ); // Remove object from list and delete it if delete_obj is true inline void remove( T obj, bool delete_node, bool delete_obj ); inline void remove( ae_list_node* node, bool delete_node, bool delete_obj ); // Remove all the nodes between node_1 and node_2 (included) from the list and return // a new list containing the removed nodes (order is conserved) inline ae_list* extract_sublist(ae_list_node* first_node, ae_list_node* last_node ); inline ae_list* extract_sublist(int32_t first, int32_t last ); inline ae_list* extract_starting_sublist( ae_list_node* last_node ); inline ae_list* extract_starting_sublist( int32_t last ); inline ae_list* extract_ending_sublist( ae_list_node* first_node ); inline ae_list* extract_ending_sublist( int32_t first ); // Erase the list (nodes are deleted). // Objects are deleted if delete_obj is true inline void erase( bool delete_obj ); // Add the elements of 'append' at the end of the list. // 'append' is emptied. inline void merge( ae_list * append ); // Add the elements of 'to_add' as new nodes at the end of the list. // 'to_add' is untouched. inline void add_list( ae_list * const to_add ); inline int32_t get_nb_elts( void ) const; inline bool is_empty( void ) const; inline int32_t get_position( T obj ) const; inline ae_list_node* get_node( int32_t pos ) const; inline T get_object( int32_t pos ) const; // Accessors inline ae_list_node* get_first( void ) const { return _first; }; inline ae_list_node* get_last( void ) const { return _last; }; // Search for a value WITHIN the object. inline ae_list_node* bsearch( void* needle, int ( * comparator ) ( const void * value, const void * object ) ) const; protected : ae_list_node* _first; ae_list_node* _last; int32_t _nb_elts; }; // Constructor template ae_list::ae_list() { _last = _first = NULL; _nb_elts = 0; } // Doesn't create new objects /*ae_list::ae_list( const ae_list &model ) { _last = _first = NULL; _nb_elts = 0; ae_list_node* node = model._first; while ( node != NULL ) { add( node->get_obj() ); node = node->get_next(); } }*/ // Destructor template ae_list::~ae_list() { erase( false ); } // Add obj in a newly created node at the end of the list template ae_list_node* ae_list::add( T obj ) { ae_list_node* node = new ae_list_node( obj, _last, NULL ); assert( node ); if ( _last != NULL ) _last->_next = node; _last = node; if ( _first == NULL ) _first = node; _nb_elts++; return node; } // Add obj in a newly created node at the beginning of the list template ae_list_node* ae_list::add_front( T obj ) { ae_list_node* node = new ae_list_node( obj, NULL, _first ); assert( node ); if ( _first != NULL ) _first->_prev = node; _first = node; if ( _last == NULL ) _last = node; _nb_elts++; return node; } // Add a node at the end of the list. The node must be unlinked template void ae_list::add( ae_list_node* node ) { node->_prev = _last; node->_next = NULL; if( _last != NULL ) _last->_next = node; _last = node; if( _first == NULL ) _first = node; _nb_elts++; } // Add a node at the beginning of the list. The node must be unlinked template void ae_list::add_front( ae_list_node* node ) { node->_prev = NULL; node->_next = _first; if( _first != NULL ) _first->_prev = node; _first = node; if( _last == NULL ) _last = node; _nb_elts++; } // Add obj in a newly created node before node n template ae_list_node* ae_list::add_before( T obj, ae_list_node* n ) { ae_list_node* node = new ae_list_node( obj, NULL, NULL ); assert( node ); insert_before( node, n ); return node; } // Add obj in a newly created node after node n template ae_list_node* ae_list::add_after( T obj, ae_list_node* n ) { ae_list_node* node = new ae_list_node( obj, NULL, NULL ); assert( node ); insert_after( node, n ); return node; } // Insert node n1 before n2 template void ae_list::insert_before( ae_list_node * n1, ae_list_node * n2 ) { // save node before n2 ae_list_node * n2_prev = n2->_prev; // link n1 -> n2 n1->_next = n2; n2->_prev = n1; // link (n2->_prev) -> n1 n1->_prev = n2_prev; if (n2_prev == NULL) { // n2 was _first _first = n1; } else { n2_prev->_next = n1; } _nb_elts++; } // Insert node n1 after n2 template void ae_list::insert_after( ae_list_node * n1, ae_list_node * n2 ) { assert( n1 != NULL && n2 != NULL ); // save node after n2 ae_list_node * n2_next = n2->_next; // link n2 -> n1 n2->_next = n1; n1->_prev = n2; // link n1 -> (n2->_next) n1->_next = n2_next; if (n2_next == NULL) { // n2 was _last _last = n1; } else { n2_next->_prev = n1; } _nb_elts++; } // Invert nodes n1 and n2 template void ae_list::invert( ae_list_node * n1, ae_list_node * n2 ) { // Optim if nodes are consecutive if ( n2 == n1->_next || n1 == n2->_next ) { if ( n1 == n2->_next ) { // Exchange n1 and n2 ae_list_node * tmp = n1; n1 = n2; n2 = tmp; } if ( n1 != _first ) n1->_prev->_next = n2; else _first = n2; if ( n2 != _last ) n2->_next->_prev = n1; else _last = n1; n2->_prev = n1->_prev; n1->_next = n2->_next; n2->_next = n1; n1->_prev = n2; } else { // TODO printf( "NOT IMPLEMENTED!!! %s %d\n", __FILE__, __LINE__ ); getchar(); } } // Remove object from list and delete it if delete_obj is true template void ae_list::remove( T obj, bool delete_node, bool delete_obj ) { for ( ae_list_node * node = _first ; node != NULL ; node = node->_next ) { if ( node->_obj == obj ) { // unlink node if ( node == _first ) { _first = node->_next; } else if ( node->_prev ) { node->_prev->_next = node->_next; } if ( node == _last ) { _last = node->_prev; } else if ( node->_next ) { node->_next->_prev = node->_prev; } // delete object (if requested) if ( delete_obj ) { if ( node->_obj != NULL ) { delete node->_obj; node->_obj = NULL; } else { printf( "%s:%d: Warning: Possible attempt to delete something twice\n", __FILE__, __LINE__ ); } } // delete node (if requested) if ( delete_node ) { if ( node != NULL ) { delete node; node = NULL; } else { printf( "%s:%d: Warning: Possible attempt to delete something twice\n", __FILE__, __LINE__ ); } } _nb_elts--; return; } } } // Remove node from list and delete the corrresponding object if delete_obj is true // Assumes node is in the list template void ae_list::remove( ae_list_node * node, bool delete_node, bool delete_obj ) { // Unlink node if( node == _first ) { _first = node->_next; } else if(node->_prev != NULL) { node->_prev->_next = node->_next; } if(node == _last) { _last = node->_prev; } else if(node->_next) node->_next->_prev = node->_prev; // delete object (if requested) if ( delete_obj ) { if ( node->_obj != NULL ) { delete node->_obj; node->_obj = NULL; } else { printf( "%s:%d: Warning: Possible attempt to delete something twice\n", __FILE__, __LINE__ ); } } // delete node (if requested) if ( delete_node ) { if ( node != NULL ) { delete node; node = NULL; } else { printf( "%s:%d: Warning: Possible attempt to delete something twice\n", __FILE__, __LINE__ ); } } _nb_elts--; } /*! @brief Remove elements from the list and returns them in a new list Remove elements from the list starting with that of index (included -- index start at 0) and return a new list containing the removed elements (order is conserved) @param first the index of the first element to be extracted @param n the number of elements to be extracted @return a new list containing all the extracted elements (in the same order) */ template ae_list * ae_list::extract_sublist(int32_t first, int32_t n) { assert(first >= 0 && n > 0 && first + n < _nb_elts); // Get first node to extract ae_list_node* first_node = _first; for (int32_t i = 0 ; i < first ; i++) { first_node = first_node->_next; } // Get last node to extract ae_list_node* last_node = first_node; for (int32_t i = 1 ; i < n ; i++) { last_node = last_node->_next; } return extract_sublist(first_node, last_node); } /*! @brief Remove elements from the list and returns them in a new list Remove the first elements from the list and return a new list containing the removed elements (order is conserved) @param n the number of elements to be extracted @return a new list containing all the extracted elements (in the same order) */ template ae_list * ae_list::extract_starting_sublist(int32_t n) { assert(n > 0 && n <= _nb_elts); // Get last node to extract ae_list_node* last_node = _first; for ( int32_t i = 1 ; i < n ; i++) { last_node = last_node->_next; } return extract_starting_sublist(last_node); } /*! @brief Remove elements from the list and returns them in a new list Remove the last elements from the list and return a new list containing the removed elements (order is conserved). @param n the number of elements to be extracted @return a new list containing all the extracted elements (in the same order) */ template ae_list * ae_list::extract_ending_sublist(int32_t n) { assert(n > 0 && n <= _nb_elts); // Get first node to extract ae_list_node* first_node = _last; for (int32_t i = 1 ; i < n ; i++) { first_node = first_node->_prev; } return extract_ending_sublist(first_node); } /*! @brief Remove elements from the list and returns them in a new list Remove all the elements between first_node and last_node (included) from the list and return a new list containing the removed elements (order is conserved) @param first_node the first node to be extracted @param last_node the last node to be extracted @return a new list containing all the extracted elements (in the same order) */ template ae_list * ae_list::extract_sublist(ae_list_node* first_node, ae_list_node* last_node) { assert(first_node != NULL && last_node != NULL); ae_list * new_list = new ae_list(); new_list->_first = first_node; new_list->_last = last_node; if ( first_node == _first && last_node == _last ) { new_list->_nb_elts = _nb_elts; _first = NULL; _last = NULL; _nb_elts = 0; } else { if ( first_node == _first ) { _first = last_node->_next; _first->_prev = NULL; last_node->_next = NULL; } else if ( last_node == _last ) { _last = first_node->_prev; _last->_next = NULL; first_node->_prev = NULL; } else { first_node->_prev->_next = last_node->_next; last_node->_next->_prev = first_node->_prev; first_node->_prev = NULL; last_node->_next = NULL; } // Update number of elements of both lists ae_list_node * node = first_node; new_list->_nb_elts++; _nb_elts--; while ( node != last_node ) { new_list->_nb_elts++; _nb_elts--; node = node->_next; } } return new_list; } /*! @brief Remove elements from the list and returns them in a new list Remove all the elements before last_node (included) from the list and return a new list containing the removed elements (order is conserved) @param last_node the last node to be extracted @return a new list containing all the extracted elements (in the same order) */ template ae_list * ae_list::extract_starting_sublist(ae_list_node * last_node) { ae_list * new_list = new ae_list(); new_list->_first = _first; new_list->_last = last_node; if ( last_node == _last ) { new_list->_nb_elts = _nb_elts; _first = NULL; _last = NULL; _nb_elts = 0; } else { _first = last_node->_next; _first->_prev = NULL; last_node->_next = NULL; // Update number of elements of both lists ae_list_node * node = last_node; while ( node != NULL ) { new_list->_nb_elts++; _nb_elts--; node = node->_prev; } } return new_list; } /*! @brief Remove elements from the list and returns them in a new list Remove all the elements after first_node (included) from the list and return a new list containing the removed elements (order is conserved) @param first_node the first node to be extracted @return a new list containing all the extracted elements (in the same order) */ template ae_list * ae_list::extract_ending_sublist(ae_list_node * first_node) { ae_list * new_list = new ae_list(); new_list->_first = first_node; new_list->_last = _last; if ( first_node == _first ) { new_list->_nb_elts = _nb_elts; _first = NULL; _last = NULL; _nb_elts = 0; } else { _last = first_node->_prev; _last->_next = NULL; first_node->_prev = NULL; // Update number of elements of both lists ae_list_node * node = first_node; while ( node != NULL ) { new_list->_nb_elts++; _nb_elts--; node = node->_next; } } return new_list; } // Erase the list (nodes are deleted). Objects are deleted if delete_obj is true template void ae_list::erase( bool delete_obj ) { ae_list_node* node = _first; while ( node != NULL ) { ae_list_node * next = node->_next; if( delete_obj ) { assert( node->_obj != NULL ); delete node->_obj; node->_obj = NULL; } delete node; node = next; } _last = _first = NULL; _nb_elts = 0; } /*! Adds all the elements of list to the list and empty @param append the list of objects to add */ template void ae_list::merge(ae_list* append) { if ( append == NULL || append->is_empty() ) return; // Nothing to do if ( this->is_empty() ) { // Copy 'append' _first = append->_first; _last = append->_last; _nb_elts = append->_nb_elts; // Empty 'append' append->_first = NULL; append->_last = NULL; append->_nb_elts = 0; } else { // Link the lists together _last->_next = append->_first; append->_first->_prev = _last; // Update '_last' _last = append->_last; // Update number of elements _nb_elts += append->_nb_elts; // Empty 'append' append->_first = NULL; append->_last = NULL; append->_nb_elts = 0; } } /*! Adds all the elements of list to the list @param to_add the list of objects to add */ template inline void ae_list::add_list(ae_list* const to_add) { if ( to_add == NULL ) return; // Nothing to do ae_list_node * to_add_node = to_add->get_first(); while ( to_add_node != NULL ) { add( new ae_list_node( *to_add_node ) ); to_add_node = to_add_node->get_next(); } } /*! Returns true if the list is empty, false otherwise @return true if the list is empty, false otherwise */ template bool ae_list::is_empty( void ) const { return ( _first == NULL ); } /*! Returns the number of elements in the list @return the number of elements in the list */ template int32_t ae_list::get_nb_elts( void ) const { return _nb_elts; } /*! Returns the position of the object provided or -1 if not found @param obj the object to find @return the position (0 for the head) of the object or -1 if not found */ template int32_t ae_list::get_position( T obj ) const { int32_t i = 0; ae_list_node * node = _first; while ( node != NULL ) { if ( node->_obj == obj ) return i; i++; node = node->_next; } return -1; } /*! Returns the node at position or NULL if pos is invalid @param pos the position of the node of interest (0 for head) @return the node at position or NULL if pos is invalid */ template ae_list_node * ae_list::get_node(int32_t pos) const { if ( pos < 0 || pos >= _nb_elts ) return NULL; ae_list_node * node = _first; for ( int32_t i = 0 ; i < pos ; i++ ) { node = node->_next; } return node; } /*! Returns the object at position or NULL if pos is invalid @param pos the position of the node of interest (0 for head) @return the object at position or NULL if pos is invalid */ template T ae_list::get_object( int32_t pos ) const { if ( pos < 0 || pos >= _nb_elts ) return NULL; ae_list_node * node = _first; for ( int32_t i = 0 ; i < pos ; i++ ) { node = node->_next; } return node->_obj; } /*! Returns a pointer to the first object in the list where needle was found Returns NULL if needle was not found comparator : function that returns true if was found in */ template ae_list_node* ae_list::bsearch( void* needle, int ( * comparator ) ( const void * value, const void * object ) ) const { ae_list_node* node = _first; while ( node != NULL ) { if ( comparator( needle, (void*)node->get_obj() ) == 0 ) return node; node = node->_next; } return NULL; } //****************************************************************************** // ae_list_node //****************************************************************************** template inline ae_list_node::ae_list_node( T obj, ae_list_node* prev, ae_list_node* next ) { _obj = obj; _prev = prev; _next = next; }; /*! Constructs a new (unlinked) node containing the same object as the model. The object is shallow-copied. @param model the model to copy the object from */ template ae_list_node::ae_list_node( const ae_list_node &model ) { _obj = model._obj; _prev = NULL; _next = NULL; }; template ae_list_node::~ae_list_node( void ) { } template inline T& ae_list_node::get_obj( void ) { return _obj; } template inline ae_list_node* ae_list_node::get_prev( void ) { return _prev; } template inline ae_list_node* ae_list_node::get_next( void ) { return _next; } template inline void ae_list_node::set_obj( T obj ) { _obj = obj; } #endif // AE_LIST_H aevol-4.4/src/libaevol/f_line.h0000644000175000017500000000760312231437075013413 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __F_LINE_H__ #define __F_LINE_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= // ================================================================= // Class declarations // ================================================================= class f_line { public : // ================================================================= // Constructors // ================================================================= f_line( void ); // ================================================================= // Destructors // ================================================================= // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= // ================================================================= // Public Attributes // ================================================================= int16_t nb_words; char words[50][255]; protected : // ================================================================= // Forbidden Constructors // ================================================================= // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= }; // ===================================================================== // Accessors definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __f_line_H__ aevol-4.4/src/libaevol/ae_population.h0000644000175000017500000004130312364503705015012 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_POPULATION_H__ #define __AE_POPULATION_H__ // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_population : public ae_object { friend class ae_selection; public : // ================================================================= // Constructors // ================================================================= ae_population( ae_exp_manager* exp_m ); //~ ae_population( char* organism_file_name ); //~ ae_population( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_population( void ); // ================================================================= // Accessors: Getters // ================================================================= inline ae_list* get_indivs( void ) const; inline int32_t get_nb_indivs( void ) const; inline ae_individual* get_best( void ) const; ae_individual* get_indiv_by_id( int32_t id ) const; inline ae_individual* get_indiv_by_rank( int32_t rank ) const; // PRNGs inline ae_jumping_mt* get_mut_prng( void ) const; inline ae_jumping_mt* get_stoch_prng( void ) const; // Spatial structure //~ inline double** get_secretion_present( void ) const; //~ inline double** get_secreted_amount( void ) const; //~ inline double** get_fitness_metabolic( void ) const; //~ inline double** get_fitness_total( void ) const; // ================================================================= // Accessors: Setters // ================================================================= void set_nb_indivs( int32_t nb_indivs ); inline void add_indiv( ae_individual* indiv ); // PRNGs inline void set_mut_prng( ae_jumping_mt* prng ); inline void set_stoch_prng( ae_jumping_mt* prng ); // Mutation rates etc... inline void set_overall_point_mutation_rate( double point_mutation_rate); inline void set_overall_small_insertion_rate( double small_insertion_rate); inline void set_overall_small_deletion_rate( double small_deletion_rate); inline void set_overall_max_indel_size( int16_t max_indel_size); inline void set_overall_duplication_rate( double duplication_rate); inline void set_overall_deletion_rate( double deletion_rate); inline void set_overall_translocation_rate( double translocation_rate); inline void set_overall_inversion_rate( double inversion_rate); inline void set_overall_neighbourhood_rate( double neighbourhood_rate); inline void set_overall_duplication_proportion( double duplication_proportion); inline void set_overall_deletion_proportion( double deletion_proportion); inline void set_overall_translocation_proportion( double translocation_proportion); inline void set_overall_inversion_proportion( double inversion_proportion); inline void set_overall_transfer_ins_rate (double transfer_ins_rate); inline void set_overall_transfer_repl_rate (double transfer_repl_rate); inline void set_replication_reports( ae_tree* tree, int32_t num_gener); // ================================================================= // Public Methods // ================================================================= void replace_population( ae_list* new_indivs ); //~ void step_to_next_generation( void ); //~ void step_to_next_generation_grid( void ); //~ ae_individual* do_replication( ae_individual* parent, int32_t id, int16_t x = -1, int16_t y = -1 ); //~ void secretion_grid_update ( void ); //~ ae_individual* calculate_local_competition ( int16_t x, int16_t y ); ae_individual* calculate_GU_transfer ( int16_t x, int16_t y ); void do_random_migrations ( void ); inline void evaluate_individuals( ae_environment* envir ); void sort_individuals( void ); void update_best( void ); void save( gzFile backup_file ) const; void load( gzFile backup_file, bool verbose ); void load(const char* backup_file_name, bool verbose); #ifndef DISTRIBUTED_PRNG void backup_stoch_prng( void ); #endif // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_population( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_population( const ae_population &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void update_population(ae_list* new_indivs); ae_individual* create_random_individual( int32_t id ); ae_individual* create_random_individual_with_good_gene( int32_t id ); ae_individual* create_clone( ae_individual* dolly, int32_t id ); ae_individual* create_individual_from_file( char* organism_file_name, int32_t id ); // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; #ifndef DISTRIBUTED_PRNG ae_jumping_mt* _mut_prng; ae_jumping_mt* _stoch_prng; ae_jumping_mt* _stoch_prng_bak; #endif // Individuals int32_t _nb_indivs; ae_list* _indivs; }; // ===================================================================== // Getters' definitions // ===================================================================== inline ae_list* ae_population::get_indivs( void ) const { return _indivs; } inline int32_t ae_population::get_nb_indivs( void ) const { return _nb_indivs; } inline ae_individual* ae_population::get_best( void ) const { return _indivs->get_last()->get_obj(); } /*! Get the indiv corresponding to the given rank (1 for the worst indiv, POP_SIZE for the best) Warning, be sure you call sort_individuals() before using get_indiv_by_rank */ inline ae_individual* ae_population::get_indiv_by_rank( int32_t rank ) const { ae_list_node* indiv_node = _indivs->get_first(); for ( int32_t i = 1 ; i < rank ; i++ ) { indiv_node = indiv_node->get_next(); } assert( indiv_node->get_obj()->get_rank() == rank ); return indiv_node->get_obj(); } inline ae_jumping_mt* ae_population::get_mut_prng( void ) const { return _mut_prng; } inline ae_jumping_mt* ae_population::get_stoch_prng( void ) const { return _stoch_prng; } // ===================================================================== // Setters' definitions // ===================================================================== /*inline void ae_population::set_nb_indivs( int32_t nb_indivs ) { _nb_indivs = nb_indivs; }*/ inline void ae_population::add_indiv( ae_individual* indiv ) { _indivs->add( indiv ); _nb_indivs++; } inline void ae_population::set_mut_prng( ae_jumping_mt* prng ) { if (_mut_prng != NULL) delete _mut_prng; _mut_prng = prng; ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_mut_prng( _mut_prng ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_stoch_prng( ae_jumping_mt* prng ) { if (_stoch_prng != NULL) delete _stoch_prng; _stoch_prng = prng; ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_stoch_prng( _stoch_prng ); indiv_node = indiv_node->get_next(); } } // Mutation rates etc... inline void ae_population::set_overall_point_mutation_rate( double point_mutation_rate ) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_point_mutation_rate( point_mutation_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_small_insertion_rate( double small_insertion_rate ) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_small_insertion_rate( small_insertion_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_small_deletion_rate( double small_deletion_rate ) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_small_deletion_rate( small_deletion_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_max_indel_size( int16_t max_indel_size ) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_max_indel_size( max_indel_size ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_duplication_rate( double duplication_rate ) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_duplication_rate( duplication_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_deletion_rate( double deletion_rate) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_deletion_rate( deletion_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_translocation_rate( double translocation_rate) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_translocation_rate( translocation_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_inversion_rate( double inversion_rate) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_inversion_rate( inversion_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_transfer_ins_rate (double transfer_ins_rate) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_HT_ins_rate( transfer_ins_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_transfer_repl_rate (double transfer_repl_rate) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_HT_repl_rate( transfer_repl_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_neighbourhood_rate( double neighbourhood_rate) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_neighbourhood_rate( neighbourhood_rate ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_duplication_proportion( double duplication_proportion) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_duplication_proportion( duplication_proportion ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_deletion_proportion( double deletion_proportion) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_deletion_proportion( deletion_proportion ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_translocation_proportion( double translocation_proportion) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_translocation_proportion( translocation_proportion ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_overall_inversion_proportion( double inversion_proportion) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_inversion_proportion( inversion_proportion ); indiv_node = indiv_node->get_next(); } } inline void ae_population::set_replication_reports( ae_tree* tree, int32_t num_gener) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->set_replication_report( tree->get_report_by_index( num_gener, indiv->get_id())); indiv_node = indiv_node->get_next(); } } // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_population::evaluate_individuals( ae_environment* envir ) { ae_list_node* indiv_node = _indivs->get_first(); ae_individual * indiv = NULL; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); indiv->evaluate( envir ); indiv->compute_statistical_data(); indiv_node = indiv_node->get_next(); } } #endif // __AE_POPULATION_H__ aevol-4.4/src/libaevol/ae_environment.h0000644000175000017500000003347612364050651015175 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_ENVIRONMENT_H__ #define __AE_ENVIRONMENT_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #ifdef __X11 #include #endif // ================================================================= // Class declarations // ================================================================= #ifdef __NO_X class ae_environment : public ae_fuzzy_set #elif defined __X11 class ae_environment : public ae_fuzzy_set_X11 #else #error You must specify a graphic option #endif { public : // ================================================================= // Constructors // ================================================================= ae_environment( void ); ae_environment( const ae_environment &model ); ae_environment( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_environment( void ); // ================================================================= // Accessors: getters // ================================================================= inline ae_list* get_gaussians( void ) const; inline ae_list* get_custom_points( void ) const; inline double get_total_area( void ) const; inline int16_t get_nb_segments( void ) const; inline ae_env_segment** get_segments( void ) const; inline double get_segment_boundaries( int16_t i ) const; inline ae_env_axis_feature get_axis_feature( int16_t i ) const; inline double get_area_by_feature( int8_t feature ) const; inline ae_env_var get_var_method( void ) const; inline double get_var_sigma( void ) const; inline int32_t get_var_tau( void ) const; inline ae_env_noise get_noise_method( void ) const; inline bool is_noise_allowed( void ) const; // ================================================================= // Accessors: setters // ================================================================= inline void set_gaussians( ae_list* gaussians ); inline void set_custom_points( ae_list* custom_points ); inline void set_sampling( int16_t val ); inline void set_segmentation( int16_t nb_segments, double* boundaries, ae_env_axis_feature* features, bool separate_segments = false ); inline void set_var_method( ae_env_var var_method ); inline void set_var_prng( ae_jumping_mt* prng ); inline void set_var_sigma( double sigma ); inline void set_var_tau( int32_t tau ); inline void set_var_sigma_tau( double sigma, int32_t tau ); inline void set_noise_method( ae_env_noise noise_method ); inline void set_noise_prng( ae_jumping_mt* prng ); inline void set_noise_sigma( double sigma ); inline void set_noise_alpha( double alpha ); inline void set_noise_prob( double prob ); inline void set_noise_sampling_log( int32_t sampling_log ); // ================================================================= // Public Methods // ================================================================= void save( gzFile backup_file ) const; void load( gzFile backup_file ); void add_custom_point( double x, double y ); void add_gaussian( double a, double b, double c ); void add_initial_gaussian( double a, double b, double c ); void build( void ); inline void clear_initial_gaussians( void ); inline void clear_gaussians( void ); inline void clear_custom_points( void ); inline void apply_variation( void ); void apply_noise( void ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_environment( void ) //~ { //~ printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; // ================================================================= // Protected Methods // ================================================================= void _apply_autoregressive_mean_variation( void ); void _apply_autoregressive_height_variation( void ); void _apply_local_gaussian_variation( void ); void _compute_area( void ); // ================================================================= // Protected Attributes // ================================================================= ae_list* _initial_gaussians; // List containing all the gaussians of the environment in their initial state ae_list* _gaussians; // List containing all the gaussians of the environment int16_t _sampling; // Number of points to be generated from the gaussians. ae_list* _custom_points; // List containing all the custom points of the environment. // This can not be used in conjunction with gaussians. int16_t _nb_segments; ae_env_segment** _segments; // Ordered table of segments. // Each ae_env_segment knows its boundaries and corresponding feature. // When the environment is not segmented, this table contains a single // segment with feature METABOLIC and boundaries MIN_X and MAX_X double _total_area; // Geometric area of the whole function double* _area_by_feature; // Geometric area of each feature // Variation management (compatible only with gaussians, not with custom points) ae_env_var _var_method; // Variation method ae_jumping_mt* _var_prng; // PRNG used for variation double _var_sigma; // Autoregressive mean variation sigma parameter int32_t _var_tau; // Autoregressive mean variation tau parameter // Noise management ae_fuzzy_set* _cur_noise; // Current noise (pure noise that is added to the environment fuzzy set) ae_jumping_mt* _noise_prng; // PRNG used for noise ae_env_noise _noise_method; // Probability of variation. double _noise_alpha; // Alpha value (variance coefficient) double _noise_sigma; // Variance of the noise double _noise_prob; // Probability of variation. int32_t _noise_sampling_log; // Log2 of the number of points in the noise fuzzy_set }; // ===================================================================== // Getters' definitions // ===================================================================== inline int16_t ae_environment::get_nb_segments( void ) const { return _nb_segments; } inline ae_list* ae_environment::get_gaussians( void ) const { return _gaussians; } inline ae_list* ae_environment::get_custom_points( void ) const { return _custom_points; } inline ae_env_segment** ae_environment::get_segments( void ) const { return _segments; } inline double ae_environment::get_segment_boundaries( int16_t i ) const { assert( i <= _nb_segments ); if ( i == _nb_segments ) return _segments[i-1]->stop; else return _segments[i]->start; } inline ae_env_axis_feature ae_environment::get_axis_feature( int16_t i ) const { assert( i < _nb_segments ); return _segments[i]->feature; } inline double ae_environment::get_area_by_feature( int8_t feature ) const { return _area_by_feature[ feature ]; } inline double ae_environment::get_total_area( void ) const { return _total_area; } inline ae_env_var ae_environment::get_var_method( void ) const { return _var_method; } inline double ae_environment::get_var_sigma( void ) const { return _var_sigma; } inline int32_t ae_environment::get_var_tau( void ) const { return _var_tau; } inline ae_env_noise ae_environment::get_noise_method( void ) const { return _noise_method; } inline bool ae_environment::is_noise_allowed( void ) const { return ( _noise_method != NO_NOISE ); } // ===================================================================== // Setters' definitions // ===================================================================== inline void ae_environment::set_gaussians( ae_list* gaussians ) { _gaussians = gaussians; } inline void ae_environment::set_custom_points( ae_list* custom_points ) { _custom_points = custom_points; } inline void ae_environment::set_sampling( int16_t val ) { _sampling = val; } inline void ae_environment::set_segmentation( int16_t nb_segments, double* boundaries, ae_env_axis_feature* features, bool separate_segments /*= false*/ ) { // Delete the data to be replaced for ( int16_t i = 0 ; i < _nb_segments ; i++ ) { delete _segments[i]; } delete _segments; // Now replace with the new data _nb_segments = nb_segments; _segments = new ae_env_segment* [_nb_segments]; for ( int16_t i = 0 ; i < _nb_segments; i++ ) { _segments[i] = new ae_env_segment( boundaries[i], boundaries[i+1], features[i] ); } // TODO : Manage separate_segments } inline void ae_environment::set_var_method( ae_env_var var_method ) { _var_method = var_method; } inline void ae_environment::set_var_prng( ae_jumping_mt* prng ) { if (_var_prng != NULL) delete _var_prng; _var_prng = prng; } inline void ae_environment::set_var_sigma( double sigma ) { _var_sigma = sigma; } inline void ae_environment::set_var_tau( int32_t tau ) { _var_tau = tau; } inline void ae_environment::set_var_sigma_tau( double sigma, int32_t tau ) { _var_sigma = sigma; _var_tau = tau; } inline void ae_environment::set_noise_method( ae_env_noise noise_method ) { _noise_method = noise_method; } inline void ae_environment::set_noise_prng( ae_jumping_mt* prng ) { if( _noise_prng != NULL) delete _noise_prng; _noise_prng = prng; } inline void ae_environment::set_noise_prob( double prob ) { _noise_prob = prob; } inline void ae_environment::set_noise_alpha( double alpha ) { _noise_alpha = alpha; } inline void ae_environment::set_noise_sigma( double sigma ) { _noise_sigma = sigma; } inline void ae_environment::set_noise_sampling_log( int32_t sampling_log ) { _noise_sampling_log = sampling_log; } // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_environment::clear_initial_gaussians( void ) { if (_initial_gaussians != NULL) { _initial_gaussians->erase(true); delete _initial_gaussians; } _initial_gaussians=NULL; } inline void ae_environment::clear_gaussians( void ) { if (_gaussians != NULL) { _gaussians->erase(true); delete _gaussians; } _gaussians = NULL; } inline void ae_environment::clear_custom_points( void ) { if (_custom_points != NULL) { _custom_points->erase(true); delete _custom_points; } _custom_points = NULL; } inline void ae_environment::apply_variation( void ) { switch ( _var_method ) { case NO_VAR : return; case AUTOREGRESSIVE_MEAN_VAR : _apply_autoregressive_mean_variation(); break; case AUTOREGRESSIVE_HEIGHT_VAR : _apply_autoregressive_height_variation(); break; case LOCAL_GAUSSIANS_VAR : _apply_local_gaussian_variation(); break; default : printf( "ERROR : in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } // Environment has changed, recompute its area _compute_area(); } #endif // __AE_ENVIRONMENT_H__ aevol-4.4/src/libaevol/ae_dump.h0000644000175000017500000001075212231437075013570 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_DUMP_H__ #define __AE_DUMP_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; #define _AE_DUMP_FILENAME_BUFSIZE INT32_C(256) class ae_dump : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_dump( ae_exp_manager* exp_m ); // ================================================================= // Destructors // ================================================================= virtual ~ae_dump( void ) { } // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= void write_current_generation_dump( void ); void write_fitness_total( void ); void write_secretion_present( void ); void write_fitness_metabolic( void ); void write_secreted_amount( void ); void write_individual_probes( void ); // ================================================================= // Public Attributes // ================================================================= protected : FILE* current_file; char filename_buffer[_AE_DUMP_FILENAME_BUFSIZE]; // ================================================================= // Forbidden Constructors // ================================================================= ae_dump( const ae_dump &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; }; // ===================================================================== // Accessors' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_DUMP_H__ aevol-4.4/src/libaevol/ae_stat_record.cpp0000644000175000017500000013362412364441727015501 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #include #include //############################################################################## // # // Class ae_stat_record # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_stat_record::ae_stat_record( ae_exp_manager* exp_m ) { _exp_m = exp_m; initialize_data(); } ae_stat_record::ae_stat_record( const ae_stat_record &model ) { _exp_m = model._exp_m; _num_gener = model._num_gener; _pop_size = model._pop_size; _metabolic_error = model._metabolic_error; _metabolic_fitness = model._metabolic_fitness; _parent_metabolic_error = model._parent_metabolic_error; _secretion_error = model._secretion_error; _secretion_fitness = model._secretion_fitness; _parent_secretion_error = model._parent_secretion_error; _compound_amount = model._compound_amount; _fitness = model._fitness; _amount_of_dna = model._amount_of_dna; _nb_coding_rnas = model._nb_coding_rnas; _nb_non_coding_rnas = model._nb_non_coding_rnas; _av_size_coding_rnas = model._av_size_coding_rnas; _av_size_non_coding_rnas = model._av_size_non_coding_rnas; _nb_functional_genes = model._nb_functional_genes; _nb_non_functional_genes = model._nb_non_functional_genes; _av_size_functional_gene = model._av_size_functional_gene; _av_size_non_functional_gene = model._av_size_non_functional_gene; _nb_mut = model._nb_mut; _nb_rear = model._nb_rear; _nb_switch = model._nb_switch; _nb_indels = model._nb_indels; _nb_dupl = model._nb_dupl; _nb_del = model._nb_del; _nb_trans = model._nb_trans; _nb_inv = model._nb_inv; _dupl_rate = model._dupl_rate; _del_rate = model._del_rate; _trans_rate = model._trans_rate; _inv_rate = model._inv_rate; _mean_align_score = model._mean_align_score; _nb_bases_in_0_CDS = model._nb_bases_in_0_CDS; _nb_bases_in_0_functional_CDS = model._nb_bases_in_0_functional_CDS; _nb_bases_in_0_non_functional_CDS = model._nb_bases_in_0_non_functional_CDS; _nb_bases_in_0_RNA = model._nb_bases_in_0_RNA; _nb_bases_in_0_coding_RNA = model._nb_bases_in_0_coding_RNA; _nb_bases_in_0_non_coding_RNA = model._nb_bases_in_0_non_coding_RNA; _nb_bases_non_essential = model._nb_bases_non_essential; _nb_bases_non_essential_including_nf_genes = model._nb_bases_non_essential_including_nf_genes; #ifdef __REGUL _nb_influences = model._nb_influences; _nb_enhancing_influences = model._nb_enhancing_influences; _nb_operating_influences = model._nb_operating_influences; _av_value_influences = model._av_value_influences; _av_value_enhancing_influences = model._av_value_enhancing_influences; _av_value_operating_influences = model._av_value_operating_influences; #endif } /* If used for post-treatments, num_gener is mandatory */ ae_stat_record::ae_stat_record( ae_exp_manager* exp_m, ae_individual const * indiv, chrom_or_gen_unit chrom_or_gu, bool compute_non_coding, int32_t num_gener ) { _exp_m = exp_m; initialize_data(); _record_type = INDIV; // --------------- // Simulation data // --------------- _num_gener = ( num_gener == -1 ) ? _exp_m->get_num_gener() : num_gener; _pop_size = 0; // The pop_size value is irrelevent when dealing with a single individual. It is present for column alignment. #ifdef __REGUL // TODO #endif ae_list_node* gen_unit_node; ae_genetic_unit* gen_unit; // TODO : These conditions are not well managed!!! if ( indiv->get_genetic_unit_list()->get_nb_elts() == 1 ) // One single Genetic Unit { // ------------------------------------------------- // Compute statistical data for the given individual // ------------------------------------------------- ae_replication_report* replic_report = indiv->get_replic_report(); // can be NULL under certain conditions gen_unit = indiv->get_genetic_unit_list()->get_first()->get_obj(); // Metabolic error stats _metabolic_error = (double) indiv->get_dist_to_target_by_feature( METABOLISM ); _metabolic_fitness = (double) indiv->get_fitness_by_feature( METABOLISM ); _parent_metabolic_error = ( replic_report != NULL ) ? replic_report->get_parent_metabolic_error() : 0.0; // Fitness _fitness = indiv->get_fitness(); // Secretion stats if ( _exp_m->get_with_secretion() ) { _secretion_error = (double) indiv->get_dist_to_target_by_feature( SECRETION ); _secretion_fitness = (double) indiv->get_fitness_by_feature( SECRETION ); _compound_amount = (double) indiv->get_grid_cell()->get_compound_amount(); _parent_secretion_error = 0.0; if ( replic_report != NULL ) { _parent_secretion_error = replic_report->get_parent_secretion_error(); } } else { _secretion_error = 0.0; _secretion_fitness = 0.0; _compound_amount = 0.0; _parent_secretion_error = 0.0; } // Genes and RNA stats _amount_of_dna = gen_unit->get_dna()->get_length(); _nb_coding_rnas = gen_unit->get_nb_coding_RNAs(); _nb_non_coding_rnas = gen_unit->get_nb_non_coding_RNAs(); _av_size_coding_rnas = gen_unit->get_av_size_coding_RNAs(); _av_size_non_coding_rnas = gen_unit->get_av_size_non_coding_RNAs(); _nb_functional_genes = gen_unit->get_nb_functional_genes(); _nb_non_functional_genes = gen_unit->get_nb_non_functional_genes(); _av_size_functional_gene = gen_unit->get_av_size_functional_genes(); _av_size_non_functional_gene = gen_unit->get_av_size_non_functional_genes(); // Non coding stats if ( compute_non_coding ) { _nb_bases_in_0_CDS = gen_unit->get_nb_bases_in_0_CDS(); _nb_bases_in_0_functional_CDS = gen_unit->get_nb_bases_in_0_functional_CDS(); _nb_bases_in_0_non_functional_CDS = gen_unit->get_nb_bases_in_0_non_functional_CDS(); _nb_bases_in_0_RNA = gen_unit->get_nb_bases_in_0_RNA(); _nb_bases_in_0_coding_RNA = gen_unit->get_nb_bases_in_0_coding_RNA(); _nb_bases_in_0_non_coding_RNA = gen_unit->get_nb_bases_in_0_non_coding_RNA(); _nb_bases_non_essential = gen_unit->get_nb_bases_non_essential(); _nb_bases_non_essential_including_nf_genes = gen_unit->get_nb_bases_non_essential_including_nf_genes(); } // Mutation stats if ( replic_report != NULL ) { _nb_mut = gen_unit->get_dna()->get_replic_report()->get_nb_small_mutations(); _nb_rear = gen_unit->get_dna()->get_replic_report()->get_nb_rearrangements(); _nb_switch = gen_unit->get_dna()->get_replic_report()->get_nb_switch(); _nb_indels = gen_unit->get_dna()->get_replic_report()->get_nb_indels(); _nb_dupl = gen_unit->get_dna()->get_replic_report()->get_nb_duplications(); _nb_del = gen_unit->get_dna()->get_replic_report()->get_nb_deletions(); _nb_trans = gen_unit->get_dna()->get_replic_report()->get_nb_translocations(); _nb_inv = gen_unit->get_dna()->get_replic_report()->get_nb_inversions(); // Rearrangement rate stats int32_t parent_genome_size = replic_report->get_parent_genome_size(); _dupl_rate = _nb_dupl / parent_genome_size; _del_rate = _nb_del / parent_genome_size; _trans_rate = _nb_trans / parent_genome_size; _inv_rate = _nb_inv / parent_genome_size; //~ // //~ if ( _nb_dupl + _nb_del + _nb_trans + _nb_inv != 0 ) //~ { //~ printf( "_nb_dupl : %"PRId32"\n_nb_del : %"PRId32"\n_nb_trans : %"PRId32"\n_nb_inv : %"PRId32"\n", //~ (int32_t) _nb_dupl, (int32_t) _nb_del, (int32_t) _nb_trans, (int32_t) _nb_inv ); //~ printf( "parent genome size : %"PRId32"\n", parent_genome_size ); //~ printf( "_dupl_rate : %f\n_del_rate : %f\n_trans_rate : %f\n_inv_rate : %f\n", //~ _dupl_rate, _del_rate, _trans_rate, _inv_rate ); //~ getchar(); //~ } //~ // _mean_align_score = replic_report->get_mean_align_score(); } } else if ( chrom_or_gu == ALL_GU ) { // ------------------------------------------------- // Compute statistical data for the given individual // ------------------------------------------------- ae_replication_report* replic_report = indiv->get_replic_report(); // can be NULL under certain conditions // Metabolic error stats _metabolic_error = (double) indiv->get_dist_to_target_by_feature( METABOLISM ); _metabolic_fitness = (double) indiv->get_fitness_by_feature( METABOLISM ); _parent_metabolic_error = ( replic_report != NULL ) ? replic_report->get_parent_metabolic_error() : 0.0; // Fitness _fitness = indiv->get_fitness(); // Secretion stats if ( _exp_m->get_with_secretion() ) { _secretion_error = (double) indiv->get_dist_to_target_by_feature( SECRETION ); _secretion_fitness = (double) indiv->get_fitness_by_feature(SECRETION); _compound_amount = (double) indiv->get_grid_cell()->get_compound_amount(); _parent_secretion_error = 0.0; if ( replic_report != NULL ) { _parent_secretion_error = replic_report->get_parent_secretion_error(); } } else { _secretion_error = 0.0; _secretion_fitness = 0.0; _compound_amount = 0.0; _parent_secretion_error = 0.0; } gen_unit_node = indiv->get_genetic_unit_list()->get_first(); while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); // Genes and RNA stats _amount_of_dna += gen_unit->get_dna()->get_length(); _nb_coding_rnas += gen_unit->get_nb_coding_RNAs(); _nb_non_coding_rnas += gen_unit->get_nb_non_coding_RNAs(); _av_size_coding_rnas += gen_unit->get_av_size_coding_RNAs(); _av_size_non_coding_rnas += gen_unit->get_av_size_non_coding_RNAs(); _nb_functional_genes += gen_unit->get_nb_functional_genes(); _nb_non_functional_genes += gen_unit->get_nb_non_functional_genes(); _av_size_functional_gene += gen_unit->get_av_size_functional_genes(); _av_size_non_functional_gene += gen_unit->get_av_size_non_functional_genes(); // Non coding stats if ( compute_non_coding ) { _nb_bases_in_0_CDS += gen_unit->get_nb_bases_in_0_CDS(); _nb_bases_in_0_functional_CDS += gen_unit->get_nb_bases_in_0_functional_CDS(); _nb_bases_in_0_non_functional_CDS += gen_unit->get_nb_bases_in_0_non_functional_CDS(); _nb_bases_in_0_RNA += gen_unit->get_nb_bases_in_0_RNA(); _nb_bases_in_0_coding_RNA += gen_unit->get_nb_bases_in_0_coding_RNA(); _nb_bases_in_0_non_coding_RNA += gen_unit->get_nb_bases_in_0_non_coding_RNA(); _nb_bases_non_essential += gen_unit->get_nb_bases_non_essential(); _nb_bases_non_essential_including_nf_genes += gen_unit->get_nb_bases_non_essential_including_nf_genes(); } // Mutation stats if ( replic_report != NULL ) { _nb_mut += gen_unit->get_dna()->get_replic_report()->get_nb_small_mutations(); _nb_rear += gen_unit->get_dna()->get_replic_report()->get_nb_rearrangements(); _nb_switch += gen_unit->get_dna()->get_replic_report()->get_nb_switch(); _nb_indels += gen_unit->get_dna()->get_replic_report()->get_nb_indels(); _nb_dupl += gen_unit->get_dna()->get_replic_report()->get_nb_duplications(); _nb_del += gen_unit->get_dna()->get_replic_report()->get_nb_deletions(); _nb_trans += gen_unit->get_dna()->get_replic_report()->get_nb_translocations(); _nb_inv += gen_unit->get_dna()->get_replic_report()->get_nb_inversions(); } gen_unit_node = gen_unit_node->get_next(); } // Rearrangement rate stats if ( replic_report != NULL ) { int32_t parent_genome_size = replic_report->get_parent_genome_size(); _dupl_rate = _nb_dupl / parent_genome_size; _del_rate = _nb_del / parent_genome_size; _trans_rate = _nb_trans / parent_genome_size; _inv_rate = _nb_inv / parent_genome_size; _mean_align_score = replic_report->get_mean_align_score(); } } else // => We have a multi-GU individual and we want only the main chromosome or only the plasmids // WARNING (TODO) As it is coded, this will work only if there is ONE SINGLE PLASMID! { if ( chrom_or_gu == PLASMIDS ) { gen_unit_node = indiv->get_genetic_unit_list()->get_first()->get_next(); } if ( chrom_or_gu == CHROM ) { gen_unit_node = indiv->get_genetic_unit_list()->get_first(); } gen_unit = gen_unit_node->get_obj(); // ------------------------------------------------- // Compute statistical data for the given individual // ------------------------------------------------- ae_replication_report* replic_report = indiv->get_replic_report(); // can be NULL under certain conditions // Metabolic error stats _metabolic_error = (double) gen_unit->get_dist_to_target_by_feature( METABOLISM ); _metabolic_fitness = (double) gen_unit->get_fitness_by_feature( METABOLISM ); _parent_metabolic_error = ( replic_report != NULL ) ? replic_report->get_parent_metabolic_error() : 0.0; // Fitness _fitness = indiv->get_fitness(); // Secretion stats if ( _exp_m->get_with_secretion() ) { _secretion_error = (double) gen_unit->get_dist_to_target_by_feature( SECRETION ); _secretion_fitness = (double) gen_unit->get_fitness_by_feature( SECRETION ); _compound_amount = (double) indiv->get_grid_cell()->get_compound_amount(); _parent_secretion_error = 0.0; if ( replic_report != NULL ) { _parent_secretion_error = replic_report->get_parent_secretion_error(); } } else { _secretion_error = 0.0; _secretion_fitness = 0.0; _compound_amount = 0.0; _parent_secretion_error = 0.0; } // Genes and RNA stats _amount_of_dna = gen_unit->get_dna()->get_length(); _nb_coding_rnas = gen_unit->get_nb_coding_RNAs(); _nb_non_coding_rnas = gen_unit->get_nb_non_coding_RNAs(); _av_size_coding_rnas = gen_unit->get_av_size_coding_RNAs(); _av_size_non_coding_rnas = gen_unit->get_av_size_non_coding_RNAs(); _nb_functional_genes = gen_unit->get_nb_functional_genes(); _nb_non_functional_genes = gen_unit->get_nb_non_functional_genes(); _av_size_functional_gene = gen_unit->get_av_size_functional_genes(); _av_size_non_functional_gene = gen_unit->get_av_size_non_functional_genes(); // Non coding stats if ( compute_non_coding ) { _nb_bases_in_0_CDS = gen_unit->get_nb_bases_in_0_CDS(); _nb_bases_in_0_functional_CDS = gen_unit->get_nb_bases_in_0_functional_CDS(); _nb_bases_in_0_non_functional_CDS = gen_unit->get_nb_bases_in_0_non_functional_CDS(); _nb_bases_in_0_RNA = gen_unit->get_nb_bases_in_0_RNA(); _nb_bases_in_0_coding_RNA = gen_unit->get_nb_bases_in_0_coding_RNA(); _nb_bases_in_0_non_coding_RNA = gen_unit->get_nb_bases_in_0_non_coding_RNA(); _nb_bases_non_essential = gen_unit->get_nb_bases_non_essential(); _nb_bases_non_essential_including_nf_genes = gen_unit->get_nb_bases_non_essential_including_nf_genes(); } // Mutation stats if ( gen_unit->get_dna()->get_replic_report() != NULL ) { _nb_mut = gen_unit->get_dna()->get_replic_report()->get_nb_small_mutations(); _nb_rear = gen_unit->get_dna()->get_replic_report()->get_nb_rearrangements(); _nb_switch = gen_unit->get_dna()->get_replic_report()->get_nb_switch(); _nb_indels = gen_unit->get_dna()->get_replic_report()->get_nb_indels(); _nb_dupl = gen_unit->get_dna()->get_replic_report()->get_nb_duplications(); _nb_del = gen_unit->get_dna()->get_replic_report()->get_nb_deletions(); _nb_trans = gen_unit->get_dna()->get_replic_report()->get_nb_translocations(); _nb_inv = gen_unit->get_dna()->get_replic_report()->get_nb_inversions(); } // Rearrangement rate stats if ( replic_report != NULL ) { int32_t parent_genome_size = replic_report->get_parent_genome_size(); _dupl_rate = _nb_dupl / parent_genome_size; _del_rate = _nb_del / parent_genome_size; _trans_rate = _nb_trans / parent_genome_size; _inv_rate = _nb_inv / parent_genome_size; _mean_align_score = replic_report->get_mean_align_score(); } } } // Calculate average statistics for all the recorded values ae_stat_record::ae_stat_record( ae_exp_manager* exp_m, ae_population const * pop, chrom_or_gen_unit chrom_or_gu ) { _exp_m = exp_m; initialize_data(); _record_type = POP; // --------------- // Simulation data // --------------- _num_gener = (double) _exp_m->get_num_gener(); _pop_size = (double) pop->get_nb_indivs(); // ------------------------------------------------------------------ // Compute statistical data for the each individual in the population // ------------------------------------------------------------------ ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; int32_t index; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); index = indiv->get_id(); ae_stat_record* indiv_stat_record = new ae_stat_record( _exp_m, indiv, chrom_or_gu, false ); this->add( indiv_stat_record, index ); delete indiv_stat_record; indiv_node = indiv_node->get_next(); } // ------------------------------------------------------------------ // Divide every accumulator by the number of indivs in the population // ------------------------------------------------------------------ this->divide( _pop_size ); } // Calculate standard deviation for all the recorded values ae_stat_record::ae_stat_record( ae_exp_manager* exp_m, ae_population const * pop, ae_stat_record const * means, chrom_or_gen_unit chrom_or_gu ) { _exp_m = exp_m; initialize_data(); _record_type = STDEVS; // --------------- // Simulation data // --------------- _num_gener = (double) _exp_m->get_num_gener(); _pop_size = (double) pop->get_nb_indivs(); // ------------------------------------------------------------------ // Compute statistical data for the each individual in the population // ------------------------------------------------------------------ ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); ae_stat_record* indiv_stat_record = new ae_stat_record( _exp_m, indiv, chrom_or_gu, false ); this->substract_power( means, indiv_stat_record, 2 ); delete indiv_stat_record; indiv_node = indiv_node->get_next(); } // --------------------------------------------------------------------------------- // Divide every accumulator by the square root of number of indivs in the population // --------------------------------------------------------------------------------- this->divide( pow((_pop_size-1), 0.5) ); } // Calculate skewness for all the recorded values ae_stat_record::ae_stat_record( ae_exp_manager* exp_m, ae_population const * pop, ae_stat_record const * means, ae_stat_record const * stdevs, chrom_or_gen_unit chrom_or_gu ) { _exp_m = exp_m; initialize_data(); _record_type = SKEWNESS; // --------------- // Simulation data // --------------- _num_gener = (double) _exp_m->get_num_gener(); _pop_size = (double) pop->get_nb_indivs(); // ------------------------------------------------------------------ // Compute statistical data for the each individual in the population // ------------------------------------------------------------------ ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); ae_stat_record* indiv_stat_record = new ae_stat_record( _exp_m, indiv, chrom_or_gu, false ); this->substract_power( means, indiv_stat_record, 3 ); delete indiv_stat_record; indiv_node = indiv_node->get_next(); } this->divide( - _pop_size ); this->divide_record( stdevs, 3/2 ); } // ================================================================= // Destructors // ================================================================= ae_stat_record::~ae_stat_record( void ) { } // ================================================================= // Public Methods // ================================================================= void ae_stat_record::initialize_data( void ) { _num_gener = 0.0; _pop_size = 0.0; _metabolic_error = 0.0; _metabolic_fitness = 0.0; _parent_metabolic_error = 0.0; _secretion_error = 0.0; _parent_secretion_error = 0.0; _secretion_fitness = 0.0; _compound_amount = 0.0; _fitness = 0.0; _amount_of_dna = 0.0; _nb_coding_rnas = 0.0; _nb_non_coding_rnas = 0.0; _av_size_coding_rnas = 0.0; _av_size_non_coding_rnas = 0.0; _nb_functional_genes = 0.0; _nb_non_functional_genes = 0.0; _av_size_functional_gene = 0.0; _av_size_non_functional_gene = 0.0; _nb_mut = 0.0; _nb_rear = 0.0; _nb_switch = 0.0; _nb_indels = 0.0; _nb_dupl = 0.0; _nb_del = 0.0; _nb_trans = 0.0; _nb_inv = 0.0; _dupl_rate = 0.0; _del_rate = 0.0; _trans_rate = 0.0; _inv_rate = 0.0; _mean_align_score = 0.0; _nb_bases_in_0_CDS = 0.0; _nb_bases_in_0_functional_CDS = 0.0; _nb_bases_in_0_non_functional_CDS = 0.0; _nb_bases_in_0_RNA = 0.0; _nb_bases_in_0_coding_RNA = 0.0; _nb_bases_in_0_non_coding_RNA = 0.0; _nb_bases_non_essential = 0.0; _nb_bases_non_essential_including_nf_genes = 0.0; #ifdef __REGUL _nb_influences = 0.0; _nb_enhancing_influences = 0.0; _nb_operating_influences = 0.0; _av_value_influences = 0.0; _av_value_enhancing_influences = 0.0; _av_value_operating_influences = 0.0; #endif } void ae_stat_record::write_to_file( FILE* stat_file, stats_type stat_type_to_print) const { if ( _record_type == INDIV ) { if ( stat_type_to_print == FITNESS_STATS ) { fprintf( stat_file, "%"PRId32" %"PRId32" %e %"PRId32" %e %e %e %e %e %e %e", (int32_t) _num_gener, (int32_t) _pop_size, _fitness, (int32_t) _amount_of_dna, _metabolic_error, _parent_metabolic_error, _metabolic_fitness, _secretion_error, _parent_secretion_error, _secretion_fitness, _compound_amount); #ifdef __REGUL fprintf( stat_file, " %"PRId32" %"PRId32" %"PRId32" %f %f %f", (int32_t) _nb_influences, (int32_t) _nb_enhancing_influences, (int32_t) _nb_operating_influences, _av_value_influences, _av_value_enhancing_influences, _av_value_operating_influences ); #endif } if ( stat_type_to_print == MUTATION_STATS ) { fprintf( stat_file, "%"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32"", (int32_t) _num_gener, (int32_t) _nb_mut, (int32_t) _nb_rear, (int32_t) _nb_switch, (int32_t) _nb_indels, (int32_t) _nb_dupl, (int32_t) _nb_del, (int32_t) _nb_trans, (int32_t) _nb_inv ); } if ( stat_type_to_print == GENES_STATS ) { fprintf( stat_file, "%"PRId32" %"PRId32" %"PRId32" %f %f %"PRId32" %"PRId32" %f %f ", (int32_t) _num_gener, (int32_t) _nb_coding_rnas, (int32_t) _nb_non_coding_rnas, _av_size_coding_rnas, _av_size_non_coding_rnas, (int32_t) _nb_functional_genes, (int32_t) _nb_non_functional_genes, _av_size_functional_gene, _av_size_non_functional_gene ); } if ( stat_type_to_print == BP_STATS ) { fprintf( stat_file, "%"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32"", (int32_t) _num_gener, (int32_t) _nb_bases_in_0_CDS, (int32_t) _nb_bases_in_0_functional_CDS, (int32_t) _nb_bases_in_0_non_functional_CDS, (int32_t) _nb_bases_in_0_RNA, (int32_t) _nb_bases_in_0_coding_RNA, (int32_t) _nb_bases_in_0_non_coding_RNA, (int32_t) _nb_bases_non_essential, (int32_t) _nb_bases_non_essential_including_nf_genes ); } if ( stat_type_to_print == REAR_STATS ) { fprintf( stat_file, "%"PRId32" %e %e %e %e %f", (int32_t) _num_gener, _dupl_rate, _del_rate, _trans_rate, _inv_rate, _mean_align_score ); } } else // if _record_type == POP { if ( stat_type_to_print == FITNESS_STATS ) { fprintf( stat_file, "%"PRId32" %"PRId32" %e %f %e %e %e %e %e %e %e", (int32_t) _num_gener, (int32_t) _pop_size, _fitness, _amount_of_dna, _metabolic_error, _parent_metabolic_error, _metabolic_fitness, _secretion_error, _parent_secretion_error, _secretion_fitness, _compound_amount); #ifdef __REGUL fprintf( stat_file, " %"PRId32" %"PRId32" %"PRId32" %f %f %f", (int32_t) _nb_influences, (int32_t) _nb_enhancing_influences, (int32_t) _nb_operating_influences, _av_value_influences, _av_value_enhancing_influences, _av_value_operating_influences ); #endif } if ( stat_type_to_print == MUTATION_STATS ) { fprintf( stat_file, "%"PRId32" %f %f %f %f %f %f %f %f", (int32_t) _num_gener, _nb_mut, _nb_rear, _nb_switch, _nb_indels, _nb_dupl, _nb_del, _nb_trans, _nb_inv ); } if ( stat_type_to_print == GENES_STATS ) { fprintf( stat_file, "%"PRId32" %f %f %f %f %f %f %f %f", (int32_t) _num_gener, _nb_coding_rnas, _nb_non_coding_rnas, _av_size_coding_rnas, _av_size_non_coding_rnas, _nb_functional_genes, _nb_non_functional_genes, _av_size_functional_gene, _av_size_non_functional_gene ); } if ( stat_type_to_print == BP_STATS ) { // TO DO (if needed) : base-pair stats for all individuals, not just for the best one. // // fprintf( stat_file, "%"PRId32" %f %f %f %f %f %f %f %f", // (int32_t)_num_gener, // _nb_bases_in_0_CDS, // _nb_bases_in_0_functional_CDS, // _nb_bases_in_0_non_functional_CDS, // _nb_bases_in_0_RNA, // _nb_bases_in_0_coding_RNA, // _nb_bases_in_0_non_coding_RNA, // _nb_bases_non_essential, // _nb_bases_non_essential_including_nf_genes ); } if ( stat_type_to_print == REAR_STATS ) { fprintf( stat_file, "%"PRId32" %e %e %e %e %f", (int32_t) _num_gener, _dupl_rate, _del_rate, _trans_rate, _inv_rate, _mean_align_score ); } } fprintf( stat_file, "\n" ); } void ae_stat_record::divide( double divisor ) { // NB : _num_gener and pop_size are global values and are not to be divided. _fitness /= divisor; _metabolic_error /= divisor; _parent_metabolic_error /= divisor; _metabolic_fitness /= divisor; _secretion_error /= divisor; _parent_secretion_error /= divisor; _secretion_fitness /= divisor; _compound_amount /= divisor; _amount_of_dna /= divisor; _nb_coding_rnas /= divisor; _nb_non_coding_rnas /= divisor; _av_size_coding_rnas /= divisor; _av_size_non_coding_rnas /= divisor; _nb_functional_genes /= divisor; _nb_non_functional_genes /= divisor; _av_size_functional_gene /= divisor; _av_size_non_functional_gene /= divisor; _nb_mut /= divisor; _nb_rear /= divisor; _nb_switch /= divisor; _nb_indels /= divisor; _nb_dupl /= divisor; _nb_del /= divisor; _nb_trans /= divisor; _nb_inv /= divisor; //~ printf( "PREFINAL %f %f %f %f\n", _dupl_rate, _del_rate, _trans_rate, _inv_rate ); _dupl_rate /= divisor; _del_rate /= divisor; _trans_rate /= divisor; _inv_rate /= divisor; //~ printf( "FINAL %f %f %f %f\n", _dupl_rate, _del_rate, _trans_rate, _inv_rate ); //~ getchar(); _mean_align_score /= divisor; _nb_bases_in_0_CDS /= divisor; _nb_bases_in_0_functional_CDS /= divisor; _nb_bases_in_0_non_functional_CDS /= divisor; _nb_bases_in_0_RNA /= divisor; _nb_bases_in_0_coding_RNA /= divisor; _nb_bases_in_0_non_coding_RNA /= divisor; _nb_bases_non_essential /= divisor; _nb_bases_non_essential_including_nf_genes /= divisor; #ifdef __REGUL _nb_influences /= divisor; _nb_enhancing_influences /= divisor; _nb_operating_influences /= divisor; _av_value_influences /= divisor; _av_value_enhancing_influences /= divisor; _av_value_operating_influences /= divisor; #endif } void ae_stat_record::divide_record( ae_stat_record const * to_divide, double power ) { // NB : _num_gener and pop_size are global values and are not to be divided. if (to_divide->_fitness != 0) { _fitness /= pow(to_divide->_fitness, power); } if (to_divide->_metabolic_error != 0) { _metabolic_error /= pow(to_divide->_metabolic_error, power); } if (to_divide->_parent_metabolic_error != 0) { _parent_metabolic_error /= pow(to_divide->_parent_metabolic_error, power); } if (to_divide->_metabolic_fitness != 0) { _metabolic_fitness /= pow(to_divide->_metabolic_fitness, power); } if (to_divide->_secretion_error != 0) { _secretion_error /= pow(to_divide->_secretion_error, power); } if (to_divide->_parent_secretion_error != 0) { _parent_secretion_error /= pow(to_divide->_parent_secretion_error, power); } if (to_divide->_secretion_fitness != 0) { _secretion_fitness /= pow(to_divide->_secretion_fitness, power); } if (to_divide->_compound_amount != 0) { _compound_amount /= pow(to_divide->_compound_amount, power); } if (to_divide->_amount_of_dna != 0) { _amount_of_dna /= pow(to_divide->_amount_of_dna, power); } if (to_divide->_nb_coding_rnas != 0) { _nb_coding_rnas /= pow(to_divide->_nb_coding_rnas, power); } if (to_divide->_nb_non_coding_rnas != 0) { _nb_non_coding_rnas /= pow(to_divide->_nb_non_coding_rnas, power); } if (to_divide->_av_size_coding_rnas != 0) { _av_size_coding_rnas /= pow(to_divide->_av_size_coding_rnas, power); } if (to_divide->_av_size_non_coding_rnas != 0) { _av_size_non_coding_rnas /= pow(to_divide->_av_size_non_coding_rnas, power); } if (to_divide->_nb_functional_genes != 0) { _nb_functional_genes /= pow(to_divide->_nb_functional_genes, power); } if (to_divide->_nb_non_functional_genes != 0) { _nb_non_functional_genes /= pow(to_divide->_nb_non_functional_genes, power); } if (to_divide->_av_size_functional_gene != 0) { _av_size_functional_gene /= pow(to_divide->_av_size_functional_gene, power); } if (to_divide->_av_size_non_functional_gene != 0) { _av_size_non_functional_gene /= pow(to_divide->_av_size_non_functional_gene, power); } if (to_divide->_nb_mut != 0) { _nb_mut /= pow(to_divide->_nb_mut, power); } if (to_divide->_nb_rear != 0) { _nb_rear /= pow(to_divide->_nb_rear, power); } if (to_divide->_nb_switch != 0) { _nb_switch /= pow(to_divide->_nb_switch, power); } if (to_divide->_nb_indels != 0) { _nb_indels /= pow(to_divide->_nb_indels, power); } if (to_divide->_nb_dupl != 0) { _nb_dupl /= pow(to_divide->_nb_dupl, power); } if (to_divide->_nb_del != 0) { _nb_del /= pow(to_divide->_nb_del, power); } if (to_divide->_nb_trans != 0) { _nb_trans /= pow(to_divide->_nb_trans, power); } if (to_divide->_nb_inv != 0) { _nb_inv /= pow(to_divide->_nb_inv, power); } if (to_divide->_dupl_rate != 0) { _dupl_rate /= pow(to_divide->_dupl_rate, power); } if (to_divide->_del_rate != 0) { _del_rate /= pow(to_divide->_del_rate, power); } if (to_divide->_trans_rate != 0) { _trans_rate /= pow(to_divide->_trans_rate, power); } if (to_divide->_inv_rate != 0) { _inv_rate /= pow(to_divide->_inv_rate, power); } if (to_divide->_mean_align_score != 0) { _mean_align_score /= pow(to_divide->_mean_align_score, power); } if (to_divide->_nb_bases_in_0_CDS != 0) { _nb_bases_in_0_CDS /= pow(to_divide->_nb_bases_in_0_CDS, power); } if (to_divide->_nb_bases_in_0_functional_CDS != 0) { _nb_bases_in_0_functional_CDS /= pow(to_divide->_nb_bases_in_0_functional_CDS, power); } if (to_divide->_nb_bases_in_0_non_functional_CDS != 0) { _nb_bases_in_0_non_functional_CDS /= pow(to_divide->_nb_bases_in_0_non_functional_CDS, power); } if (to_divide->_nb_bases_in_0_RNA != 0) { _nb_bases_in_0_RNA /= pow(to_divide->_nb_bases_in_0_RNA, power); } if (to_divide->_nb_bases_in_0_coding_RNA != 0) { _nb_bases_in_0_coding_RNA /= pow(to_divide->_nb_bases_in_0_coding_RNA, power); } if (to_divide->_nb_bases_in_0_non_coding_RNA != 0) { _nb_bases_in_0_non_coding_RNA /= pow(to_divide->_nb_bases_in_0_non_coding_RNA, power); } if (to_divide->_nb_bases_non_essential != 0) { _nb_bases_non_essential /= pow(to_divide->_nb_bases_non_essential, power); } if (to_divide->_nb_bases_non_essential_including_nf_genes != 0) { _nb_bases_non_essential_including_nf_genes /= pow(to_divide->_nb_bases_non_essential_including_nf_genes, power); } #ifdef __REGUL if (to_divide->_nb_influences != 0) { _nb_influences /= pow(to_divide->_nb_influences, power); } if (to_divide->_nb_enhancing_influences != 0) { _nb_enhancing_influences /= pow(to_divide->_nb_enhancing_influences, power); } if (to_divide->_nb_operating_influences != 0) { _nb_operating_influences /= pow(to_divide->_nb_operating_influences, power); } if (to_divide->_av_value_influences != 0) { _av_value_influences /= pow(to_divide->_av_value_influences, power); } if (to_divide->_av_value_enhancing_influences != 0) { _av_value_enhancing_influences /= pow(to_divide->_av_value_enhancing_influences, power); } if (to_divide->_av_value_operating_influences != 0) { _av_value_operating_influences /= pow(to_divide->_av_value_operating_influences, power); } #endif } void ae_stat_record::add( ae_stat_record* to_add, int32_t index ) { // NB : _num_gener and pop_size are global values and are not to be summed. _fitness += to_add->_fitness; _metabolic_error += to_add->_metabolic_error; _parent_metabolic_error += to_add->_parent_metabolic_error; _metabolic_fitness += to_add->_metabolic_fitness; _secretion_error += to_add->_secretion_error; _parent_secretion_error += to_add->_parent_secretion_error; _secretion_fitness += to_add->_secretion_fitness; _compound_amount += to_add->_compound_amount; _amount_of_dna += to_add->_amount_of_dna; _nb_coding_rnas += to_add->_nb_coding_rnas; _nb_non_coding_rnas += to_add->_nb_non_coding_rnas; _av_size_coding_rnas += to_add->_av_size_coding_rnas; _av_size_non_coding_rnas += to_add->_av_size_non_coding_rnas; _nb_functional_genes += to_add->_nb_functional_genes; _nb_non_functional_genes += to_add->_nb_non_functional_genes; _av_size_functional_gene += to_add->_av_size_functional_gene; _av_size_non_functional_gene += to_add->_av_size_non_functional_gene; _nb_mut += to_add->_nb_mut; _nb_rear += to_add->_nb_rear; _nb_switch += to_add->_nb_switch; _nb_indels += to_add->_nb_indels; _nb_dupl += to_add->_nb_dupl; _nb_del += to_add->_nb_del; _nb_trans += to_add->_nb_trans; _nb_inv += to_add->_nb_inv; _dupl_rate += to_add->_dupl_rate; _del_rate += to_add->_del_rate; _trans_rate += to_add->_trans_rate; _inv_rate += to_add->_inv_rate; //~ printf( "%f %f %f %f\n", to_add->_dupl_rate, to_add->_del_rate, to_add->_trans_rate, to_add->_inv_rate ); _mean_align_score += to_add->_mean_align_score; _nb_bases_in_0_CDS += to_add->_nb_bases_in_0_CDS; _nb_bases_in_0_functional_CDS += to_add->_nb_bases_in_0_functional_CDS; _nb_bases_in_0_non_functional_CDS += to_add->_nb_bases_in_0_non_functional_CDS; _nb_bases_in_0_RNA += to_add->_nb_bases_in_0_RNA; _nb_bases_in_0_coding_RNA += to_add->_nb_bases_in_0_coding_RNA; _nb_bases_in_0_non_coding_RNA += to_add->_nb_bases_in_0_non_coding_RNA; _nb_bases_non_essential += to_add->_nb_bases_non_essential; _nb_bases_non_essential_including_nf_genes += to_add->_nb_bases_non_essential_including_nf_genes; #ifdef __REGUL _nb_influences += to_add->_nb_influences; _nb_enhancing_influences += to_add->_nb_enhancing_influences; _nb_operating_influences += to_add->_nb_operating_influences; _av_value_influences += to_add->_av_value_influences; _av_value_enhancing_influences += to_add->_av_value_enhancing_influences; _av_value_operating_influences += to_add->_av_value_operating_influences; #endif } void ae_stat_record::substract_power( ae_stat_record const * means, ae_stat_record const * to_substract, double power ) { // NB : _num_gener and pop_size are global values and are not to be summed. _fitness += pow( means->_fitness - to_substract->_fitness, power ); _metabolic_error += pow( means->_metabolic_error - to_substract->_metabolic_error, power ); _parent_metabolic_error += pow( means->_parent_metabolic_error - to_substract->_parent_metabolic_error, power ); _metabolic_fitness += pow( means->_metabolic_fitness - to_substract->_metabolic_fitness, power ); _secretion_error += pow( means->_secretion_error - to_substract->_secretion_error, power ); _parent_secretion_error += pow( means->_parent_secretion_error - to_substract->_parent_secretion_error, power ); _secretion_fitness += pow( means->_secretion_fitness - to_substract->_secretion_fitness, power ); _compound_amount += pow( means->_compound_amount - to_substract->_compound_amount, power ); _amount_of_dna += pow( means->_amount_of_dna - to_substract->_amount_of_dna, power ); _nb_coding_rnas += pow( means->_nb_coding_rnas - to_substract->_nb_coding_rnas, power ); _nb_non_coding_rnas += pow( means->_nb_non_coding_rnas - to_substract->_nb_non_coding_rnas, power ); _av_size_coding_rnas += pow( means->_av_size_coding_rnas - to_substract->_av_size_coding_rnas, power ); _av_size_non_coding_rnas += pow( means->_av_size_non_coding_rnas - to_substract->_av_size_non_coding_rnas, power ); _nb_functional_genes += pow( means->_nb_functional_genes - to_substract->_nb_functional_genes, power ); _nb_non_functional_genes += pow( means->_nb_non_functional_genes - to_substract->_nb_non_functional_genes, power ); _av_size_functional_gene += pow( means->_av_size_functional_gene - to_substract->_av_size_functional_gene, power ); _av_size_non_functional_gene += pow( means->_av_size_non_functional_gene - to_substract->_av_size_non_functional_gene, power ); _nb_mut += pow( means->_nb_mut - to_substract->_nb_mut, power ); _nb_rear += pow( means->_nb_rear - to_substract->_nb_rear, power ); _nb_switch += pow( means->_nb_switch - to_substract->_nb_switch, power ); _nb_indels += pow( means->_nb_indels - to_substract->_nb_indels, power ); _nb_dupl += pow( means->_nb_dupl - to_substract->_nb_dupl, power ); _nb_del += pow( means->_nb_del - to_substract->_nb_del, power ); _nb_trans += pow( means->_nb_trans - to_substract->_nb_trans, power ); _nb_inv += pow( means->_nb_inv - to_substract->_nb_inv, power ); _dupl_rate += pow( means->_dupl_rate - to_substract->_dupl_rate, power ); _del_rate += pow( means->_del_rate - to_substract->_del_rate, power ); _trans_rate += pow( means->_trans_rate - to_substract->_trans_rate, power ); _inv_rate += pow( means->_inv_rate - to_substract->_inv_rate, power ); _mean_align_score += pow( means->_mean_align_score - to_substract->_mean_align_score, power ); _nb_bases_in_0_CDS += pow( means->_nb_bases_in_0_CDS - to_substract->_nb_bases_in_0_CDS, power ); _nb_bases_in_0_functional_CDS += pow( means->_nb_bases_in_0_functional_CDS - to_substract->_nb_bases_in_0_functional_CDS, power ); _nb_bases_in_0_non_functional_CDS += pow( means->_nb_bases_in_0_non_functional_CDS - to_substract->_nb_bases_in_0_non_functional_CDS, power ); _nb_bases_in_0_RNA += pow( means->_nb_bases_in_0_RNA - to_substract->_nb_bases_in_0_RNA, power ); _nb_bases_in_0_coding_RNA += pow( means->_nb_bases_in_0_coding_RNA - to_substract->_nb_bases_in_0_coding_RNA, power ); _nb_bases_in_0_non_coding_RNA += pow( means->_nb_bases_in_0_non_coding_RNA - to_substract->_nb_bases_in_0_non_coding_RNA, power ); _nb_bases_non_essential += pow( means->_nb_bases_non_essential - to_substract->_nb_bases_non_essential, power ); _nb_bases_non_essential_including_nf_genes += pow( means->_nb_bases_non_essential_including_nf_genes - to_substract->_nb_bases_non_essential_including_nf_genes, power ); #ifdef __REGUL _nb_influences += pow( means->_nb_influences - to_substract->_nb_influences, power ); _nb_enhancing_influences += pow( means->_nb_enhancing_influences - to_substract->_nb_enhancing_influences, power ); _nb_operating_influences += pow( means->_nb_operating_influences - to_substract->_nb_operating_influences, power ); _av_value_influences += pow( means->_av_value_influences - to_substract->_av_value_influences, power ); _av_value_enhancing_influences += pow( means->_av_value_enhancing_influences - to_substract->_av_value_enhancing_influences, power ); _av_value_operating_influences += pow( means->_av_value_operating_influences - to_substract->_av_value_operating_influences, power ); #endif } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_logs.h0000644000175000017500000001433512231437075013570 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_LOGS_H__ #define __AE_LOGS_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_logs : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_logs( void ); // ================================================================= // Destructors // ================================================================= virtual ~ae_logs( void ); // ================================================================= // Accessors // ================================================================= inline FILE* get_log( ae_log_type log_type ) const; inline int8_t get_logs() const; inline bool is_logged( ae_log_type log_type ) const; // ================================================================= // Operators // ================================================================= // ================================================================= // Public Methods // ================================================================= //void save( gzFile backup_file ) const; void load( int8_t logs, int32_t num_gener ); void print_to_file( FILE* file ) const; void set_logs( int8_t logs ); void flush( void ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= /* ae_logs( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_logs( const ae_logs &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= void write_headers( void ) const; // ================================================================= // Protected Attributes // ================================================================= int8_t _logs; // Which logs are "turned on" (bitmap) FILE* _transfer_log; FILE* _rear_log; FILE* _barrier_log; //FILE* _param_modification_log; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline FILE* ae_logs::get_log( ae_log_type log_type ) const { switch ( log_type ) { case LOG_TRANSFER : { return _transfer_log; } case LOG_REAR : { return _rear_log; } case LOG_BARRIER : { return _barrier_log; } /*case LOG_LOADS : { return _param_modification_log; }*/ default: { printf( "ERROR: unknown log_type in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } } inline int8_t ae_logs::get_logs() const { return _logs; } inline bool ae_logs::is_logged( ae_log_type log_type ) const { switch ( log_type ) { case LOG_TRANSFER : { return ( _logs & LOG_TRANSFER ); } case LOG_REAR : { return ( _logs & LOG_REAR ); } case LOG_BARRIER : { return ( _logs & LOG_BARRIER ); } /*case LOG_LOADS : { return ( _logs & LOG_LOADS ); }*/ default: { printf( "ERROR: unknown log_type in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } } // ===================================================================== // Operators' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_LOGS_H__ aevol-4.4/src/libaevol/ae_exp_manager.h0000644000175000017500000004723612302666111015112 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** /*! \class ae_exp_manager \brief This is aevol's top-level class. It allows for high-level experiment management An experiment manager allows one to... manage an experiment. It owns a population and an experimental_setup that can be loaded from a pair of aevol binary files (pop and exp_setup) */ #ifndef __AE_EXP_MANAGER_H__ #define __AE_EXP_MANAGER_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager : public ae_object { public : // ======================================================================= // Constructors // ======================================================================= ae_exp_manager( void ); // ======================================================================= // Destructors // ======================================================================= virtual ~ae_exp_manager( void ); // ======================================================================= // Accessors: getters // ======================================================================= inline ae_exp_setup* get_exp_s( void ) const; inline ae_population* get_pop( void ) const; inline ae_environment* get_env( void ) const; inline ae_selection* get_sel( void ) const; inline ae_output_manager* get_output_m( void ) const; inline int32_t get_first_gener( void ) const; inline int32_t get_num_gener( void ) const; inline bool quit_signal_received( void ) const; inline int16_t get_nb_env_segments( void ) const; inline ae_selection_scheme get_selection_scheme( void ) const; inline double get_selection_pressure( void ) const; // ------------------------------------------------------ Spatial structure inline bool is_spatially_structured( void ) const; inline ae_spatial_structure* get_spatial_structure( void ) const; inline ae_grid_cell* get_grid_cell( int16_t x, int16_t y ) const; inline int16_t get_grid_width( void ) const; inline int16_t get_grid_height( void ) const; inline ae_grid_cell*** get_pop_grid( void ) const; // -------------------------------------------------------- Global settings inline bool get_with_HT( void ) const; inline bool get_repl_HT_with_close_points ( void ) const; inline double get_HT_ins_rate( void ) const; inline double get_HT_repl_rate( void ) const; inline double get_repl_HT_detach_rate( void ) const; // The ability to own a plasmid is a property of the individuals (_allow_plasmids) because it is used during mutations // However there is also a property of the experimental setup (_with_plasmids) that indicates whether plasmids are used because we need this during replication and during loading/writting // For now when plasmids are used each individual has one and only one plasmid (so these variables should always be equals), however this may change in the future // There is no longer property _with_plasmids_HT because the ability to transfer is evolvable and thus may depend on the plasmid itself inline bool get_with_plasmids( void ) const; inline double get_prob_plasmid_HT( void ) const; inline double get_tune_donor_ability( void ) const; inline double get_tune_recipient_ability( void ) const; inline double get_donor_cost( void ) const; inline double get_recipient_cost( void ) const; inline bool get_swap_GUs( void ) const; inline bool get_with_secretion( void ) const; inline double get_secretion_contrib_to_fitness( void ) const; inline double get_secretion_cost( void ) const; //~ inline bool get_with_alignments( void ) const; // Accessors to population stuff inline ae_list* get_indivs( void ) const; inline int32_t get_nb_indivs( void ) const; inline ae_individual* get_best_indiv( void ) const; inline ae_individual* get_indiv_by_id( int32_t id ) const; inline ae_individual* get_indiv_by_rank( int32_t rank ) const; // Accessors to output manager stuff inline int32_t get_backup_step(void) const; inline int32_t get_big_backup_step(void) const; inline bool get_record_tree( void ) const; inline int32_t get_tree_step( void ) const; inline ae_tree_mode get_tree_mode( void ) const; inline ae_tree* get_tree( void ) const; // ======================================================================= // Accessors: setters // ======================================================================= inline void set_first_gener( int32_t first_gener ); inline void set_nb_gener( int32_t nb_gener ); //~ inline void set_min_genome_length( int32_t min_genome_length ); //~ inline void set_max_genome_length( int32_t max_genome_length ); inline void set_spatial_structure( int16_t grid_width, int16_t grid_height, ae_jumping_mt* prng ); inline void set_with_HT( bool with_HT ) ; inline void set_repl_HT_with_close_points ( bool repl_HT_with_close_points) ; inline void set_HT_ins_rate( double HT_ins_rate) ; inline void set_HT_repl_rate( double HT_repl_rate) ; inline void set_repl_HT_detach_rate( double repl_HT_detach_rate) ; // ======================================================================= // Operators // ======================================================================= // ======================================================================= // Public Methods // ======================================================================= void write_setup_files( void ); void save( void ) const; void save_copy( char* dir, int32_t num_gener = 0 ) const; inline void load( int32_t first_gener, bool use_text_files, bool verbose, bool to_be_run = true ); void load( const char* dir, int32_t first_gener, bool use_text_files, bool verbose, bool to_be_run = true ); void load( int32_t first_gener, char* exp_setup_file_name, char* out_prof_file_name, char* env_file_name, char* pop_file_name, char* sel_file_name, char* sp_struct_file_name, bool verbose, bool to_be_run = true); void run_evolution( void ); virtual void display( void ) {}; // ======================================================================= // Public Attributes // ======================================================================= protected : // ======================================================================= // Forbidden Constructors // ======================================================================= /*ae_exp_manager( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_exp_manager( const ae_exp_manager &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ======================================================================= // Protected Methods // ======================================================================= inline void step_to_next_generation( void ); void load( gzFile& pop_file, gzFile& env_file, gzFile& exp_s_gzfile, FILE*& exp_s_txtfile, gzFile& exp_backup_file, gzFile& sp_struct_file, gzFile& out_p_gzfile, FILE*& out_p_txtfile, bool verbose, bool to_be_run = true ); void create_missing_directories( const char* dir = "." ) const; void open_backup_files( gzFile& env_file, gzFile& pop_file, gzFile& sel_file, gzFile& sp_struct_file, int32_t num_gener, const char mode[3], const char* dir = "." ) const; void close_backup_files( gzFile& env_file, gzFile& pop_file, gzFile& sel_file, gzFile& sp_struct_file ) const; void open_setup_files( gzFile& exp_s_gzfile, FILE*& exp_s_txtfile, gzFile& out_p_gzfile, FILE*& out_p_txtfile, int32_t num_gener, const char mode[3], const char* dir = "." ) const; void close_setup_files( gzFile& exp_s_gzfile, FILE* exp_s_txtfile, gzFile& out_p_gzfile, FILE* out_p_txtfile ) const; // ======================================================================= // Protected Attributes // ======================================================================= // ---------------------------------------------------- Experimental setup ae_exp_setup* _exp_s; // ------------------------------------------------------------ Population ae_population* _pop; // ----------------------------------------------------------- Environment ae_environment* _env; // ----------------------------------------------------- Spatial structure ae_spatial_structure* _spatial_structure; // -------------------------------------------------------- Output manager ae_output_manager* _output_m; // -------------------------- Generation numbers (first, last and current) int32_t _first_gener; int32_t _last_gener; int32_t _num_gener; // Set to true when ctrl-Q is received. Will cause the simulation // to be ended after current generation is completed bool _quit_signal_received; }; // =========================================================================== // Getters' definitions // =========================================================================== inline ae_population* ae_exp_manager::get_pop( void ) const { return _pop; } inline ae_exp_setup* ae_exp_manager::get_exp_s( void ) const { return _exp_s; } inline ae_output_manager* ae_exp_manager::get_output_m( void ) const { return _output_m; } inline int32_t ae_exp_manager::get_first_gener( void ) const { return _first_gener; } inline int32_t ae_exp_manager::get_num_gener( void ) const { return _num_gener; } inline bool ae_exp_manager::quit_signal_received( void ) const { return _quit_signal_received; } inline ae_environment* ae_exp_manager::get_env( void ) const { return _env; } inline ae_selection* ae_exp_manager::get_sel( void ) const { return get_exp_s()->get_sel(); } inline int16_t ae_exp_manager::get_nb_env_segments( void ) const { return get_env()->get_nb_segments(); } inline ae_selection_scheme ae_exp_manager::get_selection_scheme( void ) const { return get_sel()->get_selection_scheme(); } inline double ae_exp_manager::get_selection_pressure( void ) const { return get_sel()->get_selection_pressure(); } // Global settings inline bool ae_exp_manager::is_spatially_structured( void ) const { return ( get_spatial_structure() != NULL ); } inline ae_spatial_structure* ae_exp_manager::get_spatial_structure( void ) const { return _spatial_structure; } inline ae_grid_cell* ae_exp_manager::get_grid_cell( int16_t x, int16_t y ) const { return get_spatial_structure()->get_grid_cell( x, y ); } inline int16_t ae_exp_manager::get_grid_width( void ) const { return get_spatial_structure()->get_grid_width(); } inline int16_t ae_exp_manager::get_grid_height( void ) const { return get_spatial_structure()->get_grid_height(); } inline ae_grid_cell*** ae_exp_manager::get_pop_grid( void ) const { return get_spatial_structure()->get_pop_grid(); } inline bool ae_exp_manager::get_with_HT( void ) const { return get_exp_s()->get_with_HT(); } inline bool ae_exp_manager::get_repl_HT_with_close_points ( void ) const { return get_exp_s()->get_repl_HT_with_close_points(); } inline double ae_exp_manager::get_HT_ins_rate( void ) const { return get_exp_s()->get_HT_ins_rate(); } inline double ae_exp_manager::get_HT_repl_rate( void ) const { return get_exp_s()->get_HT_repl_rate(); } inline double ae_exp_manager::get_repl_HT_detach_rate( void ) const { return get_exp_s()->get_repl_HT_detach_rate(); } inline bool ae_exp_manager::get_with_plasmids( void ) const { return get_exp_s()->get_with_plasmids(); } inline double ae_exp_manager::get_prob_plasmid_HT( void ) const { return get_exp_s()->get_prob_plasmid_HT(); } inline double ae_exp_manager::get_tune_donor_ability( void ) const { return get_exp_s()->get_tune_donor_ability(); } inline double ae_exp_manager::get_tune_recipient_ability( void ) const { return get_exp_s()->get_tune_recipient_ability(); } inline double ae_exp_manager::get_donor_cost( void ) const { return get_exp_s()->get_donor_cost(); } inline double ae_exp_manager::get_recipient_cost( void ) const { return get_exp_s()->get_recipient_cost(); } inline bool ae_exp_manager::get_swap_GUs( void ) const { return get_exp_s()->get_swap_GUs(); } inline bool ae_exp_manager::get_with_secretion( void ) const { return get_exp_s()->get_with_secretion(); } inline double ae_exp_manager::get_secretion_contrib_to_fitness( void ) const { return get_exp_s()->get_secretion_contrib_to_fitness(); } inline double ae_exp_manager::get_secretion_cost( void ) const { return get_exp_s()->get_secretion_cost(); } //~ inline bool ae_exp_manager::get_with_alignments( void ) const //~ { //~ return _exp_s->get_with_alignments(); //~ } // Accessors to population stuff inline int32_t ae_exp_manager::get_nb_indivs( void ) const { return get_pop()->get_nb_indivs(); } inline ae_individual* ae_exp_manager::get_best_indiv( void ) const { return get_pop()->get_best(); } inline ae_list* ae_exp_manager::get_indivs( void ) const { return get_pop()->get_indivs(); } inline ae_individual * ae_exp_manager::get_indiv_by_id( int32_t id ) const { return get_pop()->get_indiv_by_id( id ); } inline ae_individual * ae_exp_manager::get_indiv_by_rank( int32_t rank ) const { return get_pop()->get_indiv_by_rank( rank ); } // Accessors to output manager stuff inline int32_t ae_exp_manager::get_backup_step(void) const { return get_output_m()->get_backup_step(); } inline int32_t ae_exp_manager::get_big_backup_step(void) const { return get_output_m()->get_big_backup_step(); } inline bool ae_exp_manager::get_record_tree( void ) const { return get_output_m()->get_record_tree(); } inline int32_t ae_exp_manager::get_tree_step( void ) const { return get_output_m()->get_tree_step(); } inline ae_tree_mode ae_exp_manager::get_tree_mode( void ) const { return get_output_m()->get_tree_mode(); } inline ae_tree* ae_exp_manager::get_tree( void ) const { return get_output_m()->get_tree(); } // =========================================================================== // Setters' definitions // =========================================================================== inline void ae_exp_manager::set_first_gener( int32_t first_gener ) { _num_gener = _first_gener = first_gener; } inline void ae_exp_manager::set_nb_gener( int32_t nb_gener ) { _last_gener = _first_gener + nb_gener; } // Global constraints //~ inline void ae_exp_manager::set_min_genome_length( int32_t min_genome_length ) //~ { //~ _exp_s->set_min_genome_length( min_genome_length ); //~ } //~ inline void ae_exp_manager::set_max_genome_length( int32_t max_genome_length ) //~ { //~ _exp_s->set_max_genome_length( max_genome_length ); //~ } inline void ae_exp_manager::set_spatial_structure( int16_t grid_width, int16_t grid_height, ae_jumping_mt* prng ) { _spatial_structure = new ae_spatial_structure(); _spatial_structure->set_grid_size( grid_width, grid_height ); _spatial_structure->set_prng( prng ); } inline void ae_exp_manager::set_with_HT( bool with_HT ) { _exp_s->set_with_HT( with_HT ); } inline void ae_exp_manager::set_repl_HT_with_close_points ( bool repl_HT_with_close_points) { _exp_s->set_repl_HT_with_close_points( repl_HT_with_close_points ); } inline void ae_exp_manager::set_HT_ins_rate( double HT_ins_rate) { _exp_s->set_HT_ins_rate( HT_ins_rate ); } inline void ae_exp_manager::set_HT_repl_rate( double HT_repl_rate) { _exp_s->set_HT_repl_rate( HT_repl_rate ); } inline void ae_exp_manager::set_repl_HT_detach_rate( double repl_HT_detach_rate) { _exp_s->set_repl_HT_detach_rate( repl_HT_detach_rate ); } // =========================================================================== // Operators' definitions // =========================================================================== // =========================================================================== // Inline methods' definition // =========================================================================== inline void ae_exp_manager::step_to_next_generation( void ) { // Apply environmental variation _env->apply_variation(); // Apply environmental noise _env->apply_noise(); _exp_s->step_to_next_generation(); _num_gener++; } /*! \brief Load an experiment with default files from the current directory */ inline void ae_exp_manager::load( int32_t first_gener, bool use_text_files, bool verbose, bool to_be_run /* = true */ ) { load( ".", first_gener, use_text_files, verbose, to_be_run ); } #endif // __AE_EXP_MANAGER_H__ aevol-4.4/src/libaevol/ae_phenotype.h0000644000175000017500000001120512231437075014630 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_PHENOTYPE_H__ #define __AE_PHENOTYPE_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #ifdef __X11 #include #endif // ================================================================= // Class declarations // ================================================================= class ae_individual; #ifdef __NO_X class ae_phenotype : public ae_fuzzy_set #elif defined __X11 class ae_phenotype : public ae_fuzzy_set_X11 #else #error You must specify a graphic option #endif { public : // ================================================================= // Constructors // ================================================================= ae_phenotype( void ); ae_phenotype( ae_individual* indiv ); ae_phenotype( ae_individual* indiv, const ae_phenotype &model ); // ================================================================= // Destructors // ================================================================= virtual ~ae_phenotype( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_phenotype( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; ae_phenotype( const ae_phenotype &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_individual* _indiv; }; // ===================================================================== // Accessors definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_PHENOTYPE_H__ aevol-4.4/src/libaevol/ae_rna.cpp0000644000175000017500000001216112231437075013732 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include #include //############################################################################## // # // Class ae_rna # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_rna::ae_rna( ae_genetic_unit* gen_unit, const ae_rna &model ) { // Copy "trivial" attributes _gen_unit = gen_unit; _strand = model._strand; _pos = model._pos; _transcript_length = model._transcript_length; _basal_level = model._basal_level; // Copy transcribed proteins // WARNING : Since this list do not "own" the proteins (they will not be deleted) // proteins must NOT be CREATED here. _transcribed_proteins = new ae_list(); // TODO : Not needed for the moment... //~ ae_list_node* prot_node = model._transcribed_proteins->get_first(); //~ ae_protein* prot; //~ while ( prot_node != NULL ) //~ { //~ prot = prot_node->get_obj(); //~ _transcribed_proteins->add( prot ); //~ prot_node = prot_node->get_next(); //~ } } ae_rna::ae_rna( ae_genetic_unit* gen_unit ) { _gen_unit = gen_unit; _transcribed_proteins = new ae_list(); } ae_rna::ae_rna( ae_genetic_unit* gen_unit, ae_strand strand, int32_t pos, int8_t diff ) { _gen_unit = gen_unit; _strand = strand; _pos = pos; _transcript_length = -1; _basal_level = 1 - (double)diff / (PROM_MAX_DIFF + 1); _transcribed_proteins = new ae_list(); } /* ae_rna::ae_rna( ae_rna* parent ) { _gen_unit = parent->_gen_unit; _strand = parent->_strand; _pos = parent->_pos; _transcript_length = parent->_transcript_length; _basal_level = parent->_basal_level; } */ // ================================================================= // Destructors // ================================================================= ae_rna::~ae_rna( void ) { _transcribed_proteins->erase( false ); delete _transcribed_proteins; } // ================================================================= // Public Methods // ================================================================= int32_t ae_rna::get_first_transcribed_pos( void ) const { if ( _strand == LEADING ) { return ae_utils::mod( _pos + PROM_SIZE, _gen_unit->get_dna()->get_length() ); } else { return ae_utils::mod( _pos - PROM_SIZE, _gen_unit->get_dna()->get_length() ); } } int32_t ae_rna::get_last_transcribed_pos( void ) const { if ( _strand == LEADING ) { return ae_utils::mod( _pos + PROM_SIZE + _transcript_length - 1, _gen_unit->get_dna()->get_length() ); } else { return ae_utils::mod( _pos - (PROM_SIZE + _transcript_length - 1), _gen_unit->get_dna()->get_length() ); } } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_grid_cell.cpp0000644000175000017500000000702412231437075015100 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_grid_cell # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_grid_cell::ae_grid_cell( int16_t x, int16_t y, ae_individual* indiv ) { _x = x; _y = y; _compound_amount = 0.0; _individual = indiv; } ae_grid_cell::ae_grid_cell( gzFile backup_file ) { gzread( backup_file, &_x, sizeof(_x) ); gzread( backup_file, &_y, sizeof(_y) ); gzread( backup_file, &_compound_amount, sizeof(_compound_amount) ); _individual = NULL; } // ================================================================= // Destructors // ================================================================= ae_grid_cell::~ae_grid_cell( void ) { } // ================================================================= // Public Methods // ================================================================= void ae_grid_cell::save( gzFile backup_file ) const { gzwrite( backup_file, &_x, sizeof(_x) ); gzwrite( backup_file, &_y, sizeof(_y) ); gzwrite( backup_file, &_compound_amount, sizeof(_compound_amount) ); } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_population.cpp0000644000175000017500000002732312364503705015353 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #ifdef __NO_X #ifndef __REGUL #else #include #endif #elif defined __X11 #ifndef __REGUL #include #else #include #endif #endif #include #include //############################################################################## // # // Class ae_population # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_population::ae_population( ae_exp_manager* exp_m ) { _exp_m = exp_m; #ifndef DISTRIBUTED_PRNG _mut_prng = NULL; _stoch_prng = NULL; _stoch_prng_bak = NULL; #endif // Individuals _nb_indivs = 0; _indivs = new ae_list(); } // ================================================================= // Destructors // ================================================================= ae_population::~ae_population( void ) { #ifndef DISTRIBUTED_PRNG delete _mut_prng; delete _stoch_prng; delete _stoch_prng_bak; #endif _indivs->erase( true ); delete _indivs; } // ================================================================= // Public Methods // ================================================================= void ae_population::set_nb_indivs(int32_t nb_indivs) { int32_t index_to_duplicate; ae_individual* indiv = NULL; if(nb_indivs > _nb_indivs) { int32_t initial_pop_size = _nb_indivs; for(int32_t i = initial_pop_size; i < nb_indivs; i++) { index_to_duplicate = _exp_m->get_sel()->get_prng()->random( initial_pop_size ); indiv = new ae_individual(*get_indiv_by_id(index_to_duplicate), true); indiv->set_id(i); add_indiv(indiv); } } else if(nb_indivs < _nb_indivs) { ae_list* new_population = new ae_list(); for(int32_t i = 0; i < nb_indivs; i++) { index_to_duplicate = _exp_m->get_sel()->get_prng()->random( _nb_indivs ); indiv = new ae_individual(*get_indiv_by_id(index_to_duplicate), true); indiv->set_id(i); new_population->add(indiv); } update_population(new_population); } sort_individuals(); } void ae_population::replace_population(ae_list* new_indivs) { // First replace the former indivs by the new ones update_population(new_indivs); // Then reconciliate any possible inconsistency... // Update pointer to exp_manager in each individual // Replace indivs id by a new one ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv = NULL; int32_t id = 0; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); indiv->set_exp_m(_exp_m); indiv->set_id(id++); indiv_node = indiv_node->get_next(); } } void ae_population::save( gzFile backup_file ) const { // Write population intrinsic data #ifndef DISTRIBUTED_PRNG _mut_prng->save( backup_file ); int8_t tmp_with_stoch = _stoch_prng == NULL ? 0 : 1; gzwrite( backup_file, &tmp_with_stoch, sizeof(tmp_with_stoch) ); if ( tmp_with_stoch ) { _stoch_prng->save( backup_file ); } #endif gzwrite( backup_file, &_nb_indivs, sizeof(_nb_indivs) ); // Write individuals ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); indiv->save( backup_file ); indiv_node = indiv_node->get_next(); } } void ae_population::load( gzFile backup_file, bool verbose ) { // --------------------------------------- Retreive population intrinsic data #ifndef DISTRIBUTED_PRNG _mut_prng = new ae_jumping_mt( backup_file ); int8_t tmp_with_stoch; gzread( backup_file, &tmp_with_stoch, sizeof(tmp_with_stoch) ); if ( tmp_with_stoch ) { _stoch_prng = new ae_jumping_mt( backup_file ); } #endif gzread( backup_file, &_nb_indivs, sizeof(_nb_indivs) ); // ----------------------------------------------------- Retreive individuals if ( verbose ) printf( " Loading individuals " ); ae_individual* indiv = NULL; int32_t nb_ind_div_10 = _nb_indivs / 10; for ( int32_t i = 0 ; i < _nb_indivs ; i++ ) { if ( verbose && i && i % nb_ind_div_10 == 0 ) { putchar( '*' ); fflush( stdout ); } #ifdef __NO_X #ifndef __REGUL indiv = new ae_individual( _exp_m, backup_file ); #else indiv = new ae_individual_R( _exp_m, backup_file ); #endif #elif defined __X11 #ifndef __REGUL indiv = new ae_individual_X11( _exp_m, backup_file ); #else indiv = new ae_individual_R_X11( _exp_m, backup_file ); #endif #endif _indivs->add( indiv ); } } void ae_population::load(const char* backup_file_name, bool verbose) { gzFile backup_file = gzopen(backup_file_name, "r"); if ( backup_file == Z_NULL ) { printf( "%s:%d: error: could not open pop file %s\n", __FILE__, __LINE__, backup_file_name ); exit( EXIT_FAILURE ); } this->load(backup_file, verbose); } #ifndef DISTRIBUTED_PRNG void ae_population::backup_stoch_prng( void ) { delete _stoch_prng_bak; _stoch_prng_bak = new ae_jumping_mt( *_stoch_prng ); } #endif // ================================================================= // Protected Methods // ================================================================= void ae_population::sort_individuals( void ) { // Insertion sort ae_list_node* last_sorted = _indivs->get_first(); ae_list_node* comp = NULL; ae_list_node* item_to_sort = NULL; double fit_comp; double fitness_to_sort; bool is_sorted; // only "pop_size - 1" iterations since the first item is already "sorted" for ( int32_t nb_sorted = 1 ; nb_sorted < _nb_indivs ; nb_sorted++ ) { item_to_sort = last_sorted->get_next(); fitness_to_sort = item_to_sort->get_obj()->get_fitness(); is_sorted = false; comp = last_sorted; // looking for its place among the sorted items while ( !is_sorted ) { fit_comp = comp->get_obj()->get_fitness(); if ( fitness_to_sort >= fit_comp ) // The right place of the item is after comp { if ( item_to_sort->get_prev() == comp ) { // item_to_sort is already at the right place is_sorted = true; last_sorted = item_to_sort; } // item_to_sort has to be inserted just after comp _indivs->remove( item_to_sort, false, false ); _indivs->insert_after( item_to_sort, comp ); is_sorted = true; } else { // move on to compare with the next item comp = comp->get_prev(); } if ( comp == NULL ) { // item_to_sort has to be inserted at the beginning of the list _indivs->remove( item_to_sort, false, false ); _indivs->add_front( item_to_sort ); is_sorted = true; } } } // Update the rank of the individuals ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv = NULL; for ( int32_t rank = 1 ; rank <= _nb_indivs ; rank++ ) { indiv = indiv_node->get_obj(); indiv->set_rank( rank ); indiv_node = indiv_node->get_next(); } } // Find the best individual and put it at the end of the list: this is quicker than sorting the whole list in case we only need the best individual, for example when we have spatial structure. void ae_population::update_best( void ) { ae_list_node* current_best = _indivs->get_first(); ae_list_node* candidate = _indivs->get_first(); while ( candidate != NULL ) { if ( candidate->get_obj()->get_fitness() >= current_best->get_obj()->get_fitness() ) { current_best = candidate; } candidate = candidate->get_next(); } _indivs->remove( current_best, false, false ); _indivs->add( current_best ); current_best->get_obj()->set_rank( _nb_indivs ); } // The new pop must be consistent and belong to the same experiment as the one // it replaces, otherwise use replace_population void ae_population::update_population(ae_list* new_indivs) { // Delete the former indivs _indivs->erase( true ); delete _indivs; // Replace with new indivs _indivs = new_indivs; _nb_indivs = _indivs->get_nb_elts(); } ae_individual* ae_population::create_clone( ae_individual* dolly, int32_t id ) { ae_individual* indiv; #ifdef __NO_X #ifndef __REGUL indiv = new ae_individual( *dolly, false ); #else indiv = new ae_individual_R( *(dynamic_cast(dolly)) , false); #endif #elif defined __X11 #ifndef __REGUL indiv = new ae_individual_X11( *(dynamic_cast(dolly)), false ); #else indiv = new ae_individual_R_X11( *(dynamic_cast(dolly)), false ); #endif #endif indiv->set_id( id ); return indiv; } // ================================================================= // Non inline accessors // ================================================================= ae_individual* ae_population::get_indiv_by_id( int32_t id ) const { ae_list_node* indiv_node = _indivs->get_first(); ae_individual* indiv; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); if ( indiv->get_id() == id ) { return indiv; } indiv_node = indiv_node->get_next(); } return NULL; } aevol-4.4/src/libaevol/ae_tree.cpp0000644000175000017500000003021312364050651014105 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include //############################################################################## // # // Class ae_tree # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= const int32_t ae_tree::NO_PARENT = -1; // ================================================================= // Constructors // ================================================================= ae_tree::ae_tree( ae_exp_manager* exp_m, ae_tree_mode tree_mode, int32_t tree_step ) { _exp_m = exp_m; _tree_mode = tree_mode; _tree_step = tree_step; switch ( _tree_mode ) { case NORMAL : { _nb_indivs = new int32_t [_tree_step]; _replics = new ae_replication_report** [_tree_step]; // All pointers in the _replics table must be set to NULL, otherwise // the destructor won't work properly if called before the matrix was // filled for ( int32_t i = 0 ; i < tree_step ; i++ ) { _replics[i] = NULL; } break; } case LIGHT : { // TO DO //~ // Creates the big arrays to store number of individuals and child->parent relations //~ _nb_indivs = new int32_t[ae_common::nb_generations]; //~ _parent = new int32_t*[ae_common::nb_generations]; //~ _parent[0] = new int32_t[ae_common::init_params->get_init_pop_size()]; //~ _nb_indivs[0] = ae_common::init_params->get_init_pop_size(); //~ // Individuals from the initial population don't have parents //~ for ( int32_t i = 0 ; i < _nb_indivs[0] ; i++ ) //~ { //~ _parent[0][i] = NO_PARENT; //~ } break; } } } ae_tree::ae_tree( ae_exp_manager* exp_m, char* tree_file_name ) { _exp_m = exp_m; _tree_mode = _exp_m->get_tree_mode(); _tree_step = _exp_m->get_tree_step(); switch ( _tree_mode ) { case NORMAL : { gzFile tree_file = gzopen( tree_file_name, "r" ); if ( tree_file == Z_NULL ) { printf( "ERROR : Could not read tree file %s\n", tree_file_name ); exit( EXIT_FAILURE ); } ae_replication_report * replic_report = NULL; _nb_indivs = new int32_t[_tree_step]; _replics = new ae_replication_report**[_tree_step]; gzread( tree_file, _nb_indivs, _tree_step * sizeof(_nb_indivs[0]) ); for ( int32_t gener_i = 0 ; gener_i < _tree_step ; gener_i++ ) { _replics[gener_i] = new ae_replication_report*[_nb_indivs[gener_i]]; for ( int32_t indiv_i = 0 ; indiv_i < _nb_indivs[gener_i] ; indiv_i++ ) { // Retreive a replication report replic_report = new ae_replication_report( tree_file, NULL ); // Put it at its rightful position _replics[gener_i][replic_report->get_id()] = replic_report; } } gzclose( tree_file ); break; } case LIGHT : { // TODO break; } } } // ================================================================= // Destructors // ================================================================= ae_tree::~ae_tree( void ) { switch ( _tree_mode ) { case NORMAL : { if ( _replics != NULL ) { for ( int32_t i = 0 ; i < _tree_step ; i++ ) { if ( _replics[i] != NULL ) { for ( int32_t j = 0 ; j < _nb_indivs[i] ; j++ ) { delete _replics[i][j]; } delete [] _replics[i]; } } delete [] _replics; } break; } case LIGHT : { //~ for( int32_t n = 0 ; n < ae_common::nb_generations ; n++ ) //~ { //~ delete _parent[n]; //~ } //~ delete [] _parent; break; } } delete [] _nb_indivs; } // ================================================================= // Public Methods // ================================================================= int32_t ae_tree::get_nb_indivs( int32_t generation ) const { return _nb_indivs[ae_utils::mod(generation - 1, _tree_step)]; } ae_replication_report * ae_tree::get_report_by_index( int32_t generation, int32_t index ) const { assert( _tree_mode == NORMAL ); return _replics[ae_utils::mod(generation - 1, _tree_step)][index]; } ae_replication_report * ae_tree::get_report_by_rank( int32_t generation, int32_t rank ) const { assert( _tree_mode == NORMAL ); int32_t nb_indivs = get_nb_indivs( generation ); assert( rank <= nb_indivs ); for ( int32_t i = 0 ; i < nb_indivs ; i++ ) { if ( _replics[ae_utils::mod(generation - 1, _tree_step)][i]->get_rank() == rank ) { return _replics[ae_utils::mod(generation - 1, _tree_step)][i]; } } fprintf( stderr, "ERROR: Couldn't find indiv with rank %"PRId32" in file %s:%d\n", rank, __FILE__, __LINE__ ); return NULL; } void ae_tree::set_nb_indivs (int32_t nb_indivs, int32_t generation) { _nb_indivs[ae_utils::mod(generation - 1, _tree_step)] = nb_indivs; } void ae_tree::fill_tree_with_cur_gener( void ) { assert( _exp_m != NULL && _exp_m->get_num_gener() > 0 ); switch ( _tree_mode ) { case NORMAL : { // -1 because the tree's arrays contain information on // generations n*TREE_STEP+1 --> (n+1)*_tree_step // (for _tree_step == 100, information on generations // 1 to 100, or 101 to 200, or 201 to 300, etc) int32_t gener_i = ae_utils::mod( _exp_m->get_num_gener() - 1, _tree_step ); _nb_indivs[gener_i] = _exp_m->get_pop()->get_nb_indivs(); _replics[gener_i] = new ae_replication_report* [_nb_indivs[gener_i]]; ae_list_node* indiv_node = _exp_m->get_indivs()->get_first(); ae_individual* indiv = NULL; int32_t num_indiv = 0; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); _replics[gener_i][num_indiv++] = indiv->get_replic_report(); indiv_node = indiv_node->get_next(); } break; } case LIGHT : { // TO DO // TO CHECK !! // not sure that gener_i should be used in this block... // int32_t gener_i = ae_utils::mod( _exp_m->get_num_gener() - 1, _tree_step ); // _nb_indivs[gener_i] = _exp_m->get_nb_indivs(); // _parent[gener_i] = new int32_t [_nb_indivs[gener_i]]; // ae_list_node* indiv_node = _exp_m->get_indivs()->get_first(); // ae_individual* indiv = NULL; // int32_t num_indiv = 0; // while( indiv_node != NULL ) // { // indiv = indiv_node->get_obj(); // _parent[gener_i][num_indiv++] = indiv->get_replic_report()->get_parent_id(); // indiv_node = indiv_node->get_next(); // } break; } } } void ae_tree::write_to_tree_file( gzFile tree_file ) { switch ( _tree_mode ) { case NORMAL : { // Write the tree in the backup gzwrite( tree_file, &_nb_indivs[0], _tree_step * sizeof(_nb_indivs[0]) ); for ( int32_t gener_i = 0 ; gener_i < _tree_step ; gener_i++ ) { for ( int32_t indiv_i = 0 ; indiv_i < _nb_indivs[gener_i] ; indiv_i++ ) { assert(_replics[gener_i][indiv_i] != NULL); _replics[gener_i][indiv_i]->write_to_tree_file( tree_file ); } } // Reinitialize the tree for ( int32_t gener_i = 0 ; gener_i < _tree_step ; gener_i++ ) { for ( int32_t indiv_i = 0 ; indiv_i < _nb_indivs[gener_i] ; indiv_i++ ) { delete _replics[gener_i][indiv_i]; _replics[gener_i][indiv_i] = NULL; } delete [] _replics[gener_i]; _replics[gener_i] = NULL; } break; } case LIGHT : { // TODO : ? break; } } } // ================================================================= // Non-inline accessors' definition // ================================================================= void ae_tree::set_replic_report( int32_t id, ae_replication_report* replic_report ) { assert( _tree_mode == NORMAL ); int32_t gener_i = ae_utils::mod(_exp_m->get_num_gener() - 1, _tree_step); // CK: BUGFIX. Previous expression was: _exp_m->get_num_gener() % _tree_step; if ( _replics[gener_i] == NULL ) { _replics[gener_i] = new ae_replication_report* [_exp_m->get_nb_indivs()]; memset( _replics[gener_i], 0, _exp_m->get_nb_indivs() * sizeof( *_replics ) ); } assert( _replics[gener_i][id] == NULL ); _replics[gener_i][id] = new ae_replication_report(*replic_report); } // CK: Added for aevol_modify void ae_tree::set_replic_report( int32_t generation, int32_t id, ae_replication_report* replic_report ) { assert( _tree_mode == NORMAL ); int32_t g = ae_utils::mod(generation - 1, _tree_step); if ( _replics[g] == NULL ) { _replics[g] = new ae_replication_report* [_exp_m->get_nb_indivs()]; memset( _replics[g], 0, _exp_m->get_nb_indivs() * sizeof( *_replics ) ); } if ( _replics[g][id] != NULL ) { printf("Erased previous replication report for indiv %d of generation %d (%d)\n", id, generation, g); delete _replics[g][id]; } _replics[g][id] = new ae_replication_report(*replic_report); _replics[g][id]->set_id(id); // debug printf("Added replication report for indiv %d of generation %d (%d) :\n", id, generation, g); printf(" ID %d \n", _replics[g][id]->get_id() ); printf(" Rank %d \n", _replics[g][id]->get_rank() ); printf(" Genome size %d \n", _replics[g][id]->get_genome_size() ); printf(" P. ID %d \n", _replics[g][id]->get_parent_id() ); printf(" P. met.err. %f \n", _replics[g][id]->get_parent_metabolic_error() ); printf(" P. size %d \n", _replics[g][id]->get_parent_genome_size() ); } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/f_line.cpp0000644000175000017500000000571112231437075013744 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= //############################################################################## // # // Class f_line # // # //############################################################################## // ================================================================= // Constructors // ================================================================= f_line::f_line( void ) { nb_words = 0; } // ================================================================= // Destructors // ================================================================= // ================================================================= // Public Methods // ================================================================= // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_point_1d.h0000644000175000017500000001402312231437075014333 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_POINT_1D_H__ #define __AE_POINT_1D_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= // ================================================================= // Class declarations // ================================================================= class ae_point_1d : public ae_object { public : // ================================================================= // Constructors // ================================================================= inline ae_point_1d( void ); inline ae_point_1d( double x ); inline ae_point_1d( const ae_point_1d& source ); inline ae_point_1d( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= inline virtual ~ae_point_1d( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= inline void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= double x; protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_point_1d( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; /* ae_point_1d( const ae_point_1d &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= }; //############################################################################## // # // Class ae_point_1d # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= inline ae_point_1d::ae_point_1d( void ) { x = -1; } inline ae_point_1d::ae_point_1d( double x ) { this->x = x; } inline ae_point_1d::ae_point_1d( const ae_point_1d& source ) { this->x = source.x; } inline ae_point_1d::ae_point_1d( gzFile backup_file ) { gzread( backup_file, &x, sizeof(x) ); } // ================================================================= // Destructors // ================================================================= inline ae_point_1d::~ae_point_1d( void ) { } // ===================================================================== // Accessors definitions // ===================================================================== // ================================================================= // Public Methods // ================================================================= inline void ae_point_1d::save( gzFile backup_file ) { gzwrite( backup_file, &x, sizeof(x) ); } // ================================================================= // Protected Methods // ================================================================= #endif // __AE_POINT_1D_H__ aevol-4.4/src/libaevol/param_loader.cpp0000644000175000017500000020525712364241137015144 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #include #include #include #include //~ #ifdef __X11 //~ #include //~ #endif #ifdef __REGUL #include #endif // ================================================================= // Class declarations // ================================================================= class ae_environment; //############################################################################## // # // Class param_loader # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= static const int8_t STRAIN_NAME_DEFAULT_SIZE = 20; static const int8_t STRAIN_NAME_LOGIN_SIZE = 10; #ifndef LOGIN_NAME_MAX #define LOGIN_NAME_MAX 256 #endif // ================================================================= // Constructors // ================================================================= param_loader::param_loader( const char* file_name ) { // Give default values to parameters // ----------------------------------------- PseudoRandom Number Generators _seed = 0; _mut_seed = 0; _stoch_seed = 0; _env_var_seed = 0; _env_noise_seed = 0; // ------------------------------------------------------------ Constraints _min_genome_length = 10; _max_genome_length = 10000000; _w_max = 0.033333333; // ----------------------------------------------------- Initial conditions _chromosome_initial_length = 5000; _init_method = ONE_GOOD_GENE | CLONE; _init_pop_size = 1000; _strain_name = new char[STRAIN_NAME_DEFAULT_SIZE+1]; char* login_name = new char[LOGIN_NAME_MAX+1]; // Try get user login. If fail, replace by default value if(getlogin_r(login_name, LOGIN_NAME_MAX) != 0) strcpy(login_name, "anon"); // Copy login into strain name with at most STRAIN_NAME_LOGIN_SIZE characters strncpy(_strain_name, login_name, STRAIN_NAME_LOGIN_SIZE); delete [] login_name; // Null-terminate the c-string if the max number of characters were copied if (_strain_name[STRAIN_NAME_LOGIN_SIZE] != 0) _strain_name[STRAIN_NAME_LOGIN_SIZE + 1] = 0; // Append with a hyphen and a series of random digits int strain_name_len = strlen(_strain_name); _strain_name[strain_name_len++] = '-'; srand(time(NULL)); while (strain_name_len < STRAIN_NAME_DEFAULT_SIZE) { // Don't care for uniform distrib, using simple and ugly rand() % X _strain_name[strain_name_len++] = '0' + rand() % 10; } // ------------------------------------------------------------ Environment _env_gaussians = NULL; _env_custom_points = NULL; _env_sampling = 300; // ---------------------------------------- Environment x-axis segmentation _env_axis_nb_segments = 1; _env_axis_segment_boundaries = NULL; _env_axis_features = NULL; _env_axis_separate_segments = false; // -------------------------------------------------- Environment variation _env_var_method = NO_VAR; _env_var_sigma = 0; _env_var_tau = 0; // ------------------------------------------------------ Environment noise _env_noise_method = NO_NOISE; _env_noise_alpha = 0; _env_noise_sigma = 0; _env_noise_prob = 0; _env_noise_sampling_log = 0; // --------------------------------------------------------- Mutation rates _point_mutation_rate = 1e-5; _small_insertion_rate = 1e-5; _small_deletion_rate = 1e-5; _max_indel_size = 6; // -------------------------------------------- Rearrangements and Transfer _with_4pts_trans = true; _with_alignments = false; _with_HT = false; _repl_HT_with_close_points = false; _HT_ins_rate = 0.0; _HT_repl_rate = 0.0; _repl_HT_detach_rate = 0.0; // ------------------------------ Rearrangement rates (without alignements) _duplication_rate = 1e-5; _deletion_rate = 1e-5; _translocation_rate = 1e-5; _inversion_rate = 1e-5; // --------------------------------- Rearrangement rates (with alignements) _neighbourhood_rate = 5e-5; _duplication_proportion = 0.3; _deletion_proportion = 0.3; _translocation_proportion = 0.3; _inversion_proportion = 0.3; // ------------------------------------------------------------ Alignements _align_fun_shape = SIGMOID; _align_sigm_lambda = 4; _align_sigm_mean = 50; _align_lin_min = 0; _align_lin_max = 100; _align_max_shift = 20; _align_w_zone_h_len = 50; _align_match_bonus = 1; _align_mismatch_cost = 2; // ----------------------------------------------- Phenotypic Stochasticity _with_stochasticity = false; // -------------------------------------------------------------- Selection _selection_scheme = RANK_EXPONENTIAL; _selection_pressure = 0.998; // ------------------------------------------------------ Spatial structure _spatially_structured = false; _grid_width = 0; _grid_height = 0; _migration_number = 0; // -------------------------------------------------------------- Secretion _with_secretion = false; _secretion_contrib_to_fitness = 0; _secretion_diffusion_prop = 0; _secretion_degradation_prop = 0; _secretion_cost = 0; _secretion_init = 0; // --------------------------------------------------------------- Plasmids _allow_plasmids = false; _plasmid_initial_length = -1; _plasmid_initial_gene = 0; _plasmid_minimal_length = -1; _plasmid_maximal_length = -1; _chromosome_minimal_length = -1; _chromosome_maximal_length = -1; _prob_plasmid_HT = 0; _tune_donor_ability = 0; _tune_recipient_ability = 0; _donor_cost = 0; _recipient_cost = 0; _compute_phen_contrib_by_GU = false; _swap_GUs = false; // ------------------------------------------------------- Translation cost _translation_cost = 0; // ---------------------------------------------------------------- Outputs _stats = 0; _delete_old_stats = false; // Backups _backup_step = 500; _big_backup_step = 10000; // Tree _record_tree = false; _tree_step = 100; _tree_mode = NORMAL; // Dumps _make_dumps = false; _dump_step = 1000; // Logs _logs = 0; // Other _more_stats = false; #ifdef __REGUL // ------------------------------------------------------- Binding matrix _binding_zeros_percentage = 75; #endif // Read parameter file _param_file_name = strdup( file_name ); _param_file = fopen( _param_file_name, "r" ); if ( _param_file == NULL ) { printf( "ERROR : couldn't open file %s\n", file_name ); exit( EXIT_FAILURE ); } assert( _param_file ); read_file(); } // ================================================================= // Destructors // ================================================================= param_loader::~param_loader( void ) { free( _param_file_name ); fclose( _param_file ); if ( _env_axis_segment_boundaries != NULL ) delete [] _env_axis_segment_boundaries; if ( _env_axis_features != NULL ) delete [] _env_axis_features; if ( _prng != NULL) delete _prng; delete [] _strain_name; } // ================================================================= // Public Methods // ================================================================= void param_loader::interpret_line( f_line* line, int32_t cur_line ) { if ( strcmp( line->words[0], "STRAIN_NAME" ) == 0 ) { delete [] _strain_name; _strain_name = new char[strlen(line->words[1])+1]; strcpy(_strain_name, line->words[1]); } else if ( strcmp( line->words[0], "MAX_TRIANGLE_WIDTH" ) == 0 ) { _w_max = atof( line->words[1] ); } else if ( strcmp( line->words[0], "ENV_AXIS_FEATURES" ) == 0 ) { // Set general segmentation data _env_axis_nb_segments = line->nb_words / 2; // Set segmentation boundaries _env_axis_segment_boundaries = new double [_env_axis_nb_segments + 1]; _env_axis_segment_boundaries[0] = X_MIN; for ( int16_t i = 1 ; i < _env_axis_nb_segments ; i++ ) { _env_axis_segment_boundaries[i] = atof( line->words[2*i] ); } _env_axis_segment_boundaries[_env_axis_nb_segments] = X_MAX; // Set segment features _env_axis_features = new ae_env_axis_feature[_env_axis_nb_segments]; for ( int16_t i = 0 ; i < _env_axis_nb_segments ; i++ ) { if ( strcmp( line->words[2*i+1], "NEUTRAL" ) == 0 ) { _env_axis_features[i] = NEUTRAL; } else if ( strcmp( line->words[2*i+1], "METABOLISM" ) == 0 ) { _env_axis_features[i] = METABOLISM; } else if ( strcmp( line->words[2*i+1], "SECRETION" ) == 0 ) { _with_secretion = true; _env_axis_features[i] = SECRETION; } else if ( strcmp( line->words[2*i+1], "DONOR" ) == 0 ) { _env_axis_features[i] = DONOR; } else if ( strcmp( line->words[2*i+1], "RECIPIENT" ) == 0 ) { _env_axis_features[i] = RECIPIENT; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown axis feature \"%s\".\n", _param_file_name, cur_line, line->words[2*i+1] ); exit( EXIT_FAILURE ); } } } else if ( strcmp( line->words[0], "ENV_SEPARATE_SEGMENTS" ) == 0 ) { _env_axis_separate_segments = true; } else if ( strcmp( line->words[0], "RECORD_TREE" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _record_tree = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _record_tree = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown tree recording option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "TREE_MODE" ) == 0 ) { if ( strcmp( line->words[1], "light" ) == 0 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : the \"light\" tree recording option is not implemented yet.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); // _tree_mode = LIGHT; } else if ( strcmp( line->words[1], "normal" ) == 0 ) { _tree_mode = NORMAL; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown tree mode option (use normal/light).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "MORE_STATS" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _more_stats = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _more_stats = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown more stats option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "DUMP_STEP" ) == 0 ) { _dump_step = atol( line->words[1] ); if (_dump_step>0) _make_dumps = true; } else if ( strcmp( line->words[0], "BACKUP_STEP" ) == 0 ) { _backup_step = atol( line->words[1] ); } else if ( strcmp( line->words[0], "BIG_BACKUP_STEP" ) == 0 ) { _big_backup_step = atol( line->words[1] ); } else if ( strcmp( line->words[0], "TREE_STEP" ) == 0 ) { _tree_step = atol( line->words[1] ); } else if ( strcmp( line->words[0], "CHROMOSOME_INITIAL_LENGTH" ) == 0 ) { _chromosome_initial_length = atol( line->words[1] ); } else if ( strcmp( line->words[0], "MIN_GENOME_LENGTH" ) == 0 ) { if ( strncmp( line->words[1], "NONE", 4 ) == 0 ) { _min_genome_length = 1; // Must not be 0 } else { _min_genome_length = atol( line->words[1] ); if (_min_genome_length == 0 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : MIN_GENOME_LENGTH must be > 0.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } } else if ( strcmp( line->words[0], "MAX_GENOME_LENGTH" ) == 0 ) { if ( strncmp( line->words[1], "NONE", 4 ) == 0 ) { _max_genome_length = INT32_MAX; } else { _max_genome_length = atol( line->words[1] ); } } else if ( strcmp( line->words[0], "INIT_POP_SIZE" ) == 0 ) { _init_pop_size = atol( line->words[1] ); } else if ( strcmp( line->words[0], "POP_STRUCTURE" ) == 0 ) { if ( strcmp( line->words[1], "grid" ) == 0 ) { _spatially_structured = true; _grid_width = atol( line->words[2] ); _grid_height = atol( line->words[3] ); } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown population structure.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "MIGRATION_NUMBER" ) == 0 ) { _migration_number = atol( line->words[1] ); } else if ( strcmp( line->words[0], "INIT_METHOD" ) == 0 ) { for ( int8_t i = 1 ; i < line->nb_words ; i++ ) { if ( strcmp( line->words[i], "ONE_GOOD_GENE" ) == 0 ) { _init_method |= ONE_GOOD_GENE; } else if ( strcmp( line->words[i], "CLONE" ) == 0 ) { _init_method |= CLONE; } else if ( strcmp( line->words[i], "WITH_INS_SEQ" ) == 0 ) { _init_method |= WITH_INS_SEQ; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown initialization method %s.\n", _param_file_name, cur_line, line->words[1] ); exit( EXIT_FAILURE ); } } } else if ( strcmp( line->words[0], "POINT_MUTATION_RATE" ) == 0 ) { _point_mutation_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "SMALL_INSERTION_RATE" ) == 0 ) { _small_insertion_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "SMALL_DELETION_RATE" ) == 0 ) { _small_deletion_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "MAX_INDEL_SIZE" ) == 0 ) { _max_indel_size = atol( line->words[1] ); } else if ( strcmp( line->words[0], "DUPLICATION_RATE" ) == 0 ) { _duplication_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "DELETION_RATE" ) == 0 ) { _deletion_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "TRANSLOCATION_RATE" ) == 0 ) { _translocation_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "INVERSION_RATE" ) == 0 ) { _inversion_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "NEIGHBOURHOOD_RATE" ) == 0 ) { _neighbourhood_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "DUPLICATION_PROPORTION" ) == 0 ) { _duplication_proportion = atof( line->words[1] ); } else if ( strcmp( line->words[0], "DELETION_PROPORTION" ) == 0 ) { _deletion_proportion = atof( line->words[1] ); } else if ( strcmp( line->words[0], "TRANSLOCATION_PROPORTION" ) == 0 ) { _translocation_proportion = atof( line->words[1] ); } else if ( strcmp( line->words[0], "INVERSION_PROPORTION" ) == 0 ) { _inversion_proportion = atof( line->words[1] ); } else if ( strcmp( line->words[0], "ALIGN_FUNCTION" ) == 0 ) { if ( line->nb_words != 2 && line->nb_words != 4 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : incorrect number of parameters for keyword \"%s\".\n", _param_file_name, cur_line, line->words[0] ); exit( EXIT_FAILURE ); } if ( strcmp( line->words[1], "LINEAR" ) == 0 ) { _align_fun_shape = LINEAR; if ( line->nb_words == 4 ) { _align_lin_min = atol( line->words[2] ); _align_lin_max = atol( line->words[3] ); } } else if ( strcmp( line->words[1], "SIGMOID" ) == 0 ) { _align_fun_shape = SIGMOID; if ( line->nb_words == 4 ) { _align_sigm_lambda = atol( line->words[2] ); _align_sigm_mean = atol( line->words[3] ); } } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown align function shape \"%s\".\n", _param_file_name, cur_line, line->words[1] ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "ALIGN_MAX_SHIFT" ) == 0 ) { _align_max_shift = atol( line->words[1] ); } else if ( strcmp( line->words[0], "ALIGN_W_ZONE_H_LEN" ) == 0 ) { _align_w_zone_h_len = atol( line->words[1] ); } else if ( strcmp( line->words[0], "ALIGN_MATCH_BONUS" ) == 0 ) { _align_match_bonus = atol( line->words[1] ); } else if ( strcmp( line->words[0], "ALIGN_MISMATCH_COST" ) == 0 ) { _align_mismatch_cost = atol( line->words[1] ); } else if ( strcmp( line->words[0], "STOCHASTICITY" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _with_stochasticity = true; } } else if ( strcmp( line->words[0], "SELECTION_SCHEME" ) == 0 ) { if ( strncmp( line->words[1], "lin", 3 ) == 0 ) { if ( line->nb_words != 3 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : selection pressure parameter is missing.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } _selection_scheme = RANK_LINEAR; _selection_pressure = atof( line->words[2] ); } else if ( strncmp( line->words[1], "exp", 3 ) == 0 ) { if ( line->nb_words != 3 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : selection pressure parameter is missing.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } _selection_scheme = RANK_EXPONENTIAL; _selection_pressure = atof( line->words[2] ); } else if ( strncmp( line->words[1], "fitness", 7 ) == 0 ) { if ( line->nb_words != 3 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : selection pressure parameter is missing.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } _selection_scheme = FITNESS_PROPORTIONATE; _selection_pressure = atof( line->words[2] ); } else if ( strcmp( line->words[1], "fittest" ) == 0 ) { _selection_scheme = FITTEST; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown selection scheme \"%s\".\n", _param_file_name, cur_line, line->words[1] ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "SEED" ) == 0 ) { static bool seed_already_set = false; if ( seed_already_set ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : duplicate entry for SEED.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } _seed = atol( line->words[1] ); seed_already_set = true; } else if ( strcmp( line->words[0], "MUT_SEED" ) == 0 ) { static bool mut_seed_already_set = false; if ( mut_seed_already_set ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : duplicate entry for MUT_SEED.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } _mut_seed = atol( line->words[1] ); mut_seed_already_set = true; } else if ( strcmp( line->words[0], "STOCH_SEED" ) == 0 ) { static bool stoch_seed_already_set = false; if ( stoch_seed_already_set ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : duplicate entry for STOCH_SEED.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } _stoch_seed = atol( line->words[1] ); stoch_seed_already_set = true; } else if ( strcmp( line->words[0], "WITH_4PTS_TRANS" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _with_4pts_trans = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { printf( "ERROR: 3 points translocation hasn't been implemented yet\n" ); exit( EXIT_FAILURE ); } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown 4pts_trans option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "WITH_ALIGNMENTS" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _with_alignments = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _with_alignments = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown alignement option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "WITH_TRANSFER" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _with_HT = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _with_HT = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown transfer option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "REPL_TRANSFER_WITH_CLOSE_POINTS" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _repl_HT_with_close_points = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _repl_HT_with_close_points = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown transfer option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "SWAP_GUS" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _swap_GUs = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _swap_GUs = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown swap option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "TRANSFER_INS_RATE" ) == 0 ) { _HT_ins_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "TRANSFER_REPL_RATE" ) == 0 ) { _HT_repl_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "REPL_TRANSFER_DETACH_RATE" ) == 0 ) { _repl_HT_detach_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "TRANSLATION_COST" ) == 0 ) { _translation_cost = atof( line->words[1] ); } else if ( strcmp( line->words[0], "ENV_ADD_POINT" ) == 0 ) { if ( _env_custom_points == NULL ) _env_custom_points = new ae_list(); _env_custom_points->add( new ae_point_2d( atof( line->words[1] ), atof( line->words[2] ) ) ); } else if ( (strcmp( line->words[0], "ENV_ADD_GAUSSIAN" ) == 0 ) || ( strcmp( line->words[0], "ENV_GAUSSIAN" ) == 0 )) { if ( _env_gaussians == NULL ) _env_gaussians = new ae_list(); _env_gaussians->add( new ae_gaussian( atof( line->words[1] ), atof( line->words[2] ), atof( line->words[3] ) ) ); } else if ( strcmp( line->words[0], "ENV_SAMPLING" ) == 0 ) { _env_sampling = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "ENV_VARIATION" ) == 0 ) { static bool env_var_already_set = false; if ( env_var_already_set ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : duplicate entry for %s.\n", _param_file_name, cur_line, line->words[0] ); exit( EXIT_FAILURE ); } env_var_already_set = true; if ( strcmp( line->words[1], "none" ) == 0 ) { assert( line->nb_words == 2 ); _env_var_method = NO_VAR; } else if ( strcmp( line->words[1], "autoregressive_mean_variation" ) == 0 ) { assert( line->nb_words == 5 ); _env_var_method = AUTOREGRESSIVE_MEAN_VAR; _env_var_sigma = atof( line->words[2] ); _env_var_tau = atol( line->words[3] ); _env_var_seed = atoi( line->words[4] ); } else if ( strcmp( line->words[1], "autoregressive_height_variation" ) == 0 ) { assert( line->nb_words == 5 ); _env_var_method = AUTOREGRESSIVE_HEIGHT_VAR; _env_var_sigma = atof( line->words[2] ); _env_var_tau = atol( line->words[3] ); _env_var_seed = atoi( line->words[4] ); } else if ( strcmp( line->words[1], "add_local_gaussians" ) == 0 ) { assert( line->nb_words == 3 ); _env_var_method = LOCAL_GAUSSIANS_VAR; _env_var_seed = atoi( line->words[2] ); } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown environment variation method.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "ENV_NOISE" ) == 0 ) { static bool env_noise_already_set = false; if ( env_noise_already_set ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : duplicate entry for %s.\n", _param_file_name, cur_line, line->words[0] ); exit( EXIT_FAILURE ); } env_noise_already_set = true; if ( strcmp( line->words[1], "none" ) == 0 ) { assert( line->nb_words == 2 ); _env_noise_method = NO_NOISE; } else if ( strcmp( line->words[1], "FRACTAL" ) == 0 ) { assert( line->nb_words == 6 ); _env_noise_method = FRACTAL; _env_noise_sampling_log = atoi( line->words[2] ); _env_noise_sigma = atof( line->words[3] ); _env_noise_alpha = atof( line->words[4] ); _env_noise_prob = atof( line->words[5] ); _env_noise_seed = atoi( line->words[6] ); } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown environment noise method.\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "SECRETION_CONTRIB_TO_FITNESS" ) == 0 ) { _secretion_contrib_to_fitness = atof( line->words[1] ); } else if ( strcmp( line->words[0], "SECRETION_DIFFUSION_PROP" ) == 0 ) { _secretion_diffusion_prop = atof( line->words[1] ); } else if ( strcmp( line->words[0], "SECRETION_DEGRADATION_PROP" ) == 0 ) { _secretion_degradation_prop = atof( line->words[1] ); if ( _secretion_degradation_prop > 1 || _secretion_degradation_prop < 0 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : degradation must be in (0,1).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "SECRETION_INITIAL" ) == 0 ) { _secretion_init = atof( line->words[1] ); } else if ( strcmp( line->words[0], "SECRETION_COST" ) == 0 ) { _secretion_cost = atof( line->words[1] ); } else if ( strcmp( line->words[0], "ALLOW_PLASMIDS" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _allow_plasmids = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _allow_plasmids = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown allow_plasmids option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "PLASMID_INITIAL_LENGTH" ) == 0 ) { _plasmid_initial_length = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "PLASMID_INITIAL_GENE" ) == 0 ) { _plasmid_initial_gene = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "PLASMID_MINIMAL_LENGTH" ) == 0 ) { _plasmid_minimal_length = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "PLASMID_MAXIMAL_LENGTH" ) == 0 ) { _plasmid_maximal_length = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "CHROMOSOME_MINIMAL_LENGTH" ) == 0 ) { _chromosome_minimal_length = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "CHROMOSOME_MAXIMAL_LENGTH" ) == 0 ) { _chromosome_maximal_length = atoi( line->words[1] ); } else if ( strcmp( line->words[0], "PROB_PLASMID_HT" ) == 0 ) { _prob_plasmid_HT = atof( line->words[1] ); } else if ( strcmp( line->words[0], "TUNE_DONOR_ABILITY" ) == 0 ) { _tune_donor_ability = atof( line->words[1] ); } else if ( strcmp( line->words[0], "TUNE_RECIPIENT_ABILITY" ) == 0 ) { _tune_recipient_ability = atof( line->words[1] ); } else if ( strcmp( line->words[0], "DONOR_COST" ) == 0 ) { _donor_cost = atof( line->words[1] ); } else if ( strcmp( line->words[0], "RECIPIENT_COST" ) == 0 ) { _recipient_cost = atof( line->words[1] ); } else if ( strcmp( line->words[0], "COMPUTE_PHEN_CONTRIB_BY_GU" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _compute_phen_contrib_by_GU = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _compute_phen_contrib_by_GU = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown compute_phen_contrib_by_GU option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "LOG" ) == 0 ) { for ( int8_t i = 1 ; i < line->nb_words ; i++ ) { if ( strcmp( line->words[i], "TRANSFER" ) == 0 ) { _logs |= LOG_TRANSFER; } else if ( strcmp( line->words[i], "REAR" ) == 0 ) { _logs |= LOG_REAR; } else if ( strcmp( line->words[i], "BARRIER" ) == 0 ) { _logs |= LOG_BARRIER; } /*else if ( strcmp( line->words[i], "LOADS" ) == 0 ) { tmp_to_be_logged |= LOG_LOADS; } */ else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown log option %s.\n", _param_file_name, cur_line, line->words[1] ); exit( EXIT_FAILURE ); } } } #ifdef __REGUL else if ( strcmp( line->words[0], "HILL_SHAPE_N" ) == 0 ) { _hill_shape_n = atof( line->words[1] ); } else if ( strcmp( line->words[0], "HILL_SHAPE_THETA" ) == 0 ) { _hill_shape_theta = atof( line->words[1] ); } else if ( strcmp( line->words[0], "DEGRADATION_RATE" ) == 0 ) { _degradation_rate = atof( line->words[1] ); } else if ( strcmp( line->words[0], "DEGRADATION_STEP" ) == 0 ) { _degradation_step = atof( line->words[1] ); // Check that 1/degradation_step is an integer if( 1/_degradation_step != ((int) 1/_degradation_step) ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : DEGRADATION STEP\n", _param_file_name, cur_line ); printf( "This step has to divide 1.\n"); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "INDIVIDUAL_EVALUATION_DATES" ) == 0 ) { _individual_evaluation_nbr = line->nb_words - 1; if( _individual_evaluation_nbr == 0 ) { printf( "ERROR in param file \"%s\" on line %"PRId32" : no evaluation dates provided\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } ae_array_short* individual_evaluation_dates = new ae_array_short( _individual_evaluation_nbr ); for( int16_t i = 0 ; i < _individual_evaluation_nbr ; i++ ) { individual_evaluation_dates->set_value( i, atoi( line->words[1 + i] ) ); } individual_evaluation_dates->sort(); _individual_evaluation_dates = individual_evaluation_dates; } else if ( strcmp( line->words[0], "BINDING_ZEROS_PERCENTAGE" ) == 0 ) { _binding_zeros_percentage = atof( line->words[1] ); } else if ( strcmp( line->words[0], "WITH_HEREDITY" ) == 0 ) { if ( strncmp( line->words[1], "true", 4 ) == 0 ) { _with_heredity = true; } else if ( strncmp( line->words[1], "false", 5 ) == 0 ) { _with_heredity = false; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown with_heredity option (use true/false).\n", _param_file_name, cur_line ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "PROTEIN_PRESENCE_LIMIT" ) == 0 ) { _protein_presence_limit = atof( line->words[1] ); } #endif else { printf( "ERROR in param file \"%s\" on line %"PRId32" : undefined key word \"%s\"\n", _param_file_name, cur_line, line->words[0] ); exit( EXIT_FAILURE ); } } void param_loader::read_file( void ) { // The rewind is only necessary when using multiple param files rewind( _param_file ); int32_t cur_line = 0; f_line* line; while ( ( line = get_line(&cur_line) ) != NULL ) // TODO : write line = new f_line( _param_file ) => f_line::f_line( char* ) { interpret_line( line, cur_line ); delete line; } } void param_loader::load( ae_exp_manager* exp_m, bool verbose, char* chromosome, int32_t lchromosome, char* plasmid, int32_t lplasmid ) { // Check consistency of min, max and initial length of chromosome and plasmid // Default for by GU minimal or maximal size is -1. // If equal to -1, maximal sizes of each GU will be replaced by total maximal size for the whole genome if (_allow_plasmids) { if (_plasmid_initial_gene!=1) // the plasmid will be copied from the chromosome { if (_plasmid_initial_length != -1) { printf("WARNING: PLASMID_INITIAL_LENGTH is not taken into account because PLASMID_INITIAL_GENE is set to 0 (copy from chromosome)\n"); _plasmid_initial_length = _chromosome_initial_length; } } if (_plasmid_maximal_length == -1) { _plasmid_maximal_length = _max_genome_length; } if(_plasmid_minimal_length > _plasmid_initial_length) { printf("ERROR: PLASMID_INITIAL_LENGTH is lower than PLASMID_MINIMAL_LENGTH\n"); exit( EXIT_FAILURE ); } if (_plasmid_maximal_length < _plasmid_initial_length) { printf("ERROR: PLASMID_INITIAL_LENGTH is higher than PLASMID_MAXIMAL_LENGTH\n"); exit( EXIT_FAILURE ); } } if (_chromosome_maximal_length == -1) { _chromosome_maximal_length = _max_genome_length; } if (_chromosome_minimal_length > _chromosome_initial_length) { printf("ERROR: CHROMOSOME_INITIAL_LENGTH is lower than CHROMOSOME_MINIMAL_LENGTH\n"); exit( EXIT_FAILURE ); } if (_chromosome_maximal_length < _chromosome_initial_length) { printf("ERROR: CHROMOSOME_INITIAL_LENGTH is higher than PLASMID_MAXIMAL_LENGTH\n"); exit( EXIT_FAILURE ); } // Check for incompatible environment options if ( ( _env_custom_points != NULL) && ( _env_gaussians != NULL)) { printf( "ERROR in param file \"%s\" : ENV_ADD_POINT is incompatible with ENV_ADD_GAUSSIAN (or ENV_GAUSSIAN).\n", _param_file_name ); exit( EXIT_FAILURE ); } if ( ( _env_custom_points != NULL) && ( _env_var_method != NO_VAR)) { printf( "ERROR in param file \"%s\" : ENV_ADD_POINT is incompatible with environmental variation.\n", _param_file_name ); exit( EXIT_FAILURE ); } // Initialize _prng // This one will be used to create the initial genome(s) and to generate seeds for other prng _prng = new ae_jumping_mt( _seed ); // Initialize mut_prng, stoch_prng, spatial_struct_prng : // if mut_seed (respectively stoch_seed) not given in param.in, choose it at random int32_t selection_seed = _prng->random( 1000000 ); if ( _mut_seed == 0 ) { _mut_seed = _prng->random( 1000000 ); } if ( _stoch_seed == 0 ) { _stoch_seed = _prng->random( 1000000 ); } ae_jumping_mt * mut_prng = new ae_jumping_mt( _mut_seed ); ae_jumping_mt * stoch_prng = new ae_jumping_mt( _stoch_seed ); ae_jumping_mt * selection_prng = new ae_jumping_mt( selection_seed ); ae_jumping_mt * spatial_struct_prng = NULL; if ( _spatially_structured ) { int32_t spatial_struct_seed = _prng->random( 1000000 ); spatial_struct_prng = new ae_jumping_mt( spatial_struct_seed ); } // Create aliases (syntaxic sugars) ae_exp_setup* exp_s = exp_m->get_exp_s(); ae_population* pop = exp_m->get_pop(); ae_environment* env = exp_m->get_env(); ae_selection* sel = exp_m->get_sel(); ae_output_manager* output_m = exp_m->get_output_m(); // If the population is spatially structured, // check that the population fits in the spatial structure if ( _spatially_structured ) { if ( _init_pop_size != _grid_width * _grid_height ) { printf( "ERROR: the number of individuals does not match the size of the grid\n" ); exit( EXIT_FAILURE ); } } // 1) ------------------------------------- Initialize the experimental setup sel->set_prng( selection_prng ); // ---------------------------------------------------------------- Selection sel->set_selection_scheme( _selection_scheme ); sel->set_selection_pressure( _selection_pressure ); // ----------------------------------------------------------------- Transfer exp_s->set_with_HT( _with_HT ); exp_s->set_repl_HT_with_close_points( _repl_HT_with_close_points ); exp_s->set_HT_ins_rate( _HT_ins_rate ); exp_s->set_HT_repl_rate( _HT_repl_rate ); exp_s->set_repl_HT_detach_rate( _repl_HT_detach_rate ); // ----------------------------------------------------------------- Plasmids exp_s->set_with_plasmids( _allow_plasmids ); exp_s->set_prob_plasmid_HT( _prob_plasmid_HT ); exp_s->set_tune_donor_ability( _tune_donor_ability ); exp_s->set_tune_recipient_ability( _tune_recipient_ability ); exp_s->set_donor_cost( _donor_cost ); exp_s->set_recipient_cost( _recipient_cost ); exp_s->set_swap_GUs( _swap_GUs ); output_m->set_compute_phen_contrib_by_GU( _compute_phen_contrib_by_GU ); // -------------------------------------------------------- Spatial structure if ( _spatially_structured ) { exp_m->set_spatial_structure( _grid_width, _grid_height, spatial_struct_prng ); ae_spatial_structure* sp_struct = exp_m->get_spatial_structure(); sp_struct->set_secretion_degradation_prop( _secretion_degradation_prop ); sp_struct->set_secretion_diffusion_prop( _secretion_diffusion_prop ); sp_struct->set_migration_number( _migration_number ); } // ---------------------------------------------------------------- Secretion exp_s->set_with_secretion( _with_secretion ); exp_s->set_secretion_contrib_to_fitness( _secretion_contrib_to_fitness ); exp_s->set_secretion_cost( _secretion_cost ); // 2) ------------------------------------------------ Create the environment // Move the gaussian list and the list of custom points from the parameters // to the environment env->set_gaussians( _env_gaussians ); _env_gaussians = NULL; env->set_custom_points( _env_custom_points ); _env_custom_points = NULL; // Copy the sampling env->set_sampling( _env_sampling ); // Set the environment segmentation if( (_env_axis_features != NULL) && (_env_axis_segment_boundaries != NULL) ) { // if param.in contained a line starting with ENV_AXIS_FEATURES, // we use the values indicated on this line env->set_segmentation( _env_axis_nb_segments, _env_axis_segment_boundaries, _env_axis_features, _env_axis_separate_segments ); } // else we leave the ae_environment as it is by default (one "metabolic" segment from X_MIN to XMAX) // Set environmental variation if ( _env_var_method != NO_VAR ) { env->set_var_method( _env_var_method ); env->set_var_prng( new ae_jumping_mt( _env_var_seed ) ); env->set_var_sigma_tau( _env_var_sigma, _env_var_tau ); } // Set environmental noise if ( _env_noise_method != NO_NOISE ) { env->set_noise_method( _env_noise_method ); env->set_noise_sampling_log( _env_noise_sampling_log ); env->set_noise_prng( new ae_jumping_mt( _env_noise_seed ) ); env->set_noise_alpha( _env_noise_alpha ); env->set_noise_sigma( _env_noise_sigma ); env->set_noise_prob( _env_noise_prob ); } // Build the environment env->build(); if ( verbose ) { printf( "Entire geometric area of the environment : %f\n", env->get_geometric_area() ); } // 3) --------------------------------------------- Create the new population pop->set_mut_prng( mut_prng ); pop->set_stoch_prng( stoch_prng ); // Generate a model ae_mut_param object ae_params_mut* param_mut = new ae_params_mut(); param_mut->set_point_mutation_rate( _point_mutation_rate ); param_mut->set_small_insertion_rate( _small_insertion_rate ); param_mut->set_small_deletion_rate( _small_deletion_rate ); param_mut->set_max_indel_size( _max_indel_size ); param_mut->set_with_4pts_trans( _with_4pts_trans ); param_mut->set_with_alignments( _with_alignments ); param_mut->set_with_HT( _with_HT ); param_mut->set_repl_HT_with_close_points( _repl_HT_with_close_points ); param_mut->set_HT_ins_rate( _HT_ins_rate ); param_mut->set_HT_repl_rate( _HT_repl_rate ); param_mut->set_repl_HT_detach_rate( _repl_HT_detach_rate ); param_mut->set_duplication_rate( _duplication_rate ); param_mut->set_deletion_rate( _deletion_rate ); param_mut->set_translocation_rate( _translocation_rate ); param_mut->set_inversion_rate( _inversion_rate ); param_mut->set_neighbourhood_rate( _neighbourhood_rate ); param_mut->set_duplication_proportion( _duplication_proportion ); param_mut->set_deletion_proportion( _deletion_proportion ); param_mut->set_translocation_proportion( _translocation_proportion ); param_mut->set_inversion_proportion( _inversion_proportion ); ae_individual* indiv = NULL; int32_t id_new_indiv = 0; if (chromosome != NULL) { printf("Option -c is used: chromosome will be loaded from a text file\n"); ae_individual* indiv = new ae_individual( exp_m, pop->get_mut_prng(), pop->get_stoch_prng(), param_mut, _w_max, _min_genome_length, _max_genome_length, _allow_plasmids, id_new_indiv++, _strain_name, 0 ); indiv->add_GU( chromosome, lchromosome ); indiv->get_genetic_unit(0)->set_min_gu_length(_chromosome_minimal_length); indiv->get_genetic_unit(0)->set_max_gu_length(_chromosome_maximal_length); if (plasmid != NULL) { printf("Option -p is used: plasmid will be loaded from a text file\n"); if (! _allow_plasmids) { printf( "ERROR: option -p requires ALLOW_PLASMIDS set to true\n" ); exit( EXIT_FAILURE ); } indiv->add_GU( plasmid, lplasmid ); indiv->get_genetic_unit(1)->set_min_gu_length(_plasmid_minimal_length); indiv->get_genetic_unit(1)->set_max_gu_length(_plasmid_maximal_length); } else if (_allow_plasmids) { printf( "ERROR: if you use option -c and ALLOW_PLASMIDS is set to true, you must also use option -p. \n For now loading a genetic unit from text file and generating the other is not supported.\n" ); exit( EXIT_FAILURE ); } indiv->set_with_stochasticity( _with_stochasticity ); indiv->compute_statistical_data(); indiv->evaluate( exp_m->get_env() ); printf("Starting with a clonal population of individual with metabolic error %f and secretion error %f \n",indiv->get_dist_to_target_by_feature(METABOLISM),indiv->get_dist_to_target_by_feature(SECRETION)); pop->add_indiv( indiv ); // Make the clones and add them to the list of individuals ae_individual* clone = NULL; for ( int32_t i = 1 ; i < _init_pop_size ; i++ ) { clone = create_clone( indiv, id_new_indiv++ ); pop->add_indiv( clone ); } pop->sort_individuals(); } else if (plasmid != NULL) { printf( "ERROR: option -p can only be used in combination with option -c for now\n" ); exit( EXIT_FAILURE ); } else if ( _init_method & ONE_GOOD_GENE ) { if ( _init_method & CLONE ) { // Create an individual with a "good" gene (in fact, make an indiv whose // fitness is better than that corresponding to a flat phenotype) // and set its id indiv = create_random_individual_with_good_gene( exp_m, param_mut, id_new_indiv++ ); indiv->get_genetic_unit(0)->set_min_gu_length(_chromosome_minimal_length); indiv->get_genetic_unit(0)->set_max_gu_length(_chromosome_maximal_length); if (_allow_plasmids) { indiv->get_genetic_unit(1)->set_min_gu_length(_plasmid_minimal_length); indiv->get_genetic_unit(1)->set_max_gu_length(_plasmid_maximal_length); } indiv->set_with_stochasticity( _with_stochasticity ); // Add it to the list pop->add_indiv( indiv ); // Make the clones and add them to the list of individuals ae_individual* clone = NULL; for ( int32_t i = 1 ; i < _init_pop_size ; i++ ) { // Create a clone, setting its id clone = create_clone( indiv, id_new_indiv++ ); #ifdef DISTRIBUTED_PRNG #error Not implemented yet ! indiv->do_prng_jump(); #endif // Add it to the list pop->add_indiv( clone ); } pop->sort_individuals(); } else // if ( ! CLONE ) { for ( int32_t i = 0 ; i < _init_pop_size ; i++ ) { // Create an individual and set its id indiv = create_random_individual_with_good_gene( exp_m, param_mut, id_new_indiv++ ); indiv->get_genetic_unit(0)->set_min_gu_length(_chromosome_minimal_length); indiv->get_genetic_unit(0)->set_max_gu_length(_chromosome_maximal_length); if (_allow_plasmids) { indiv->get_genetic_unit(1)->set_min_gu_length(_plasmid_minimal_length); indiv->get_genetic_unit(1)->set_max_gu_length(_plasmid_maximal_length); } // Add it to the list pop->add_indiv( indiv ); } pop->sort_individuals(); } } else // if ( ! ONE_GOOD_GENE ) { if ( _init_method & CLONE ) { // Create a random individual and set its id indiv = create_random_individual( exp_m, param_mut, id_new_indiv++ ); indiv->get_genetic_unit(0)->set_min_gu_length(_chromosome_minimal_length); indiv->get_genetic_unit(0)->set_max_gu_length(_chromosome_maximal_length); if (_allow_plasmids) { indiv->get_genetic_unit(1)->set_min_gu_length(_plasmid_minimal_length); indiv->get_genetic_unit(1)->set_max_gu_length(_plasmid_maximal_length); } // Add it to the list pop->add_indiv( indiv ); // Make the clones and add them to the list of individuals ae_individual* clone = NULL; for ( int32_t i = 1 ; i < _init_pop_size ; i++ ) { // Create a clone, setting its id clone = create_clone( indiv, id_new_indiv++ ); #ifdef DISTRIBUTED_PRNG #error Not implemented yet ! indiv->do_prng_jump(); #endif // Add it to the list pop->add_indiv( clone ); } pop->sort_individuals(); } else // if ( ! CLONE ) { for ( int32_t i = 0 ; i < _init_pop_size ; i++ ) { // Create a random individual and set its id indiv = create_random_individual( exp_m, param_mut, id_new_indiv++ ); indiv->get_genetic_unit(0)->set_min_gu_length(_chromosome_minimal_length); indiv->get_genetic_unit(0)->set_max_gu_length(_chromosome_maximal_length); if (_allow_plasmids) { indiv->get_genetic_unit(1)->set_min_gu_length(_plasmid_minimal_length); indiv->get_genetic_unit(1)->set_max_gu_length(_plasmid_maximal_length); } // Add it to the list pop->add_indiv( indiv ); } pop->sort_individuals(); } } // If the population is spatially structured, set each individual's position if ( exp_m->is_spatially_structured() ) { int16_t x, y; int16_t x_max = exp_m->get_grid_width(); int16_t y_max = exp_m->get_grid_height(); ae_grid_cell* grid_cell = NULL; ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); do { x = exp_m->get_spatial_structure()->get_prng()->random( x_max ); y = exp_m->get_spatial_structure()->get_prng()->random( y_max ); grid_cell = exp_m->get_grid_cell( x, y ); } while ( grid_cell->get_individual() != NULL ); grid_cell->set_individual( indiv ); indiv_node = indiv_node->get_next(); } } // 4) ------------------------------------------ Set the recording parameters output_m->set_backup_step( _backup_step ); output_m->set_big_backup_step( _big_backup_step ); if ( _record_tree ) { output_m->init_tree( exp_m, _tree_mode, _tree_step ); } if ( _make_dumps ) { output_m->set_dump_step( _dump_step ); } output_m->set_logs( _logs ); delete param_mut; } // ================================================================= // Protected Methods // ================================================================= /*! \brief Format a line by parsing it and the words inside \param formated_line the resulted formated line \param line original line in char* \param line_is_interpretable boolean with about the possible intrepretation of the line */ void param_loader::format_line( f_line* formated_line, char* line, bool* line_is_interpretable ) { int16_t i = 0; int16_t j; // Parse line while ( line[i] != '\n' && line[i] != '\0' && line[i] != '\r' ) { j = 0; // Flush white spaces and tabs while ( line[i] == ' ' || line[i] == 0x09 ) i++; // 0x09 is the ASCII code for TAB // Check comments if ( line[i] == '#' ) break; // If we got this far, there is content in the line *line_is_interpretable = true; // Parse word while ( line[i] != ' ' && line[i] != '\n' && line[i] != '\0' && line[i] != '\r' ) { formated_line->words[formated_line->nb_words][j++] = line[i++]; } // Add '\0' at end of word if it's not empty (line ending with space or tab) if ( j != 0 ) { formated_line->words[formated_line->nb_words++][j] = '\0'; } } } /*! \brief Get a line in a file and format it \return line (pointer) \see format_line(f_line* formated_line, char* line, bool* line_is_interpretable ) */ f_line* param_loader::get_line( int32_t* cur_line_ptr ) // void { char line[255]; f_line* formated_line = new f_line(); bool found_interpretable_line = false; // Found line that is neither a comment nor empty while ( !feof( _param_file ) && !found_interpretable_line ) { if ( !fgets( line, 255, _param_file ) ) { delete formated_line; return NULL; } (*cur_line_ptr)++; format_line( formated_line, line, &found_interpretable_line ); } if ( found_interpretable_line ) { return formated_line; } else { delete formated_line; return NULL; } } /*! \brief Create an individual with random sequences \param exp_m global exp_manager \param param_mut mutation parameter of the newly created individual \param id index of newly created individual in the population \return clone of dolly */ ae_individual* param_loader::create_random_individual( ae_exp_manager* exp_m, ae_params_mut* param_mut, int32_t id ) const { // Generate a random genome char * random_genome = new char [_chromosome_initial_length + 1]; for ( int32_t i = 0 ; i < _chromosome_initial_length ; i++ ) { random_genome[i] = '0' + _prng->random( NB_BASE ); } random_genome[_chromosome_initial_length] = 0; // ------------------------------------------------------- Global constraints // Create an individual with this genome and set its id #ifdef DISTRIBUTED_PRNG #error Not implemented yet ! #endif ae_individual* indiv = new ae_individual( exp_m, exp_m->get_pop()->get_mut_prng(), exp_m->get_pop()->get_stoch_prng(), param_mut, _w_max, _min_genome_length, _max_genome_length, _allow_plasmids, id, _strain_name, 0 ); indiv->add_GU( random_genome, _chromosome_initial_length ); if (_allow_plasmids) // We create a plasmid { char * plasmid_genome; if ( _plasmid_initial_gene == 1 ) // Then the plasmid is generated independently from the chromosome { plasmid_genome = new char [_plasmid_initial_length + 1]; // As ae_dna constructor do not allocate memory but directly use the provided string, we allocate the memory here. for ( int32_t i = 0 ; i < _plasmid_initial_length ; i++ ) { plasmid_genome[i] = '0' + _prng->random( NB_BASE ); } plasmid_genome[_plasmid_initial_length] = 0; indiv->add_GU( plasmid_genome, _plasmid_initial_length ); } else // The plasmid has the same genome than the chromosome { plasmid_genome = new char [_chromosome_initial_length + 1]; // As ae_dna constructor do not allocate memory but directly use the provided string, we allocate the memory here. strncpy(plasmid_genome,random_genome,_chromosome_initial_length+1); indiv->add_GU( plasmid_genome, _chromosome_initial_length ); } plasmid_genome = NULL; // should not be deleted since it is now the plasmid dna } random_genome = NULL; // should not be deleted since it is now the chromosomal dna // Insert a few IS in the sequence /*if ( ae_common::init_params->get_init_method() & WITH_INS_SEQ ) { // Create a random sequence int32_t seq_len = 50; char* ins_seq = new char[seq_len+1]; int16_t nb_insert = 50; int16_t nb_invert = 50; for ( int32_t i = 0 ; i < seq_len ; i++ ) { ins_seq[i] = '0' + ae_common::sim->prng->random( NB_BASE ); } ins_seq[seq_len] = '\0'; // Insert the sequence at random positions ae_mutation* mut1 = NULL; for ( int16_t i = 0 ; i < nb_insert ; i++ ) { mut1 = indiv->get_genetic_unit(0)->get_dna()->do_insertion( ins_seq, seq_len ); delete mut1; } // Invert the sequence and insert it at random positions char* inverted_seq = new char[seq_len+1]; for ( int32_t i = 0 ; i < seq_len ; i++ ) { inverted_seq[i] = (ins_seq[seq_len-1-i] == '1') ? '0' : '1'; } inverted_seq[seq_len] = '\0'; for ( int16_t i = 0 ; i < nb_invert ; i++ ) { mut1 = indiv->get_genetic_unit(0)->get_dna()->do_insertion( inverted_seq, seq_len ); delete mut1; } delete [] ins_seq; delete [] inverted_seq; }*/ // Evaluate the newly created individual indiv->evaluate( exp_m->get_env() ); return indiv; } /*! \brief Create an individual with random sequences. The individual have to have at least one good functional gene \param exp_m global exp_manager \param param_mut mutation parameter of the newly created individual \param id index of newly created individual in the population \return clone of dolly */ ae_individual* param_loader::create_random_individual_with_good_gene( ae_exp_manager* exp_m, ae_params_mut* param_mut, int32_t id ) const { // Create a random individual and evaluate it ae_individual* indiv = create_random_individual( exp_m, param_mut, id ); // While the created individual is not better than the flat individual (indiv whith no metabolic gene), // we delete it and replace it by another random individual double env_metabolic_area; env_metabolic_area = exp_m->get_env()->get_area_by_feature( METABOLISM ); // If there are plasmids, make sure there is at least one metabolic gene on each genetic units if ( _allow_plasmids ) { if ( _plasmid_initial_gene == 1 ) { while ( indiv->get_genetic_unit(0)->get_dist_to_target_by_feature( METABOLISM ) >= env_metabolic_area || indiv->get_genetic_unit(1)->get_dist_to_target_by_feature( METABOLISM ) >= env_metabolic_area ) { delete indiv; indiv = create_random_individual( exp_m, param_mut, id ); } } else { // here things work the same as before, but in the constructor of the individual, // a single genetic unit is created and then copied from the chromosome to the plasmid while ( indiv->get_dist_to_target_by_feature( METABOLISM ) >= env_metabolic_area ) { delete indiv; indiv = create_random_individual( exp_m, param_mut, id ); } } } else { while ( indiv->get_dist_to_target_by_feature( METABOLISM ) >= env_metabolic_area ) { delete indiv; indiv = create_random_individual( exp_m, param_mut, id ); } } // Compute the "good" individual's statistics indiv->compute_statistical_data(); //~ printf( "metabolic error of the generated individual : %f (%"PRId32" gene(s))\n", //~ indiv->get_dist_to_target_by_feature(METABOLISM), indiv->get_protein_list()->get_nb_elts() ); return indiv; } /*! \brief Create of clone of an ae_individual \param dolly original individual that would be cloned \param id index of the clone in the population \return clone of dolly */ ae_individual* param_loader::create_clone( ae_individual* dolly, int32_t id ) const { ae_individual* indiv; indiv = new ae_individual( *dolly, false ); //~ #ifdef __X11 //~ indiv = new ae_individual_X11( *(dynamic_cast(dolly)), false ); //~ #else //~ indiv = new ae_individual( *dolly, false ); //~ #endif indiv->set_id( id ); //~ printf( "metabolic error of the clonal individual : %f (%"PRId32" gene(s))\n", //~ indiv->get_dist_to_target_by_feature(METABOLISM), indiv->get_protein_list()->get_nb_elts()); return indiv; } void param_loader::print_to_file( FILE* file ) { // ------------------------------------------------------------ Constraints fprintf( file, "\nConstraints ---------------------------------------------\n" ); fprintf( file, "min_genome_length : %"PRId32"\n", _min_genome_length ); fprintf( file, "max_genome_length : %"PRId32"\n", _max_genome_length ); fprintf( file, "W_MAX : %f\n", _w_max ); // --------------------------------------------------------- Mutation rates fprintf( file, "\nMutation rates ------------------------------------------\n" ); fprintf( file, "point_mutation_rate : %e\n", _point_mutation_rate ); fprintf( file, "small_insertion_rate : %e\n", _small_insertion_rate ); fprintf( file, "small_deletion_rate : %e\n", _small_deletion_rate ); fprintf( file, "max_indel_size : %"PRId16"\n", _max_indel_size ); // -------------------------------------------- Rearrangements and Transfer fprintf( file, "\nRearrangements and Transfer -----------------------------\n" ); fprintf( file, "with_4pts_trans : %s\n", _with_4pts_trans? "true" : "false" ); fprintf( file, "with_alignments : %s\n", _with_alignments? "true" : "false" ); fprintf( file, "with_HT : %s\n", _with_HT? "true" : "false" ); fprintf( file, "repl_HT_with_close_points : %s\n", _repl_HT_with_close_points? "true" : "false" ); fprintf( file, "HT_ins_rate : %e\n", _HT_ins_rate ); fprintf( file, "HT_repl_rate : %e\n", _HT_repl_rate ); // ---------------------------------------------------- Rearrangement rates if ( _with_alignments ) { fprintf( file, "\nRearrangement rates (with alignements) ------------------\n" ); fprintf( file, "neighbourhood_rate : %e\n", _neighbourhood_rate ); fprintf( file, "duplication_proportion : %e\n", _duplication_proportion ); fprintf( file, "deletion_proportion : %e\n", _deletion_proportion ); fprintf( file, "translocation_proportion : %e\n", _translocation_proportion ); fprintf( file, "inversion_proportion : %e\n", _inversion_proportion ); } else { fprintf( file, "\nRearrangement rates (without alignements) ----------------\n" ); fprintf( file, "duplication_rate : %e\n", _duplication_rate ); fprintf( file, "deletion_rate : %e\n", _deletion_rate ); fprintf( file, "translocation_rate : %e\n", _translocation_rate ); fprintf( file, "inversion_rate : %e\n", _inversion_rate ); } // ------------------------------------------------------------ Alignements fprintf( file, "\nAlignements ---------------------------------------------\n" ); fprintf( file, "align_fun_shape : %"PRId16"\n", (int16_t) _align_fun_shape ); fprintf( file, "align_sigm_lambda : %f\n", _align_sigm_lambda ); fprintf( file, "align_sigm_mean : %"PRId16"\n", _align_sigm_mean ); fprintf( file, "align_lin_min : %"PRId16"\n", _align_lin_min ); fprintf( file, "align_lin_max : %"PRId16"\n", _align_lin_max ); fprintf( file, "align_max_shift : %"PRId16"\n", _align_max_shift ); fprintf( file, "align_w_zone_h_len : %"PRId16"\n", _align_w_zone_h_len ); fprintf( file, "align_match_bonus : %"PRId16"\n", _align_match_bonus ); fprintf( file, "align_mismatch_cost : %"PRId16"\n", _align_mismatch_cost ); // -------------------------------------------------------------- Selection fprintf( file, "\nSelection -----------------------------------------------\n" ); switch ( _selection_scheme ) { case RANK_LINEAR : { fprintf( file, "selection_scheme : RANK_LINEAR\n" ); break; } case RANK_EXPONENTIAL : { fprintf( file, "selection_scheme : RANK_EXPONENTIAL\n" ); break; } case FITNESS_PROPORTIONATE : { fprintf( file, "selection_scheme : FITNESS_PROPORTIONATE\n" ); break; } case FITTEST : { fprintf( file, "selection_scheme : FITTEST\n" ); break; } default : { fprintf( file, "selection_scheme : UNKNOWN\n" ); break; } } fprintf( file, "selection_pressure : %e\n", _selection_pressure ); // -------------------------------------------------------------- Secretion fprintf( file, "\nSecretion -----------------------------------------------\n" ); fprintf( file, "with_secretion : %s\n", _with_secretion? "true" : "false" ); fprintf( file, "secretion_contrib_to_fitness : %e\n", _secretion_contrib_to_fitness ); fprintf( file, "secretion_diffusion_prop : %e\n", _secretion_diffusion_prop ); fprintf( file, "secretion_degradation_prop : %e\n", _secretion_degradation_prop ); fprintf( file, "secretion_cost : %e\n", _secretion_cost ); // --------------------------------------------------------------- Plasmids fprintf( file, "\nPlasmids ------------------------------------------------\n" ); fprintf( file, "allow_plasmids : %s\n", _allow_plasmids? "true" : "false" ); fprintf( file, "plasmid_minimal_length : %"PRId32"\n", _plasmid_minimal_length ); fprintf( file, "plasmid_maximal_length : %"PRId32"\n", _plasmid_maximal_length ); fprintf( file, "chromosome_minimal_length : %"PRId32"\n", _chromosome_minimal_length ); fprintf( file, "chromosome_maximal_length : %"PRId32"\n", _chromosome_maximal_length ); fprintf( file, "prob_plasmid_HT : %e\n", _prob_plasmid_HT ); fprintf( file, "tune_donor_ability : %e\n", _tune_donor_ability ); fprintf( file, "tune_recipient_ability : %e\n", _tune_recipient_ability ); fprintf( file, "donor_cost : %e\n", _donor_cost ); fprintf( file, "recipient_cost : %e\n", _recipient_cost ); fprintf( file, "compute_phen_contrib_by_GU : %s\n", _compute_phen_contrib_by_GU? "true" : "false" ); fprintf( file, "swap_GUs : %s\n", _swap_GUs? "true" : "false" ); // ------------------------------------------------------- Translation cost fprintf( file, "\nTranslation cost ----------------------------------------\n" ); fprintf( file, "translation_cost : %e\n", _translation_cost ); } aevol-4.4/src/libaevol/ae_align.h0000644000175000017500000001222112231437075013706 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_ALIGN_H__ #define __AE_ALIGN_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_dna; class ae_align : public ae_object { public : // ================================================================= // Constructors // ================================================================= // ================================================================= // Destructors // ================================================================= // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= static ae_vis_a_vis* search_alignment_direct( const ae_dna* chrom1, const int32_t seed1, const ae_dna* chrom2, const int32_t seed2, int16_t needed_score ); static ae_vis_a_vis* search_alignment_indirect( const ae_dna* chrom1, const int32_t seed1, const ae_dna* chrom2, const int32_t seed2, int16_t needed_score ); // ================================================================= // Public Attributes // ================================================================= static bool with_alignments; static ae_align_fun_shape align_fun_shape; static double align_sigm_lambda; static int16_t align_sigm_mean; static int16_t align_lin_min; static int16_t align_lin_max; // Maximum shift of one seq on the other static int16_t align_max_shift; // Work zone half length static int16_t align_w_zone_h_len; // Corresponding residues match bonus static int16_t align_match_bonus; // Corresponding residues mismatch cost static int16_t align_mismatch_cost; protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_align( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_align( const ae_align &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= }; // ===================================================================== // Accessors' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_ALIGN_H__ aevol-4.4/src/libaevol/ae_exp_setup.cpp0000644000175000017500000002066012234223723015165 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #ifdef __X11 #include #endif //############################################################################## // # // Class ae_exp_setup # // # //############################################################################## // =========================================================================== // Definition of static attributes // =========================================================================== // =========================================================================== // Constructors // =========================================================================== ae_exp_setup::ae_exp_setup( ae_exp_manager* exp_m ) { _exp_m = exp_m; // -------------------------------------------------------------- Selection _sel = new ae_selection( exp_m ); // --------------------------------------------------------------- Transfer _with_HT = false; _repl_HT_with_close_points = false; _HT_ins_rate = 0.0; _HT_repl_rate = 0.0; _repl_HT_detach_rate = 0.0; // --------------------------------------------------------------- Plasmids _with_plasmids = false; _prob_plasmid_HT = 0.0; _tune_donor_ability = 0.0; _tune_recipient_ability = 0.0; _donor_cost = 0.0; _recipient_cost = 0.0; _swap_GUs = false; // -------------------------------------------------------------- Secretion _with_secretion = false; _secretion_contrib_to_fitness = 0.0; _secretion_cost = 0.0; } // =========================================================================== // Destructor // =========================================================================== ae_exp_setup::~ae_exp_setup( void ) { delete _sel; } // =========================================================================== // Public Methods // =========================================================================== /*! */ void ae_exp_setup::write_setup_file( gzFile exp_setup_file ) const { // --------------------------------------------------------------- Transfer int8_t tmp_with_HT = _with_HT; gzwrite( exp_setup_file, &tmp_with_HT, sizeof(tmp_with_HT) ); int8_t tmp_repl_HT_with_close_points = _repl_HT_with_close_points; gzwrite( exp_setup_file, &tmp_repl_HT_with_close_points, sizeof(tmp_repl_HT_with_close_points) ); if ( _with_HT ) { gzwrite( exp_setup_file, &_HT_ins_rate, sizeof(_HT_ins_rate) ); gzwrite( exp_setup_file, &_HT_repl_rate, sizeof(_HT_repl_rate) ); } if(_repl_HT_with_close_points) { gzwrite( exp_setup_file, &_repl_HT_detach_rate, sizeof(_repl_HT_detach_rate) ); } // --------------------------------------------------------------- Plasmids int8_t tmp_with_plasmids = get_with_plasmids(); gzwrite( exp_setup_file, &tmp_with_plasmids, sizeof(tmp_with_plasmids) ); if ( tmp_with_plasmids ) { gzwrite( exp_setup_file, &_prob_plasmid_HT, sizeof(_prob_plasmid_HT) ); gzwrite( exp_setup_file, &_tune_donor_ability, sizeof(_tune_donor_ability) ); gzwrite( exp_setup_file, &_tune_recipient_ability, sizeof(_tune_recipient_ability) ); gzwrite( exp_setup_file, &_donor_cost, sizeof(_donor_cost) ); gzwrite( exp_setup_file, &_recipient_cost, sizeof(_recipient_cost) ); int8_t tmp_swap_GUs = _swap_GUs; gzwrite( exp_setup_file, &tmp_swap_GUs, sizeof(tmp_swap_GUs) ); } // -------------------------------------------------------------- Secretion int8_t tmp_with_secretion = _with_secretion; gzwrite( exp_setup_file, &tmp_with_secretion, sizeof(tmp_with_secretion) ); gzwrite( exp_setup_file, &_secretion_contrib_to_fitness, sizeof(_secretion_contrib_to_fitness) ); gzwrite( exp_setup_file, &_secretion_cost, sizeof(_secretion_cost) ); get_sel()->write_setup_file( exp_setup_file ); } void ae_exp_setup::write_setup_file( FILE* exp_setup_file ) const { // --------------------------------------------------------------- Transfer //... // -------------------------------------------------------------- Secretion //... get_sel()->write_setup_file( exp_setup_file ); } void ae_exp_setup::load( gzFile setup_file, gzFile backup_file, bool verbose ) { // -------------------------------------------- Retrieve transfer parameters int8_t tmp_with_HT; gzread( setup_file, &tmp_with_HT, sizeof(tmp_with_HT) ); _with_HT = tmp_with_HT ? 1 : 0; int8_t tmp_repl_HT_with_close_points; gzread( setup_file, &tmp_repl_HT_with_close_points, sizeof(tmp_repl_HT_with_close_points) ); _repl_HT_with_close_points = tmp_repl_HT_with_close_points ? 1 : 0; if ( _with_HT ) { gzread( setup_file, &_HT_ins_rate, sizeof(_HT_ins_rate) ); gzread( setup_file, &_HT_repl_rate, sizeof(_HT_repl_rate) ); } if(_repl_HT_with_close_points) { gzread( setup_file, &_repl_HT_detach_rate, sizeof(_repl_HT_detach_rate) ); } // -------------------------------------------- Retrieve plasmid parameters int8_t tmp_with_plasmids; gzread( setup_file, &tmp_with_plasmids, sizeof(tmp_with_plasmids) ); _with_plasmids = tmp_with_plasmids ? 1 : 0; if ( _with_plasmids ) { gzread( setup_file, &_prob_plasmid_HT, sizeof(_prob_plasmid_HT) ); gzread( setup_file, &_tune_donor_ability, sizeof(_tune_donor_ability) ); gzread( setup_file, &_tune_recipient_ability, sizeof(_tune_recipient_ability) ); gzread( setup_file, &_donor_cost, sizeof(_donor_cost) ); gzread( setup_file, &_recipient_cost, sizeof(_recipient_cost) ); int8_t tmp_swap_GUs; gzread( setup_file, &tmp_swap_GUs, sizeof(tmp_swap_GUs) ); _swap_GUs = tmp_swap_GUs ? 1 : 0; } // ------------------------------------------ Retrieve secretion parameters int8_t tmp_with_secretion; gzread( setup_file, &tmp_with_secretion, sizeof(tmp_with_secretion) ); _with_secretion = tmp_with_secretion ? true : false; gzread( setup_file, &_secretion_contrib_to_fitness, sizeof(_secretion_contrib_to_fitness) ); gzread( setup_file, &_secretion_cost, sizeof(_secretion_cost) ); // ---------------------------------------------- Retrieve selection context get_sel()->load( setup_file, backup_file, verbose ); } void ae_exp_setup::load( FILE* setup_file, gzFile backup_file, bool verbose ) { printf( "Plain text setup file support not implemented yet (sorry)\n" ); exit( EXIT_FAILURE ); } // =========================================================================== // Protected Methods // =========================================================================== aevol-4.4/src/libaevol/ae_dna_replic_report.h0000644000175000017500000002034012242613025016301 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_DNA_REPLIC_REPORT_H__ #define __AE_DNA_REPLIC_REPORT_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_dna; class ae_dna_replic_report : public ae_object { friend class ae_dna; public : // ================================================================= // Constructors // ================================================================= ae_dna_replic_report( void ); ae_dna_replic_report( const ae_dna_replic_report &model ); // ================================================================= // Destructors // ================================================================= virtual ~ae_dna_replic_report( void ); // ================================================================= // Accessors // ================================================================= inline ae_list* get_mutations( void ) const; inline ae_list* get_rearrangements( void ) const; inline ae_list* get_HT( void ) const; inline int32_t get_nb_small_mutations( void ) const; inline int32_t get_nb_rearrangements( void ) const; inline int32_t get_nb_HT( void ) const; inline int32_t get_nb_switch( void ) const; inline int32_t get_nb_small_insertions( void ) const; inline int32_t get_nb_small_deletions( void ) const; inline int32_t get_nb_indels( void ) const; inline int32_t get_nb_duplications( void ) const; inline int32_t get_nb_deletions( void ) const; inline int32_t get_nb_translocations( void ) const; inline int32_t get_nb_inversions( void ) const; inline int32_t get_nb_ins_HT( void ) const; inline int32_t get_nb_repl_HT( void ) const; // ================================================================= // Public Methods // ================================================================= void compute_stats( void ); // useful when we inspect a tree file inline void add_rear( ae_mutation* rear ); inline void add_mut( ae_mutation* mut ); inline void add_HT( ae_mutation* HT); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= /* ae_dna_replic_report( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_dna_replic_report( const ae_dna_replic_report &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_list* _mutations; // Lists of mutations, rearrangements and undergone ae_list* _rearrangements; // by the genetic unit at last replication ae_list* _HT; int32_t _nb_mut[10]; // Number of mutations/rearrangements/HT of each type undergone }; // ===================================================================== // Accessors' definitions // ===================================================================== inline ae_list* ae_dna_replic_report::get_mutations( void ) const { return _mutations; } inline ae_list* ae_dna_replic_report::get_rearrangements( void ) const { return _rearrangements; } inline ae_list* ae_dna_replic_report::get_HT( void ) const { return _HT; } inline int32_t ae_dna_replic_report::get_nb_small_mutations( void ) const { assert( _mutations->get_nb_elts() == _nb_mut[SWITCH] + _nb_mut[S_INS] + _nb_mut[S_DEL] ); return _mutations->get_nb_elts(); } inline int32_t ae_dna_replic_report::get_nb_rearrangements( void ) const { assert( _rearrangements->get_nb_elts() == _nb_mut[DUPL] + _nb_mut[DEL] + _nb_mut[TRANS] + _nb_mut[INV] ); return _rearrangements->get_nb_elts(); } inline int32_t ae_dna_replic_report::get_nb_HT( void ) const { assert( _HT->get_nb_elts() == _nb_mut[INS_HT] + _nb_mut[REPL_HT] ); return _HT->get_nb_elts(); } inline int32_t ae_dna_replic_report::get_nb_switch( void ) const { return _nb_mut[SWITCH]; } inline int32_t ae_dna_replic_report::get_nb_small_insertions( void ) const { return _nb_mut[S_INS]; } inline int32_t ae_dna_replic_report::get_nb_small_deletions( void ) const { return _nb_mut[S_DEL]; } inline int32_t ae_dna_replic_report::get_nb_indels( void ) const { return _nb_mut[S_INS] + _nb_mut[S_DEL]; } inline int32_t ae_dna_replic_report::get_nb_duplications( void ) const { return _nb_mut[DUPL]; } inline int32_t ae_dna_replic_report::get_nb_deletions( void ) const { return _nb_mut[DEL]; } inline int32_t ae_dna_replic_report::get_nb_translocations( void ) const { return _nb_mut[TRANS]; } inline int32_t ae_dna_replic_report::get_nb_inversions( void ) const { return _nb_mut[INV]; } inline int32_t ae_dna_replic_report::get_nb_ins_HT( void ) const { return _nb_mut[INS_HT]; } inline int32_t ae_dna_replic_report::get_nb_repl_HT( void ) const { return _nb_mut[REPL_HT]; } // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_dna_replic_report::add_mut( ae_mutation* mut ) { assert( mut != NULL ); _mutations->add( mut ); _nb_mut[ mut->get_mut_type() ]++; } inline void ae_dna_replic_report::add_rear( ae_mutation* rear ) { assert( rear != NULL ); _rearrangements->add( rear ); _nb_mut[ rear->get_mut_type() ]++; } inline void ae_dna_replic_report::add_HT( ae_mutation* HT ) { assert( HT != NULL ); _HT->add( HT ); _nb_mut[ HT->get_mut_type() ]++; } #endif // __AE_DNA_REPLIC_REPORT_H__ aevol-4.4/src/libaevol/ae_output_manager.cpp0000644000175000017500000002476512364050651016217 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_output_manager # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_output_manager::ae_output_manager( ae_exp_manager* exp_m ) { _exp_m = exp_m; _stats = NULL; _tree = NULL; _dump = NULL; _compute_phen_contrib_by_GU = false; _record_tree = false; _make_dumps = false; _dump_step = 0; _logs = new ae_logs(); } // ================================================================= // Destructors // ================================================================= ae_output_manager::~ae_output_manager( void ) { delete _stats; delete _tree; delete _dump; delete _logs; } // ================================================================= // Public Methods // ================================================================= void ae_output_manager::write_setup_file( gzFile setup_file ) const { // Write the backup steps gzwrite( setup_file, &_backup_step, sizeof(_backup_step) ); gzwrite( setup_file, &_big_backup_step, sizeof(_big_backup_step) ); // Stats gzwrite( setup_file, &_compute_phen_contrib_by_GU, sizeof(_compute_phen_contrib_by_GU) ); // Tree int8_t record_tree = _record_tree; gzwrite( setup_file, &record_tree, sizeof(record_tree) ); if ( _record_tree ) { int32_t tmp_tree_step = _tree->get_tree_step(); gzwrite( setup_file, &tmp_tree_step, sizeof(tmp_tree_step) ); int8_t tmp_tree_mode = (int8_t) _tree->get_tree_mode(); gzwrite( setup_file, &tmp_tree_mode, sizeof(tmp_tree_mode) ); } // Dumps int8_t make_dumps = _make_dumps; gzwrite( setup_file, &make_dumps, sizeof(make_dumps) ); gzwrite( setup_file, &_dump_step, sizeof(_dump_step) ); // Logs int8_t logs = _logs->get_logs(); gzwrite( setup_file, &logs, sizeof(logs) ); } void ae_output_manager::write_setup_file( FILE* setup_file ) const { // Write the backup steps fprintf( setup_file, "BACKUP_STEP %"PRId32"\n", _backup_step ); fprintf( setup_file, "BIG_BACKUP_STEP %"PRId32"\n", _big_backup_step ); // Stats fprintf( setup_file, "COMPUTE_PHENOTYPIC_CONTRIBUTION_BY_GU %"PRId8"\n", (int8_t) _compute_phen_contrib_by_GU ); // Tree fprintf( setup_file, "RECORD_TREE %s\n", _record_tree ? "true" : "false" ); if ( _record_tree ) { fprintf( setup_file, "TREE_STEP %"PRId32"\n", _tree->get_tree_step() ); if ( _tree->get_tree_mode() == LIGHT ) { fprintf( setup_file, "TREE_MODE LIGHT\n" ); } else if ( _tree->get_tree_mode() == NORMAL ) { fprintf( setup_file, "TREE_MODE NORMAL\n" ); } else { fprintf( setup_file, "TREE_MODE UNKNOWN\n" ); } } // Dumps fprintf( setup_file, "MAKE_DUMPS %s\n", _make_dumps ? "true" : "false" ); fprintf( setup_file, "DUMP_STEP %"PRId32"\n", _dump_step ); // Logs int8_t logs = _logs->get_logs(); fprintf( setup_file, "LOGS %"PRId8"\n", logs ); } void ae_output_manager::load( gzFile setup_file, bool verbose, bool to_be_run ) { // Write the backup steps gzread( setup_file, &_backup_step, sizeof(_backup_step) ); gzread( setup_file, &_big_backup_step, sizeof(_big_backup_step) ); // Stats int32_t num_gener = _exp_m->get_num_gener(); if( to_be_run ) { if ( num_gener > 0 ) { _stats = new ae_stats( _exp_m, num_gener ); } else { _stats = new ae_stats( _exp_m ); } } gzread( setup_file, &_compute_phen_contrib_by_GU, sizeof(_compute_phen_contrib_by_GU) ); // Tree int8_t record_tree; gzread( setup_file, &record_tree, sizeof(record_tree) ); _record_tree = record_tree; if ( _record_tree ) { int32_t tmp_tree_step; gzread( setup_file, &tmp_tree_step, sizeof(tmp_tree_step) ); int8_t tmp_tree_mode; gzread( setup_file, &tmp_tree_mode, sizeof(tmp_tree_mode) ); if ( (ae_tree_mode)tmp_tree_mode != LIGHT && (ae_tree_mode)tmp_tree_mode != NORMAL) { printf( "%s:%d: error: invalid tree mode\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } _tree = new ae_tree( _exp_m, (ae_tree_mode) tmp_tree_mode, tmp_tree_step ); } // Dumps int8_t make_dumps; gzread( setup_file, &make_dumps, sizeof(make_dumps) ); _make_dumps = make_dumps; gzread( setup_file, &_dump_step, sizeof(_dump_step) ); if( _make_dumps == true) { _dump = new ae_dump(_exp_m); } // Logs int8_t logs; gzread( setup_file, &logs, sizeof(logs) ); if( to_be_run) { _logs->load(logs, num_gener); } } void ae_output_manager::load( FILE* setup_file, bool verbose, bool to_be_run ) { // Write the backup steps fscanf( setup_file, "BACKUP_STEP %"PRId32"\n", &_backup_step ); fscanf( setup_file, "BIG_BACKUP_STEP %"PRId32"\n", &_big_backup_step ); // Stats int32_t num_gener = _exp_m->get_num_gener(); if( to_be_run) { if ( num_gener > 0 ) { _stats = new ae_stats( _exp_m, num_gener ); } else { _stats = new ae_stats( _exp_m ); } } fscanf( setup_file, "COMPUTE_PHENOTYPIC_CONTRIBUTION_BY_GU %"PRId8"\n", (int8_t*) &_compute_phen_contrib_by_GU ); char tmp[10]; // Tree fscanf( setup_file, "RECORD_TREE %s\n", tmp ); _record_tree = ! strcmp( tmp, "true" ); if ( _record_tree ) { int32_t tmp_tree_step; fscanf( setup_file, "TREE_STEP %"PRId32"\n", &tmp_tree_step ); int8_t tmp_tree_mode; fscanf( setup_file, "TREE_MODE %"PRId8"\n", &tmp_tree_mode ); if ( (ae_tree_mode)tmp_tree_mode != LIGHT && (ae_tree_mode)tmp_tree_mode != NORMAL) { printf( "%s:%d: error: invalid tree mode\n", __FILE__, __LINE__ ); assert( false ); exit( EXIT_FAILURE ); } _tree = new ae_tree( _exp_m, (ae_tree_mode) tmp_tree_mode, tmp_tree_step ); } // Dumps fscanf( setup_file, "MAKE_DUMPS %s\n", tmp ); _make_dumps = ! strcmp( tmp, "true" ); fscanf( setup_file, "DUMP_STEP %"PRId32"\n", &_dump_step ); if( _make_dumps == true) { _dump = new ae_dump(_exp_m); } // Logs int8_t logs; fscanf( setup_file, "LOGS %"PRId8"\n", &logs ); _logs->load(logs, num_gener); } void ae_output_manager::write_current_generation_outputs( void ) const { int32_t num_gener = _exp_m->get_num_gener(); _stats->write_current_generation_statistics(); if ( _record_tree ) { if ( num_gener > 0 ) { _tree->fill_tree_with_cur_gener(); } } // Write backup and tree if ( _record_tree && (num_gener != _exp_m->get_first_gener()) && (num_gener % _tree->get_tree_step() == 0) ) { if ( _tree->get_tree_mode() == NORMAL ) { write_tree(); } } if ( num_gener % _backup_step == 0 ) { _stats->flush(); _exp_m->save(); // Update the LAST_GENER file FILE* last_gener_file = fopen( LAST_GENER_FNAME, "w" ); if ( last_gener_file != NULL ) { fprintf( last_gener_file, "%"PRId32"\n", num_gener ); fclose( last_gener_file ); } else { printf( "Error : could not open file "LAST_GENER_FNAME"\n" ); } #ifdef __IN2P3 if ( num_gener % _big_backup_step == 0 ) { system( "./make_big_backup.py" ); } #endif } if ( _make_dumps ) { if( num_gener % _dump_step == 0 ) { _dump->write_current_generation_dump(); } } } // ================================================================= // Protected Methods // ================================================================= void ae_output_manager::write_tree( void ) const { // Create the tree directory if it doesn't exist int status; status = mkdir( TREE_DIR, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, "Impossible to create the directory %s", TREE_DIR ); } char tree_file_name[50]; #ifdef __REGUL sprintf( tree_file_name, "tree/tree_%06"PRId32".rae", _exp_m->get_num_gener() ); #else sprintf( tree_file_name, "tree/tree_%06"PRId32".ae", _exp_m->get_num_gener() ); #endif gzFile tree_file = gzopen( tree_file_name, "w" ); // Write phylogenetic data (tree) _tree->write_to_tree_file( tree_file ); gzclose( tree_file ); } // ================================================================= // Non inline accessors // ================================================================= aevol-4.4/src/libaevol/ae_codon.cpp0000644000175000017500000001004212231437075014250 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_codon # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_codon::ae_codon( void ) { _value = -1; } ae_codon::ae_codon( const ae_codon &model ) { _value = model._value; } ae_codon::ae_codon( int8_t value ) { _value = value; } ae_codon::ae_codon( ae_dna* dna, ae_strand strand, int32_t index ) { const char* gen = dna->get_data(); int32_t len = dna->get_length(); _value = 0; if ( strand == LEADING ) { for ( int8_t i = 0 ; i < CODON_SIZE ; i++ ) { if ( gen[ae_utils::mod((index+i),len)] == '1' ) { //_value += pow( 2, CODON_SIZE - i - 1 ); _value += 1 << ( CODON_SIZE - i - 1 ); } } } else // ( strand == LAGGING ) { for ( int8_t i = 0 ; i < CODON_SIZE ; i++ ) { if ( gen[ae_utils::mod((index-i),len)] != '1' ) // == and not != because we are on the complementary strand... { //_value += pow( 2, CODON_SIZE - i - 1 ); _value += 1 << ( CODON_SIZE - i - 1 ); } } } } ae_codon::ae_codon( gzFile backup_file ) { gzread( backup_file, &_value, sizeof(_value) ); } // ================================================================= // Destructors // ================================================================= ae_codon::~ae_codon( void ) { } // ================================================================= // Public Methods // ================================================================= void ae_codon::save( gzFile backup_file ) { gzwrite( backup_file, &_value, sizeof(_value) ); } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_jumping_mt.cpp0000644000175000017500000002551412231437075015331 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_jumping_mt # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= int32_t ae_jumping_mt::nb_jumps = 0; double ae_jumping_mt::jump_time = 0; // ================================================================= // Constructors // ================================================================= /*! Create a generator initialized with a simple uint32_t */ ae_jumping_mt::ae_jumping_mt( const uint32_t& simple_seed ) { _sfmt = new sfmt_t(); sfmt_init_gen_rand( _sfmt, simple_seed ); // Jump to get rid of the initializatino skew jump(); } /*! Create a copy of an existing generator */ ae_jumping_mt::ae_jumping_mt( const ae_jumping_mt& model ) { _sfmt = new sfmt_t(); memcpy(_sfmt->state, model._sfmt->state, SFMT_N*sizeof(_sfmt->state[0])); _sfmt->idx = model._sfmt->idx; } /*! Load a generator from a gz backup file */ ae_jumping_mt::ae_jumping_mt( gzFile backup_file ) { _sfmt = new sfmt_t(); gzread( backup_file, _sfmt->state, SFMT_N * sizeof( _sfmt->state[0] ) ); gzread( backup_file, &(_sfmt->idx), sizeof( _sfmt->idx ) ); } // ================================================================= // Destructors // ================================================================= ae_jumping_mt::~ae_jumping_mt( void ) { delete _sfmt; } // ================================================================= // Public Methods // ================================================================= /*! Jump Ahead by a predefined jump length */ void ae_jumping_mt::jump( void ) { //~ clock_t start, end; //~ start = clock(); #ifdef TRIVIAL_METHOD_JUMP_SIZE for ( int i = 0 ; i < TRIVIAL_METHOD_JUMP_SIZE ; i++ ) { sfmt_genrand_real2( _sfmt ); } #else SFMT_jump( _sfmt, jump_poly ); #endif //~ int nb_sup_steps = 100 * (double)rand() / ((double)RAND_MAX + 1); //~ for ( int i = 0 ; i < nb_sup_steps ; i++ ) //~ { //~ sfmt_genrand_real2( _sfmt ); //~ } //~ end = clock(); //~ jump_time += (end - start) * 1000 / CLOCKS_PER_SEC; //~ nb_jumps++; } /*! Binomial drawing of parameter (nb_drawings, prob). Number of successes out of nb_drawings trials each of probability prob. */ int32_t ae_jumping_mt::binomial_random( int32_t nb_drawings, double prob ) { int32_t nb_success; // The binomial distribution is invariant under changing // ProbSuccess to 1-ProbSuccess, if we also change the answer to // NbTrials minus itself; we ll remember to do this below. double p; if ( prob <= 0.5 ) p = prob; else p = 1.0 - prob; // mean of the deviate to be produced double mean = nb_drawings * p; if ( nb_drawings < 25 ) // Use the direct method while NbTrials is not too large. // This can require up to 25 calls to the uniform random. { nb_success = 0; for ( int32_t j = 1 ; j <= nb_drawings ; j++ ) { if ( random() < p ) nb_success++; } } else if ( mean < 1.0 ) // If fewer than one event is expected out of 25 or more trials, // then the distribution is quite accurately Poisson. Use direct Poisson method. { double g = exp( -mean ); double t = 1.0; int32_t j; for ( j = 0; j <= nb_drawings ; j++ ) { t = t * random(); if ( t < g ) break; } if ( j <= nb_drawings ) nb_success = j; else nb_success = nb_drawings; } else // Use the rejection method. { double en = nb_drawings; double oldg = gammln( en + 1.0 ); double pc = 1.0 - p; double plog = log( p ); double pclog = log( pc ); // rejection method with a Lorentzian comparison function. double sq = sqrt( 2.0 * mean * pc ); double angle, y, em, t; do { do { angle = M_PI * random(); y = tan( angle ); em = sq*y + mean; } while ( em < 0.0 || em >= (en + 1.0) ); // Reject. em = floor( em ); // Trick for integer-valued distribution. t = 1.2 * sq * (1.0 + y*y) * exp( oldg - gammln(em + 1.0) - gammln(en - em + 1.0) + em * plog + (en - em) * pclog ); } while ( random() > t ); // Reject. This happens about 1.5 times per deviate, on average. nb_success = (int32_t) rint( em ); } // Undo the symmetry transformation. if ( p != prob ) nb_success = nb_drawings - nb_success; return nb_success; } double ae_jumping_mt::gaussian_random( void ) { double x1, x2; double r = 0; do { x1 = 2.0 * random() - 1.0; x2 = 2.0 * random() - 1.0; r = x1*x1 + x2*x2; // (x1,x2) must be in the unit circle } while ( (r >= 1.0) || (r == 0) ); r = sqrt( (-2.0 * log(r)) / r ); // Box-muller transformation return x1 * r; } int8_t ae_jumping_mt::roulette_random( double* probs, int8_t nb_elts ) { double pick_one = 0.0; while ( pick_one == 0 ) { pick_one = random(); } int8_t found_org = 0; pick_one -= probs[0]; while ( pick_one > 0 ) { assert(found_org 0 ) { printf( "Zero sum in multinomial function\n" ); assert( false ); exit( EXIT_FAILURE ); } int32_t x; int32_t n = nb_drawings; for ( int32_t i = 0 ; i < nb_colors - 1 ; i++ ) { // generate output by calling binomial (nb_colors-1) times p = source[i]; if ( sum <= p ) { // this fixes two problems: // 1. prevent division by 0 when sum = 0 // 2. prevent p/sum getting bigger than 1 in case of rounding errors x = n; } else { x = binomial_random( n, p/sum ); } n = n - x; sum = sum - p; destination[i] = x; } // get the last one destination[nb_colors-1] = n; } void ae_jumping_mt::save( gzFile backup_file ) const { gzwrite( backup_file, _sfmt->state, SFMT_N * sizeof( _sfmt->state[0] ) ); gzwrite( backup_file, &(_sfmt->idx), sizeof( _sfmt->idx ) ); } // ================================================================= // Protected Methods // ================================================================= double ae_jumping_mt::gammln( double X ) // Returns the value ln[gamma(X)] for X. // The gamma function is defined by the integral gamma(z) = int(0, +inf, t^(z-1).e^(-t)dt). // When the argument z is an integer, the gamma function is just the familiar factorial // function, but offset by one, n! = gamma(n + 1). { double x, y, tmp, ser; static double cof[6] = { 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5 }; y = x = X; tmp = x + 5.5; tmp -= (x+0.5) * log(tmp); ser = 1.000000000190015; for ( int8_t j = 0 ; j <= 5 ; j++ ) { ser += cof[j] / ++y; } return -tmp + log(2.5066282746310005 * ser / x); } // ================================================================= // Non inline accessors // ================================================================= aevol-4.4/src/libaevol/ae_macros.h0000644000175000017500000001046512231437075014110 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #include #define NB_BASE INT8_C(2) // WARNING : A lot of stuff has been optimized for binary genomes // Changing the value of NB_BASE implies verifying the existing code // and make changes where necessary // Backup directories and file name formats // Experimental Setup #define EXP_S_DIR "exp_setup" #define EXP_S_FNAME_BASE "exp_setup_%06"PRId32 #define EXP_S_FNAME_FORMAT EXP_S_DIR"/"EXP_S_FNAME_BASE".ae" //~ #define EXP_S_TXT_FNAME_FORMAT EXP_S_DIR"/"EXP_S_FNAME_BASE".in" #define EXP_S_CONST_FNAME_BASE "exp_setup_const" #define EXP_S_CONST_FNAME_FORMAT EXP_S_DIR"/"EXP_S_CONST_FNAME_BASE".ae" #define EXP_S_TXT_CONST_FNAME_FORMAT EXP_S_DIR"/"EXP_S_CONST_FNAME_BASE".in" // Output Profile #define OUT_P_DIR "output_profile" #define OUT_P_FNAME_BASE "output_profile" #define OUT_P_FNAME_FORMAT OUT_P_DIR"/"OUT_P_FNAME_BASE".ae" #define OUT_P_TXT_FNAME_FORMAT OUT_P_DIR"/"OUT_P_FNAME_BASE".in" #define OUT_P_CUR_FNAME "output_profile.ae" #define OUT_P_TXT_CUR_FNAME "output_profile.in" // Environment #define ENV_DIR "environment" #define ENV_FNAME_BASE "env_%06"PRId32 #define ENV_FNAME_FORMAT ENV_DIR"/"ENV_FNAME_BASE".ae" // Population #define POP_DIR "populations" #define POP_FNAME_BASE "pop_%06"PRId32 #define POP_FNAME_FORMAT POP_DIR"/"POP_FNAME_BASE".ae" // Spatial Structure #define SP_STRUCT_DIR "spatial_structure" #define SP_STRUCT_FNAME_BASE "sp_struct_%06"PRId32 #define SP_STRUCT_FNAME_FORMAT SP_STRUCT_DIR"/"SP_STRUCT_FNAME_BASE".ae" // Stats #define STATS_DIR "stats" // Tree #define TREE_DIR "tree" // Last gener file #define LAST_GENER_FNAME "last_gener.txt" // Best last organism file #define BEST_LAST_ORG_FNAME "best_last_org.txt" #define FIXED_POPULATION_SIZE // Some calculation can be spared if we know that the size of the population is fixed #define PROM_SIZE INT8_C(22) #define PROM_SEQ "0101011001110010010110" #define PROM_MAX_DIFF INT8_C(4) #define TERM_STEM_SIZE INT8_C(4) #define TERM_LOOP_SIZE INT8_C(3) #define TERM_SIZE INT8_C(2 * TERM_STEM_SIZE + TERM_LOOP_SIZE) #define SHINE_DAL_SIZE INT8_C(6) #define SHINE_DAL_SEQ "011011" #define SHINE_START_SPACER INT8_C(4) #define CODON_SIZE INT8_C(3) #define CODON_START INT8_C(0) // "000" #define CODON_STOP INT8_C(1) // "001" #define CODON_M0 INT8_C(4) // "100" #define CODON_M1 INT8_C(5) // "101" #define CODON_W0 INT8_C(2) // "010" #define CODON_W1 INT8_C(3) // "011" #define CODON_H0 INT8_C(6) // "110" #define CODON_H1 INT8_C(7) // "111" #ifdef __REGUL #define MAX_CODON INT8_C(1 << CODON_SIZE) #define QUADON_SIZE 4 #define MAX_QUADON INT8_C(1 << QUADON_SIZE) #endif #define X_MIN 0.0 #define X_MAX 1.0 #define Y_MIN 0.0 #define Y_MAX 1.0 #define H_MIN -1.0 #define H_MAX 1.0 #define W_MIN 0.0 // W_MAX is defined through a parameter #define SC_MATCH_BONUS INT8_C(1) #define SC_MISMATCH_COST INT8_C(2) aevol-4.4/src/libaevol/ae_selection.cpp0000644000175000017500000007246512364503705015155 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #ifdef __NO_X #ifndef __REGUL #include #else #include #endif #elif defined __X11 #ifndef __REGUL #include #else #include #endif #endif //############################################################################## // # // Class ae_selection # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_selection::ae_selection( ae_exp_manager* exp_m ) { _exp_m = exp_m; // ----------------------------------------- Pseudo-random number generator _prng = NULL; // -------------------------------------------------------------- Selection _selection_scheme = RANK_EXPONENTIAL; _selection_pressure = 0.998; // --------------------------- Probability of reproduction of each organism _prob_reprod = NULL; } // ================================================================= // Destructors // ================================================================= ae_selection::~ae_selection( void ) { delete _prng; if (_prob_reprod!=NULL) { delete [] _prob_reprod; } } // ================================================================= // Public Methods // ================================================================= void ae_selection::step_to_next_generation( void ) { // To create the new generation, we must create nb_indivs new individuals // (offspring) and "kill" the existing ones. // The number of offspring on a given individual will be given by a stochastic // process biased on it's fitness value (the selection process). // There are 3 possible selection schemes : // * Linear Ranking // * Exponential Ranking // * Fitness proportionate // // Whichever method is chosen, we will // 1) Compute the probability of reproduction of each individual in the population // 2) Simulate the stochastic process by a multinomial drawing (based upon the probabilities computed in 1) // 3) Make the selected individuals reproduce, thus creating the new generation // 4) Replace the current generation by the newly created one. // 5) Sort the newly created population* if ( _prng == NULL ) { printf( "%s:%d: error: PRNG not initialized.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } if ( _exp_m->is_spatially_structured() ) { step_to_next_generation_grid(); return; } if ( _exp_m->get_pop()->get_indiv_by_id( 0 )->get_with_stochasticity() ) { _exp_m->get_pop()->backup_stoch_prng(); } // ------------------------------------------------------------------------------- // 1) Compute the probability of reproduction of each individual in the population // ------------------------------------------------------------------------------- #ifndef FIXED_POPULATION_SIZE #error this method is not ready for variable population size compute_prob_reprod(); #else if ( _selection_scheme == FITNESS_PROPORTIONATE || _prob_reprod == NULL ) { compute_prob_reprod(); } #endif // -------------------------------------------------------------------------------------------------------- // 2) Simulate the stochastic process by a multinomial drawing (based upon the probabilities computed in 1) // -------------------------------------------------------------------------------------------------------- int32_t nb_indivs = _exp_m->get_pop()->get_nb_indivs(); int32_t* nb_offsprings = new int32_t[nb_indivs]; _prng->multinomial_drawing( nb_offsprings, _prob_reprod, nb_indivs, nb_indivs ); // ------------------------------------------------------------------------------ // 3) Make the selected individuals "reproduce", thus creating the new generation // ------------------------------------------------------------------------------ ae_list* new_generation = new ae_list(); ae_list* old_generation = _exp_m->get_indivs(); ae_list_node* indiv_node = old_generation->get_first(); ae_list_node* next_indiv_node = NULL; ae_individual* indiv = NULL; int32_t index_new_indiv = 0; for ( int32_t i = 0 ; i < nb_indivs ; i++ ) { // Make indiv i reproduce (nb_offsprings[i] offsprings) indiv = indiv_node->get_obj(); next_indiv_node = indiv_node->get_next(); for ( int32_t j = 0 ; j < nb_offsprings[i] ; j++ ) { #ifdef DISTRIBUTED_PRNG #error Not implemented yet ! // For all but the first time, Take a jump in the PRNG if ( j > 0 ) indiv->do_prng_jump(); #endif // Create a new individual (evaluated at the end of do_replication) new_generation->add( do_replication( indiv, index_new_indiv++ ) ); } // All the offsprings of this individual have been generated, if there is no transfer, // the indiv will not be used any more and can hence be deleted if ( (not _exp_m->get_with_HT()) and (not _exp_m->get_with_plasmids()) ) { old_generation->remove( indiv_node, true, true ); } indiv_node = next_indiv_node; } if ( _exp_m->get_with_HT() or _exp_m->get_with_plasmids() ) { // The individuals have not yet been deleted, do it now. old_generation->erase( true ); } delete [] nb_offsprings; // ------------------------------------------------------------- // 4) Replace the current generation by the newly created one. // ------------------------------------------------------------- assert( _exp_m->get_pop()->get_indivs()->is_empty() ); _exp_m->get_pop()->update_population( new_generation ); // -------------------------------------- // 5) Sort the newly created population // -------------------------------------- _exp_m->get_pop()->sort_individuals(); } void ae_selection::step_to_next_generation_grid( void ) { // ------------------------------------------------------------------------------- // 1) Compute the probability of reproduction of each individual in the population // ------------------------------------------------------------------------------- #ifndef FIXED_POPULATION_SIZE #error this method is not ready for variable population size compute_local_prob_reprod(); #else // The function compute_local_prob_reprod creates and fills the array _prob_reprod, which is telling us the probability of being picked for reproduction according to the rank of an individual in its neighboorhood. // It is only usefull when selection is rank based. When selection scheme is FITNESS_PROPORTIONATE, we do not need to call it. // It shoud only be called once in the simulation and not at each generation. So if _prob_reprod already exists we do not need to call it. if ( (_selection_scheme != FITNESS_PROPORTIONATE) && (_prob_reprod == NULL) ) { compute_local_prob_reprod(); } #endif if ( _prng == NULL ) { printf( "%s:%d: error: PRNG not initialized.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } ae_spatial_structure* sp_struct = _exp_m->get_spatial_structure(); int16_t grid_width = _exp_m->get_grid_width(); int16_t grid_height = _exp_m->get_grid_height(); ae_grid_cell*** pop_grid = _exp_m->get_pop_grid(); // create a temporary grid to store new individuals ae_individual*** new_indiv_grid = new ae_individual** [grid_width]; for ( int16_t i = 0 ; i < grid_width ; i++ ) { new_indiv_grid[i] = new ae_individual* [grid_height]; } // Do local competitions for ( int16_t x = 0 ; x < grid_width ; x++ ) { for ( int16_t y = 0 ; y < grid_height ; y++ ) { new_indiv_grid[x][y] = calculate_local_competition( x, y ); } } // Add the compound secreted by the individuals if ( _exp_m->get_with_secretion() ) { double tmp_secretion; for ( int16_t x = 0 ; x < grid_width ; x++ ) { for ( int16_t y = 0 ; y < grid_height ; y++ ) { tmp_secretion = pop_grid[x][y]->get_compound_amount() + pop_grid[x][y]->get_individual()->get_fitness_by_feature(SECRETION); pop_grid[x][y]->set_compound_amount( tmp_secretion ); } } // Diffusion and degradation of compound in the environment sp_struct->update_secretion_grid(); } // Create the new generation ae_list* new_generation = new ae_list(); int32_t index_new_indiv = 0; for ( int16_t x = 0 ; x < grid_width ; x++ ) { for ( int16_t y = 0 ; y < grid_height ; y++ ) { pop_grid[x][y]->set_individual( do_replication( new_indiv_grid[x][y], index_new_indiv++, x, y ) ); #ifdef DISTRIBUTED_PRNG #error Not implemented yet ! new_indiv_grid[x][y]->do_prng_jump(); #endif new_generation->add( pop_grid[x][y]->get_individual() ); } } // Replace the old population by the newly created one _exp_m->get_pop()->replace_population( new_generation ); // delete the temporary grid for ( int16_t x = 0 ; x < grid_width ; x++ ) { delete [] new_indiv_grid[x]; } delete [] new_indiv_grid; // randomly migrate some organisms, if necessary if ( sp_struct->get_migration_number() > 0 ) { sp_struct->do_random_migrations(); } // Perform plasmid transfer if ( _exp_m->get_with_plasmids() && ( (_exp_m->get_prob_plasmid_HT() != 0.0) || (_exp_m->get_tune_donor_ability() != 0.0) || (_exp_m->get_tune_recipient_ability() != 0.0) ) ) { int16_t x_offset, y_offset, new_x, new_y; // Shuffle the grid: int16_t total_size = ((grid_width)*(grid_height)); int16_t** shuffled_table = new int16_t* [total_size]; for ( int16_t z = 0 ; z < total_size ; z++ ) { shuffled_table[z] = new int16_t[2]; int16_t quotient = z / grid_width; int16_t remainder = z % grid_width; shuffled_table[z][0] = (int16_t) remainder; shuffled_table[z][1] = (int16_t) quotient; } for ( int16_t z = 0 ;z < total_size - 1 ; z++ ) { int16_t rand_nb = _prng->random((int16_t) (total_size-z)); int16_t* tmp=shuffled_table[z+rand_nb]; shuffled_table[z+rand_nb]=shuffled_table[z]; shuffled_table[z]=tmp; } // First transfer all the plasmids, but just add them at the end of the list of the GUs for ( int16_t z = 0 ; z < total_size ; z++ ) // for each individual x { int16_t x=shuffled_table[z][0]; int16_t y=shuffled_table[z][1]; for ( int16_t n = 0 ; n < 9 ; n++ ) // for each neighbour n of x { x_offset = ( n / 3 ) - 1; y_offset = ( n % 3 ) - 1; new_x = (x+x_offset+grid_width) % grid_width; new_y = (y+y_offset+grid_height) % grid_height; if ((new_x != x)||(new_y != y)) { double ptransfer = _exp_m->get_prob_plasmid_HT() + _exp_m->get_tune_donor_ability() * sp_struct->get_indiv_at(x, y)->get_fitness_by_feature(DONOR) + _exp_m->get_tune_recipient_ability() * sp_struct->get_indiv_at(new_x, new_y)->get_fitness_by_feature(RECIPIENT) ; if ( _prng->random() < ptransfer ) // will x give a plasmid to n ? { if ( _exp_m->get_swap_GUs() ) { sp_struct->get_indiv_at(new_x, new_y)->inject_2GUs( sp_struct->get_indiv_at(x, y) ); } else { sp_struct->get_indiv_at(new_x, new_y)->inject_GU( sp_struct->get_indiv_at(x, y) ); } } } } } for(int16_t z=0;z get_indiv_at(x, y)->get_genetic_unit_list()->get_nb_elts() > 2 ) { reevaluate = true; sp_struct->get_indiv_at(x, y)->get_genetic_unit_list()->remove( sp_struct->get_indiv_at(x, y)->get_genetic_unit_list()->get_first()->get_next(), true, true); } if (reevaluate) { sp_struct->get_indiv_at(x, y)->reevaluate(); //previous code avoided full re-evaluation, just updated the "full" proteins list: //_pop_grid[x][y]->get_individual()->reevaluate_after_GU_transfer(ae_common::sim->get_env()); } } } } // Update the best individual _exp_m->get_pop()->update_best(); } /*! */ void ae_selection::write_setup_file( gzFile exp_setup_file ) const { // ---------------------------------------------------- Selection Parameters int8_t tmp_sel_scheme = _selection_scheme; gzwrite( exp_setup_file, &tmp_sel_scheme, sizeof(tmp_sel_scheme) ); gzwrite( exp_setup_file, &_selection_pressure, sizeof(_selection_pressure) ); } /*! */ void ae_selection::write_setup_file( FILE* exp_setup_file ) const { // TODO } /*! */ void ae_selection::save( gzFile& backup_file ) const { if ( _prng == NULL ) { printf( "%s:%d: error: PRNG not initialized.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } // ----------------------------------------- Pseudo-random number generator _prng->save( backup_file ); } void ae_selection::load( gzFile& exp_setup_file, gzFile& backup_file, bool verbose ) { // ---------------------------------------------------- Selection parameters int8_t tmp_sel_scheme; gzread( exp_setup_file, &tmp_sel_scheme, sizeof(tmp_sel_scheme) ); _selection_scheme = (ae_selection_scheme) tmp_sel_scheme; gzread( exp_setup_file, &_selection_pressure, sizeof(_selection_pressure) ); // ----------------------------------------- Pseudo-random number generator _prng = new ae_jumping_mt( backup_file ); } void ae_selection::load( FILE*& exp_setup_file, gzFile& backup_file, bool verbose ) { // TODO } // ================================================================= // Protected Methods // ================================================================= void ae_selection::compute_prob_reprod( void ) { if ( _prob_reprod != NULL ) { delete [] _prob_reprod; } int32_t nb_indivs = _exp_m->get_pop()->get_nb_indivs(); _prob_reprod = new double[nb_indivs]; if ( _selection_scheme == RANK_LINEAR ) { // The probability of reproduction for an individual is given by // ( 2-SP + 2 * (SP-1) * (R-1)/(N-1) ) / N // With : // SP : selective pressure. Linear ranking allows values of SP in [1.0, 2.0]. // R : the rank of the individual in the population (1 for the worst individual) // N : the number of individuals in the population // // We can transform this expression into (2-SP)/N + ((2*(SP-1)) / (N*(N-1))) * (R-1) // Furthermore, (R-1) is given directly by (the index of our probability table) // // probs[0] will hence be given by (2-SP)/N // probs[i+1] can then be expressed by probs[i] + (2*(SP-1)) / (N*(N-1)) double increment = (2 * (_selection_pressure-1)) / (nb_indivs * (nb_indivs-1)); _prob_reprod[0] = (2 - _selection_pressure) / nb_indivs; for ( int32_t i = 1 ; i < nb_indivs ; i++ ) { _prob_reprod[i] = _prob_reprod[i-1] + increment; } // No need to normalize: The sum is always 1 for linear ranking } else if ( _selection_scheme == RANK_EXPONENTIAL ) { // The probability of reproduction for an individual is given by // ( (SP-1) * SP^(N-R) ) / ( SP^N - 1 ) // Which is equivalent to // ( (SP-1) * SP^N ) / ( (SP^N - 1) * SP^R ) // With : // SP : selective pressure. Exponential ranking allows values of SP in ]0.0, 1.0[ // R : the rank of the individual in the population (1 for the worst individual) // N : the number of individuals in the population // // NB : The only rank-dependent term is SP^R // // Because we don't allow ex-aequo, // probs[i+1] can hence be expressed as (probs[i] / SP) // We will hence compute probs[0] with the original formula and infer the remaining values double SP_N = pow(_selection_pressure, nb_indivs); // SP^N _prob_reprod[0] = ( (_selection_pressure - 1) * SP_N ) / ( (SP_N - 1) * _selection_pressure ); for ( int32_t i = 1 ; i < nb_indivs ; i++ ) { _prob_reprod[i] = _prob_reprod[i-1] / _selection_pressure; } // No need to normalize: We don't allow ex-aequo } else if ( _selection_scheme == FITNESS_PROPORTIONATE ) // Fitness Proportionate { // The probability of reproduction for an individual is given by // exp( -SP * gap ) / sum of this measure on all individuals // SP : selective pressure. Fitness proportionate allows values of SP in ]0, +inf[ // The closer SP to 0, the closer the selection to being linear. double* fitnesses = new double[nb_indivs]; double sum = 0; ae_list_node* indiv_node = _exp_m->get_pop()->get_indivs()->get_first(); ae_individual* indiv = NULL; for ( int32_t i = 0 ; i < nb_indivs ; i++ ) { indiv = indiv_node->get_obj(); fitnesses[i] = indiv->get_fitness(); sum += fitnesses[i]; indiv_node = indiv_node->get_next(); } for ( int32_t i = 0 ; i < nb_indivs ; i++ ) { _prob_reprod[i] = fitnesses[i] / sum; } delete [] fitnesses; } else if ( _selection_scheme == FITTEST) // Fittest individual { printf( "ERROR, fittest selection scheme is meant to be used for spatially structured populations %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } else { printf( "ERROR, invalid selection scheme in file %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } void ae_selection::compute_local_prob_reprod( void ) { int16_t neighborhood_size = 9; if ( _prob_reprod != NULL ) { printf ("Warning, already defined %s:%d\n", __FILE__, __LINE__); delete [] _prob_reprod; } _prob_reprod = new double[neighborhood_size]; if ( _selection_scheme == RANK_LINEAR ) { double increment = (2 * (_selection_pressure-1)) / (neighborhood_size * (neighborhood_size-1)); double init_prob = (2 - _selection_pressure) / neighborhood_size; for ( int16_t i = 0 ; i < neighborhood_size ; i++ ) { _prob_reprod[i] = init_prob + increment * i; } } else if ( _selection_scheme == RANK_EXPONENTIAL ) { double SP_N = pow(_selection_pressure, neighborhood_size); _prob_reprod[0] = ( (_selection_pressure - 1) * SP_N ) / ( (SP_N - 1) * _selection_pressure ); for ( int16_t i = 1 ; i < neighborhood_size ; i++ ) { _prob_reprod[i] = _prob_reprod[i-1] / _selection_pressure; } } else if ( _selection_scheme == FITTEST) // Fittest individual { for ( int16_t i = 0 ; i < neighborhood_size-1 ; i++ ) { _prob_reprod[i] = 0.; } _prob_reprod[neighborhood_size-1] = 1.; } else if ( _selection_scheme == FITNESS_PROPORTIONATE ) // Fitness Proportionate { printf( "ERROR, this function is not intented to be use with this selection scheme %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } else { printf( "ERROR, invalid selection scheme in file %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } ae_individual* ae_selection::do_replication( ae_individual* parent, int32_t index, int16_t x /*= -1 */, int16_t y /*= -1 */ ) { ae_individual* new_indiv = NULL; // =========================================================================== // 1) Copy parent // =========================================================================== #ifdef __NO_X #ifndef __REGUL new_indiv = new ae_individual( parent, index, parent->get_mut_prng(), parent->get_stoch_prng() ); #else new_indiv = new ae_individual_R( dynamic_cast(parent), index, parent->get_mut_prng(), parent->get_stoch_prng() ); #endif #elif defined __X11 #ifndef __REGUL new_indiv = new ae_individual_X11( dynamic_cast(parent), index, parent->get_mut_prng(), parent->get_stoch_prng() ); #else new_indiv = new ae_individual_R_X11( dynamic_cast(parent), index, parent->get_mut_prng(), parent->get_stoch_prng() ); #endif #endif // =========================================================================== // 2) Set the new individual's location on the grid // (needed if the population is structured) // =========================================================================== if ( _exp_m->is_spatially_structured() && (x != -1) ) { new_indiv->set_grid_cell( _exp_m->get_spatial_structure()->get_grid_cell( x, y ) ); } // =========================================================================== // 3) Perform transfer, rearrangements and mutations // =========================================================================== if ( ! new_indiv->get_allow_plasmids() ) { ae_genetic_unit* chromosome = new_indiv->get_genetic_unit_list()->get_first()->get_obj(); chromosome->get_dna()->perform_mutations( parent->get_id()); if ( new_indiv->get_replic_report() != NULL ) { new_indiv->get_replic_report()->get_dna_replic_reports()->add( chromosome->get_dna()->get_replic_report() ); } } else { // For each GU, apply mutations ae_list_node* gen_unit_node = NULL; ae_genetic_unit* gen_unit = NULL; // Randomly determine the order in which the GUs will undergo mutations bool inverse_order = (_prng->random((int32_t) 2) < 0.5); if ( ! inverse_order ) // Apply mutations in normal GU order { gen_unit_node = new_indiv->get_genetic_unit_list()->get_first(); while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->get_dna()->perform_mutations( parent->get_id() ); if ( new_indiv->get_replic_report() != NULL ) { new_indiv->get_replic_report()->get_dna_replic_reports()->add( gen_unit->get_dna()->get_replic_report() ); } gen_unit_node = gen_unit_node->get_next(); } } else // Apply mutations in inverse GU order { gen_unit_node = new_indiv->get_genetic_unit_list()->get_last(); while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->get_dna()->perform_mutations( parent->get_id() ); if ( new_indiv->get_replic_report() != NULL ) { new_indiv->get_replic_report()->get_dna_replic_reports()->add( gen_unit->get_dna()->get_replic_report() ); } gen_unit_node = gen_unit_node->get_prev(); } } } // =========================================================================== // 4) Evaluate new individual // =========================================================================== new_indiv->evaluate(); // =========================================================================== // 5) Compute statistics // =========================================================================== new_indiv->compute_statistical_data(); #ifdef BIG_DEBUG // ae_common::sim->get_logs()->flush(); // ae_common::sim is obsolete in version 4 // new_indiv->assert_promoters(); #endif return new_indiv; } ae_individual* ae_selection::calculate_local_competition ( int16_t x, int16_t y ) { // This function uses the array _prob_reprod when selection scheme is RANK_LINEAR, RANK_EXPONENTIAL, or FITTEST. For these selection schemes, the function compute_local_prob_reprod (creating the array _prob_reprod) must have been called before. // When selection scheme is FITNESS_PROPORTIONATE, this function only uses the fitness values ae_spatial_structure* sp_struct = _exp_m->get_spatial_structure(); int16_t neighborhood_size = 9; int16_t grid_width = sp_struct->get_grid_width(); int16_t grid_height = sp_struct->get_grid_height(); int16_t cur_x; int16_t cur_y; // construct a temporarry local array of fitness values double * local_fit_array = new double[neighborhood_size]; double * sort_fit_array = new double[neighborhood_size]; int16_t * initial_location = new int16_t[neighborhood_size]; double * probs = new double[neighborhood_size]; int16_t count = 0; double sum_local_fit = 0.0; for ( int8_t i = -1 ; i < 2 ; i++ ) { for ( int8_t j = -1 ; j < 2 ; j++ ) { cur_x = ( x + i + grid_width ) % grid_width; cur_y = ( y + j + grid_height ) % grid_height; local_fit_array[count] = sp_struct->get_indiv_at( cur_x, cur_y )->get_fitness(); sort_fit_array[count] = local_fit_array[count]; initial_location[count] = count; sum_local_fit += local_fit_array[count]; count++; } } // Do the competitions between the individuals, based on one of the 4 methods: // 1. Rank linear // 2. Rank exponential // 3. Fitness proportionate // 4. Fittest individual // Any rank based selection switch ( _selection_scheme ) { case RANK_LINEAR : case RANK_EXPONENTIAL : case FITTEST : { assert(_prob_reprod); // First we sort the local fitness values using bubble sort : // we sort by increasing order, so the first element will have the worst fitness. bool swaped = true; int16_t loop_length = 8; double tmp_holder; int16_t tmp_holder2; while ( swaped == true ) { swaped = false; for ( int16_t i = 0 ; i < loop_length ; i++ ) { //if the first is higher than the second, exchange them if ( sort_fit_array[i] > sort_fit_array[i+1] ) { tmp_holder = sort_fit_array[i]; sort_fit_array[i] = sort_fit_array[i+1]; sort_fit_array[i+1] = tmp_holder; tmp_holder2 = initial_location[i]; initial_location[i] = initial_location[i+1]; initial_location[i+1] = tmp_holder2; swaped = true; } } loop_length = loop_length - 1; } // Then we use the already computed probabilities for ( int16_t i = 0 ; i < neighborhood_size ; i++ ) { probs[initial_location[i]] = _prob_reprod[i]; } break; } // Fitness proportionate selection case FITNESS_PROPORTIONATE : { for( int16_t i = 0 ; i < neighborhood_size ; i++ ) { probs[i] = local_fit_array[i]/sum_local_fit; } break; } default : { printf( "ERROR, invalid selection scheme in file %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } // pick one organism to reproduce, based on probs[] calculated above, using roulette selection int8_t found_org = _prng->roulette_random( probs, 9 ); int16_t x_offset = ( found_org / 3 ) - 1; int16_t y_offset = ( found_org % 3 ) - 1; delete [] local_fit_array; delete [] sort_fit_array; delete [] initial_location; delete [] probs; return sp_struct->get_indiv_at( (x+x_offset+grid_width) % grid_width, (y+y_offset+grid_height) % grid_height ); } // ================================================================= // Non inline accessors // ================================================================= aevol-4.4/src/libaevol/ae_X11_window.h0000644000175000017500000001701212231437075014557 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_X11_WINDOW_H__ #define __AE_X11_WINDOW_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= enum color_map { WHITE, BLACK, RED, GREEN, BLUE, ORANGE, YELLOW, GREY, LIGHT_GREY, DARK_GREY, DARKER_GREY }; class ae_X11_window : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_X11_window( void ); ae_X11_window( Display* display, int8_t screen, Atom * atoms, uint16_t pos_x, uint16_t pos_y, uint16_t width, uint16_t height, const char* caption ); // ================================================================= // Destructors // ================================================================= virtual ~ae_X11_window( void ); // ================================================================= // Accessors // ================================================================= GC get_gc_white( void ) { return _gcWhite; }; GC get_gc_black( void ) { return _gcBlack; }; GC getGCBlue( void ) { return _gcBlue; }; GC getGCRed( void ) { return _gcRed; }; GC getGCLightGrey( void ) { return _gcLightGrey; }; GC getGCDarkGrey( void ) { return _gcDarkGrey; }; GC getGCDarkerGrey( void ) { return _gcDarkerGrey; }; GC getGCGrey( void ) { return _gcGrey; }; GC getGCGreen( void ) { return _gcGreen; }; GC getGCOrange( void ) { return _gcOrange; }; GC getGCYellow( void ) { return _gcYellow; }; uint16_t get_width( void ) { return _width; }; uint16_t get_height( void ) { return _height; }; Window get_window( void ) { return _window; }; Display * get_display( void ) { return _display; }; // ================================================================= // Public Methods // ================================================================= void resize( unsigned int width, unsigned int height ); inline void blacken( void ); void draw_string( int16_t x, int16_t y, char* str ); void draw_line( int16_t x1, int16_t y1, int16_t x2, int16_t y2, color_map color, bool bold = false ); void draw_line( int16_t x1, int16_t y1, int16_t x2, int16_t y2, char* color, bool bold = false ); void draw_circle( int16_t x, int16_t y, int16_t diam ); void draw_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ); void draw_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ); void draw_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ); void draw_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ); void fill_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ); void fill_arc( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ); void fill_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2 ); void fill_arc_64( int16_t x, int16_t y, int16_t diam, int16_t angle1, int16_t angle2, char* color ); void fill_rectangle( int16_t x, int16_t y, int16_t width, int16_t height, color_map color ); void fill_rectangle( int16_t x, int16_t y, int16_t width, int16_t height, char* color ); static char* get_color( double mean ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_X11_window( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; ae_X11_window( const ae_X11_window &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= uint32_t get_pixel( Display *display, int8_t screen, char *color_name, uint32_t default_color ); void set_codes( void ); // ================================================================= // Protected Attributes // ================================================================= Display * _display; int8_t _screen; Window _window; Cursor _cursor; uint16_t _width; uint16_t _height; // Graphic Contexts GC _gcWhite; GC _gcBlack; GC _gcRed; GC _gcGreen; GC _gcBlue; GC _gcOrange; GC _gcYellow; GC _gcGrey; GC _gcLightGrey; GC _gcDarkGrey; GC _gcDarkerGrey; }; // ===================================================================== // Accessors' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== void ae_X11_window::blacken( void ) { fill_rectangle( 0, 0, _width, _height, BLACK ); } #endif // __AE_X11_WINDOW_H__ aevol-4.4/src/libaevol/SFMT-src-1.4/0000755000000000000000000000000012365454434013672 500000000000000aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params216091.h0000644000175000017500000000371612044513720016525 00000000000000#pragma once #ifndef SFMT_PARAMS216091_H #define SFMT_PARAMS216091_H #define SFMT_POS1 627 #define SFMT_SL1 11 #define SFMT_SL2 3 #define SFMT_SR1 10 #define SFMT_SR2 1 #define SFMT_MSK1 0xbff7bff7U #define SFMT_MSK2 0xbfffffffU #define SFMT_MSK3 0xbffffa7fU #define SFMT_MSK4 0xffddfbfbU #define SFMT_PARITY1 0xf8000001U #define SFMT_PARITY2 0x89e80709U #define SFMT_PARITY3 0x3bd2b64bU #define SFMT_PARITY4 0x0c64b1e4U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10} #define SFMT_ALTI_SL2_PERM64 {3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-216091:627-11-3-10-1:bff7bff7-bfffffff-bffffa7f-ffddfbfb" #endif /* SFMT_PARAMS216091_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params44497.h0000644000175000017500000000371612044513720016456 00000000000000#pragma once #ifndef SFMT_PARAMS44497_H #define SFMT_PARAMS44497_H #define SFMT_POS1 330 #define SFMT_SL1 5 #define SFMT_SL2 3 #define SFMT_SR1 9 #define SFMT_SR2 3 #define SFMT_MSK1 0xeffffffbU #define SFMT_MSK2 0xdfbebfffU #define SFMT_MSK3 0xbfbf7befU #define SFMT_MSK4 0x9ffd7bffU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0xa3ac4000U #define SFMT_PARITY4 0xecc1327aU /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(5,6,7,0,9,10,11,4,13,14,15,8,19,19,19,12) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(13,14,15,0,1,2,3,4,19,19,19,8,9,10,11,12) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10} #define SFMT_ALTI_SL2_PERM64 {3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2} #define SFMT_ALTI_SR2_PERM {5,6,7,0,9,10,11,4,13,14,15,8,19,19,19,12} #define SFMT_ALTI_SR2_PERM64 {13,14,15,0,1,2,3,4,19,19,19,8,9,10,11,12} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-44497:330-5-3-9-3:effffffb-dfbebfff-bfbf7bef-9ffd7bff" #endif /* SFMT_PARAMS44497_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT.c0000644000175000017500000002750412102721144014551 00000000000000/** * @file SFMT.c * @brief SIMD oriented Fast Mersenne Twister(SFMT) * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (Hiroshima University) * * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima * University. * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima * University and The University of Tokyo. * All rights reserved. * * The 3-clause BSD License is applied to this software, see * LICENSE.txt */ #if defined(__cplusplus) extern "C" { #endif #include #include #include "SFMT.h" #include "SFMT-params.h" #include "SFMT-common.h" #if defined(__BIG_ENDIAN__) && !defined(__amd64) && !defined(BIG_ENDIAN64) #define BIG_ENDIAN64 1 #endif #if defined(HAVE_ALTIVEC) && !defined(BIG_ENDIAN64) #define BIG_ENDIAN64 1 #endif #if defined(ONLY64) && !defined(BIG_ENDIAN64) #if defined(__GNUC__) #error "-DONLY64 must be specified with -DBIG_ENDIAN64" #endif #undef ONLY64 #endif /** * parameters used by sse2. */ static const w128_t sse2_param_mask = {{SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4}}; /*---------------- STATIC FUNCTIONS ----------------*/ inline static int idxof(int i); inline static void gen_rand_array(sfmt_t * sfmt, w128_t *array, int size); inline static uint32_t func1(uint32_t x); inline static uint32_t func2(uint32_t x); static void period_certification(sfmt_t * sfmt); #if defined(BIG_ENDIAN64) && !defined(ONLY64) inline static void swap(w128_t *array, int size); #endif #if defined(HAVE_ALTIVEC) #include "SFMT-alti.h" #elif defined(HAVE_SSE2) #include "SFMT-sse2.h" #endif /** * This function simulate a 64-bit index of LITTLE ENDIAN * in BIG ENDIAN machine. */ #ifdef ONLY64 inline static int idxof(int i) { return i ^ 1; } #else inline static int idxof(int i) { return i; } #endif #if (!defined(HAVE_ALTIVEC)) && (!defined(HAVE_SSE2)) /** * This function fills the user-specified array with pseudorandom * integers. * * @param sfmt SFMT internal state * @param array an 128-bit array to be filled by pseudorandom numbers. * @param size number of 128-bit pseudorandom numbers to be generated. */ inline static void gen_rand_array(sfmt_t * sfmt, w128_t *array, int size) { int i, j; w128_t *r1, *r2; r1 = &sfmt->state[SFMT_N - 2]; r2 = &sfmt->state[SFMT_N - 1]; for (i = 0; i < SFMT_N - SFMT_POS1; i++) { do_recursion(&array[i], &sfmt->state[i], &sfmt->state[i + SFMT_POS1], r1, r2); r1 = r2; r2 = &array[i]; } for (; i < SFMT_N; i++) { do_recursion(&array[i], &sfmt->state[i], &array[i + SFMT_POS1 - SFMT_N], r1, r2); r1 = r2; r2 = &array[i]; } for (; i < size - SFMT_N; i++) { do_recursion(&array[i], &array[i - SFMT_N], &array[i + SFMT_POS1 - SFMT_N], r1, r2); r1 = r2; r2 = &array[i]; } for (j = 0; j < 2 * SFMT_N - size; j++) { sfmt->state[j] = array[j + size - SFMT_N]; } for (; i < size; i++, j++) { do_recursion(&array[i], &array[i - SFMT_N], &array[i + SFMT_POS1 - SFMT_N], r1, r2); r1 = r2; r2 = &array[i]; sfmt->state[j] = array[i]; } } #endif #if defined(BIG_ENDIAN64) && !defined(ONLY64) && !defined(HAVE_ALTIVEC) inline static void swap(w128_t *array, int size) { int i; uint32_t x, y; for (i = 0; i < size; i++) { x = array[i].u[0]; y = array[i].u[2]; array[i].u[0] = array[i].u[1]; array[i].u[2] = array[i].u[3]; array[i].u[1] = x; array[i].u[3] = y; } } #endif /** * This function represents a function used in the initialization * by init_by_array * @param x 32-bit integer * @return 32-bit integer */ static uint32_t func1(uint32_t x) { return (x ^ (x >> 27)) * (uint32_t)1664525UL; } /** * This function represents a function used in the initialization * by init_by_array * @param x 32-bit integer * @return 32-bit integer */ static uint32_t func2(uint32_t x) { return (x ^ (x >> 27)) * (uint32_t)1566083941UL; } /** * This function certificate the period of 2^{MEXP} * @param sfmt SFMT internal state */ static void period_certification(sfmt_t * sfmt) { int inner = 0; int i, j; uint32_t work; uint32_t *psfmt32 = &sfmt->state[0].u[0]; const uint32_t parity[4] = {SFMT_PARITY1, SFMT_PARITY2, SFMT_PARITY3, SFMT_PARITY4}; for (i = 0; i < 4; i++) inner ^= psfmt32[idxof(i)] & parity[i]; for (i = 16; i > 0; i >>= 1) inner ^= inner >> i; inner &= 1; /* check OK */ if (inner == 1) { return; } /* check NG, and modification */ for (i = 0; i < 4; i++) { work = 1; for (j = 0; j < 32; j++) { if ((work & parity[i]) != 0) { psfmt32[idxof(i)] ^= work; return; } work = work << 1; } } } /*---------------- PUBLIC FUNCTIONS ----------------*/ #define UNUSED_VARIABLE(x) (void)(x) /** * This function returns the identification string. * The string shows the word size, the Mersenne exponent, * and all parameters of this generator. * @param sfmt SFMT internal state */ const char *sfmt_get_idstring(sfmt_t * sfmt) { UNUSED_VARIABLE(sfmt); return SFMT_IDSTR; } /** * This function returns the minimum size of array used for \b * fill_array32() function. * @param sfmt SFMT internal state * @return minimum size of array used for fill_array32() function. */ int sfmt_get_min_array_size32(sfmt_t * sfmt) { UNUSED_VARIABLE(sfmt); return SFMT_N32; } /** * This function returns the minimum size of array used for \b * fill_array64() function. * @param sfmt SFMT internal state * @return minimum size of array used for fill_array64() function. */ int sfmt_get_min_array_size64(sfmt_t * sfmt) { UNUSED_VARIABLE(sfmt); return SFMT_N64; } #if !defined(HAVE_SSE2) && !defined(HAVE_ALTIVEC) /** * This function fills the internal state array with pseudorandom * integers. * @param sfmt SFMT internal state */ void sfmt_gen_rand_all(sfmt_t * sfmt) { int i; w128_t *r1, *r2; r1 = &sfmt->state[SFMT_N - 2]; r2 = &sfmt->state[SFMT_N - 1]; for (i = 0; i < SFMT_N - SFMT_POS1; i++) { do_recursion(&sfmt->state[i], &sfmt->state[i], &sfmt->state[i + SFMT_POS1], r1, r2); r1 = r2; r2 = &sfmt->state[i]; } for (; i < SFMT_N; i++) { do_recursion(&sfmt->state[i], &sfmt->state[i], &sfmt->state[i + SFMT_POS1 - SFMT_N], r1, r2); r1 = r2; r2 = &sfmt->state[i]; } } #endif #ifndef ONLY64 /** * This function generates pseudorandom 32-bit integers in the * specified array[] by one call. The number of pseudorandom integers * is specified by the argument size, which must be at least 624 and a * multiple of four. The generation by this function is much faster * than the following gen_rand function. * * For initialization, init_gen_rand or init_by_array must be called * before the first call of this function. This function can not be * used after calling gen_rand function, without initialization. * * @param sfmt SFMT internal state * @param array an array where pseudorandom 32-bit integers are filled * by this function. The pointer to the array must be \b "aligned" * (namely, must be a multiple of 16) in the SIMD version, since it * refers to the address of a 128-bit integer. In the standard C * version, the pointer is arbitrary. * * @param size the number of 32-bit pseudorandom integers to be * generated. size must be a multiple of 4, and greater than or equal * to (MEXP / 128 + 1) * 4. * * @note \b memalign or \b posix_memalign is available to get aligned * memory. Mac OSX doesn't have these functions, but \b malloc of OSX * returns the pointer to the aligned memory block. */ void sfmt_fill_array32(sfmt_t * sfmt, uint32_t *array, int size) { assert(sfmt->idx == SFMT_N32); assert(size % 4 == 0); assert(size >= SFMT_N32); gen_rand_array(sfmt, (w128_t *)array, size / 4); sfmt->idx = SFMT_N32; } #endif /** * This function generates pseudorandom 64-bit integers in the * specified array[] by one call. The number of pseudorandom integers * is specified by the argument size, which must be at least 312 and a * multiple of two. The generation by this function is much faster * than the following gen_rand function. * * @param sfmt SFMT internal state * For initialization, init_gen_rand or init_by_array must be called * before the first call of this function. This function can not be * used after calling gen_rand function, without initialization. * * @param array an array where pseudorandom 64-bit integers are filled * by this function. The pointer to the array must be "aligned" * (namely, must be a multiple of 16) in the SIMD version, since it * refers to the address of a 128-bit integer. In the standard C * version, the pointer is arbitrary. * * @param size the number of 64-bit pseudorandom integers to be * generated. size must be a multiple of 2, and greater than or equal * to (MEXP / 128 + 1) * 2 * * @note \b memalign or \b posix_memalign is available to get aligned * memory. Mac OSX doesn't have these functions, but \b malloc of OSX * returns the pointer to the aligned memory block. */ void sfmt_fill_array64(sfmt_t * sfmt, uint64_t *array, int size) { assert(sfmt->idx == SFMT_N32); assert(size % 2 == 0); assert(size >= SFMT_N64); gen_rand_array(sfmt, (w128_t *)array, size / 2); sfmt->idx = SFMT_N32; #if defined(BIG_ENDIAN64) && !defined(ONLY64) swap((w128_t *)array, size /2); #endif } /** * This function initializes the internal state array with a 32-bit * integer seed. * * @param sfmt SFMT internal state * @param seed a 32-bit integer used as the seed. */ void sfmt_init_gen_rand( sfmt_t * sfmt, uint32_t seed ) { int i; uint32_t *psfmt32 = &sfmt->state[0].u[0]; psfmt32[idxof(0)] = seed; for (i = 1; i < SFMT_N32; i++) { psfmt32[idxof(i)] = 1812433253UL * (psfmt32[idxof(i - 1)] ^ (psfmt32[idxof(i - 1)] >> 30)) + i; } sfmt->idx = SFMT_N32; period_certification(sfmt); } /** * This function initializes the internal state array, * with an array of 32-bit integers used as the seeds * @param sfmt SFMT internal state * @param init_key the array of 32-bit integers, used as a seed. * @param key_length the length of init_key. */ void sfmt_init_by_array(sfmt_t * sfmt, uint32_t *init_key, int key_length) { int i, j, count; uint32_t r; int lag; int mid; int size = SFMT_N * 4; uint32_t *psfmt32 = &sfmt->state[0].u[0]; if (size >= 623) { lag = 11; } else if (size >= 68) { lag = 7; } else if (size >= 39) { lag = 5; } else { lag = 3; } mid = (size - lag) / 2; memset(sfmt, 0x8b, sizeof(sfmt_t)); if (key_length + 1 > SFMT_N32) { count = key_length + 1; } else { count = SFMT_N32; } r = func1(psfmt32[idxof(0)] ^ psfmt32[idxof(mid)] ^ psfmt32[idxof(SFMT_N32 - 1)]); psfmt32[idxof(mid)] += r; r += key_length; psfmt32[idxof(mid + lag)] += r; psfmt32[idxof(0)] = r; count--; for (i = 1, j = 0; (j < count) && (j < key_length); j++) { r = func1(psfmt32[idxof(i)] ^ psfmt32[idxof((i + mid) % SFMT_N32)] ^ psfmt32[idxof((i + SFMT_N32 - 1) % SFMT_N32)]); psfmt32[idxof((i + mid) % SFMT_N32)] += r; r += init_key[j] + i; psfmt32[idxof((i + mid + lag) % SFMT_N32)] += r; psfmt32[idxof(i)] = r; i = (i + 1) % SFMT_N32; } for (; j < count; j++) { r = func1(psfmt32[idxof(i)] ^ psfmt32[idxof((i + mid) % SFMT_N32)] ^ psfmt32[idxof((i + SFMT_N32 - 1) % SFMT_N32)]); psfmt32[idxof((i + mid) % SFMT_N32)] += r; r += i; psfmt32[idxof((i + mid + lag) % SFMT_N32)] += r; psfmt32[idxof(i)] = r; i = (i + 1) % SFMT_N32; } for (j = 0; j < SFMT_N32; j++) { r = func2(psfmt32[idxof(i)] + psfmt32[idxof((i + mid) % SFMT_N32)] + psfmt32[idxof((i + SFMT_N32 - 1) % SFMT_N32)]); psfmt32[idxof((i + mid) % SFMT_N32)] ^= r; r -= i; psfmt32[idxof((i + mid + lag) % SFMT_N32)] ^= r; psfmt32[idxof(i)] = r; i = (i + 1) % SFMT_N32; } sfmt->idx = SFMT_N32; period_certification(sfmt); } #if defined(__cplusplus) } #endif aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT.h0000644000175000017500000001701712102721144014554 00000000000000#pragma once /** * @file SFMT.h * * @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom * number generator using C structure. * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (The University of Tokyo) * * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima * University. * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima * University and The University of Tokyo. * All rights reserved. * * The 3-clause BSD License is applied to this software, see * LICENSE.txt * * @note We assume that your system has inttypes.h. If your system * doesn't have inttypes.h, you have to typedef uint32_t and uint64_t, * and you have to define PRIu64 and PRIx64 in this file as follows: * @verbatim typedef unsigned int uint32_t typedef unsigned long long uint64_t #define PRIu64 "llu" #define PRIx64 "llx" @endverbatim * uint32_t must be exactly 32-bit unsigned integer type (no more, no * less), and uint64_t must be exactly 64-bit unsigned integer type. * PRIu64 and PRIx64 are used for printf function to print 64-bit * unsigned int and 64-bit unsigned int in hexadecimal format. */ #ifndef SFMTST_H #define SFMTST_H #if defined(__cplusplus) extern "C" { #endif #include #include #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) #include #elif defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; #define inline __inline #else #include #if defined(__GNUC__) #define inline __inline__ #endif #endif #ifndef PRIu64 #if defined(_MSC_VER) || defined(__BORLANDC__) #define PRIu64 "I64u" #define PRIx64 "I64x" #else #define PRIu64 "llu" #define PRIx64 "llx" #endif #endif #include "SFMT-params.h" /*------------------------------------------ 128-bit SIMD like data type for standard C ------------------------------------------*/ #if defined(HAVE_ALTIVEC) #if !defined(__APPLE__) #include #endif /** 128-bit data structure */ union W128_T { vector unsigned int s; uint32_t u[4]; uint64_t u64[2]; }; #elif defined(HAVE_SSE2) #include /** 128-bit data structure */ union W128_T { uint32_t u[4]; uint64_t u64[2]; __m128i si; }; #else /** 128-bit data structure */ union W128_T { uint32_t u[4]; uint64_t u64[2]; }; #endif /** 128-bit data type */ typedef union W128_T w128_t; /** * SFMT internal state */ struct SFMT_T { /** the 128-bit internal state array */ w128_t state[SFMT_N]; /** index counter to the 32-bit internal state array */ int idx; }; typedef struct SFMT_T sfmt_t; void sfmt_fill_array32(sfmt_t * sfmt, uint32_t * array, int size); void sfmt_fill_array64(sfmt_t * sfmt, uint64_t * array, int size); void sfmt_init_gen_rand(sfmt_t * sfmt, uint32_t seed); void sfmt_init_by_array(sfmt_t * sfmt, uint32_t * init_key, int key_length); const char * sfmt_get_idstring(sfmt_t * sfmt); int sfmt_get_min_array_size32(sfmt_t * sfmt); int sfmt_get_min_array_size64(sfmt_t * sfmt); void sfmt_gen_rand_all(sfmt_t * sfmt); #ifndef ONLY64 /** * This function generates and returns 32-bit pseudorandom number. * init_gen_rand or init_by_array must be called before this function. * @param sfmt SFMT internal state * @return 32-bit pseudorandom number */ inline static uint32_t sfmt_genrand_uint32(sfmt_t * sfmt) { uint32_t r; uint32_t * psfmt32 = &sfmt->state[0].u[0]; if (sfmt->idx >= SFMT_N32) { sfmt_gen_rand_all(sfmt); sfmt->idx = 0; } r = psfmt32[sfmt->idx++]; return r; } #endif /** * This function generates and returns 64-bit pseudorandom number. * init_gen_rand or init_by_array must be called before this function. * The function gen_rand64 should not be called after gen_rand32, * unless an initialization is again executed. * @param sfmt SFMT internal state * @return 64-bit pseudorandom number */ inline static uint64_t sfmt_genrand_uint64(sfmt_t * sfmt) { #if defined(BIG_ENDIAN64) && !defined(ONLY64) uint32_t * psfmt32 = &sfmt->state[0].u[0]; uint32_t r1, r2; #else uint64_t r; #endif uint64_t * psfmt64 = &sfmt->state[0].u64[0]; assert(sfmt->idx % 2 == 0); if (sfmt->idx >= SFMT_N32) { sfmt_gen_rand_all(sfmt); sfmt->idx = 0; } #if defined(BIG_ENDIAN64) && !defined(ONLY64) r1 = psfmt32[sfmt->idx]; r2 = psfmt32[sfmt->idx + 1]; sfmt->idx += 2; return ((uint64_t)r2 << 32) | r1; #else r = psfmt64[sfmt->idx / 2]; sfmt->idx += 2; return r; #endif } /* ================================================= The following real versions are due to Isaku Wada ================================================= */ /** * converts an unsigned 32-bit number to a double on [0,1]-real-interval. * @param v 32-bit unsigned integer * @return double on [0,1]-real-interval */ inline static double sfmt_to_real1(uint32_t v) { return v * (1.0/4294967295.0); /* divided by 2^32-1 */ } /** * generates a random number on [0,1]-real-interval * @param sfmt SFMT internal state * @return double on [0,1]-real-interval */ inline static double sfmt_genrand_real1(sfmt_t * sfmt) { return sfmt_to_real1(sfmt_genrand_uint32(sfmt)); } /** * converts an unsigned 32-bit integer to a double on [0,1)-real-interval. * @param v 32-bit unsigned integer * @return double on [0,1)-real-interval */ inline static double sfmt_to_real2(uint32_t v) { return v * (1.0/4294967296.0); /* divided by 2^32 */ } /** * generates a random number on [0,1)-real-interval * @param sfmt SFMT internal state * @return double on [0,1)-real-interval */ inline static double sfmt_genrand_real2(sfmt_t * sfmt) { return sfmt_to_real2(sfmt_genrand_uint32(sfmt)); } /** * converts an unsigned 32-bit integer to a double on (0,1)-real-interval. * @param v 32-bit unsigned integer * @return double on (0,1)-real-interval */ inline static double sfmt_to_real3(uint32_t v) { return (((double)v) + 0.5)*(1.0/4294967296.0); /* divided by 2^32 */ } /** * generates a random number on (0,1)-real-interval * @param sfmt SFMT internal state * @return double on (0,1)-real-interval */ inline static double sfmt_genrand_real3(sfmt_t * sfmt) { return sfmt_to_real3(sfmt_genrand_uint32(sfmt)); } /** * converts an unsigned 32-bit integer to double on [0,1) * with 53-bit resolution. * @param v 32-bit unsigned integer * @return double on [0,1)-real-interval with 53-bit resolution. */ inline static double sfmt_to_res53(uint64_t v) { return v * (1.0/18446744073709551616.0L); } /** * generates a random number on [0,1) with 53-bit resolution * @param sfmt SFMT internal state * @return double on [0,1) with 53-bit resolution */ inline static double sfmt_genrand_res53(sfmt_t * sfmt) { return sfmt_to_res53(sfmt_genrand_uint64(sfmt)); } /* ================================================= The following function are added by Saito. ================================================= */ /** * generates a random number on [0,1) with 53-bit resolution from two * 32 bit integers */ inline static double sfmt_to_res53_mix(uint32_t x, uint32_t y) { return sfmt_to_res53(x | ((uint64_t)y << 32)); } /** * generates a random number on [0,1) with 53-bit resolution * using two 32bit integers. * @param sfmt SFMT internal state * @return double on [0,1) with 53-bit resolution */ inline static double sfmt_genrand_res53_mix(sfmt_t * sfmt) { uint32_t x, y; x = sfmt_genrand_uint32(sfmt); y = sfmt_genrand_uint32(sfmt); return sfmt_to_res53_mix(x, y); } #if defined(__cplusplus) } #endif #endif aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params2281.h0000644000175000017500000000370012044513720016350 00000000000000#pragma once #ifndef SFMT_PARAMS2281_H #define SFMT_PARAMS2281_H #define SFMT_POS1 12 #define SFMT_SL1 19 #define SFMT_SL2 1 #define SFMT_SR1 5 #define SFMT_SR2 1 #define SFMT_MSK1 0xbff7ffbfU #define SFMT_MSK2 0xfdfffffeU #define SFMT_MSK3 0xf7ffef7fU #define SFMT_MSK4 0xf2f7cbbfU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0x00000000U #define SFMT_PARITY4 0x41dfa600U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8} #define SFMT_ALTI_SL2_PERM64 {1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-2281:12-19-1-5-1:bff7ffbf-fdfffffe-f7ffef7f-f2f7cbbf" #endif /* SFMT_PARAMS2281_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params4253.h0000644000175000017500000000370012044513720016351 00000000000000#pragma once #ifndef SFMT_PARAMS4253_H #define SFMT_PARAMS4253_H #define SFMT_POS1 17 #define SFMT_SL1 20 #define SFMT_SL2 1 #define SFMT_SR1 7 #define SFMT_SR2 1 #define SFMT_MSK1 0x9f7bffffU #define SFMT_MSK2 0x9fffff5fU #define SFMT_MSK3 0x3efffffbU #define SFMT_MSK4 0xfffff7bbU #define SFMT_PARITY1 0xa8000001U #define SFMT_PARITY2 0xaf5390a3U #define SFMT_PARITY3 0xb740b3f8U #define SFMT_PARITY4 0x6c11486dU /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8} #define SFMT_ALTI_SL2_PERM64 {1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-4253:17-20-1-7-1:9f7bffff-9fffff5f-3efffffb-fffff7bb" #endif /* SFMT_PARAMS4253_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params607.h0000644000175000017500000000370612044513720016276 00000000000000#pragma once #ifndef SFMT_PARAMS607_H #define SFMT_PARAMS607_H #define SFMT_POS1 2 #define SFMT_SL1 15 #define SFMT_SL2 3 #define SFMT_SR1 13 #define SFMT_SR2 3 #define SFMT_MSK1 0xfdff37ffU #define SFMT_MSK2 0xef7f3f7dU #define SFMT_MSK3 0xff777b7dU #define SFMT_MSK4 0x7ff7fb2fU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0x00000000U #define SFMT_PARITY4 0x5986f054U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(5,6,7,0,9,10,11,4,13,14,15,8,19,19,19,12) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(13,14,15,0,1,2,3,4,19,19,19,8,9,10,11,12) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10} #define SFMT_ALTI_SL2_PERM64 {3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2} #define SFMT_ALTI_SR2_PERM {5,6,7,0,9,10,11,4,13,14,15,8,19,19,19,12} #define SFMT_ALTI_SR2_PERM64 {13,14,15,0,1,2,3,4,19,19,19,8,9,10,11,12} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-607:2-15-3-13-3:fdff37ff-ef7f3f7d-ff777b7d-7ff7fb2f" #endif /* SFMT_PARAMS607_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params132049.h0000644000175000017500000000371412044513720016523 00000000000000#pragma once #ifndef SFMT_PARAMS132049_H #define SFMT_PARAMS132049_H #define SFMT_POS1 110 #define SFMT_SL1 19 #define SFMT_SL2 1 #define SFMT_SR1 21 #define SFMT_SR2 1 #define SFMT_MSK1 0xffffbb5fU #define SFMT_MSK2 0xfb6ebf95U #define SFMT_MSK3 0xfffefffaU #define SFMT_MSK4 0xcff77fffU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0xcb520000U #define SFMT_PARITY4 0xc7e91c7dU /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8} #define SFMT_ALTI_SL2_PERM64 {1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-132049:110-19-1-21-1:ffffbb5f-fb6ebf95-fffefffa-cff77fff" #endif /* SFMT_PARAMS132049_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/Makefile.in0000644000000000000000000004762312365454415015672 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ############################################ # Variables # ############################################ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src/libaevol/SFMT-src-1.4 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libsfmt_a_AR = $(AR) $(ARFLAGS) libsfmt_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am__objects_1 = am_libsfmt_a_OBJECTS = libsfmt_a-SFMT.$(OBJEXT) \ jump/libsfmt_a-SFMT-jump.$(OBJEXT) $(am__objects_1) libsfmt_a_OBJECTS = $(am_libsfmt_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(libsfmt_a_SOURCES) DIST_SOURCES = $(libsfmt_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects ######################## # Set library to build # ######################## noinst_LIBRARIES = libsfmt.a ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS = -I./ -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS \ -D__STDC_LIMIT_MACROS SFMT_params = SFMT-params.h SFMT-params607.h SFMT-params1279.h SFMT-params2281.h SFMT-params4253.h SFMT-params11213.h SFMT-params19937.h SFMT-params44497.h SFMT-params86243.h SFMT-params132049.h SFMT-params216091.h libsfmt_adir = ./ libsfmt_a_CPPFLAGS = $(AM_CPPFLAGS) #libsfmt_a_HEADERS = SFMT.h SFMT-common.h $(SFMT_params) jump/SFMT-jump.h libsfmt_a_SOURCES = SFMT.c jump/SFMT-jump.cpp SFMT.h SFMT-common.h \ $(SFMT_params) jump/SFMT-jump.h all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libaevol/SFMT-src-1.4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libaevol/SFMT-src-1.4/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) jump/$(am__dirstamp): @$(MKDIR_P) jump @: > jump/$(am__dirstamp) jump/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) jump/$(DEPDIR) @: > jump/$(DEPDIR)/$(am__dirstamp) jump/libsfmt_a-SFMT-jump.$(OBJEXT): jump/$(am__dirstamp) \ jump/$(DEPDIR)/$(am__dirstamp) libsfmt.a: $(libsfmt_a_OBJECTS) $(libsfmt_a_DEPENDENCIES) $(EXTRA_libsfmt_a_DEPENDENCIES) -rm -f libsfmt.a $(libsfmt_a_AR) libsfmt.a $(libsfmt_a_OBJECTS) $(libsfmt_a_LIBADD) $(RANLIB) libsfmt.a mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f jump/libsfmt_a-SFMT-jump.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsfmt_a-SFMT.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libsfmt_a-SFMT.o: SFMT.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsfmt_a-SFMT.o -MD -MP -MF $(DEPDIR)/libsfmt_a-SFMT.Tpo -c -o libsfmt_a-SFMT.o `test -f 'SFMT.c' || echo '$(srcdir)/'`SFMT.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsfmt_a-SFMT.Tpo $(DEPDIR)/libsfmt_a-SFMT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SFMT.c' object='libsfmt_a-SFMT.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsfmt_a-SFMT.o `test -f 'SFMT.c' || echo '$(srcdir)/'`SFMT.c libsfmt_a-SFMT.obj: SFMT.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libsfmt_a-SFMT.obj -MD -MP -MF $(DEPDIR)/libsfmt_a-SFMT.Tpo -c -o libsfmt_a-SFMT.obj `if test -f 'SFMT.c'; then $(CYGPATH_W) 'SFMT.c'; else $(CYGPATH_W) '$(srcdir)/SFMT.c'; fi` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsfmt_a-SFMT.Tpo $(DEPDIR)/libsfmt_a-SFMT.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SFMT.c' object='libsfmt_a-SFMT.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libsfmt_a-SFMT.obj `if test -f 'SFMT.c'; then $(CYGPATH_W) 'SFMT.c'; else $(CYGPATH_W) '$(srcdir)/SFMT.c'; fi` .cpp.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` jump/libsfmt_a-SFMT-jump.o: jump/SFMT-jump.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jump/libsfmt_a-SFMT-jump.o -MD -MP -MF jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Tpo -c -o jump/libsfmt_a-SFMT-jump.o `test -f 'jump/SFMT-jump.cpp' || echo '$(srcdir)/'`jump/SFMT-jump.cpp @am__fastdepCXX_TRUE@ $(am__mv) jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Tpo jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='jump/SFMT-jump.cpp' object='jump/libsfmt_a-SFMT-jump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jump/libsfmt_a-SFMT-jump.o `test -f 'jump/SFMT-jump.cpp' || echo '$(srcdir)/'`jump/SFMT-jump.cpp jump/libsfmt_a-SFMT-jump.obj: jump/SFMT-jump.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jump/libsfmt_a-SFMT-jump.obj -MD -MP -MF jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Tpo -c -o jump/libsfmt_a-SFMT-jump.obj `if test -f 'jump/SFMT-jump.cpp'; then $(CYGPATH_W) 'jump/SFMT-jump.cpp'; else $(CYGPATH_W) '$(srcdir)/jump/SFMT-jump.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Tpo jump/$(DEPDIR)/libsfmt_a-SFMT-jump.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='jump/SFMT-jump.cpp' object='jump/libsfmt_a-SFMT-jump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsfmt_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jump/libsfmt_a-SFMT-jump.obj `if test -f 'jump/SFMT-jump.cpp'; then $(CYGPATH_W) 'jump/SFMT-jump.cpp'; else $(CYGPATH_W) '$(srcdir)/jump/SFMT-jump.cpp'; fi` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f jump/$(DEPDIR)/$(am__dirstamp) -rm -f jump/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) jump/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) jump/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-common.h0000644000175000017500000001170412044513720016043 00000000000000#pragma once /** * @file SFMT-common.h * * @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom * number generator with jump function. This file includes common functions * used in random number generation and jump. * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (The University of Tokyo) * * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima * University. * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima * University and The University of Tokyo. * All rights reserved. * * The 3-clause BSD License is applied to this software, see * LICENSE.txt */ #ifndef SFMT_COMMON_H #define SFMT_COMMON_H #if defined(__cplusplus) extern "C" { #endif #include "SFMT.h" inline static void do_recursion(w128_t * r, w128_t * a, w128_t * b, w128_t * c, w128_t * d); inline static void rshift128(w128_t *out, w128_t const *in, int shift); inline static void lshift128(w128_t *out, w128_t const *in, int shift); /** * This function simulates SIMD 128-bit right shift by the standard C. * The 128-bit integer given in in is shifted by (shift * 8) bits. * This function simulates the LITTLE ENDIAN SIMD. * @param out the output of this function * @param in the 128-bit data to be shifted * @param shift the shift value */ #ifdef ONLY64 inline static void rshift128(w128_t *out, w128_t const *in, int shift) { uint64_t th, tl, oh, ol; th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]); tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]); oh = th >> (shift * 8); ol = tl >> (shift * 8); ol |= th << (64 - shift * 8); out->u[0] = (uint32_t)(ol >> 32); out->u[1] = (uint32_t)ol; out->u[2] = (uint32_t)(oh >> 32); out->u[3] = (uint32_t)oh; } #else inline static void rshift128(w128_t *out, w128_t const *in, int shift) { uint64_t th, tl, oh, ol; th = ((uint64_t)in->u[3] << 32) | ((uint64_t)in->u[2]); tl = ((uint64_t)in->u[1] << 32) | ((uint64_t)in->u[0]); oh = th >> (shift * 8); ol = tl >> (shift * 8); ol |= th << (64 - shift * 8); out->u[1] = (uint32_t)(ol >> 32); out->u[0] = (uint32_t)ol; out->u[3] = (uint32_t)(oh >> 32); out->u[2] = (uint32_t)oh; } #endif /** * This function simulates SIMD 128-bit left shift by the standard C. * The 128-bit integer given in in is shifted by (shift * 8) bits. * This function simulates the LITTLE ENDIAN SIMD. * @param out the output of this function * @param in the 128-bit data to be shifted * @param shift the shift value */ #ifdef ONLY64 inline static void lshift128(w128_t *out, w128_t const *in, int shift) { uint64_t th, tl, oh, ol; th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]); tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]); oh = th << (shift * 8); ol = tl << (shift * 8); oh |= tl >> (64 - shift * 8); out->u[0] = (uint32_t)(ol >> 32); out->u[1] = (uint32_t)ol; out->u[2] = (uint32_t)(oh >> 32); out->u[3] = (uint32_t)oh; } #else inline static void lshift128(w128_t *out, w128_t const *in, int shift) { uint64_t th, tl, oh, ol; th = ((uint64_t)in->u[3] << 32) | ((uint64_t)in->u[2]); tl = ((uint64_t)in->u[1] << 32) | ((uint64_t)in->u[0]); oh = th << (shift * 8); ol = tl << (shift * 8); oh |= tl >> (64 - shift * 8); out->u[1] = (uint32_t)(ol >> 32); out->u[0] = (uint32_t)ol; out->u[3] = (uint32_t)(oh >> 32); out->u[2] = (uint32_t)oh; } #endif /** * This function represents the recursion formula. * @param r output * @param a a 128-bit part of the internal state array * @param b a 128-bit part of the internal state array * @param c a 128-bit part of the internal state array * @param d a 128-bit part of the internal state array */ #ifdef ONLY64 inline static void do_recursion(w128_t *r, w128_t *a, w128_t *b, w128_t *c, w128_t *d) { w128_t x; w128_t y; lshift128(&x, a, SFMT_SL2); rshift128(&y, c, SFMT_SR2); r->u[0] = a->u[0] ^ x.u[0] ^ ((b->u[0] >> SFMT_SR1) & SFMT_MSK2) ^ y.u[0] ^ (d->u[0] << SFMT_SL1); r->u[1] = a->u[1] ^ x.u[1] ^ ((b->u[1] >> SFMT_SR1) & SFMT_MSK1) ^ y.u[1] ^ (d->u[1] << SFMT_SL1); r->u[2] = a->u[2] ^ x.u[2] ^ ((b->u[2] >> SFMT_SR1) & SFMT_MSK4) ^ y.u[2] ^ (d->u[2] << SFMT_SL1); r->u[3] = a->u[3] ^ x.u[3] ^ ((b->u[3] >> SFMT_SR1) & SFMT_MSK3) ^ y.u[3] ^ (d->u[3] << SFMT_SL1); } #else inline static void do_recursion(w128_t *r, w128_t *a, w128_t *b, w128_t *c, w128_t *d) { w128_t x; w128_t y; lshift128(&x, a, SFMT_SL2); rshift128(&y, c, SFMT_SR2); r->u[0] = a->u[0] ^ x.u[0] ^ ((b->u[0] >> SFMT_SR1) & SFMT_MSK1) ^ y.u[0] ^ (d->u[0] << SFMT_SL1); r->u[1] = a->u[1] ^ x.u[1] ^ ((b->u[1] >> SFMT_SR1) & SFMT_MSK2) ^ y.u[1] ^ (d->u[1] << SFMT_SL1); r->u[2] = a->u[2] ^ x.u[2] ^ ((b->u[2] >> SFMT_SR1) & SFMT_MSK3) ^ y.u[2] ^ (d->u[2] << SFMT_SL1); r->u[3] = a->u[3] ^ x.u[3] ^ ((b->u[3] >> SFMT_SR1) & SFMT_MSK4) ^ y.u[3] ^ (d->u[3] << SFMT_SL1); } #endif #endif #if defined(__cplusplus) } #endif aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params.h0000644000175000017500000000502512044513720016035 00000000000000#pragma once #ifndef SFMT_PARAMS_H #define SFMT_PARAMS_H #if !defined(SFMT_MEXP) #if defined(__GNUC__) && !defined(__ICC) #warning "SFMT_MEXP is not defined. I assume MEXP is 19937." #endif #define SFMT_MEXP 19937 #endif /*----------------- BASIC DEFINITIONS -----------------*/ /** Mersenne Exponent. The period of the sequence * is a multiple of 2^MEXP-1. * #define SFMT_MEXP 19937 */ /** SFMT generator has an internal state array of 128-bit integers, * and N is its size. */ #define SFMT_N (SFMT_MEXP / 128 + 1) /** N32 is the size of internal state array when regarded as an array * of 32-bit integers.*/ #define SFMT_N32 (SFMT_N * 4) /** N64 is the size of internal state array when regarded as an array * of 64-bit integers.*/ #define SFMT_N64 (SFMT_N * 2) /*---------------------- the parameters of SFMT following definitions are in paramsXXXX.h file. ----------------------*/ /** the pick up position of the array. #define SFMT_POS1 122 */ /** the parameter of shift left as four 32-bit registers. #define SFMT_SL1 18 */ /** the parameter of shift left as one 128-bit register. * The 128-bit integer is shifted by (SFMT_SL2 * 8) bits. #define SFMT_SL2 1 */ /** the parameter of shift right as four 32-bit registers. #define SFMT_SR1 11 */ /** the parameter of shift right as one 128-bit register. * The 128-bit integer is shifted by (SFMT_SL2 * 8) bits. #define SFMT_SR21 1 */ /** A bitmask, used in the recursion. These parameters are introduced * to break symmetry of SIMD. #define SFMT_MSK1 0xdfffffefU #define SFMT_MSK2 0xddfecb7fU #define SFMT_MSK3 0xbffaffffU #define SFMT_MSK4 0xbffffff6U */ /** These definitions are part of a 128-bit period certification vector. #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0x00000000U #define SFMT_PARITY4 0xc98e126aU */ #if SFMT_MEXP == 607 #include "SFMT-params607.h" #elif SFMT_MEXP == 1279 #include "SFMT-params1279.h" #elif SFMT_MEXP == 2281 #include "SFMT-params2281.h" #elif SFMT_MEXP == 4253 #include "SFMT-params4253.h" #elif SFMT_MEXP == 11213 #include "SFMT-params11213.h" #elif SFMT_MEXP == 19937 #include "SFMT-params19937.h" #elif SFMT_MEXP == 44497 #include "SFMT-params44497.h" #elif SFMT_MEXP == 86243 #include "SFMT-params86243.h" #elif SFMT_MEXP == 132049 #include "SFMT-params132049.h" #elif SFMT_MEXP == 216091 #include "SFMT-params216091.h" #else #if defined(__GNUC__) && !defined(__ICC) #error "SFMT_MEXP is not valid." #undef SFMT_MEXP #else #undef SFMT_MEXP #endif #endif #endif /* SFMT_PARAMS_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params11213.h0000644000175000017500000000371612044513720016432 00000000000000#pragma once #ifndef SFMT_PARAMS11213_H #define SFMT_PARAMS11213_H #define SFMT_POS1 68 #define SFMT_SL1 14 #define SFMT_SL2 3 #define SFMT_SR1 7 #define SFMT_SR2 3 #define SFMT_MSK1 0xeffff7fbU #define SFMT_MSK2 0xffffffefU #define SFMT_MSK3 0xdfdfbfffU #define SFMT_MSK4 0x7fffdbfdU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0xe8148000U #define SFMT_PARITY4 0xd0c7afa3U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(5,6,7,0,9,10,11,4,13,14,15,8,19,19,19,12) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(13,14,15,0,1,2,3,4,19,19,19,8,9,10,11,12) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10} #define SFMT_ALTI_SL2_PERM64 {3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2} #define SFMT_ALTI_SR2_PERM {5,6,7,0,9,10,11,4,13,14,15,8,19,19,19,12} #define SFMT_ALTI_SR2_PERM64 {13,14,15,0,1,2,3,4,19,19,19,8,9,10,11,12} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-11213:68-14-3-7-3:effff7fb-ffffffef-dfdfbfff-7fffdbfd" #endif /* SFMT_PARAMS11213_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/jump/0000755000000000000000000000000012365454434014645 500000000000000aevol-4.4/src/libaevol/SFMT-src-1.4/jump/SFMT-jump.h0000644000175000017500000000110412044513720016472 00000000000000#ifndef SFMT_JUMP_H #define SFMT_JUMP_H /** * @file SFMT-jump.h * * @brief jump header file. * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (The University of Tokyo) * * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, * Hiroshima University and The University of Tokyo. * All rights reserved. * * The 3-clause BSD License is applied to this software, see * LICENSE.txt */ #if defined(__cplusplus) extern "C" { #endif #include "../SFMT.h" void SFMT_jump(sfmt_t * sfmt, const char * jump_str); #if defined(__cplusplus) } #endif #endif aevol-4.4/src/libaevol/SFMT-src-1.4/jump/SFMT-jump.cpp0000644000175000017500000000567612044513720017047 00000000000000/** * @file SFMT-jump.c * * @brief do jump using jump polynomial. * * @author Mutsuo Saito (Hiroshima University) * @author Makoto Matsumoto (The University of Tokyo) * * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, * Hiroshima University and The University of Tokyo. * All rights reserved. * * The 3-clause BSD License is applied to this software, see * LICENSE.txt */ #include #include #include #include #include "SFMT-params.h" #include "SFMT.h" #include "SFMT-jump.h" #include "SFMT-common.h" #if defined(__cplusplus) extern "C" { #endif inline static void next_state(sfmt_t * sfmt); #if defined(HAVE_SSE2) /** * add internal state of src to dest as F2-vector. * @param dest destination state * @param src source state */ inline static void add(sfmt_t *dest, sfmt_t *src) { int dp = dest->idx / 4; int sp = src->idx / 4; int diff = (sp - dp + SFMT_N) % SFMT_N; int p; int i; for (i = 0; i < SFMT_N - diff; i++) { p = i + diff; dest->state[i].si = _mm_xor_si128(dest->state[i].si, src->state[p].si); } for (; i < SFMT_N; i++) { p = i + diff - SFMT_N; dest->state[i].si = _mm_xor_si128(dest->state[i].si, src->state[p].si); } } #else inline static void add(sfmt_t *dest, sfmt_t *src) { int dp = dest->idx / 4; int sp = src->idx / 4; int diff = (sp - dp + SFMT_N) % SFMT_N; int p; int i; for (i = 0; i < SFMT_N - diff; i++) { p = i + diff; for (int j = 0; j < 4; j++) { dest->state[i].u[j] ^= src->state[p].u[j]; } } for (; i < SFMT_N; i++) { p = i + diff - SFMT_N; for (int j = 0; j < 4; j++) { dest->state[i].u[j] ^= src->state[p].u[j]; } } } #endif /** * calculate next state * @param sfmt SFMT internal state */ inline static void next_state(sfmt_t * sfmt) { int idx = (sfmt->idx / 4) % SFMT_N; w128_t *r1, *r2; w128_t * pstate = sfmt->state; r1 = &pstate[(idx + SFMT_N - 2) % SFMT_N]; r2 = &pstate[(idx + SFMT_N - 1) % SFMT_N]; do_recursion(&pstate[idx], &pstate[idx], &pstate[(idx + SFMT_POS1) % SFMT_N], r1, r2); r1 = r2; r2 = &pstate[idx]; sfmt->idx = sfmt->idx + 4; } /** * jump ahead using jump_string * @param sfmt SFMT internal state input and output. * @param jump_string string which represents jump polynomial. */ void SFMT_jump(sfmt_t * sfmt, const char * jump_string) { sfmt_t work; int index = sfmt->idx; int bits; memset(&work, 0, sizeof(sfmt_t)); sfmt->idx = SFMT_N32; for (int i = 0; jump_string[i] != '\0'; i++) { bits = jump_string[i]; assert(isxdigit(bits)); bits = tolower(bits); if (bits >= 'a' && bits <= 'f') { bits = bits - 'a' + 10; } else { bits = bits - '0'; } bits = bits & 0x0f; for (int j = 0; j < 4; j++) { if ((bits & 1) != 0) { add(&work, sfmt); } next_state(sfmt); bits = bits >> 1; } } *sfmt = work; sfmt->idx = index; } #if defined(__cplusplus) } #endif aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params19937.h0000644000175000017500000000371012044513720016451 00000000000000#pragma once #ifndef SFMT_PARAMS19937_H #define SFMT_PARAMS19937_H #define SFMT_POS1 122 #define SFMT_SL1 18 #define SFMT_SL2 1 #define SFMT_SR1 11 #define SFMT_SR2 1 #define SFMT_MSK1 0xdfffffefU #define SFMT_MSK2 0xddfecb7fU #define SFMT_MSK3 0xbffaffffU #define SFMT_MSK4 0xbffffff6U #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0x00000000U #define SFMT_PARITY4 0x13c9e684U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {1,2,3,23,5,6,7,0,9,10,11,4,13,14,15,8} #define SFMT_ALTI_SL2_PERM64 {1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-19937:122-18-1-11-1:dfffffef-ddfecb7f-bffaffff-bffffff6" #endif /* SFMT_PARAMS19937_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params86243.h0000644000175000017500000000371412044513720016447 00000000000000#pragma once #ifndef SFMT_PARAMS86243_H #define SFMT_PARAMS86243_H #define SFMT_POS1 366 #define SFMT_SL1 6 #define SFMT_SL2 7 #define SFMT_SR1 19 #define SFMT_SR2 1 #define SFMT_MSK1 0xfdbffbffU #define SFMT_MSK2 0xbff7ff3fU #define SFMT_MSK3 0xfd77efffU #define SFMT_MSK4 0xbf9ff3ffU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0x00000000U #define SFMT_PARITY4 0xe9528d85U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(25,25,25,25,3,25,25,25,7,0,1,2,11,4,5,6) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(7,25,25,25,25,25,25,25,15,0,1,2,3,4,5,6) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {25,25,25,25,3,25,25,25,7,0,1,2,11,4,5,6} #define SFMT_ALTI_SL2_PERM64 {7,25,25,25,25,25,25,25,15,0,1,2,3,4,5,6} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-86243:366-6-7-19-1:fdbffbff-bff7ff3f-fd77efff-bf9ff3ff" #endif /* SFMT_PARAMS86243_H */ aevol-4.4/src/libaevol/SFMT-src-1.4/Makefile.am0000644000175000017500000000240512364676005015700 00000000000000############################################ # Variables # ############################################ AUTOMAKE_OPTIONS = subdir-objects ######################## # Set library to build # ######################## noinst_LIBRARIES = libsfmt.a AM_CPPFLAGS = -I./ ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS SFMT_params = SFMT-params.h SFMT-params607.h SFMT-params1279.h SFMT-params2281.h SFMT-params4253.h SFMT-params11213.h SFMT-params19937.h SFMT-params44497.h SFMT-params86243.h SFMT-params132049.h SFMT-params216091.h libsfmt_adir = ./ libsfmt_a_CPPFLAGS = $(AM_CPPFLAGS) #libsfmt_a_HEADERS = SFMT.h SFMT-common.h $(SFMT_params) jump/SFMT-jump.h libsfmt_a_SOURCES = SFMT.c jump/SFMT-jump.cpp libsfmt_a_SOURCES += SFMT.h SFMT-common.h $(SFMT_params) jump/SFMT-jump.h aevol-4.4/src/libaevol/SFMT-src-1.4/SFMT-params1279.h0000644000175000017500000000370012044513720016356 00000000000000#pragma once #ifndef SFMT_PARAMS1279_H #define SFMT_PARAMS1279_H #define SFMT_POS1 7 #define SFMT_SL1 14 #define SFMT_SL2 3 #define SFMT_SR1 5 #define SFMT_SR2 1 #define SFMT_MSK1 0xf7fefffdU #define SFMT_MSK2 0x7fefcfffU #define SFMT_MSK3 0xaff3ef3fU #define SFMT_MSK4 0xb5ffff7fU #define SFMT_PARITY1 0x00000001U #define SFMT_PARITY2 0x00000000U #define SFMT_PARITY3 0x00000000U #define SFMT_PARITY4 0x20000000U /* PARAMETERS FOR ALTIVEC */ #if defined(__APPLE__) /* For OSX */ #define SFMT_ALTI_SL1 \ (vector unsigned int)(SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1) #define SFMT_ALTI_SR1 \ (vector unsigned int)(SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1) #define SFMT_ALTI_MSK \ (vector unsigned int)(SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4) #define SFMT_ALTI_MSK64 \ (vector unsigned int)(SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3) #define SFMT_ALTI_SL2_PERM \ (vector unsigned char)(3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10) #define SFMT_ALTI_SL2_PERM64 \ (vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2) #define SFMT_ALTI_SR2_PERM \ (vector unsigned char)(7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14) #define SFMT_ALTI_SR2_PERM64 \ (vector unsigned char)(15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14) #else /* For OTHER OSs(Linux?) */ #define SFMT_ALTI_SL1 {SFMT_SL1, SFMT_SL1, SFMT_SL1, SFMT_SL1} #define SFMT_ALTI_SR1 {SFMT_SR1, SFMT_SR1, SFMT_SR1, SFMT_SR1} #define SFMT_ALTI_MSK {SFMT_MSK1, SFMT_MSK2, SFMT_MSK3, SFMT_MSK4} #define SFMT_ALTI_MSK64 {SFMT_MSK2, SFMT_MSK1, SFMT_MSK4, SFMT_MSK3} #define SFMT_ALTI_SL2_PERM {3,21,21,21,7,0,1,2,11,4,5,6,15,8,9,10} #define SFMT_ALTI_SL2_PERM64 {3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2} #define SFMT_ALTI_SR2_PERM {7,0,1,2,11,4,5,6,15,8,9,10,17,12,13,14} #define SFMT_ALTI_SR2_PERM64 {15,0,1,2,3,4,5,6,17,8,9,10,11,12,13,14} #endif /* For OSX */ #define SFMT_IDSTR "SFMT-1279:7-14-3-5-1:f7fefffd-7fefcfff-aff3ef3f-b5ffff7f" #endif /* SFMT_PARAMS1279_H */ aevol-4.4/src/libaevol/ae_params_mut.h0000644000175000017500000004412212234223723014765 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_PARAMS_MUT_H__ #define __AE_PARAMS_MUT_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_params_mut : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_params_mut( void ); ae_params_mut( const ae_params_mut& model ); ae_params_mut( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_params_mut( void ); // ================================================================= // Accessors: getters // ================================================================= // --------------------------------------------------------- Mutation rates inline double get_point_mutation_rate( void ) const; inline double get_small_insertion_rate( void ) const; inline double get_small_deletion_rate( void ) const; inline int16_t get_max_indel_size( void ) const; // -------------------------------------------- Rearrangements and Transfer inline bool get_with_4pts_trans( void ) const; inline bool get_with_alignments( void ) const; inline bool get_with_HT( void ) const; inline bool get_repl_HT_with_close_points( void ) const; inline double get_HT_ins_rate( void ) const; inline double get_HT_repl_rate( void ) const; inline double get_repl_HT_detach_rate( void ) const; // ------------------------------ Rearrangement rates (without alignements) inline double get_duplication_rate( void ) const; inline double get_deletion_rate( void ) const; inline double get_translocation_rate( void ) const; inline double get_inversion_rate( void ) const; // --------------------------------- Rearrangement rates (with alignements) inline double get_neighbourhood_rate( void ) const; inline double get_duplication_proportion( void ) const; inline double get_deletion_proportion( void ) const; inline double get_translocation_proportion( void ) const; inline double get_inversion_proportion( void ) const; // ------------------------------------------------------------ Alignements inline ae_align_fun_shape get_align_fun_shape( void ) const; inline double get_align_sigm_lambda( void ) const; inline int16_t get_align_sigm_mean( void ) const; inline int16_t get_align_lin_min( void ) const; inline int16_t get_align_lin_max( void ) const; // Maximum shift of one seq on the other inline int16_t get_align_max_shift( void ) const; // Work zone half length inline int16_t get_align_w_zone_h_len( void ) const; // Corresponding residues match bonus inline int16_t get_align_match_bonus( void ) const; // Corresponding residues mismatch cost inline int16_t get_align_mismatch_cost( void ) const; // ================================================================= // Accessors: setters // ================================================================= // --------------------------------------------------------- Mutation rates inline void set_point_mutation_rate( double point_mutation_rate ); inline void set_small_insertion_rate( double small_insertion_rate ); inline void set_small_deletion_rate( double small_deletion_rate ); inline void set_max_indel_size( int16_t max_indel_size ); // -------------------------------------------- Rearrangements and Transfer inline void set_with_4pts_trans( bool with_4pts_trans ); inline void set_with_alignments( bool with_alignments ); inline void set_with_HT( bool with_HT ); inline void set_repl_HT_with_close_points( bool repl_HT_with_close_points); inline void set_HT_ins_rate( double HT_ins_rate ); inline void set_HT_repl_rate( double HT_repl_rate ); inline void set_repl_HT_detach_rate( double repl_HT_detach_rate ); // ------------------------------ Rearrangement rates (without alignements) inline void set_duplication_rate( double duplication_rate ); inline void set_deletion_rate( double deletion_rate ); inline void set_translocation_rate( double translocation_rate ); inline void set_inversion_rate( double inversion_rate ); // --------------------------------- Rearrangement rates (with alignements) inline void set_neighbourhood_rate( double neighbourhood_rate ); inline void set_duplication_proportion( double duplication_proportion ); inline void set_deletion_proportion( double deletion_proportion ); inline void set_translocation_proportion( double translocation_proportion ); inline void set_inversion_proportion( double inversion_proportion ); // ------------------------------------------------------------ Alignements inline void set_align_fun_shape( ae_align_fun_shape align_fun_shape ); inline void set_align_sigm_lambda( double align_sigm_lambda ); inline void set_align_sigm_mean( int16_t align_sigm_mean ); inline void set_align_lin_min( int16_t align_lin_min ); inline void set_align_lin_max( int16_t align_lin_max ); inline void set_align_max_shift( int16_t align_max_shift ); inline void set_align_w_zone_h_len( int16_t align_w_zone_h_len ); inline void set_align_match_bonus( int16_t align_match_bonus ); inline void set_align_mismatch_cost( int16_t align_mismatch_cost ); // ================================================================= // Operators // ================================================================= // ================================================================= // Public Methods // ================================================================= void save( gzFile backup_file ) const; // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= /*ae_params_mut( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_params_mut( const ae_params_mut &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= // --------------------------------------------------------- Mutation rates double _point_mutation_rate; double _small_insertion_rate; double _small_deletion_rate; int16_t _max_indel_size; // -------------------------------------------- Rearrangements and Transfer bool _with_4pts_trans; bool _with_alignments; bool _with_HT; bool _repl_HT_with_close_points; double _HT_ins_rate; double _HT_repl_rate; double _repl_HT_detach_rate; // ------------------------------ Rearrangement rates (without alignements) double _duplication_rate; double _deletion_rate; double _translocation_rate; double _inversion_rate; // --------------------------------- Rearrangement rates (with alignements) double _neighbourhood_rate; double _duplication_proportion; double _deletion_proportion; double _translocation_proportion; double _inversion_proportion; // ------------------------------------------------------------ Alignements ae_align_fun_shape _align_fun_shape; double _align_sigm_lambda; int16_t _align_sigm_mean; int16_t _align_lin_min; int16_t _align_lin_max; int16_t _align_max_shift; // Maximum shift of one seq on the other int16_t _align_w_zone_h_len; // Work zone half length int16_t _align_match_bonus; // Corresponding residues match bonus int16_t _align_mismatch_cost; // Corresponding residues mismatch cost }; // ===================================================================== // Getters' definitions // ===================================================================== // ------------------------------------------------------------- Mutation rates inline double ae_params_mut::get_point_mutation_rate( void ) const { return _point_mutation_rate; } inline double ae_params_mut::get_small_insertion_rate( void ) const { return _small_insertion_rate; } inline double ae_params_mut::get_small_deletion_rate( void ) const { return _small_deletion_rate; } inline int16_t ae_params_mut::get_max_indel_size( void ) const { return _max_indel_size; } // ------------------------------------------------ Rearrangements and Transfer inline bool ae_params_mut::get_with_4pts_trans( void ) const { return _with_4pts_trans; } inline bool ae_params_mut::get_with_alignments( void ) const { return _with_alignments; } inline bool ae_params_mut::get_with_HT( void ) const { return _with_HT; } inline bool ae_params_mut::get_repl_HT_with_close_points( void ) const { return _repl_HT_with_close_points; } inline double ae_params_mut::get_HT_ins_rate( void ) const { return _HT_ins_rate; } inline double ae_params_mut::get_HT_repl_rate( void ) const { return _HT_repl_rate; } inline double ae_params_mut::get_repl_HT_detach_rate( void ) const { return _repl_HT_detach_rate; } // ---------------------------------- Rearrangement rates (without alignements) inline double ae_params_mut::get_duplication_rate( void ) const { return _duplication_rate; } inline double ae_params_mut::get_deletion_rate( void ) const { return _deletion_rate; } inline double ae_params_mut::get_translocation_rate( void ) const { return _translocation_rate; } inline double ae_params_mut::get_inversion_rate( void ) const { return _inversion_rate; } // ------------------------------------- Rearrangement rates (with alignements) inline double ae_params_mut::get_neighbourhood_rate( void ) const { return _neighbourhood_rate; } inline double ae_params_mut::get_duplication_proportion( void ) const { return _duplication_proportion; } inline double ae_params_mut::get_deletion_proportion( void ) const { return _deletion_proportion; } inline double ae_params_mut::get_translocation_proportion( void ) const { return _translocation_proportion; } inline double ae_params_mut::get_inversion_proportion( void ) const { return _inversion_proportion; } // ---------------------------------------------------------------- Alignements inline ae_align_fun_shape ae_params_mut::get_align_fun_shape( void ) const { return _align_fun_shape; } inline double ae_params_mut::get_align_sigm_lambda( void ) const { return _align_sigm_lambda; } inline int16_t ae_params_mut::get_align_sigm_mean( void ) const { return _align_sigm_mean; } inline int16_t ae_params_mut::get_align_lin_min( void ) const { return _align_lin_min; } inline int16_t ae_params_mut::get_align_lin_max( void ) const { return _align_lin_max; } inline int16_t ae_params_mut::get_align_max_shift( void ) const { return _align_max_shift; } inline int16_t ae_params_mut::get_align_w_zone_h_len( void ) const { return _align_w_zone_h_len; } inline int16_t ae_params_mut::get_align_match_bonus( void ) const { return _align_match_bonus; } inline int16_t ae_params_mut::get_align_mismatch_cost( void ) const { return _align_mismatch_cost; } // ===================================================================== // Setters' definitions // ===================================================================== // ------------------------------------------------------------- Mutation rates inline void ae_params_mut::set_point_mutation_rate( double point_mutation_rate ) { _point_mutation_rate = point_mutation_rate; } inline void ae_params_mut::set_small_insertion_rate( double small_insertion_rate ) { _small_insertion_rate = small_insertion_rate; } inline void ae_params_mut::set_small_deletion_rate( double small_deletion_rate ) { _small_deletion_rate = small_deletion_rate; } inline void ae_params_mut::set_max_indel_size( int16_t max_indel_size ) { _max_indel_size = max_indel_size; } // ------------------------------------------------ Rearrangements and Transfer inline void ae_params_mut::set_with_4pts_trans( bool with_4pts_trans ) { _with_4pts_trans = with_4pts_trans; } inline void ae_params_mut::set_with_alignments( bool with_alignments ) { _with_alignments = with_alignments; } inline void ae_params_mut::set_with_HT( bool with_HT ) { _with_HT = with_HT; } inline void ae_params_mut::set_repl_HT_with_close_points( bool repl_HT_with_close_points) { _repl_HT_with_close_points = repl_HT_with_close_points; } inline void ae_params_mut::set_HT_ins_rate( double HT_ins_rate ) { _HT_ins_rate = HT_ins_rate; } inline void ae_params_mut::set_HT_repl_rate( double HT_repl_rate ) { _HT_repl_rate = HT_repl_rate; } inline void ae_params_mut::set_repl_HT_detach_rate( double repl_HT_detach_rate ) { _repl_HT_detach_rate = repl_HT_detach_rate; } // ---------------------------------- Rearrangement rates (without alignements) inline void ae_params_mut::set_duplication_rate( double duplication_rate ) { _duplication_rate = duplication_rate; } inline void ae_params_mut::set_deletion_rate( double deletion_rate ) { _deletion_rate = deletion_rate; } inline void ae_params_mut::set_translocation_rate( double translocation_rate ) { _translocation_rate = translocation_rate; } inline void ae_params_mut::set_inversion_rate( double inversion_rate ) { _inversion_rate = inversion_rate; } // ------------------------------------- Rearrangement rates (with alignements) inline void ae_params_mut::set_neighbourhood_rate( double neighbourhood_rate ) { _neighbourhood_rate = neighbourhood_rate; } inline void ae_params_mut::set_duplication_proportion( double duplication_proportion ) { _duplication_proportion = duplication_proportion; } inline void ae_params_mut::set_deletion_proportion( double deletion_proportion ) { _deletion_proportion = deletion_proportion; } inline void ae_params_mut::set_translocation_proportion( double translocation_proportion ) { _translocation_proportion = translocation_proportion; } inline void ae_params_mut::set_inversion_proportion( double inversion_proportion ) { _inversion_proportion = inversion_proportion; } // ---------------------------------------------------------------- Alignements inline void ae_params_mut::set_align_fun_shape( ae_align_fun_shape align_fun_shape ) { _align_fun_shape = align_fun_shape; } inline void ae_params_mut::set_align_sigm_lambda( double align_sigm_lambda ) { _align_sigm_lambda = align_sigm_lambda; } inline void ae_params_mut::set_align_sigm_mean( int16_t align_sigm_mean ) { _align_sigm_mean = align_sigm_mean; } inline void ae_params_mut::set_align_lin_min( int16_t align_lin_min ) { _align_lin_min = align_lin_min; } inline void ae_params_mut::set_align_lin_max( int16_t align_lin_max ) { _align_lin_max = align_lin_max; } inline void ae_params_mut::set_align_max_shift( int16_t align_max_shift ) { _align_max_shift = align_max_shift; } inline void ae_params_mut::set_align_w_zone_h_len( int16_t align_w_zone_h_len ) { _align_w_zone_h_len = align_w_zone_h_len; } inline void ae_params_mut::set_align_match_bonus( int16_t align_match_bonus ) { _align_match_bonus = align_match_bonus; } inline void ae_params_mut::set_align_mismatch_cost( int16_t align_mismatch_cost ) { _align_mismatch_cost = align_mismatch_cost; } // ===================================================================== // Operators' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_PARAMS_MUT_H__ aevol-4.4/src/libaevol/ae_fuzzy_set_X11.cpp0000644000175000017500000001117512334625707015656 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include //############################################################################## // # // Class ae_fuzzy_set_X11 # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_fuzzy_set_X11::ae_fuzzy_set_X11( void ) : ae_fuzzy_set() { } ae_fuzzy_set_X11::ae_fuzzy_set_X11( const ae_fuzzy_set &model ) : ae_fuzzy_set(model) { }; // ================================================================= // Destructors // ================================================================= ae_fuzzy_set_X11::~ae_fuzzy_set_X11( void ) { } // ================================================================= // Public Methods // ================================================================= void ae_fuzzy_set_X11::display( ae_X11_window* win, color_map color, bool fill /*= false*/, bool bold /*= false*/ ) { double y_min = Y_MIN - 0.1 * Y_MAX; // Yields a bottom margin double y_max = Y_MAX * 1.1; // Yields a top margin double delta_x = X_MAX - X_MIN; double delta_y = y_max - y_min; ae_list_node* node = _points->get_first(); ae_point_2d* cur_point = NULL; ae_point_2d* next_point = NULL; int16_t cur_x; int16_t cur_y; int16_t next_x; int16_t next_y; while ( (node != NULL) && (node->get_next() != NULL) ) { cur_point = node->get_obj(); next_point = node->get_next()->get_obj(); // Display segment [cur_point, next_point] cur_x = ( (cur_point->x - X_MIN) / delta_x ) * win->get_width(); cur_y = ( 1 - ((cur_point->y - y_min) / delta_y) ) * win->get_height(); next_x = ( (next_point->x - X_MIN) / delta_x ) * win->get_width(); next_y = ( 1 - ((next_point->y - y_min) / delta_y) ) * win->get_height(); if ( fill ) { char* fill_color; for ( int16_t i = cur_x ; i < next_x ; i++ ) { fill_color = ae_X11_window::get_color( ((double)i / win->get_width()) * (X_MAX - X_MIN) ); win->draw_line( i, ( 1 - ((0 - y_min) / delta_y) ) * win->get_height(), i, cur_y + (((i - cur_x) * (next_y - cur_y)) / (next_x - cur_x)) , fill_color ); delete [] fill_color; } } win->draw_line( cur_x, cur_y, next_x, next_y, color, bold ); node = node->get_next(); } } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_point_2d.h0000644000175000017500000001433612231437075014343 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_POINT_2D_H__ #define __AE_POINT_2D_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= class ae_point_2d : public ae_object { public : // ================================================================= // Constructors // ================================================================= inline ae_point_2d( void ); inline ae_point_2d( double x, double y ); inline ae_point_2d( const ae_point_2d& source ); inline ae_point_2d( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= inline virtual ~ae_point_2d( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= inline void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= double x; double y; protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_point_2d( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; /* ae_point_2d( const ae_point_2d &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= }; //############################################################################## // # // Class ae_point_2d # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= inline ae_point_2d::ae_point_2d( void ) { x = -1; y = -1; } inline ae_point_2d::ae_point_2d( double x, double y ) { this->x = x; this->y = y; } inline ae_point_2d::ae_point_2d( const ae_point_2d& source ) { this->x = source.x; this->y = source.y; } inline ae_point_2d::ae_point_2d( gzFile backup_file ) { gzread( backup_file, &x, sizeof(x) ); gzread( backup_file, &y, sizeof(y) ); } // ================================================================= // Destructors // ================================================================= inline ae_point_2d::~ae_point_2d( void ) { } // ===================================================================== // Accessors definitions // ===================================================================== // ================================================================= // Public Methods // ================================================================= inline void ae_point_2d::save( gzFile backup_file ) { gzwrite( backup_file, &x, sizeof(x) ); gzwrite( backup_file, &y, sizeof(y) ); } // ================================================================= // Protected Methods // ================================================================= #endif // __AE_POINT_2D_H__ aevol-4.4/src/libaevol/ae_exp_manager.cpp0000644000175000017500000006766712365452043015465 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #ifdef __X11 #include #endif //############################################################################## // # // Class ae_exp_manager # // # //############################################################################## // =========================================================================== // Definition of static attributes // =========================================================================== // =========================================================================== // Constructors // =========================================================================== ae_exp_manager::ae_exp_manager( void ) { // ------------------------------------------------------ Experimental setup _exp_s = new ae_exp_setup( this ); // -------------------------------------------------------------- Population #ifdef __X11 _pop = new ae_population_X11( this ); #else _pop = new ae_population( this ); #endif // ------------------------------------------------------------- Environment _env = new ae_environment(); // ------------------------------------------------------- Spatial structure _spatial_structure = NULL; // ---------------------------------------------------------- Output manager _output_m = new ae_output_manager( this ); // ---------------------------- Generation numbers (first, last and current) _num_gener = 0; _first_gener = 0; _last_gener = 0; // ------------------------------------------------------------- Quit signal _quit_signal_received = false; } // =========================================================================== // Destructor // =========================================================================== ae_exp_manager::~ae_exp_manager( void ) { delete _pop; delete _exp_s; delete _output_m; delete _env; if ( _spatial_structure != NULL ){delete _spatial_structure;} } // =========================================================================== // Public Methods // =========================================================================== /*! \brief Save all the static data (the data that is constant throughout a simulation) Save * The experimental setup * The output profile These are written in the current directory in gzipped binary files as well as plain text files This data should be saved once and for all when the experiment is created. There is no need to save this data in the middle of a simulation since it is constant throughout the experiment. \see load( int32_t first_gener, char* exp_setup_file_name, char* out_prof_file_name, char* env_file_name, char* pop_file_name, char* sel_file_name, char* sp_struct_file_name, bool verbose ) \see save( void ) \see save_copy( char* dir, int32_t num_gener ) */ void ae_exp_manager::write_setup_files(void) { // 1) Create missing directories create_missing_directories(); // 2) Open setup files (experimental setup and output profile) gzFile exp_s_gzfile, out_p_gzfile; FILE* exp_s_txtfile, * out_p_txtfile; open_setup_files( exp_s_gzfile, exp_s_txtfile, out_p_gzfile, out_p_txtfile, _num_gener, "w" ); // 4) Write setup data _exp_s->write_setup_file( exp_s_gzfile ); _output_m->write_setup_file( out_p_gzfile ); _exp_s->write_setup_file( exp_s_txtfile ); _output_m->write_setup_file( out_p_txtfile ); // 5) Close setup files close_setup_files( exp_s_gzfile, exp_s_txtfile, out_p_gzfile, out_p_txtfile ); } /*! \brief Save all the dynamic data (the data that changes over the simulation) Save the state of * The population * The environment iff it is changing (i.e. it has variation and/or noise) * The spatial structure (if any) * The PRNG (random generator) used for the selection These are written in the current directory in gzipped binary files whose names are appended with the current generation number. WARNING: The experimental setup and output profile are *not* saved. These should be saved once and for all when the experiment is created. \see load( int32_t first_gener, char* exp_setup_file_name, char* out_prof_file_name, char* env_file_name, char* pop_file_name, char* sel_file_name, char* sp_struct_file_name, bool verbose ) \see write_setup_files( void ) \see save_copy( char* dir, int32_t num_gener ) */ void ae_exp_manager::save(void) const { // 1) Create missing directories create_missing_directories(); // 2) Open backup files (environment, population, selection and spatial structure) gzFile env_file, pop_file, sel_file, sp_struct_file; open_backup_files( env_file, pop_file, sel_file, sp_struct_file, _num_gener, "w" ); // 3) Write the state of the environment, population and spatial structure into the backups get_env()->save( env_file ); get_pop()->save( pop_file ); get_sel()->save( sel_file ); if ( is_spatially_structured() ) { get_spatial_structure()->save( sp_struct_file ); } // 4) Close backup files close_backup_files( env_file, pop_file, sel_file, sp_struct_file ); } /*! \brief Saves a complete copy of the experiment to the provided location. Save both the setup (constant) and the backup (dynamic) files to the directory. Dynamic file names will be appended with the Static files (saved both as gzipped binary and plain text) * The experimental setup * The output profile Dynamic files (saved as gzipped binary) * The population * The environment iff it is changing (i.e. it has variation and/or noise) * The spatial structure (if any) * The PRNG (random generator) used for the selection \see load( int32_t first_gener, char* exp_setup_file_name, char* out_prof_file_name, char* env_file_name, char* pop_file_name, char* sel_file_name, char* sp_struct_file_name, bool verbose ) \see write_setup_files( void ) \see save( void ) */ void ae_exp_manager::save_copy( char* dir, int32_t num_gener /*= 0*/ ) const { // 1) Create missing directories create_missing_directories(dir); // 2) Open setup files (experimental setup and output profile) // and backup files (environment, population, selection and spacial structure) gzFile exp_s_gzfile, out_p_gzfile; FILE* exp_s_txtfile, * out_p_txtfile; open_setup_files( exp_s_gzfile, exp_s_txtfile, out_p_gzfile, out_p_txtfile, num_gener, "w", dir ); gzFile env_file, pop_file, sel_file, sp_struct_file; open_backup_files( env_file, pop_file, sel_file, sp_struct_file, num_gener, "w", dir ); // 3) Write setup data _exp_s->write_setup_file( exp_s_gzfile ); _output_m->write_setup_file( out_p_gzfile ); // 4) Write the state of the environment, population, selection and spatial structure into the backups get_env()->save( env_file ); get_pop()->save( pop_file ); get_sel()->save( sel_file ); if ( is_spatially_structured() ) { get_spatial_structure()->save( sp_struct_file ); } // 4) Close setup and backup files close_setup_files( exp_s_gzfile, exp_s_txtfile, out_p_gzfile, out_p_txtfile ); close_backup_files( env_file, pop_file, sel_file, sp_struct_file ); } /*! \brief Load an experiment with the provided files */ void ae_exp_manager::load( gzFile& pop_file, gzFile& env_file, gzFile& exp_s_gzfile, FILE*& exp_s_txtfile, gzFile& exp_backup_file, gzFile& sp_struct_file, gzFile& out_p_gzfile, FILE*& out_p_txtfile, bool verbose, bool to_be_run /* = true */ ) { // ---------------------------------------- Retrieve experimental setup data printf( " Loading experimental setup..." ); fflush( stdout ); if ( exp_s_gzfile != NULL ) { _exp_s->load( exp_s_gzfile, exp_backup_file, verbose ); } else { _exp_s->load( exp_s_txtfile, exp_backup_file, verbose ); } printf( " OK\n" ); // ----------------------------------------- Retrieve spatial structure data if ( sp_struct_file != NULL ) { printf( " Loading spatial structure..." ); fflush( stdout ); _spatial_structure = new ae_spatial_structure( sp_struct_file ); printf( " OK\n" ); } // ------------------------------------------------ Retrieve population data printf( " Loading population..." ); fflush( stdout ); _pop->load( pop_file, verbose ); printf( " OK\n" ); // --------------------------------------------- Retrieve environmental data printf( " Loading environment..." ); fflush( stdout ); //~ delete _env; //~ _env = new ae_environment(); _env->load( env_file ); printf( " OK\n" ); // --------------------------------------------- Retrieve output profile data printf( " Loading output profile..." ); fflush( stdout ); if ( out_p_gzfile != NULL ) { _output_m->load( out_p_gzfile, verbose, to_be_run ); } else { _output_m->load( out_p_txtfile, verbose, to_be_run ); } printf( " OK\n" ); } /*! \brief Load an experiment with default files from a given directory */ void ae_exp_manager::load( const char* dir, int32_t first_gener, bool use_text_files, bool verbose, bool to_be_run /* = true */ ) { _first_gener = first_gener; _num_gener = first_gener; // ------------------------------------------------------------------------- // 1) Open setup files (experimental setup and output profile) // and backup files (environment, population, selection and sp structure) // ------------------------------------------------------------------------- gzFile exp_s_gzfile, out_p_gzfile; FILE* exp_s_txtfile, * out_p_txtfile; open_setup_files( exp_s_gzfile, exp_s_txtfile, out_p_gzfile, out_p_txtfile, first_gener, "r", dir ); gzFile env_file, pop_file, exp_backup_file, sp_struct_file; open_backup_files( env_file, pop_file, exp_backup_file, sp_struct_file, first_gener, "r", dir ); // ------------------------------------------------------------------------- // 2) Load data from backup and parameter files // ------------------------------------------------------------------------- load( pop_file, env_file, exp_s_gzfile, exp_s_txtfile, exp_backup_file, sp_struct_file, out_p_gzfile, out_p_txtfile, verbose, to_be_run ); // ------------------------------------------------------------------------- // 3) Close setup and backup files // ------------------------------------------------------------------------- close_setup_files( exp_s_gzfile, exp_s_txtfile, out_p_gzfile, out_p_txtfile ); close_backup_files( env_file, pop_file, exp_backup_file, sp_struct_file ); // --------------------------------------------------------------------------- // 4) Recompute unsaved data // --------------------------------------------------------------------------- // Evaluate individuals _pop->evaluate_individuals( get_env() ); // If the population is spatially structured, then the individuals are saved // and loaded in the order of the grid and not in increasing order of fitness // so we have to sort the individuals if ( is_spatially_structured() ) { _pop->sort_individuals(); } } /*! \brief Load an experiment with the provided constitutive files */ void ae_exp_manager::load( int32_t first_gener, char* pop_file_name, char* env_file_name, char* exp_setup_file_name, char* exp_backup_file_name, char* sp_struct_file_name, char* out_prof_file_name, bool verbose , bool to_be_run /* = true */) { _first_gener = first_gener; _num_gener = first_gener; // --------------------------------------------------------------------------- // 1) Determine whether the parameter files are in binary or plain text format // and open in the corresponding "mode" // --------------------------------------------------------------------------- gzFile exp_setup_gzfile = NULL; gzFile out_prof_gzfile = NULL; FILE* exp_setup_txtfile = NULL; FILE* out_prof_txtfile = NULL; exp_setup_gzfile = gzopen( exp_setup_file_name, "r" ); out_prof_gzfile = gzopen( out_prof_file_name, "r" ); if ( exp_setup_gzfile == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, exp_setup_file_name ); exit( EXIT_FAILURE ); } if ( out_prof_gzfile == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, out_prof_file_name ); exit( EXIT_FAILURE ); } if ( gzdirect( exp_setup_gzfile ) ) { // The provided output profile file is not zipped, it is a plain text setup file // => Close gzfile and open as plain file instead gzclose( exp_setup_gzfile ); exp_setup_gzfile = NULL; exp_setup_txtfile = fopen( exp_setup_file_name, "r" ); } if ( gzdirect( out_prof_gzfile ) ) { // The provided output profile file is not zipped, it is a plain text setup file // => Close gzfile and open as plain file instead gzclose( out_prof_gzfile ); out_prof_gzfile = NULL; out_prof_txtfile = fopen( out_prof_file_name, "r" ); } // --------------------------------------------------------------------------- // 2) Open backup and parameter files // --------------------------------------------------------------------------- gzFile env_file = gzopen( env_file_name, "r" ); gzFile pop_file = gzopen( pop_file_name, "r" ); gzFile exp_backup_file = gzopen( exp_backup_file_name, "r" ); gzFile sp_struct_file = NULL; if ( env_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, env_file_name ); exit( EXIT_FAILURE ); } if ( pop_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, pop_file_name ); exit( EXIT_FAILURE ); } if ( exp_backup_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, exp_backup_file_name ); exit( EXIT_FAILURE ); } if ( sp_struct_file_name != NULL ) { sp_struct_file = gzopen( sp_struct_file_name, "r" ); if ( sp_struct_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, sp_struct_file_name ); exit( EXIT_FAILURE ); } } // --------------------------------------------------------------------------- // 3) Load data from backup and parameter files // --------------------------------------------------------------------------- // ----------------------------------------- Retrieve spatial structure data if ( sp_struct_file != NULL ) { printf( " Loading spatial structure..." ); fflush( stdout ); _spatial_structure = new ae_spatial_structure( sp_struct_file ); printf( "OK\n" ); } // ------------------------------------------------ Retrieve population data printf( " Loading population..." ); fflush( stdout ); _pop->load( pop_file, verbose ); printf( "OK\n" ); // --------------------------------------------- Retrieve environmental data printf( " Loading environment..." ); fflush( stdout ); //~ delete _env; //~ _env = new ae_environment(); _env->load( env_file ); printf( "OK\n" ); // ---------------------------------------- Retrieve experimental setup data printf( " Loading experimental setup..." ); fflush( stdout ); if ( exp_setup_gzfile != NULL ) { _exp_s->load( exp_setup_gzfile, exp_backup_file, verbose ); } else { _exp_s->load( exp_setup_txtfile, exp_backup_file, verbose ); } printf( "OK\n" ); // --------------------------------------------- Retrieve output profile data if ( out_prof_gzfile != NULL ) { _output_m->load( out_prof_gzfile, verbose, to_be_run ); } else { _output_m->load( out_prof_txtfile, verbose, to_be_run ); } // --------------------------------------------------------------------------- // 4) Close setup and backup files // --------------------------------------------------------------------------- gzclose( pop_file ); gzclose( env_file ); gzclose( exp_setup_gzfile ); gzclose( exp_backup_file ); gzclose( sp_struct_file ); gzclose( out_prof_gzfile ); // --------------------------------------------------------------------------- // 5) Recompute unsaved data // --------------------------------------------------------------------------- // Evaluate individuals _pop->evaluate_individuals( get_env() ); // If the population is spatially structured, then the individuals are saved // and loaded in the order of the grid and not in increasing order of fitness // so we have to sort the individuals if ( is_spatially_structured() ) { _pop->sort_individuals(); } } /*! Run the simulation */ void ae_exp_manager::run_evolution( void ) { // We are running a simulation. // Save the setup files to keep track of the setup history write_setup_files(); // Dump the initial state of the population; useful for restarts _output_m->write_current_generation_outputs(); while ( _num_gener < _last_gener ) { if ( quit_signal_received() ) break; printf( "============================== %"PRId32" ==============================\n", _num_gener ); printf( " Best individual's distance to target (metabolic) : %f\n", _pop->get_best()->get_dist_to_target_by_feature( METABOLISM ) ); #ifdef __X11 display(); #endif // Take one step in the evolutionary loop step_to_next_generation(); // Write statistical data and store phylogenetic data (tree) _output_m->write_current_generation_outputs(); } _output_m->flush(); printf( "============================== %"PRId32" ==============================\n", _num_gener ); printf( " Best individual's distance to target (metabolic) : %f\n", _pop->get_best()->get_dist_to_target_by_feature( METABOLISM ) ); printf( "===================================================================\n"); printf (" The run is finished. \n"); printf (" Printing the final best individual into "BEST_LAST_ORG_FNAME"\n"); FILE* org_file = fopen( BEST_LAST_ORG_FNAME, "w" ); fputs( _pop->get_best()->get_genetic_unit(0)->get_dna()->get_data(), org_file ); fclose ( org_file ); } // =========================================================================== // Protected Methods // =========================================================================== void ae_exp_manager::create_missing_directories( const char* dir /*= "."*/ ) const { char cur_dir_name[255]; int status; // Base directory status = mkdir( dir, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, cur_dir_name, errno ); } // Experimental setup sprintf( cur_dir_name, "%s/"EXP_S_DIR, dir ); status = mkdir( cur_dir_name, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, cur_dir_name, errno ); } // Output profile sprintf( cur_dir_name, "%s/"OUT_P_DIR, dir ); status = mkdir( cur_dir_name, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, cur_dir_name, errno ); } // Environment sprintf( cur_dir_name, "%s/"ENV_DIR, dir ); status = mkdir( cur_dir_name, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, cur_dir_name, errno ); } // Population sprintf( cur_dir_name, "%s/"POP_DIR, dir ); status = mkdir( cur_dir_name, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, cur_dir_name, errno ); } // Spatial structure if ( is_spatially_structured() ) { sprintf( cur_dir_name, "%s/"SP_STRUCT_DIR, dir ); status = mkdir( cur_dir_name, 0755 ); if ( status == -1 && errno != EEXIST ) { err( EXIT_FAILURE, cur_dir_name, errno ); } } } void ae_exp_manager::open_backup_files( gzFile& env_file, gzFile& pop_file, gzFile& exp_backup_file, gzFile& sp_struct_file, int32_t num_gener, const char mode[3], const char* dir /*= "."*/ ) const { assert( strcmp( mode, "w" ) == 0 or strcmp( mode, "r" ) == 0 ); // ------------------------------------------------------------------------- // 1) Generate backup file names for mandatory files. // Optional files (e.g. spatial structure) will be handled separately // ------------------------------------------------------------------------- char env_file_name[255]; char pop_file_name[255]; char exp_backup_file_name[255]; sprintf( env_file_name, "%s/"ENV_FNAME_FORMAT, dir, num_gener ); sprintf( pop_file_name, "%s/"POP_FNAME_FORMAT, dir, num_gener ); sprintf( exp_backup_file_name, "%s/"EXP_S_FNAME_FORMAT, dir, num_gener ); // ------------------------------------------------------------------------- // 2) Open backup files (environment, population and selection) // ------------------------------------------------------------------------- env_file = gzopen( env_file_name, mode ); pop_file = gzopen( pop_file_name, mode ); exp_backup_file = gzopen( exp_backup_file_name, mode ); // ------------------------------------------------------------------------- // 3) Check that files were correctly opened // ------------------------------------------------------------------------- if ( env_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, env_file_name ); exit( EXIT_FAILURE ); } if ( pop_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, pop_file_name ); exit( EXIT_FAILURE ); } if ( exp_backup_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, exp_backup_file_name ); exit( EXIT_FAILURE ); } // ------------------------------------------------------------------------- // 4) Handle optional files // ------------------------------------------------------------------------- char sp_struct_file_name[255]; sprintf( sp_struct_file_name, "%s/"SP_STRUCT_FNAME_FORMAT, dir, num_gener ); // Check whether there should be spatial structure bool spatially_structured = false; if ( strcmp( mode, "w" ) == 0 ) { if ( is_spatially_structured() ) spatially_structured = true; } else if ( strcmp( mode, "r" ) == 0 ) { // Check for the existence of the corresponding file in the file system. struct stat stat_buf; if ( stat( sp_struct_file_name, &stat_buf ) == -1 ) { if ( errno != ENOENT ) { printf( "%s:%d: error: unknown error.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } // Else file does not exist, leave spatially_structured to false } else { spatially_structured = true; } } // If there should be spatial structure, open file and check if ( spatially_structured ) { sp_struct_file = gzopen( sp_struct_file_name, mode ); if ( sp_struct_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, sp_struct_file_name ); exit( EXIT_FAILURE ); } } else { sp_struct_file = NULL; } } void ae_exp_manager::close_backup_files( gzFile& env_file, gzFile& pop_file, gzFile& exp_backup_file, gzFile& sp_struct_file ) const { gzclose( env_file ); gzclose( pop_file ); gzclose( exp_backup_file ); if ( is_spatially_structured() ) { gzclose( sp_struct_file ); } } void ae_exp_manager::open_setup_files( gzFile& exp_s_gzfile, FILE*& exp_s_txtfile, gzFile& out_p_gzfile, FILE*& out_p_txtfile, int32_t num_gener, const char mode[3], const char* dir /*= "."*/ ) const { // 1) Generate setup file names char exp_s_gzfile_name[255]; char exp_s_txtfile_name[255]; char out_p_gzfile_name[255]; char out_p_txtfile_name[255]; sprintf( exp_s_gzfile_name, "%s/"EXP_S_CONST_FNAME_FORMAT, dir ); sprintf( exp_s_txtfile_name, "%s/"EXP_S_TXT_CONST_FNAME_FORMAT, dir ); sprintf( out_p_gzfile_name, "%s/"OUT_P_FNAME_FORMAT, dir ); sprintf( out_p_txtfile_name, "%s/"OUT_P_TXT_FNAME_FORMAT, dir ); // 2) Open backup files (environment, population and spacial structure) exp_s_gzfile = gzopen( exp_s_gzfile_name, mode ); exp_s_txtfile = fopen( exp_s_txtfile_name, mode ); out_p_gzfile = gzopen( out_p_gzfile_name, mode ); out_p_txtfile = fopen( out_p_txtfile_name, mode ); // 3) Check that files were correctly opened if ( exp_s_gzfile == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, exp_s_gzfile_name ); exit( EXIT_FAILURE ); } if ( exp_s_txtfile == NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, exp_s_txtfile_name ); exit( EXIT_FAILURE ); } if ( out_p_gzfile == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, out_p_gzfile_name ); exit( EXIT_FAILURE ); } if ( out_p_txtfile == NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, out_p_txtfile_name ); exit( EXIT_FAILURE ); } } void ae_exp_manager::close_setup_files( gzFile& exp_s_gzfile, FILE* exp_s_txtfile, gzFile& out_p_gzfile, FILE* out_p_txtfile ) const { gzclose( exp_s_gzfile ); fclose( exp_s_txtfile ); gzclose( out_p_gzfile ); fclose( out_p_txtfile ); } // =========================================================================== // Non inline accessors // =========================================================================== aevol-4.4/src/libaevol/ae_string.h0000644000175000017500000001317612231437075014134 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_STRING_H__ #define __AE_STRING_H__ // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= #define BLOCK_SIZE INT32_C(1024) class ae_string : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_string( void ); ae_string( const ae_string &model ); ae_string( int32_t length ); ae_string( const char* seq, int32_t length ); ae_string( char* seq, int32_t length, bool use_seq ); ae_string( gzFile backup_file ); ae_string( char* organism_file_name ); // ================================================================= // Destructors // ================================================================= virtual ~ae_string( void ); // ================================================================= // Accessors // ================================================================= inline const char* get_data( void ) const; inline void set_data( char* data, int32_t length = -1 ); inline int32_t get_length( void ) const; // ================================================================= // Public Methods // ================================================================= void remove( int32_t first, int32_t last ); void insert( int32_t pos, const char* seq, int32_t seq_length = -1 ); void replace( int32_t pos, char* seq, int32_t seq_length = -1 ); void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_string( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; /* ae_string( const ae_string &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= static inline int32_t nb_blocks( int32_t length ); // ================================================================= // Protected Attributes // ================================================================= char* _data; int32_t _length; int32_t _nb_blocks; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline const char* ae_string::get_data( void ) const { return _data; } inline void ae_string::set_data( char* data, int32_t length /* = -1 */ ) { if ( _data != NULL ) { delete [] _data; _data = NULL; } _data = data; _length = ( length != -1 ) ? length : strlen( _data ); _nb_blocks = nb_blocks( _length ); } inline int32_t ae_string::get_length( void ) const { return _length; } // ===================================================================== // Inline functions' definition // ===================================================================== int32_t ae_string::nb_blocks( int32_t length ) { return length/BLOCK_SIZE + 1; } #endif // __AE_STRING_H__ aevol-4.4/src/libaevol/param_loader.h0000644000175000017500000002566012364240744014612 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __PARAM_LOADER_H__ #define __PARAM_LOADER_H__ // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_environment; class ae_individual; class param_loader { public : // ================================================================= // Constructors // ================================================================= param_loader( const char* file_name ); // ================================================================= // Destructors // ================================================================= virtual ~param_loader( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= void read_file( void ); void load( ae_exp_manager* exp_m, bool verbose = false, char* chromosome = NULL, int32_t lchromosome = 0, char* plasmid = NULL, int32_t lplasmid = 0 ); f_line* get_line( int32_t* ); // ================================================================= // Public Attributes // ================================================================= void print_to_file( FILE* file ); protected : // ================================================================= // Forbidden Constructors // ================================================================= param_loader( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; param_loader( const param_loader &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= static void format_line( f_line*, char*, bool* ); void interpret_line( f_line* line, int32_t cur_line ); ae_individual* create_random_individual( ae_exp_manager* exp_m, ae_params_mut* param_mut, int32_t id ) const; ae_individual* create_random_individual_with_good_gene( ae_exp_manager* exp_m, ae_params_mut* param_mut, int32_t id ) const; ae_individual* create_clone( ae_individual* dolly, int32_t id ) const; // ================================================================= // Protected Attributes // ================================================================= //~ ae_exp_manager* _exp_m; ae_jumping_mt* _prng; char* _param_file_name; FILE* _param_file; // ----------------------------------------- PseudoRandom Number Generators // Seed for the selection random generator int32_t _seed; // Seed for the mutations random generator int32_t _mut_seed; // Seed for the stochasticity random generator int32_t _stoch_seed; // Seed for the environmental variation random generator int32_t _env_var_seed; // Seed for the environmental noise random generator int32_t _env_noise_seed; // ------------------------------------------------------------ Constraints int32_t _min_genome_length; int32_t _max_genome_length; double _w_max; // ----------------------------------------------------- Initial conditions int32_t _chromosome_initial_length; int8_t _init_method; int32_t _init_pop_size; char* _strain_name; // ------------------------------------------------------------ Environment ae_list* _env_gaussians; ae_list* _env_custom_points; int16_t _env_sampling; // ---------------------------------------- Environment x-axis segmentation // Number of x-axis segments int16_t _env_axis_nb_segments; // x-axis segment boundaries (sorted -- including MIN_X and MAX_X) double* _env_axis_segment_boundaries; // x-axis segment features ae_env_axis_feature* _env_axis_features; // Whether to automatically separate segments bool _env_axis_separate_segments; // -------------------------------------------------- Environment variation ae_env_var _env_var_method; double _env_var_sigma; int32_t _env_var_tau; // ------------------------------------------------------ Environment noise ae_env_noise _env_noise_method; // Method... TODO double _env_noise_alpha; // Alpha value (variance coefficient) double _env_noise_sigma; // Variance of the noise double _env_noise_prob; // Probability of variation. int32_t _env_noise_sampling_log; // Log2 of the number of points in the noise fuzzy_set // --------------------------------------------------------- Mutation rates double _point_mutation_rate; double _small_insertion_rate; double _small_deletion_rate; int16_t _max_indel_size; // -------------------------------------------- Rearrangements and Transfer bool _with_4pts_trans; bool _with_alignments; bool _with_HT; bool _repl_HT_with_close_points; double _HT_ins_rate; double _HT_repl_rate; double _repl_HT_detach_rate; // ------------------------------ Rearrangement rates (without alignements) double _duplication_rate; double _deletion_rate; double _translocation_rate; double _inversion_rate; // --------------------------------- Rearrangement rates (with alignements) double _neighbourhood_rate; double _duplication_proportion; double _deletion_proportion; double _translocation_proportion; double _inversion_proportion; // ------------------------------------------------------------ Alignements ae_align_fun_shape _align_fun_shape; double _align_sigm_lambda; int16_t _align_sigm_mean; int16_t _align_lin_min; int16_t _align_lin_max; int16_t _align_max_shift; // Maximum shift of one seq on the other int16_t _align_w_zone_h_len; // Work zone half length int16_t _align_match_bonus; // Corresponding residues match bonus int16_t _align_mismatch_cost; // Corresponding residues mismatch cost // ----------------------------------------------- Phenotypic Stochasticity bool _with_stochasticity; // -------------------------------------------------------------- Selection ae_selection_scheme _selection_scheme; double _selection_pressure; // ------------------------------------------------------ Spatial structure bool _spatially_structured; int16_t _grid_width; int16_t _grid_height; int32_t _migration_number; // TODO : explain // -------------------------------------------------------------- Secretion bool _with_secretion; // Proportion of the fitness contributed by secretion double _secretion_contrib_to_fitness; // (0,1) // Proportion that diffuses into each cell, every generation // (0 for no diffusion) double _secretion_diffusion_prop; // Proportion of secreted substance that degrades every generation double _secretion_degradation_prop; // Cost of secreting the compound, as a proportion of the amount secreted double _secretion_cost; // Starting configuration of secretion grid // 0, all are 0; 1, point source of secreted compund double _secretion_init; // --------------------------------------------------------------- Plasmids bool _allow_plasmids; int32_t _plasmid_initial_length; int32_t _plasmid_initial_gene; int32_t _plasmid_minimal_length; int32_t _plasmid_maximal_length; int32_t _chromosome_minimal_length; int32_t _chromosome_maximal_length; double _prob_plasmid_HT; double _tune_donor_ability; double _tune_recipient_ability; double _donor_cost; double _recipient_cost; bool _compute_phen_contrib_by_GU; bool _swap_GUs; // ------------------------------------------------------- Translation cost double _translation_cost; // ---------------------------------------------------------------- Outputs // Stats int8_t _stats; // Whether to delete the existing statistics file // (otherwise kept with the suffix ".old") bool _delete_old_stats; // Backups int32_t _backup_step; int32_t _big_backup_step; // Tree bool _record_tree; int32_t _tree_step; ae_tree_mode _tree_mode; // Dumps // TODO : explain bool _make_dumps; int32_t _dump_step; // Logs int8_t _logs; // Other bool _more_stats; // TODO : explain #ifdef __REGUL // ------------------------------------------------------- Binding matrix double _binding_zeros_percentage; #endif }; #endif // __param_loader_H__ aevol-4.4/src/libaevol/ae_genetic_unit.h0000644000175000017500000010035012364503705015273 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_GENETIC_UNIT_H__ #define __AE_GENETIC_UNIT_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_genetic_unit : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_genetic_unit( ae_individual* indiv, int32_t length ); ae_genetic_unit( ae_individual* indiv, char* seq, int32_t length, ae_list** prom_list = NULL ); ae_genetic_unit( ae_individual* indiv, const ae_genetic_unit &model ); ae_genetic_unit( ae_individual* indiv, ae_genetic_unit* const parent ); ae_genetic_unit( ae_individual* indiv, gzFile backup_file ); ae_genetic_unit( ae_individual* indiv, char* organism_file_name ); // ================================================================= // Destructors // ================================================================= virtual ~ae_genetic_unit( void ); // ================================================================= // Accessors // ================================================================= inline ae_exp_manager* get_exp_m( void ) const; inline ae_individual* get_indiv( void ) const; inline ae_dna* get_dna( void ) const; inline ae_fuzzy_set* get_activ_contribution( void ) const; inline ae_fuzzy_set* get_inhib_contribution( void ) const; inline ae_fuzzy_set* get_phenotypic_contribution( void ) const; inline ae_list** get_rna_list( void ) const; inline ae_list** get_protein_list( void ) const; // Direct DNA access inline const char* get_sequence( void ) const; inline int32_t get_seq_length( void ) const; // Statistical data inline int32_t get_nb_coding_RNAs( void ) const; inline int32_t get_nb_non_coding_RNAs( void ) const; inline double get_overall_size_coding_RNAs( void ) const; inline double get_av_size_coding_RNAs( void ) const; inline double get_overall_size_non_coding_RNAs( void ) const; inline double get_av_size_non_coding_RNAs( void ) const; inline int32_t get_nb_genes_activ( void ) const; inline int32_t get_nb_genes_inhib( void ) const; inline int32_t get_nb_functional_genes( void ) const; inline int32_t get_nb_non_functional_genes( void ) const; inline double get_overall_size_functional_genes( void ) const; inline double get_av_size_functional_genes( void ) const; inline double get_overall_size_non_functional_genes( void ) const; inline double get_av_size_non_functional_genes( void ) const; inline int32_t get_nb_bases_in_0_CDS( void ); inline int32_t get_nb_bases_in_0_functional_CDS( void ); inline int32_t get_nb_bases_in_0_non_functional_CDS( void ); inline int32_t get_nb_bases_in_0_RNA( void ); inline int32_t get_nb_bases_in_0_coding_RNA( void ); inline int32_t get_nb_bases_in_0_non_coding_RNA( void ); inline int32_t get_nb_bases_non_essential( void ); inline int32_t get_nb_bases_non_essential_including_nf_genes( void ); inline int32_t get_nb_bases_in_neutral_regions( void ); inline int32_t get_nb_neutral_regions( void ); inline int32_t* get_beginning_neutral_regions( void ); inline int32_t* get_end_neutral_regions( void ); inline double get_modularity( void ) const; inline double get_dist_to_target_by_feature( ae_env_axis_feature feature ) const; inline double get_fitness( void ) const; inline double get_fitness_by_feature( ae_env_axis_feature feature ) const; inline int32_t get_min_gu_length( void ) const; inline int32_t get_max_gu_length( void ) const; inline void set_rna_list( ae_list** new_list ); inline void set_min_gu_length( int32_t min_gu_length ); inline void set_max_gu_length( int32_t max_gu_length ); inline void set_exp_m( ae_exp_manager* exp_m ); // ================================================================= // Public Methods // ================================================================= void locate_promoters( void ); void do_transcription( void ); void do_translation( void ); void compute_phenotypic_contribution( void ); // DM: these two are identical to functions from ae_individual void compute_distance_to_target( ae_environment* envir ); void compute_fitness( ae_environment* envir ); void reset_expression( void ); // useful for post-treatment programs inline void print_rnas( void ) const; void print_coding_rnas( void ); inline static void print_rnas( ae_list** rnas ); static void print_rnas( ae_list* rnas, ae_strand strand ); void print_proteins( void ) const; bool is_promoter( ae_strand strand, int32_t pos, int8_t& dist ) const; bool is_terminator( ae_strand strand, int32_t pos ) const; bool is_shine_dalgarno( ae_strand strand, int32_t pos ) const; inline bool is_start( ae_strand strand, int32_t pos ) const; inline bool is_stop( ae_strand strand, int32_t pos ) const; int8_t get_codon( ae_strand strand, int32_t pos ) const; void compute_non_coding( void ); void duplicate_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** duplicated_promoters ); void get_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** promoters ); void get_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* leading_promoters ); void get_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* lagging_promoters ); void get_leading_promoters_starting_after( int32_t pos, ae_list* leading_promoters ); void get_leading_promoters_starting_before( int32_t pos, ae_list* leading_promoters ); void get_lagging_promoters_starting_before( int32_t pos, ae_list* lagging_promoters ); void get_lagging_promoters_starting_after( int32_t pos, ae_list* lagging_promoters ); void invert_promoters_included_in( int32_t pos_1, int32_t pos_2 ); static void invert_promoters( ae_list** promoter_lists, int32_t seq_length ); static void invert_promoters( ae_list** promoter_lists, int32_t pos_1, int32_t pos_2 ); // See WARNING inline void extract_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** extracted_promoters ); inline void extract_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list** extracted_promoters ); void extract_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* extracted_promoters ); void extract_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* extracted_promoters ); void extract_leading_promoters_starting_after( int32_t pos, ae_list* extracted_promoters ); void extract_leading_promoters_starting_before( int32_t pos, ae_list* extracted_promoters ); void extract_lagging_promoters_starting_before( int32_t pos, ae_list* extracted_promoters ); void extract_lagging_promoters_starting_after( int32_t pos, ae_list* extracted_promoters ); static void shift_promoters( ae_list** promoters_to_shift, int32_t delta_pos, int32_t seq_length ); void insert_promoters( ae_list** promoters_to_insert ); void insert_promoters_at( ae_list** promoters_to_insert, int32_t pos ); inline void remove_promoters_around( int32_t pos ); inline void remove_promoters_around( int32_t pos_1, int32_t pos_2 ); inline void remove_all_promoters( void ); inline void look_for_new_promoters_around( int32_t pos ); inline void look_for_new_promoters_around( int32_t pos_1, int32_t pos_2 ); inline void move_all_promoters_after( int32_t pos, int32_t delta_pos ); void move_all_leading_promoters_after( int32_t pos, int32_t delta_pos ); void move_all_lagging_promoters_after( int32_t pos, int32_t delta_pos ); // Not implemented!!! //~ inline void duplicate_promoters_starting_between( int32_t pos_1, int32_t pos_2, int32_t delta_pos ); //~ void duplicate_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, int32_t delta_pos ); //~ void duplicate_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, int32_t delta_pos ); inline void copy_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** new_promoter_lists ); inline void copy_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list** new_promoter_lists ); void copy_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* new_promoter_list ); void copy_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* new_promoter_list ); //~ inline void copy_all_promoters( ae_list** new_promoter_lists ); void save( gzFile backup_file ); int32_t get_nb_terminators( void ); //~ // set the genetic unit of all promoters to the appropriate //~ void reasign_promoter_genetic_unit (void); #ifdef DEBUG void assert_promoters( void ); void assert_promoters_order( void ); #endif bool* is_belonging_to_coding_RNA(void); void remove_non_coding_bases( void); void double_non_coding_bases(void); // WARNING: The method below works properly only in the case of a single genetic unit (no plasmid). // Translocations between different genetic units is not managed. void compute_nb_of_affected_genes(ae_mutation * mut, int & nb_genes_at_breakpoints, int & nb_genes_in_segment, int & nb_genes_in_replaced_segment); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_genetic_unit( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_genetic_unit( const ae_genetic_unit &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void init_statistical_data( void ); void remove_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2 ); void remove_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2 ); void remove_leading_promoters_starting_before( int32_t pos ); void remove_lagging_promoters_starting_before( int32_t pos ); void remove_leading_promoters_starting_after( int32_t pos ); void remove_lagging_promoters_starting_after( int32_t pos ); void look_for_new_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2 ); void look_for_new_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2 ); void look_for_new_leading_promoters_starting_after( int32_t pos ); void look_for_new_lagging_promoters_starting_after( int32_t pos ); void look_for_new_leading_promoters_starting_before( int32_t pos ); void look_for_new_lagging_promoters_starting_before( int32_t pos ); // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; ae_individual* _indiv; ae_dna* _dna; ae_fuzzy_set* _activ_contribution; ae_fuzzy_set* _inhib_contribution; ae_fuzzy_set* _phenotypic_contribution; // NB : _phenotypic_contribution is only an indicative value, not used for the whole phenotype computation ae_list** _rna_list; ae_list** _protein_list; // DM: For plasmid work, we sometimes *need* all the data (e.g. fitness, secretion) calculated for each GU double* _dist_to_target_per_segment; double* _dist_to_target_by_feature; double* _fitness_by_feature; double _fitness; // Statistical data (intrinsic for this genetic unit) int32_t _nb_coding_RNAs; // Number of coding RNAs (at least one gene on RNA) int32_t _nb_non_coding_RNAs; // Number of non-coding-RNAs double _overall_size_coding_RNAs; // Average size of coding RNAs double _overall_size_non_coding_RNAs; // Average size of non-coding RNAs int32_t _nb_genes_activ; // Number of genes realizing a function int32_t _nb_genes_inhib; // Number of genes inhibitting a function int32_t _nb_fun_genes; // Number of functional genes int32_t _nb_non_fun_genes; // Number of non-functional genes double _overall_size_fun_genes; // Average size of functional genes double _overall_size_non_fun_genes; // Average size of non-functional genes int32_t _nb_bases_in_0_CDS; // Number of bases that are not included in any gene int32_t _nb_bases_in_0_functional_CDS; // Number of bases that are not included in any non-degenerated gene int32_t _nb_bases_in_0_non_functional_CDS; // Number of bases that are not included in any degenerated gene int32_t _nb_bases_in_0_RNA; // Number of bases that are not included in any RNA int32_t _nb_bases_in_0_coding_RNA; // Number of bases that are not included in any coding RNA // (RNAs containing at least one CDS) int32_t _nb_bases_in_0_non_coding_RNA; // Number of bases that are not included in any non coding RNA int32_t _nb_bases_non_essential; // Number of bases that are not included in any non-degenerated gene or involved in its expression int32_t _nb_bases_non_essential_including_nf_genes; // Number of bases that are not included in any gene or involved in its expression int32_t _nb_bases_in_neutral_regions; // Number of bases that are not included in a neutral region // A base is considered neutral when neither itself NOR its corresponding base on the other // strand belongs to a coding promoter->terminator region (both included) int32_t _nb_neutral_regions; // Number of neutral regions int32_t* _beginning_neutral_regions; // Beginning of neutral regions int32_t* _end_neutral_regions; // Corresponding ends of neutral regions double _modularity; // Ratio between the pairwise distance between genes whose corresponding // phenotypic triangles overlap and the average intergenic distance // (ignoring non-functional genes) int32_t _min_gu_length; int32_t _max_gu_length; // TODO : check and comment what it is for //~ int32_t _nb_promoters[2]; //~ int32_t _nb_genes[2]; //~ int32_t _nb_functional_genes[2]; //~ double _average_gene_size; //~ double _average_functional_gene_size; //~ int32_t _nb_coding_bp; //~ double _clustering; // We keep trace of what we have already computed to avoid double computation (mainly in post-treaments) bool _transcribed; bool _translated; bool _phenotypic_contributions_computed; bool _non_coding_computed; bool _distance_to_target_computed; bool _fitness_computed; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline ae_exp_manager* ae_genetic_unit::get_exp_m( void ) const { return _exp_m; } inline ae_individual* ae_genetic_unit::get_indiv( void ) const { return _indiv; } inline ae_dna* ae_genetic_unit::get_dna( void ) const { return _dna; } inline ae_list** ae_genetic_unit::get_rna_list( void ) const { return _rna_list; } inline ae_list** ae_genetic_unit::get_protein_list( void ) const { assert( _protein_list ); assert( _protein_list[LEADING] ); assert( _protein_list[LAGGING] ); return _protein_list; } inline ae_fuzzy_set* ae_genetic_unit::get_activ_contribution( void ) const { return _activ_contribution; } inline ae_fuzzy_set* ae_genetic_unit::get_inhib_contribution( void ) const { return _inhib_contribution; } inline ae_fuzzy_set* ae_genetic_unit::get_phenotypic_contribution( void ) const { assert(_phenotypic_contribution != NULL); return _phenotypic_contribution; } /*! Returns the DNA sequence */ inline const char* ae_genetic_unit::get_sequence( void ) const { return _dna->get_data(); } /*! Returns the DNA sequence length */ inline int32_t ae_genetic_unit::get_seq_length( void ) const { return _dna->get_length(); } inline int32_t ae_genetic_unit::get_nb_coding_RNAs( void ) const { return _nb_coding_RNAs; } inline int32_t ae_genetic_unit::get_nb_non_coding_RNAs( void ) const { return _nb_non_coding_RNAs; } inline double ae_genetic_unit::get_overall_size_coding_RNAs( void ) const { return _overall_size_coding_RNAs; } inline double ae_genetic_unit::get_av_size_coding_RNAs( void ) const { if ( _nb_coding_RNAs != 0 ) { return _overall_size_coding_RNAs / _nb_coding_RNAs; } else return 0.0; } inline double ae_genetic_unit::get_overall_size_non_coding_RNAs( void ) const { return _overall_size_non_coding_RNAs; } inline double ae_genetic_unit::get_av_size_non_coding_RNAs( void ) const { if ( _nb_non_coding_RNAs != 0 ) { return _overall_size_non_coding_RNAs / _nb_non_coding_RNAs; } else return 0.0; } inline int32_t ae_genetic_unit::get_nb_genes_activ( void ) const { return _nb_genes_activ; } inline int32_t ae_genetic_unit::get_nb_genes_inhib( void ) const { return _nb_genes_inhib; } inline int32_t ae_genetic_unit::get_nb_functional_genes( void ) const { return _nb_fun_genes; } inline int32_t ae_genetic_unit::get_nb_non_functional_genes( void ) const { return _nb_non_fun_genes; } inline double ae_genetic_unit::get_overall_size_functional_genes( void ) const { return _overall_size_fun_genes; } inline double ae_genetic_unit::get_av_size_functional_genes( void ) const { if ( _nb_fun_genes != 0 ) { return _overall_size_fun_genes / _nb_fun_genes; } else return 0.0; } inline double ae_genetic_unit::get_overall_size_non_functional_genes( void ) const { return _overall_size_non_fun_genes; } inline double ae_genetic_unit::get_av_size_non_functional_genes( void ) const { if ( _nb_non_fun_genes != 0 ) { return _overall_size_non_fun_genes / _nb_non_fun_genes; } else return 0.0; } inline int32_t ae_genetic_unit::get_nb_bases_in_0_CDS( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_CDS; } inline int32_t ae_genetic_unit::get_nb_bases_in_0_functional_CDS( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_functional_CDS; } inline int32_t ae_genetic_unit::get_nb_bases_in_0_non_functional_CDS( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_non_functional_CDS; } inline int32_t ae_genetic_unit::get_nb_bases_in_0_RNA( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_RNA; } inline int32_t ae_genetic_unit::get_nb_bases_in_0_coding_RNA( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_coding_RNA; } inline int32_t ae_genetic_unit::get_nb_bases_in_0_non_coding_RNA( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_non_coding_RNA; } inline int32_t ae_genetic_unit::get_nb_bases_non_essential( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_non_essential; } inline int32_t ae_genetic_unit::get_nb_bases_non_essential_including_nf_genes( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_non_essential_including_nf_genes; } inline int32_t ae_genetic_unit::get_nb_bases_in_neutral_regions( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_neutral_regions; } inline int32_t ae_genetic_unit::get_nb_neutral_regions( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _nb_neutral_regions; } inline int32_t* ae_genetic_unit::get_beginning_neutral_regions( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _beginning_neutral_regions; } inline int32_t* ae_genetic_unit::get_end_neutral_regions( void ) { if ( ! _non_coding_computed ) compute_non_coding(); return _end_neutral_regions; } inline double ae_genetic_unit::get_modularity( void ) const { return _modularity; } inline double ae_genetic_unit::get_dist_to_target_by_feature( ae_env_axis_feature feature ) const { assert( _distance_to_target_computed ); return _dist_to_target_by_feature[feature]; } inline double ae_genetic_unit::get_fitness( void ) const { assert( _fitness_computed ); return _fitness; } inline double ae_genetic_unit::get_fitness_by_feature( ae_env_axis_feature feature ) const { assert( _fitness_computed ); return _fitness_by_feature[feature]; } inline int32_t ae_genetic_unit::get_min_gu_length( void ) const { return _min_gu_length; } inline int32_t ae_genetic_unit::get_max_gu_length( void ) const { return _max_gu_length; } inline void ae_genetic_unit::set_rna_list( ae_list** new_list ) { _rna_list = new_list; } // TODO : erase that! // NOTE : Why? inline void ae_genetic_unit::set_min_gu_length( int32_t min_gu_length ) { _min_gu_length = min_gu_length; } inline void ae_genetic_unit::set_max_gu_length( int32_t max_gu_length ) { _max_gu_length = max_gu_length; } inline void ae_genetic_unit::set_exp_m( ae_exp_manager* exp_m ) { _exp_m = exp_m; } // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_genetic_unit::print_rnas( void ) const { print_rnas( _rna_list ); } inline /* static */ void ae_genetic_unit::print_rnas( ae_list** rnas ) { print_rnas( rnas[LEADING], LEADING ); print_rnas( rnas[LAGGING], LAGGING ); } inline bool ae_genetic_unit::is_start( ae_strand strand, int32_t index ) const { return ( get_codon( strand, index ) == CODON_START ); } inline bool ae_genetic_unit::is_stop( ae_strand strand, int32_t index ) const { return ( get_codon( strand, index ) == CODON_STOP ); } inline void ae_genetic_unit::remove_all_promoters( void ) { _rna_list[LEADING]->erase( true ); _rna_list[LAGGING]->erase( true ); } inline void ae_genetic_unit::move_all_promoters_after( int32_t pos, int32_t delta_pos ) { move_all_leading_promoters_after( pos, delta_pos ); move_all_lagging_promoters_after( pos, delta_pos ); } inline void ae_genetic_unit::extract_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** extracted_promoters ) { assert( pos_1 >= 0 && pos_1 < pos_2 && pos_2 <= _dna->get_length() ); if ( pos_2 - pos_1 >= PROM_SIZE ) { extract_leading_promoters_starting_between( pos_1, pos_2 - PROM_SIZE + 1, extracted_promoters[LEADING] ); extract_lagging_promoters_starting_between( pos_1 + PROM_SIZE - 1, pos_2, extracted_promoters[LAGGING] ); } } inline void ae_genetic_unit::extract_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list** extracted_promoters ) { extract_leading_promoters_starting_between( pos_1, pos_2, extracted_promoters[LEADING] ); extract_lagging_promoters_starting_between( pos_1, pos_2, extracted_promoters[LAGGING] ); } /*! \brief Remove those promoters that would be broken if the chromosome was cut at pos. Remove promoters that include BOTH the base before AND after pos (marked X in the cartoon below). If the genome is smaller than the size of a promoter, all the promoters will be removed. \verbatim ------------------------------------------------------- | | | | | X | X | | | | | | | | | ------------------------------------------------------- ^ ^ 0 pos \endverbatim */ inline void ae_genetic_unit::remove_promoters_around( int32_t pos ) { if ( _dna->get_length() >= PROM_SIZE ) { remove_leading_promoters_starting_between( ae_utils::mod(pos - PROM_SIZE + 1, _dna->get_length()), pos ); remove_lagging_promoters_starting_between( pos, ae_utils::mod(pos + PROM_SIZE - 1, _dna->get_length()) ); } else { remove_all_promoters(); } } /*! \brief Remove those promoters that would be broken if the sequence [pos_1 ; pos_2[ was deleted. Remove promoters that * include BOTH the base before AND after pos_1 (marked X in the cartoon below). * include BOTH the base before AND after pos_2 (marked Y in the cartoon below). * are completely contained between pos_1 and pos_2. If the remaining sequence, i.e. [pos_2 ; pos_1[ is smaller than the size of a promoter, all the promoters will be removed. \verbatim ------------------------------------------------------- | | | | | X | X | | | | Y | Y | | | | ------------------------------------------------------- ^ ^ ^ 0 pos_1 pos_2 \endverbatim */ inline void ae_genetic_unit::remove_promoters_around( int32_t pos_1, int32_t pos_2 ) { if ( ae_utils::mod(pos_1 - pos_2, _dna->get_length()) >= PROM_SIZE ) { remove_leading_promoters_starting_between( ae_utils::mod(pos_1 - PROM_SIZE + 1, _dna->get_length()), pos_2 ); remove_lagging_promoters_starting_between( pos_1, ae_utils::mod(pos_2 + PROM_SIZE - 1, _dna->get_length()) ); } else { remove_all_promoters(); } } /*! \brief Look for promoters that are astride pos and add them to the list of promoters (_rna_list). Look for promoters that include BOTH the base before AND after pos (marked X in the cartoon below). If the genome is smaller than the size of a promoter, no search is performed. \verbatim ------------------------------------------------------- | | | | | X | X | | | | | | | | | ------------------------------------------------------- ^ ^ 0 pos \endverbatim */ inline void ae_genetic_unit::look_for_new_promoters_around( int32_t pos ) { assert( pos >= 0 && pos <= _dna->get_length() ); if ( _dna->get_length() >= PROM_SIZE ) { look_for_new_leading_promoters_starting_between( ae_utils::mod(pos - PROM_SIZE + 1, _dna->get_length()), ae_utils::mod(pos , _dna->get_length()) ); look_for_new_lagging_promoters_starting_between( ae_utils::mod(pos , _dna->get_length()), ae_utils::mod(pos + PROM_SIZE - 1, _dna->get_length()) ); } } /*! \brief Look for promoters that contain at least 1 base lying in [pos_1 ; pos_2[ and add them to the list of promoters (_rna_list). Look for promoters that * include BOTH the base before AND after pos_1 (marked X in the cartoon below). * include BOTH the base before AND after pos_2 (marked Y in the cartoon below). * are completely contained between pos_1 and pos_2. If the genome is smaller than the size of a promoter, no search is performed. \verbatim ------------------------------------------------------- | | | | | X | X | | | | Y | Y | | | | ------------------------------------------------------- ^ ^ ^ 0 pos_1 pos_2 \endverbatim */ inline void ae_genetic_unit::look_for_new_promoters_around( int32_t pos_1, int32_t pos_2 ) { //~ if ( ae_utils::mod( pos_1 - pos_2, _dna->get_length()) == PROM_SIZE - 1 ) //~ { //~ // We have to look at every possible position on the genome. //~ locate_promoters(); //~ } /*else*/ if ( _dna->get_length() >= PROM_SIZE ) { look_for_new_leading_promoters_starting_between( ae_utils::mod(pos_1 - PROM_SIZE + 1, _dna->get_length()), pos_2 ); look_for_new_lagging_promoters_starting_between( pos_1, ae_utils::mod(pos_2 + PROM_SIZE - 1, _dna->get_length()) ); } } //~ inline void ae_genetic_unit::duplicate_promoters_starting_between( int32_t pos_1, int32_t pos_2, int32_t delta_pos ) //~ { //~ duplicate_leading_promoters_starting_between( pos_1, pos_2, delta_pos ); //~ duplicate_lagging_promoters_starting_between( pos_1, pos_2, delta_pos ); //~ } inline void ae_genetic_unit::copy_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** new_promoter_lists ) { if ( ae_utils::mod( pos_2 - pos_1 - 1, _dna->get_length() ) + 1 >= PROM_SIZE ) { copy_leading_promoters_starting_between( pos_1, ae_utils::mod( pos_2 - PROM_SIZE + 1, _dna->get_length() ), new_promoter_lists[LEADING] ); copy_lagging_promoters_starting_between( ae_utils::mod( pos_1 + PROM_SIZE - 1, _dna->get_length() ), pos_2, new_promoter_lists[LAGGING] ); } } inline void ae_genetic_unit::copy_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list** new_promoter_lists ) { copy_leading_promoters_starting_between( pos_1, pos_2, new_promoter_lists[LEADING] ); copy_lagging_promoters_starting_between( pos_1, pos_2, new_promoter_lists[LAGGING] ); } //~ inline void ae_genetic_unit::copy_all_promoters( ae_list** new_promoter_lists ) //~ { //~ ae_list_node* rna_node = NULL; //~ for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) //~ { //~ rna_node = _rna_list[strand]->get_first(); //~ while ( rna_node != NULL ) //~ { //~ new_promoter_lists[strand]->add( new ae_rna( this, *(rna_node->get_obj()) ) ); //~ rna_node = rna_node->get_next(); //~ } //~ } //~ } #endif // __ae_genetic_unit_H__ aevol-4.4/src/libaevol/Makefile.in0000644000000000000000000031525512365454415014033 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src/libaevol DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libaevol_a_AR = $(AR) $(ARFLAGS) libaevol_a_LIBADD = am__libaevol_a_SOURCES_DIST = ae_align.cpp ae_codon.cpp ae_dna.cpp \ ae_dump.cpp ae_environment.cpp ae_exp_manager.cpp \ ae_exp_setup.cpp ae_fuzzy_set.cpp ae_genetic_unit.cpp \ ae_grid_cell.cpp ae_individual.cpp ae_logs.cpp ae_mutation.cpp \ ae_output_manager.cpp ae_params_mut.cpp ae_phenotype.cpp \ ae_population.cpp ae_protein.cpp ae_jumping_mt.cpp \ ae_replication_report.cpp ae_dna_replic_report.cpp ae_rna.cpp \ ae_stats.cpp ae_stat_record.cpp ae_string.cpp ae_tree.cpp \ ae_vis_a_vis.cpp ae_selection.cpp ae_spatial_structure.cpp \ ae_gene_tree.cpp ae_gene_tree_node.cpp ae_gene_mutation.cpp \ param_loader.cpp f_line.cpp ae_align.h ae_codon.h ae_dna.h \ ae_dump.h ae_enums.h ae_environment.h ae_env_segment.h \ ae_exp_manager.h ae_exp_setup.h ae_fuzzy_set.h ae_gaussian.h \ ae_genetic_unit.h ae_grid_cell.h ae_individual.h ae_list.h \ ae_logs.h ae_macros.h ae_mutation.h ae_object.h \ ae_output_manager.h ae_params_mut.h ae_phenotype.h \ ae_population.h ae_point_1d.h ae_point_2d.h ae_protein.h \ ae_jumping_mt.h ae_jump_poly.h ae_replication_report.h \ ae_dna_replic_report.h ae_rna.h ae_stats.h ae_stat_record.h \ ae_string.h ae_tree.h ae_utils.h ae_vis_a_vis.h ae_selection.h \ ae_spatial_structure.h ae_gene_tree.h ae_gene_tree_node.h \ ae_gene_mutation.h param_loader.h f_line.h \ ae_fuzzy_set_X11.cpp ae_individual_X11.cpp \ ae_population_X11.cpp ae_exp_manager_X11.cpp ae_X11_window.cpp \ ae_fuzzy_set_X11.h ae_individual_X11.h ae_population_X11.h \ ae_exp_manager_X11.h ae_X11_window.h am__objects_1 = libaevol_a-ae_align.$(OBJEXT) \ libaevol_a-ae_codon.$(OBJEXT) libaevol_a-ae_dna.$(OBJEXT) \ libaevol_a-ae_dump.$(OBJEXT) \ libaevol_a-ae_environment.$(OBJEXT) \ libaevol_a-ae_exp_manager.$(OBJEXT) \ libaevol_a-ae_exp_setup.$(OBJEXT) \ libaevol_a-ae_fuzzy_set.$(OBJEXT) \ libaevol_a-ae_genetic_unit.$(OBJEXT) \ libaevol_a-ae_grid_cell.$(OBJEXT) \ libaevol_a-ae_individual.$(OBJEXT) \ libaevol_a-ae_logs.$(OBJEXT) libaevol_a-ae_mutation.$(OBJEXT) \ libaevol_a-ae_output_manager.$(OBJEXT) \ libaevol_a-ae_params_mut.$(OBJEXT) \ libaevol_a-ae_phenotype.$(OBJEXT) \ libaevol_a-ae_population.$(OBJEXT) \ libaevol_a-ae_protein.$(OBJEXT) \ libaevol_a-ae_jumping_mt.$(OBJEXT) \ libaevol_a-ae_replication_report.$(OBJEXT) \ libaevol_a-ae_dna_replic_report.$(OBJEXT) \ libaevol_a-ae_rna.$(OBJEXT) libaevol_a-ae_stats.$(OBJEXT) \ libaevol_a-ae_stat_record.$(OBJEXT) \ libaevol_a-ae_string.$(OBJEXT) libaevol_a-ae_tree.$(OBJEXT) \ libaevol_a-ae_vis_a_vis.$(OBJEXT) \ libaevol_a-ae_selection.$(OBJEXT) \ libaevol_a-ae_spatial_structure.$(OBJEXT) \ libaevol_a-ae_gene_tree.$(OBJEXT) \ libaevol_a-ae_gene_tree_node.$(OBJEXT) \ libaevol_a-ae_gene_mutation.$(OBJEXT) \ libaevol_a-param_loader.$(OBJEXT) libaevol_a-f_line.$(OBJEXT) am__objects_2 = am__objects_3 = libaevol_a-ae_fuzzy_set_X11.$(OBJEXT) \ libaevol_a-ae_individual_X11.$(OBJEXT) \ libaevol_a-ae_population_X11.$(OBJEXT) \ libaevol_a-ae_exp_manager_X11.$(OBJEXT) \ libaevol_a-ae_X11_window.$(OBJEXT) @WITH_X_FALSE@am_libaevol_a_OBJECTS = $(am__objects_1) \ @WITH_X_FALSE@ $(am__objects_2) @WITH_X_TRUE@am_libaevol_a_OBJECTS = $(am__objects_1) $(am__objects_3) \ @WITH_X_TRUE@ $(am__objects_2) $(am__objects_2) libaevol_a_OBJECTS = $(am_libaevol_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libaevol_a_SOURCES) DIST_SOURCES = $(am__libaevol_a_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = SFMT-src-1.4 . tests DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ############################################ # Variables # ############################################ ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS = $(AEVOLCPPFLAGS) -D__STDC_FORMAT_MACROS \ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) @WITH_CPPUNIT_FALSE@SUBDIRS = SFMT-src-1.4 . @WITH_CPPUNIT_TRUE@SUBDIRS = SFMT-src-1.4 . tests ######################## # Set library to build # ######################## noinst_LIBRARIES = libaevol.a common_headers = ae_align.h ae_codon.h ae_dna.h ae_dump.h ae_enums.h \ ae_environment.h ae_env_segment.h ae_exp_manager.h \ ae_exp_setup.h ae_fuzzy_set.h ae_gaussian.h ae_genetic_unit.h \ ae_grid_cell.h ae_individual.h ae_list.h ae_logs.h ae_macros.h \ ae_mutation.h ae_object.h ae_output_manager.h ae_params_mut.h \ ae_phenotype.h ae_population.h ae_point_1d.h ae_point_2d.h \ ae_protein.h ae_jumping_mt.h ae_jump_poly.h \ ae_replication_report.h ae_dna_replic_report.h ae_rna.h \ ae_stats.h ae_stat_record.h ae_string.h ae_tree.h ae_utils.h \ ae_vis_a_vis.h ae_selection.h ae_spatial_structure.h \ ae_gene_tree.h ae_gene_tree_node.h ae_gene_mutation.h \ param_loader.h f_line.h common_sources = ae_align.cpp ae_codon.cpp ae_dna.cpp ae_dump.cpp \ ae_environment.cpp ae_exp_manager.cpp ae_exp_setup.cpp \ ae_fuzzy_set.cpp ae_genetic_unit.cpp ae_grid_cell.cpp \ ae_individual.cpp ae_logs.cpp ae_mutation.cpp \ ae_output_manager.cpp ae_params_mut.cpp ae_phenotype.cpp \ ae_population.cpp ae_protein.cpp ae_jumping_mt.cpp \ ae_replication_report.cpp ae_dna_replic_report.cpp ae_rna.cpp \ ae_stats.cpp ae_stat_record.cpp ae_string.cpp ae_tree.cpp \ ae_vis_a_vis.cpp ae_selection.cpp ae_spatial_structure.cpp \ ae_gene_tree.cpp ae_gene_tree_node.cpp ae_gene_mutation.cpp \ param_loader.cpp f_line.cpp X11_headers = ae_fuzzy_set_X11.h ae_individual_X11.h ae_population_X11.h ae_exp_manager_X11.h ae_X11_window.h X11_sources = ae_fuzzy_set_X11.cpp ae_individual_X11.cpp ae_population_X11.cpp ae_exp_manager_X11.cpp ae_X11_window.cpp # The target_CPPFLAGS for each target may look useless, it is here to force automake to create # prefixed object files so that we don't use an object file built for another set of macrodefinitions # e.g. We don't want to use an object file created with NO_X when building the X11 lib libaevol_a_CPPFLAGS = $(AM_CPPFLAGS) #libaevol_a_HEADERS = $(common_headers) @WITH_X_FALSE@libaevol_a_SOURCES = $(common_sources) $(common_headers) #libaevol_a_HEADERS = $(common_headers) $(X11_headers) @WITH_X_TRUE@libaevol_a_SOURCES = $(common_sources) $(X11_sources) \ @WITH_X_TRUE@ $(common_headers) $(X11_headers) all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libaevol/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libaevol/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libaevol.a: $(libaevol_a_OBJECTS) $(libaevol_a_DEPENDENCIES) $(EXTRA_libaevol_a_DEPENDENCIES) -rm -f libaevol.a $(libaevol_a_AR) libaevol.a $(libaevol_a_OBJECTS) $(libaevol_a_LIBADD) $(RANLIB) libaevol.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_X11_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_align.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_codon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_dna.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_dna_replic_report.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_environment.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_exp_manager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_exp_manager_X11.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_exp_setup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_fuzzy_set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_gene_mutation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_gene_tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_gene_tree_node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_genetic_unit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_grid_cell.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_individual.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_individual_X11.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_jumping_mt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_logs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_mutation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_output_manager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_params_mut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_phenotype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_population.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_population_X11.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_protein.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_replication_report.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_rna.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_selection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_spatial_structure.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_stat_record.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-ae_vis_a_vis.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-f_line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaevol_a-param_loader.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` libaevol_a-ae_align.o: ae_align.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_align.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_align.Tpo -c -o libaevol_a-ae_align.o `test -f 'ae_align.cpp' || echo '$(srcdir)/'`ae_align.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_align.Tpo $(DEPDIR)/libaevol_a-ae_align.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_align.cpp' object='libaevol_a-ae_align.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_align.o `test -f 'ae_align.cpp' || echo '$(srcdir)/'`ae_align.cpp libaevol_a-ae_align.obj: ae_align.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_align.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_align.Tpo -c -o libaevol_a-ae_align.obj `if test -f 'ae_align.cpp'; then $(CYGPATH_W) 'ae_align.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_align.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_align.Tpo $(DEPDIR)/libaevol_a-ae_align.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_align.cpp' object='libaevol_a-ae_align.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_align.obj `if test -f 'ae_align.cpp'; then $(CYGPATH_W) 'ae_align.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_align.cpp'; fi` libaevol_a-ae_codon.o: ae_codon.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_codon.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_codon.Tpo -c -o libaevol_a-ae_codon.o `test -f 'ae_codon.cpp' || echo '$(srcdir)/'`ae_codon.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_codon.Tpo $(DEPDIR)/libaevol_a-ae_codon.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_codon.cpp' object='libaevol_a-ae_codon.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_codon.o `test -f 'ae_codon.cpp' || echo '$(srcdir)/'`ae_codon.cpp libaevol_a-ae_codon.obj: ae_codon.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_codon.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_codon.Tpo -c -o libaevol_a-ae_codon.obj `if test -f 'ae_codon.cpp'; then $(CYGPATH_W) 'ae_codon.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_codon.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_codon.Tpo $(DEPDIR)/libaevol_a-ae_codon.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_codon.cpp' object='libaevol_a-ae_codon.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_codon.obj `if test -f 'ae_codon.cpp'; then $(CYGPATH_W) 'ae_codon.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_codon.cpp'; fi` libaevol_a-ae_dna.o: ae_dna.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_dna.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_dna.Tpo -c -o libaevol_a-ae_dna.o `test -f 'ae_dna.cpp' || echo '$(srcdir)/'`ae_dna.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_dna.Tpo $(DEPDIR)/libaevol_a-ae_dna.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_dna.cpp' object='libaevol_a-ae_dna.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_dna.o `test -f 'ae_dna.cpp' || echo '$(srcdir)/'`ae_dna.cpp libaevol_a-ae_dna.obj: ae_dna.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_dna.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_dna.Tpo -c -o libaevol_a-ae_dna.obj `if test -f 'ae_dna.cpp'; then $(CYGPATH_W) 'ae_dna.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_dna.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_dna.Tpo $(DEPDIR)/libaevol_a-ae_dna.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_dna.cpp' object='libaevol_a-ae_dna.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_dna.obj `if test -f 'ae_dna.cpp'; then $(CYGPATH_W) 'ae_dna.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_dna.cpp'; fi` libaevol_a-ae_dump.o: ae_dump.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_dump.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_dump.Tpo -c -o libaevol_a-ae_dump.o `test -f 'ae_dump.cpp' || echo '$(srcdir)/'`ae_dump.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_dump.Tpo $(DEPDIR)/libaevol_a-ae_dump.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_dump.cpp' object='libaevol_a-ae_dump.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_dump.o `test -f 'ae_dump.cpp' || echo '$(srcdir)/'`ae_dump.cpp libaevol_a-ae_dump.obj: ae_dump.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_dump.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_dump.Tpo -c -o libaevol_a-ae_dump.obj `if test -f 'ae_dump.cpp'; then $(CYGPATH_W) 'ae_dump.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_dump.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_dump.Tpo $(DEPDIR)/libaevol_a-ae_dump.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_dump.cpp' object='libaevol_a-ae_dump.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_dump.obj `if test -f 'ae_dump.cpp'; then $(CYGPATH_W) 'ae_dump.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_dump.cpp'; fi` libaevol_a-ae_environment.o: ae_environment.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_environment.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_environment.Tpo -c -o libaevol_a-ae_environment.o `test -f 'ae_environment.cpp' || echo '$(srcdir)/'`ae_environment.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_environment.Tpo $(DEPDIR)/libaevol_a-ae_environment.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_environment.cpp' object='libaevol_a-ae_environment.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_environment.o `test -f 'ae_environment.cpp' || echo '$(srcdir)/'`ae_environment.cpp libaevol_a-ae_environment.obj: ae_environment.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_environment.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_environment.Tpo -c -o libaevol_a-ae_environment.obj `if test -f 'ae_environment.cpp'; then $(CYGPATH_W) 'ae_environment.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_environment.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_environment.Tpo $(DEPDIR)/libaevol_a-ae_environment.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_environment.cpp' object='libaevol_a-ae_environment.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_environment.obj `if test -f 'ae_environment.cpp'; then $(CYGPATH_W) 'ae_environment.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_environment.cpp'; fi` libaevol_a-ae_exp_manager.o: ae_exp_manager.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_exp_manager.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_exp_manager.Tpo -c -o libaevol_a-ae_exp_manager.o `test -f 'ae_exp_manager.cpp' || echo '$(srcdir)/'`ae_exp_manager.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_exp_manager.Tpo $(DEPDIR)/libaevol_a-ae_exp_manager.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_exp_manager.cpp' object='libaevol_a-ae_exp_manager.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_exp_manager.o `test -f 'ae_exp_manager.cpp' || echo '$(srcdir)/'`ae_exp_manager.cpp libaevol_a-ae_exp_manager.obj: ae_exp_manager.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_exp_manager.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_exp_manager.Tpo -c -o libaevol_a-ae_exp_manager.obj `if test -f 'ae_exp_manager.cpp'; then $(CYGPATH_W) 'ae_exp_manager.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_exp_manager.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_exp_manager.Tpo $(DEPDIR)/libaevol_a-ae_exp_manager.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_exp_manager.cpp' object='libaevol_a-ae_exp_manager.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_exp_manager.obj `if test -f 'ae_exp_manager.cpp'; then $(CYGPATH_W) 'ae_exp_manager.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_exp_manager.cpp'; fi` libaevol_a-ae_exp_setup.o: ae_exp_setup.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_exp_setup.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_exp_setup.Tpo -c -o libaevol_a-ae_exp_setup.o `test -f 'ae_exp_setup.cpp' || echo '$(srcdir)/'`ae_exp_setup.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_exp_setup.Tpo $(DEPDIR)/libaevol_a-ae_exp_setup.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_exp_setup.cpp' object='libaevol_a-ae_exp_setup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_exp_setup.o `test -f 'ae_exp_setup.cpp' || echo '$(srcdir)/'`ae_exp_setup.cpp libaevol_a-ae_exp_setup.obj: ae_exp_setup.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_exp_setup.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_exp_setup.Tpo -c -o libaevol_a-ae_exp_setup.obj `if test -f 'ae_exp_setup.cpp'; then $(CYGPATH_W) 'ae_exp_setup.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_exp_setup.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_exp_setup.Tpo $(DEPDIR)/libaevol_a-ae_exp_setup.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_exp_setup.cpp' object='libaevol_a-ae_exp_setup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_exp_setup.obj `if test -f 'ae_exp_setup.cpp'; then $(CYGPATH_W) 'ae_exp_setup.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_exp_setup.cpp'; fi` libaevol_a-ae_fuzzy_set.o: ae_fuzzy_set.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_fuzzy_set.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_fuzzy_set.Tpo -c -o libaevol_a-ae_fuzzy_set.o `test -f 'ae_fuzzy_set.cpp' || echo '$(srcdir)/'`ae_fuzzy_set.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_fuzzy_set.Tpo $(DEPDIR)/libaevol_a-ae_fuzzy_set.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_fuzzy_set.cpp' object='libaevol_a-ae_fuzzy_set.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_fuzzy_set.o `test -f 'ae_fuzzy_set.cpp' || echo '$(srcdir)/'`ae_fuzzy_set.cpp libaevol_a-ae_fuzzy_set.obj: ae_fuzzy_set.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_fuzzy_set.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_fuzzy_set.Tpo -c -o libaevol_a-ae_fuzzy_set.obj `if test -f 'ae_fuzzy_set.cpp'; then $(CYGPATH_W) 'ae_fuzzy_set.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_fuzzy_set.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_fuzzy_set.Tpo $(DEPDIR)/libaevol_a-ae_fuzzy_set.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_fuzzy_set.cpp' object='libaevol_a-ae_fuzzy_set.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_fuzzy_set.obj `if test -f 'ae_fuzzy_set.cpp'; then $(CYGPATH_W) 'ae_fuzzy_set.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_fuzzy_set.cpp'; fi` libaevol_a-ae_genetic_unit.o: ae_genetic_unit.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_genetic_unit.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_genetic_unit.Tpo -c -o libaevol_a-ae_genetic_unit.o `test -f 'ae_genetic_unit.cpp' || echo '$(srcdir)/'`ae_genetic_unit.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_genetic_unit.Tpo $(DEPDIR)/libaevol_a-ae_genetic_unit.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_genetic_unit.cpp' object='libaevol_a-ae_genetic_unit.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_genetic_unit.o `test -f 'ae_genetic_unit.cpp' || echo '$(srcdir)/'`ae_genetic_unit.cpp libaevol_a-ae_genetic_unit.obj: ae_genetic_unit.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_genetic_unit.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_genetic_unit.Tpo -c -o libaevol_a-ae_genetic_unit.obj `if test -f 'ae_genetic_unit.cpp'; then $(CYGPATH_W) 'ae_genetic_unit.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_genetic_unit.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_genetic_unit.Tpo $(DEPDIR)/libaevol_a-ae_genetic_unit.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_genetic_unit.cpp' object='libaevol_a-ae_genetic_unit.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_genetic_unit.obj `if test -f 'ae_genetic_unit.cpp'; then $(CYGPATH_W) 'ae_genetic_unit.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_genetic_unit.cpp'; fi` libaevol_a-ae_grid_cell.o: ae_grid_cell.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_grid_cell.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_grid_cell.Tpo -c -o libaevol_a-ae_grid_cell.o `test -f 'ae_grid_cell.cpp' || echo '$(srcdir)/'`ae_grid_cell.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_grid_cell.Tpo $(DEPDIR)/libaevol_a-ae_grid_cell.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_grid_cell.cpp' object='libaevol_a-ae_grid_cell.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_grid_cell.o `test -f 'ae_grid_cell.cpp' || echo '$(srcdir)/'`ae_grid_cell.cpp libaevol_a-ae_grid_cell.obj: ae_grid_cell.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_grid_cell.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_grid_cell.Tpo -c -o libaevol_a-ae_grid_cell.obj `if test -f 'ae_grid_cell.cpp'; then $(CYGPATH_W) 'ae_grid_cell.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_grid_cell.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_grid_cell.Tpo $(DEPDIR)/libaevol_a-ae_grid_cell.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_grid_cell.cpp' object='libaevol_a-ae_grid_cell.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_grid_cell.obj `if test -f 'ae_grid_cell.cpp'; then $(CYGPATH_W) 'ae_grid_cell.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_grid_cell.cpp'; fi` libaevol_a-ae_individual.o: ae_individual.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_individual.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_individual.Tpo -c -o libaevol_a-ae_individual.o `test -f 'ae_individual.cpp' || echo '$(srcdir)/'`ae_individual.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_individual.Tpo $(DEPDIR)/libaevol_a-ae_individual.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_individual.cpp' object='libaevol_a-ae_individual.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_individual.o `test -f 'ae_individual.cpp' || echo '$(srcdir)/'`ae_individual.cpp libaevol_a-ae_individual.obj: ae_individual.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_individual.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_individual.Tpo -c -o libaevol_a-ae_individual.obj `if test -f 'ae_individual.cpp'; then $(CYGPATH_W) 'ae_individual.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_individual.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_individual.Tpo $(DEPDIR)/libaevol_a-ae_individual.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_individual.cpp' object='libaevol_a-ae_individual.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_individual.obj `if test -f 'ae_individual.cpp'; then $(CYGPATH_W) 'ae_individual.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_individual.cpp'; fi` libaevol_a-ae_logs.o: ae_logs.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_logs.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_logs.Tpo -c -o libaevol_a-ae_logs.o `test -f 'ae_logs.cpp' || echo '$(srcdir)/'`ae_logs.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_logs.Tpo $(DEPDIR)/libaevol_a-ae_logs.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_logs.cpp' object='libaevol_a-ae_logs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_logs.o `test -f 'ae_logs.cpp' || echo '$(srcdir)/'`ae_logs.cpp libaevol_a-ae_logs.obj: ae_logs.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_logs.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_logs.Tpo -c -o libaevol_a-ae_logs.obj `if test -f 'ae_logs.cpp'; then $(CYGPATH_W) 'ae_logs.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_logs.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_logs.Tpo $(DEPDIR)/libaevol_a-ae_logs.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_logs.cpp' object='libaevol_a-ae_logs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_logs.obj `if test -f 'ae_logs.cpp'; then $(CYGPATH_W) 'ae_logs.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_logs.cpp'; fi` libaevol_a-ae_mutation.o: ae_mutation.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_mutation.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_mutation.Tpo -c -o libaevol_a-ae_mutation.o `test -f 'ae_mutation.cpp' || echo '$(srcdir)/'`ae_mutation.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_mutation.Tpo $(DEPDIR)/libaevol_a-ae_mutation.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_mutation.cpp' object='libaevol_a-ae_mutation.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_mutation.o `test -f 'ae_mutation.cpp' || echo '$(srcdir)/'`ae_mutation.cpp libaevol_a-ae_mutation.obj: ae_mutation.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_mutation.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_mutation.Tpo -c -o libaevol_a-ae_mutation.obj `if test -f 'ae_mutation.cpp'; then $(CYGPATH_W) 'ae_mutation.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_mutation.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_mutation.Tpo $(DEPDIR)/libaevol_a-ae_mutation.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_mutation.cpp' object='libaevol_a-ae_mutation.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_mutation.obj `if test -f 'ae_mutation.cpp'; then $(CYGPATH_W) 'ae_mutation.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_mutation.cpp'; fi` libaevol_a-ae_output_manager.o: ae_output_manager.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_output_manager.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_output_manager.Tpo -c -o libaevol_a-ae_output_manager.o `test -f 'ae_output_manager.cpp' || echo '$(srcdir)/'`ae_output_manager.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_output_manager.Tpo $(DEPDIR)/libaevol_a-ae_output_manager.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_output_manager.cpp' object='libaevol_a-ae_output_manager.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_output_manager.o `test -f 'ae_output_manager.cpp' || echo '$(srcdir)/'`ae_output_manager.cpp libaevol_a-ae_output_manager.obj: ae_output_manager.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_output_manager.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_output_manager.Tpo -c -o libaevol_a-ae_output_manager.obj `if test -f 'ae_output_manager.cpp'; then $(CYGPATH_W) 'ae_output_manager.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_output_manager.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_output_manager.Tpo $(DEPDIR)/libaevol_a-ae_output_manager.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_output_manager.cpp' object='libaevol_a-ae_output_manager.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_output_manager.obj `if test -f 'ae_output_manager.cpp'; then $(CYGPATH_W) 'ae_output_manager.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_output_manager.cpp'; fi` libaevol_a-ae_params_mut.o: ae_params_mut.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_params_mut.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_params_mut.Tpo -c -o libaevol_a-ae_params_mut.o `test -f 'ae_params_mut.cpp' || echo '$(srcdir)/'`ae_params_mut.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_params_mut.Tpo $(DEPDIR)/libaevol_a-ae_params_mut.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_params_mut.cpp' object='libaevol_a-ae_params_mut.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_params_mut.o `test -f 'ae_params_mut.cpp' || echo '$(srcdir)/'`ae_params_mut.cpp libaevol_a-ae_params_mut.obj: ae_params_mut.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_params_mut.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_params_mut.Tpo -c -o libaevol_a-ae_params_mut.obj `if test -f 'ae_params_mut.cpp'; then $(CYGPATH_W) 'ae_params_mut.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_params_mut.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_params_mut.Tpo $(DEPDIR)/libaevol_a-ae_params_mut.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_params_mut.cpp' object='libaevol_a-ae_params_mut.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_params_mut.obj `if test -f 'ae_params_mut.cpp'; then $(CYGPATH_W) 'ae_params_mut.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_params_mut.cpp'; fi` libaevol_a-ae_phenotype.o: ae_phenotype.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_phenotype.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_phenotype.Tpo -c -o libaevol_a-ae_phenotype.o `test -f 'ae_phenotype.cpp' || echo '$(srcdir)/'`ae_phenotype.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_phenotype.Tpo $(DEPDIR)/libaevol_a-ae_phenotype.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_phenotype.cpp' object='libaevol_a-ae_phenotype.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_phenotype.o `test -f 'ae_phenotype.cpp' || echo '$(srcdir)/'`ae_phenotype.cpp libaevol_a-ae_phenotype.obj: ae_phenotype.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_phenotype.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_phenotype.Tpo -c -o libaevol_a-ae_phenotype.obj `if test -f 'ae_phenotype.cpp'; then $(CYGPATH_W) 'ae_phenotype.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_phenotype.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_phenotype.Tpo $(DEPDIR)/libaevol_a-ae_phenotype.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_phenotype.cpp' object='libaevol_a-ae_phenotype.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_phenotype.obj `if test -f 'ae_phenotype.cpp'; then $(CYGPATH_W) 'ae_phenotype.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_phenotype.cpp'; fi` libaevol_a-ae_population.o: ae_population.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_population.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_population.Tpo -c -o libaevol_a-ae_population.o `test -f 'ae_population.cpp' || echo '$(srcdir)/'`ae_population.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_population.Tpo $(DEPDIR)/libaevol_a-ae_population.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_population.cpp' object='libaevol_a-ae_population.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_population.o `test -f 'ae_population.cpp' || echo '$(srcdir)/'`ae_population.cpp libaevol_a-ae_population.obj: ae_population.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_population.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_population.Tpo -c -o libaevol_a-ae_population.obj `if test -f 'ae_population.cpp'; then $(CYGPATH_W) 'ae_population.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_population.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_population.Tpo $(DEPDIR)/libaevol_a-ae_population.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_population.cpp' object='libaevol_a-ae_population.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_population.obj `if test -f 'ae_population.cpp'; then $(CYGPATH_W) 'ae_population.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_population.cpp'; fi` libaevol_a-ae_protein.o: ae_protein.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_protein.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_protein.Tpo -c -o libaevol_a-ae_protein.o `test -f 'ae_protein.cpp' || echo '$(srcdir)/'`ae_protein.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_protein.Tpo $(DEPDIR)/libaevol_a-ae_protein.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_protein.cpp' object='libaevol_a-ae_protein.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_protein.o `test -f 'ae_protein.cpp' || echo '$(srcdir)/'`ae_protein.cpp libaevol_a-ae_protein.obj: ae_protein.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_protein.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_protein.Tpo -c -o libaevol_a-ae_protein.obj `if test -f 'ae_protein.cpp'; then $(CYGPATH_W) 'ae_protein.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_protein.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_protein.Tpo $(DEPDIR)/libaevol_a-ae_protein.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_protein.cpp' object='libaevol_a-ae_protein.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_protein.obj `if test -f 'ae_protein.cpp'; then $(CYGPATH_W) 'ae_protein.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_protein.cpp'; fi` libaevol_a-ae_jumping_mt.o: ae_jumping_mt.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_jumping_mt.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_jumping_mt.Tpo -c -o libaevol_a-ae_jumping_mt.o `test -f 'ae_jumping_mt.cpp' || echo '$(srcdir)/'`ae_jumping_mt.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_jumping_mt.Tpo $(DEPDIR)/libaevol_a-ae_jumping_mt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_jumping_mt.cpp' object='libaevol_a-ae_jumping_mt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_jumping_mt.o `test -f 'ae_jumping_mt.cpp' || echo '$(srcdir)/'`ae_jumping_mt.cpp libaevol_a-ae_jumping_mt.obj: ae_jumping_mt.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_jumping_mt.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_jumping_mt.Tpo -c -o libaevol_a-ae_jumping_mt.obj `if test -f 'ae_jumping_mt.cpp'; then $(CYGPATH_W) 'ae_jumping_mt.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_jumping_mt.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_jumping_mt.Tpo $(DEPDIR)/libaevol_a-ae_jumping_mt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_jumping_mt.cpp' object='libaevol_a-ae_jumping_mt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_jumping_mt.obj `if test -f 'ae_jumping_mt.cpp'; then $(CYGPATH_W) 'ae_jumping_mt.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_jumping_mt.cpp'; fi` libaevol_a-ae_replication_report.o: ae_replication_report.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_replication_report.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_replication_report.Tpo -c -o libaevol_a-ae_replication_report.o `test -f 'ae_replication_report.cpp' || echo '$(srcdir)/'`ae_replication_report.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_replication_report.Tpo $(DEPDIR)/libaevol_a-ae_replication_report.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_replication_report.cpp' object='libaevol_a-ae_replication_report.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_replication_report.o `test -f 'ae_replication_report.cpp' || echo '$(srcdir)/'`ae_replication_report.cpp libaevol_a-ae_replication_report.obj: ae_replication_report.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_replication_report.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_replication_report.Tpo -c -o libaevol_a-ae_replication_report.obj `if test -f 'ae_replication_report.cpp'; then $(CYGPATH_W) 'ae_replication_report.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_replication_report.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_replication_report.Tpo $(DEPDIR)/libaevol_a-ae_replication_report.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_replication_report.cpp' object='libaevol_a-ae_replication_report.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_replication_report.obj `if test -f 'ae_replication_report.cpp'; then $(CYGPATH_W) 'ae_replication_report.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_replication_report.cpp'; fi` libaevol_a-ae_dna_replic_report.o: ae_dna_replic_report.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_dna_replic_report.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_dna_replic_report.Tpo -c -o libaevol_a-ae_dna_replic_report.o `test -f 'ae_dna_replic_report.cpp' || echo '$(srcdir)/'`ae_dna_replic_report.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_dna_replic_report.Tpo $(DEPDIR)/libaevol_a-ae_dna_replic_report.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_dna_replic_report.cpp' object='libaevol_a-ae_dna_replic_report.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_dna_replic_report.o `test -f 'ae_dna_replic_report.cpp' || echo '$(srcdir)/'`ae_dna_replic_report.cpp libaevol_a-ae_dna_replic_report.obj: ae_dna_replic_report.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_dna_replic_report.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_dna_replic_report.Tpo -c -o libaevol_a-ae_dna_replic_report.obj `if test -f 'ae_dna_replic_report.cpp'; then $(CYGPATH_W) 'ae_dna_replic_report.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_dna_replic_report.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_dna_replic_report.Tpo $(DEPDIR)/libaevol_a-ae_dna_replic_report.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_dna_replic_report.cpp' object='libaevol_a-ae_dna_replic_report.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_dna_replic_report.obj `if test -f 'ae_dna_replic_report.cpp'; then $(CYGPATH_W) 'ae_dna_replic_report.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_dna_replic_report.cpp'; fi` libaevol_a-ae_rna.o: ae_rna.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_rna.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_rna.Tpo -c -o libaevol_a-ae_rna.o `test -f 'ae_rna.cpp' || echo '$(srcdir)/'`ae_rna.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_rna.Tpo $(DEPDIR)/libaevol_a-ae_rna.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_rna.cpp' object='libaevol_a-ae_rna.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_rna.o `test -f 'ae_rna.cpp' || echo '$(srcdir)/'`ae_rna.cpp libaevol_a-ae_rna.obj: ae_rna.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_rna.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_rna.Tpo -c -o libaevol_a-ae_rna.obj `if test -f 'ae_rna.cpp'; then $(CYGPATH_W) 'ae_rna.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_rna.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_rna.Tpo $(DEPDIR)/libaevol_a-ae_rna.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_rna.cpp' object='libaevol_a-ae_rna.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_rna.obj `if test -f 'ae_rna.cpp'; then $(CYGPATH_W) 'ae_rna.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_rna.cpp'; fi` libaevol_a-ae_stats.o: ae_stats.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_stats.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_stats.Tpo -c -o libaevol_a-ae_stats.o `test -f 'ae_stats.cpp' || echo '$(srcdir)/'`ae_stats.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_stats.Tpo $(DEPDIR)/libaevol_a-ae_stats.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_stats.cpp' object='libaevol_a-ae_stats.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_stats.o `test -f 'ae_stats.cpp' || echo '$(srcdir)/'`ae_stats.cpp libaevol_a-ae_stats.obj: ae_stats.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_stats.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_stats.Tpo -c -o libaevol_a-ae_stats.obj `if test -f 'ae_stats.cpp'; then $(CYGPATH_W) 'ae_stats.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_stats.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_stats.Tpo $(DEPDIR)/libaevol_a-ae_stats.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_stats.cpp' object='libaevol_a-ae_stats.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_stats.obj `if test -f 'ae_stats.cpp'; then $(CYGPATH_W) 'ae_stats.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_stats.cpp'; fi` libaevol_a-ae_stat_record.o: ae_stat_record.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_stat_record.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_stat_record.Tpo -c -o libaevol_a-ae_stat_record.o `test -f 'ae_stat_record.cpp' || echo '$(srcdir)/'`ae_stat_record.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_stat_record.Tpo $(DEPDIR)/libaevol_a-ae_stat_record.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_stat_record.cpp' object='libaevol_a-ae_stat_record.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_stat_record.o `test -f 'ae_stat_record.cpp' || echo '$(srcdir)/'`ae_stat_record.cpp libaevol_a-ae_stat_record.obj: ae_stat_record.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_stat_record.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_stat_record.Tpo -c -o libaevol_a-ae_stat_record.obj `if test -f 'ae_stat_record.cpp'; then $(CYGPATH_W) 'ae_stat_record.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_stat_record.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_stat_record.Tpo $(DEPDIR)/libaevol_a-ae_stat_record.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_stat_record.cpp' object='libaevol_a-ae_stat_record.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_stat_record.obj `if test -f 'ae_stat_record.cpp'; then $(CYGPATH_W) 'ae_stat_record.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_stat_record.cpp'; fi` libaevol_a-ae_string.o: ae_string.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_string.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_string.Tpo -c -o libaevol_a-ae_string.o `test -f 'ae_string.cpp' || echo '$(srcdir)/'`ae_string.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_string.Tpo $(DEPDIR)/libaevol_a-ae_string.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_string.cpp' object='libaevol_a-ae_string.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_string.o `test -f 'ae_string.cpp' || echo '$(srcdir)/'`ae_string.cpp libaevol_a-ae_string.obj: ae_string.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_string.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_string.Tpo -c -o libaevol_a-ae_string.obj `if test -f 'ae_string.cpp'; then $(CYGPATH_W) 'ae_string.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_string.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_string.Tpo $(DEPDIR)/libaevol_a-ae_string.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_string.cpp' object='libaevol_a-ae_string.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_string.obj `if test -f 'ae_string.cpp'; then $(CYGPATH_W) 'ae_string.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_string.cpp'; fi` libaevol_a-ae_tree.o: ae_tree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_tree.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_tree.Tpo -c -o libaevol_a-ae_tree.o `test -f 'ae_tree.cpp' || echo '$(srcdir)/'`ae_tree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_tree.Tpo $(DEPDIR)/libaevol_a-ae_tree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_tree.cpp' object='libaevol_a-ae_tree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_tree.o `test -f 'ae_tree.cpp' || echo '$(srcdir)/'`ae_tree.cpp libaevol_a-ae_tree.obj: ae_tree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_tree.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_tree.Tpo -c -o libaevol_a-ae_tree.obj `if test -f 'ae_tree.cpp'; then $(CYGPATH_W) 'ae_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_tree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_tree.Tpo $(DEPDIR)/libaevol_a-ae_tree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_tree.cpp' object='libaevol_a-ae_tree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_tree.obj `if test -f 'ae_tree.cpp'; then $(CYGPATH_W) 'ae_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_tree.cpp'; fi` libaevol_a-ae_vis_a_vis.o: ae_vis_a_vis.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_vis_a_vis.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_vis_a_vis.Tpo -c -o libaevol_a-ae_vis_a_vis.o `test -f 'ae_vis_a_vis.cpp' || echo '$(srcdir)/'`ae_vis_a_vis.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_vis_a_vis.Tpo $(DEPDIR)/libaevol_a-ae_vis_a_vis.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_vis_a_vis.cpp' object='libaevol_a-ae_vis_a_vis.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_vis_a_vis.o `test -f 'ae_vis_a_vis.cpp' || echo '$(srcdir)/'`ae_vis_a_vis.cpp libaevol_a-ae_vis_a_vis.obj: ae_vis_a_vis.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_vis_a_vis.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_vis_a_vis.Tpo -c -o libaevol_a-ae_vis_a_vis.obj `if test -f 'ae_vis_a_vis.cpp'; then $(CYGPATH_W) 'ae_vis_a_vis.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_vis_a_vis.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_vis_a_vis.Tpo $(DEPDIR)/libaevol_a-ae_vis_a_vis.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_vis_a_vis.cpp' object='libaevol_a-ae_vis_a_vis.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_vis_a_vis.obj `if test -f 'ae_vis_a_vis.cpp'; then $(CYGPATH_W) 'ae_vis_a_vis.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_vis_a_vis.cpp'; fi` libaevol_a-ae_selection.o: ae_selection.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_selection.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_selection.Tpo -c -o libaevol_a-ae_selection.o `test -f 'ae_selection.cpp' || echo '$(srcdir)/'`ae_selection.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_selection.Tpo $(DEPDIR)/libaevol_a-ae_selection.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_selection.cpp' object='libaevol_a-ae_selection.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_selection.o `test -f 'ae_selection.cpp' || echo '$(srcdir)/'`ae_selection.cpp libaevol_a-ae_selection.obj: ae_selection.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_selection.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_selection.Tpo -c -o libaevol_a-ae_selection.obj `if test -f 'ae_selection.cpp'; then $(CYGPATH_W) 'ae_selection.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_selection.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_selection.Tpo $(DEPDIR)/libaevol_a-ae_selection.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_selection.cpp' object='libaevol_a-ae_selection.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_selection.obj `if test -f 'ae_selection.cpp'; then $(CYGPATH_W) 'ae_selection.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_selection.cpp'; fi` libaevol_a-ae_spatial_structure.o: ae_spatial_structure.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_spatial_structure.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_spatial_structure.Tpo -c -o libaevol_a-ae_spatial_structure.o `test -f 'ae_spatial_structure.cpp' || echo '$(srcdir)/'`ae_spatial_structure.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_spatial_structure.Tpo $(DEPDIR)/libaevol_a-ae_spatial_structure.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_spatial_structure.cpp' object='libaevol_a-ae_spatial_structure.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_spatial_structure.o `test -f 'ae_spatial_structure.cpp' || echo '$(srcdir)/'`ae_spatial_structure.cpp libaevol_a-ae_spatial_structure.obj: ae_spatial_structure.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_spatial_structure.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_spatial_structure.Tpo -c -o libaevol_a-ae_spatial_structure.obj `if test -f 'ae_spatial_structure.cpp'; then $(CYGPATH_W) 'ae_spatial_structure.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_spatial_structure.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_spatial_structure.Tpo $(DEPDIR)/libaevol_a-ae_spatial_structure.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_spatial_structure.cpp' object='libaevol_a-ae_spatial_structure.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_spatial_structure.obj `if test -f 'ae_spatial_structure.cpp'; then $(CYGPATH_W) 'ae_spatial_structure.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_spatial_structure.cpp'; fi` libaevol_a-ae_gene_tree.o: ae_gene_tree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_gene_tree.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_gene_tree.Tpo -c -o libaevol_a-ae_gene_tree.o `test -f 'ae_gene_tree.cpp' || echo '$(srcdir)/'`ae_gene_tree.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_gene_tree.Tpo $(DEPDIR)/libaevol_a-ae_gene_tree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_gene_tree.cpp' object='libaevol_a-ae_gene_tree.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_gene_tree.o `test -f 'ae_gene_tree.cpp' || echo '$(srcdir)/'`ae_gene_tree.cpp libaevol_a-ae_gene_tree.obj: ae_gene_tree.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_gene_tree.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_gene_tree.Tpo -c -o libaevol_a-ae_gene_tree.obj `if test -f 'ae_gene_tree.cpp'; then $(CYGPATH_W) 'ae_gene_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_gene_tree.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_gene_tree.Tpo $(DEPDIR)/libaevol_a-ae_gene_tree.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_gene_tree.cpp' object='libaevol_a-ae_gene_tree.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_gene_tree.obj `if test -f 'ae_gene_tree.cpp'; then $(CYGPATH_W) 'ae_gene_tree.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_gene_tree.cpp'; fi` libaevol_a-ae_gene_tree_node.o: ae_gene_tree_node.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_gene_tree_node.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_gene_tree_node.Tpo -c -o libaevol_a-ae_gene_tree_node.o `test -f 'ae_gene_tree_node.cpp' || echo '$(srcdir)/'`ae_gene_tree_node.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_gene_tree_node.Tpo $(DEPDIR)/libaevol_a-ae_gene_tree_node.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_gene_tree_node.cpp' object='libaevol_a-ae_gene_tree_node.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_gene_tree_node.o `test -f 'ae_gene_tree_node.cpp' || echo '$(srcdir)/'`ae_gene_tree_node.cpp libaevol_a-ae_gene_tree_node.obj: ae_gene_tree_node.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_gene_tree_node.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_gene_tree_node.Tpo -c -o libaevol_a-ae_gene_tree_node.obj `if test -f 'ae_gene_tree_node.cpp'; then $(CYGPATH_W) 'ae_gene_tree_node.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_gene_tree_node.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_gene_tree_node.Tpo $(DEPDIR)/libaevol_a-ae_gene_tree_node.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_gene_tree_node.cpp' object='libaevol_a-ae_gene_tree_node.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_gene_tree_node.obj `if test -f 'ae_gene_tree_node.cpp'; then $(CYGPATH_W) 'ae_gene_tree_node.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_gene_tree_node.cpp'; fi` libaevol_a-ae_gene_mutation.o: ae_gene_mutation.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_gene_mutation.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_gene_mutation.Tpo -c -o libaevol_a-ae_gene_mutation.o `test -f 'ae_gene_mutation.cpp' || echo '$(srcdir)/'`ae_gene_mutation.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_gene_mutation.Tpo $(DEPDIR)/libaevol_a-ae_gene_mutation.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_gene_mutation.cpp' object='libaevol_a-ae_gene_mutation.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_gene_mutation.o `test -f 'ae_gene_mutation.cpp' || echo '$(srcdir)/'`ae_gene_mutation.cpp libaevol_a-ae_gene_mutation.obj: ae_gene_mutation.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_gene_mutation.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_gene_mutation.Tpo -c -o libaevol_a-ae_gene_mutation.obj `if test -f 'ae_gene_mutation.cpp'; then $(CYGPATH_W) 'ae_gene_mutation.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_gene_mutation.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_gene_mutation.Tpo $(DEPDIR)/libaevol_a-ae_gene_mutation.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_gene_mutation.cpp' object='libaevol_a-ae_gene_mutation.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_gene_mutation.obj `if test -f 'ae_gene_mutation.cpp'; then $(CYGPATH_W) 'ae_gene_mutation.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_gene_mutation.cpp'; fi` libaevol_a-param_loader.o: param_loader.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-param_loader.o -MD -MP -MF $(DEPDIR)/libaevol_a-param_loader.Tpo -c -o libaevol_a-param_loader.o `test -f 'param_loader.cpp' || echo '$(srcdir)/'`param_loader.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-param_loader.Tpo $(DEPDIR)/libaevol_a-param_loader.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='param_loader.cpp' object='libaevol_a-param_loader.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-param_loader.o `test -f 'param_loader.cpp' || echo '$(srcdir)/'`param_loader.cpp libaevol_a-param_loader.obj: param_loader.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-param_loader.obj -MD -MP -MF $(DEPDIR)/libaevol_a-param_loader.Tpo -c -o libaevol_a-param_loader.obj `if test -f 'param_loader.cpp'; then $(CYGPATH_W) 'param_loader.cpp'; else $(CYGPATH_W) '$(srcdir)/param_loader.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-param_loader.Tpo $(DEPDIR)/libaevol_a-param_loader.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='param_loader.cpp' object='libaevol_a-param_loader.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-param_loader.obj `if test -f 'param_loader.cpp'; then $(CYGPATH_W) 'param_loader.cpp'; else $(CYGPATH_W) '$(srcdir)/param_loader.cpp'; fi` libaevol_a-f_line.o: f_line.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-f_line.o -MD -MP -MF $(DEPDIR)/libaevol_a-f_line.Tpo -c -o libaevol_a-f_line.o `test -f 'f_line.cpp' || echo '$(srcdir)/'`f_line.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-f_line.Tpo $(DEPDIR)/libaevol_a-f_line.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='f_line.cpp' object='libaevol_a-f_line.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-f_line.o `test -f 'f_line.cpp' || echo '$(srcdir)/'`f_line.cpp libaevol_a-f_line.obj: f_line.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-f_line.obj -MD -MP -MF $(DEPDIR)/libaevol_a-f_line.Tpo -c -o libaevol_a-f_line.obj `if test -f 'f_line.cpp'; then $(CYGPATH_W) 'f_line.cpp'; else $(CYGPATH_W) '$(srcdir)/f_line.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-f_line.Tpo $(DEPDIR)/libaevol_a-f_line.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='f_line.cpp' object='libaevol_a-f_line.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-f_line.obj `if test -f 'f_line.cpp'; then $(CYGPATH_W) 'f_line.cpp'; else $(CYGPATH_W) '$(srcdir)/f_line.cpp'; fi` libaevol_a-ae_fuzzy_set_X11.o: ae_fuzzy_set_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_fuzzy_set_X11.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Tpo -c -o libaevol_a-ae_fuzzy_set_X11.o `test -f 'ae_fuzzy_set_X11.cpp' || echo '$(srcdir)/'`ae_fuzzy_set_X11.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Tpo $(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_fuzzy_set_X11.cpp' object='libaevol_a-ae_fuzzy_set_X11.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_fuzzy_set_X11.o `test -f 'ae_fuzzy_set_X11.cpp' || echo '$(srcdir)/'`ae_fuzzy_set_X11.cpp libaevol_a-ae_fuzzy_set_X11.obj: ae_fuzzy_set_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_fuzzy_set_X11.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Tpo -c -o libaevol_a-ae_fuzzy_set_X11.obj `if test -f 'ae_fuzzy_set_X11.cpp'; then $(CYGPATH_W) 'ae_fuzzy_set_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_fuzzy_set_X11.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Tpo $(DEPDIR)/libaevol_a-ae_fuzzy_set_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_fuzzy_set_X11.cpp' object='libaevol_a-ae_fuzzy_set_X11.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_fuzzy_set_X11.obj `if test -f 'ae_fuzzy_set_X11.cpp'; then $(CYGPATH_W) 'ae_fuzzy_set_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_fuzzy_set_X11.cpp'; fi` libaevol_a-ae_individual_X11.o: ae_individual_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_individual_X11.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_individual_X11.Tpo -c -o libaevol_a-ae_individual_X11.o `test -f 'ae_individual_X11.cpp' || echo '$(srcdir)/'`ae_individual_X11.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_individual_X11.Tpo $(DEPDIR)/libaevol_a-ae_individual_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_individual_X11.cpp' object='libaevol_a-ae_individual_X11.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_individual_X11.o `test -f 'ae_individual_X11.cpp' || echo '$(srcdir)/'`ae_individual_X11.cpp libaevol_a-ae_individual_X11.obj: ae_individual_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_individual_X11.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_individual_X11.Tpo -c -o libaevol_a-ae_individual_X11.obj `if test -f 'ae_individual_X11.cpp'; then $(CYGPATH_W) 'ae_individual_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_individual_X11.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_individual_X11.Tpo $(DEPDIR)/libaevol_a-ae_individual_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_individual_X11.cpp' object='libaevol_a-ae_individual_X11.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_individual_X11.obj `if test -f 'ae_individual_X11.cpp'; then $(CYGPATH_W) 'ae_individual_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_individual_X11.cpp'; fi` libaevol_a-ae_population_X11.o: ae_population_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_population_X11.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_population_X11.Tpo -c -o libaevol_a-ae_population_X11.o `test -f 'ae_population_X11.cpp' || echo '$(srcdir)/'`ae_population_X11.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_population_X11.Tpo $(DEPDIR)/libaevol_a-ae_population_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_population_X11.cpp' object='libaevol_a-ae_population_X11.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_population_X11.o `test -f 'ae_population_X11.cpp' || echo '$(srcdir)/'`ae_population_X11.cpp libaevol_a-ae_population_X11.obj: ae_population_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_population_X11.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_population_X11.Tpo -c -o libaevol_a-ae_population_X11.obj `if test -f 'ae_population_X11.cpp'; then $(CYGPATH_W) 'ae_population_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_population_X11.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_population_X11.Tpo $(DEPDIR)/libaevol_a-ae_population_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_population_X11.cpp' object='libaevol_a-ae_population_X11.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_population_X11.obj `if test -f 'ae_population_X11.cpp'; then $(CYGPATH_W) 'ae_population_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_population_X11.cpp'; fi` libaevol_a-ae_exp_manager_X11.o: ae_exp_manager_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_exp_manager_X11.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_exp_manager_X11.Tpo -c -o libaevol_a-ae_exp_manager_X11.o `test -f 'ae_exp_manager_X11.cpp' || echo '$(srcdir)/'`ae_exp_manager_X11.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_exp_manager_X11.Tpo $(DEPDIR)/libaevol_a-ae_exp_manager_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_exp_manager_X11.cpp' object='libaevol_a-ae_exp_manager_X11.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_exp_manager_X11.o `test -f 'ae_exp_manager_X11.cpp' || echo '$(srcdir)/'`ae_exp_manager_X11.cpp libaevol_a-ae_exp_manager_X11.obj: ae_exp_manager_X11.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_exp_manager_X11.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_exp_manager_X11.Tpo -c -o libaevol_a-ae_exp_manager_X11.obj `if test -f 'ae_exp_manager_X11.cpp'; then $(CYGPATH_W) 'ae_exp_manager_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_exp_manager_X11.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_exp_manager_X11.Tpo $(DEPDIR)/libaevol_a-ae_exp_manager_X11.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_exp_manager_X11.cpp' object='libaevol_a-ae_exp_manager_X11.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_exp_manager_X11.obj `if test -f 'ae_exp_manager_X11.cpp'; then $(CYGPATH_W) 'ae_exp_manager_X11.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_exp_manager_X11.cpp'; fi` libaevol_a-ae_X11_window.o: ae_X11_window.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_X11_window.o -MD -MP -MF $(DEPDIR)/libaevol_a-ae_X11_window.Tpo -c -o libaevol_a-ae_X11_window.o `test -f 'ae_X11_window.cpp' || echo '$(srcdir)/'`ae_X11_window.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_X11_window.Tpo $(DEPDIR)/libaevol_a-ae_X11_window.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_X11_window.cpp' object='libaevol_a-ae_X11_window.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_X11_window.o `test -f 'ae_X11_window.cpp' || echo '$(srcdir)/'`ae_X11_window.cpp libaevol_a-ae_X11_window.obj: ae_X11_window.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libaevol_a-ae_X11_window.obj -MD -MP -MF $(DEPDIR)/libaevol_a-ae_X11_window.Tpo -c -o libaevol_a-ae_X11_window.obj `if test -f 'ae_X11_window.cpp'; then $(CYGPATH_W) 'ae_X11_window.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_X11_window.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libaevol_a-ae_X11_window.Tpo $(DEPDIR)/libaevol_a-ae_X11_window.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ae_X11_window.cpp' object='libaevol_a-ae_X11_window.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libaevol_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libaevol_a-ae_X11_window.obj `if test -f 'ae_X11_window.cpp'; then $(CYGPATH_W) 'ae_X11_window.cpp'; else $(CYGPATH_W) '$(srcdir)/ae_X11_window.cpp'; fi` # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/src/libaevol/ae_replication_report.h0000644000175000017500000002372312364050651016527 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_REPLICATION_REPORT_H__ #define __AE_REPLICATION_REPORT_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_individual; class ae_replication_report : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_replication_report( ae_individual * indiv, ae_individual * parent, ae_individual * donor = NULL ); // Creates a completely independent copy of the original report ae_replication_report( const ae_replication_report &model ); ae_replication_report( gzFile tree_file, ae_individual * indiv ); // ================================================================= // Destructors // ================================================================= virtual ~ae_replication_report( void ); // ================================================================= // Accessors // ================================================================= inline ae_individual * get_indiv( void ) const; int32_t get_id( void ) const; int32_t get_rank( void ) const; inline int32_t get_genome_size( void ) const; inline int32_t get_parent_id( void ) const; inline double get_parent_metabolic_error( void ) const; inline double get_parent_secretion_error( void ) const; inline int32_t get_parent_genome_size( void ) const; inline double get_mean_align_score( void ) const; inline int32_t get_donor_id( void ) const; inline double get_donor_metabolic_error( void ) const; inline double get_donor_secretion_error( void ) const; inline int32_t get_donor_genome_size( void ) const; void set_indiv( ae_individual * indiv); void set_id( int32_t id ); void set_rank( int32_t rank ); inline void set_parent_id( int32_t parent_id ); inline void set_parent_metabolic_error( double parent_metabolic_error ); inline void set_parent_secretion_error( double parent_secretion_error ); inline void set_parent_genome_size( int32_t parent_genome_size ); inline void set_donor_id(int32_t donor_id ); inline void set_donor_metabolic_error( double donor_metabolic_error ); inline void set_donor_secretion_error( double donor_secretion_error ); inline void set_donor_genome_size( int32_t donor_genome_size ); inline ae_list* get_dna_replic_reports( void ) const; // ================================================================= // Public Methods // ================================================================= //~ inline void add_mutation_list( ae_list* mut_list ); //~ inline void add_rearrangement_list( ae_list* rear_list ); void signal_end_of_replication( void ); void write_to_tree_file( gzFile tree_file ) const; // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_replication_report( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_individual* _indiv; int32_t _id; int32_t _rank; int32_t _parent_id; int32_t _genome_size; double _metabolic_error; int16_t _nb_genes_activ; int16_t _nb_genes_inhib; int16_t _nb_non_fun_genes; int16_t _nb_coding_RNAs; int16_t _nb_non_coding_RNAs; ae_list* _dna_replic_reports; // List of each genetic unit's replication report double _parent_metabolic_error; double _parent_secretion_error; int32_t _parent_genome_size; int32_t _donor_id; double _donor_metabolic_error; double _donor_secretion_error; int32_t _donor_genome_size; // CK: I think that the attributes below are obsolete // (HT events are now stored in the ae_dna_replic_reports) double _mean_align_score; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline ae_individual * ae_replication_report::get_indiv( void ) const { return _indiv; } inline int32_t ae_replication_report::get_id( void ) const { return _id; } inline int32_t ae_replication_report::get_rank( void ) const { return _rank; } inline int32_t ae_replication_report::get_genome_size( void ) const { return _genome_size; } int32_t ae_replication_report::get_parent_id( void ) const { return _parent_id; } double ae_replication_report::get_parent_metabolic_error( void ) const { return _parent_metabolic_error; } double ae_replication_report::get_parent_secretion_error( void ) const { return _parent_secretion_error; } int32_t ae_replication_report::get_parent_genome_size( void ) const { return _parent_genome_size; } inline int32_t ae_replication_report::get_donor_id( void ) const { return _donor_id; } inline double ae_replication_report::get_donor_metabolic_error( void ) const { return _donor_metabolic_error; } inline int32_t ae_replication_report::get_donor_genome_size( void ) const { return _donor_genome_size; } inline double ae_replication_report::get_mean_align_score( void ) const { return _mean_align_score; } inline ae_list* ae_replication_report::get_dna_replic_reports( void ) const { return _dna_replic_reports; } inline void ae_replication_report::set_indiv( ae_individual * indiv ) { _indiv = indiv; } inline void ae_replication_report::set_id( int32_t id ) { _id = id; } inline void ae_replication_report::set_rank( int32_t rank ) { _rank = rank; } void ae_replication_report::set_parent_id( int32_t parent_id ) { _parent_id = parent_id; } void ae_replication_report::set_parent_metabolic_error( double parent_metabolic_error ) { _parent_metabolic_error = parent_metabolic_error; } void ae_replication_report::set_parent_secretion_error( double parent_secretion_error ) { _parent_secretion_error = parent_secretion_error; } void ae_replication_report::set_parent_genome_size( int32_t parent_genome_size ) { _parent_genome_size = parent_genome_size; } inline void ae_replication_report::set_donor_id(int32_t donor_id ) { _donor_id = donor_id; } inline void ae_replication_report::set_donor_metabolic_error( double donor_metabolic_error ) { _donor_metabolic_error = donor_metabolic_error; } inline void ae_replication_report::set_donor_secretion_error( double donor_secretion_error ) { _donor_secretion_error = donor_secretion_error; } inline void ae_replication_report::set_donor_genome_size( int32_t donor_genome_size ) { _donor_genome_size = donor_genome_size; } // ===================================================================== // Inline functions' definition // ===================================================================== //~ void ae_replication_report::add_mutation_list( ae_list* mut_list ) //~ { //~ _mutations->add( mut_list ); //~ } //~ void ae_replication_report::add_rearrangement_list( ae_list* rear_list ) //~ { //~ _rearrangements->add( rear_list ); //~ } #endif // __AE_REPLICATION_REPORT_H__ aevol-4.4/src/libaevol/ae_params_mut.cpp0000644000175000017500000003025212234223723015317 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_params_mut # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_params_mut::ae_params_mut( void ) { // --------------------------------------------------------- Mutation rates _point_mutation_rate = 0.0; _small_insertion_rate = 0.0; _small_deletion_rate = 0.0; _max_indel_size = 0; // -------------------------------------------- Rearrangements and Transfer _with_4pts_trans = false; _with_alignments = false; _with_HT = false; _repl_HT_with_close_points = false; _HT_ins_rate = 0.0; _HT_repl_rate = 0.0; _repl_HT_detach_rate = 0.0; // ------------------------------ Rearrangement rates (without alignements) _duplication_rate = 0.0; _deletion_rate = 0.0; _translocation_rate = 0.0; _inversion_rate = 0.0; // --------------------------------- Rearrangement rates (with alignements) _neighbourhood_rate = 0.0; _duplication_proportion = 0.0; _deletion_proportion = 0.0; _translocation_proportion = 0.0; _inversion_proportion = 0.0; // ------------------------------------------------------------ Alignements _align_fun_shape = SIGMOID; _align_sigm_lambda = 4; _align_sigm_mean = 50; _align_lin_min = 0; _align_lin_max = 100; _align_max_shift = 20; _align_w_zone_h_len = 50; _align_match_bonus = 1; _align_mismatch_cost = 2; } ae_params_mut::ae_params_mut( const ae_params_mut& model ) { // --------------------------------------------------------- Mutation rates _point_mutation_rate = model._point_mutation_rate; _small_insertion_rate = model._small_insertion_rate; _small_deletion_rate = model._small_deletion_rate; _max_indel_size = model._max_indel_size; // -------------------------------------------- Rearrangements and Transfer _with_4pts_trans = model._with_4pts_trans; _with_alignments = model._with_alignments; _with_HT = model._with_HT; _repl_HT_with_close_points = model._repl_HT_with_close_points; _HT_ins_rate = model._HT_ins_rate; _HT_repl_rate = model._HT_repl_rate; _repl_HT_detach_rate = model._repl_HT_detach_rate; // ------------------------------ Rearrangement rates (without alignements) _duplication_rate = model._duplication_rate; _deletion_rate = model._deletion_rate; _translocation_rate = model._translocation_rate; _inversion_rate = model._inversion_rate; // --------------------------------- Rearrangement rates (with alignements) _neighbourhood_rate = model._neighbourhood_rate; _duplication_proportion = model._duplication_proportion; _deletion_proportion = model._deletion_proportion; _translocation_proportion = model._translocation_proportion; _inversion_proportion = model._inversion_proportion; // ------------------------------------------------------------ Alignements _align_fun_shape = model._align_fun_shape; _align_sigm_lambda = model._align_sigm_lambda; _align_sigm_mean = model._align_sigm_mean; _align_lin_min = model._align_lin_min; _align_lin_max = model._align_lin_max; _align_max_shift = model._align_max_shift; _align_w_zone_h_len = model._align_w_zone_h_len; _align_match_bonus = model._align_match_bonus; _align_mismatch_cost = model._align_mismatch_cost; } ae_params_mut::ae_params_mut( gzFile backup_file ) { // --------------------------------------------------------- Mutation rates gzread( backup_file, &_point_mutation_rate, sizeof(_point_mutation_rate) ); gzread( backup_file, &_small_insertion_rate, sizeof(_small_insertion_rate) ); gzread( backup_file, &_small_deletion_rate, sizeof(_small_deletion_rate) ); gzread( backup_file, &_max_indel_size, sizeof(_max_indel_size) ); // -------------------------------------------- Rearrangements and Transfer int8_t tmp; gzread( backup_file, &tmp, sizeof(tmp) ); _with_4pts_trans = (tmp != 0); gzread( backup_file, &tmp, sizeof(tmp) ); _with_alignments = (tmp != 0); gzread( backup_file, &tmp, sizeof(tmp) ); _with_HT = (tmp != 0); gzread( backup_file, &tmp, sizeof(tmp) ); _repl_HT_with_close_points = (tmp != 0); gzread( backup_file, &_HT_ins_rate, sizeof(_HT_ins_rate) ); gzread( backup_file, &_HT_repl_rate, sizeof(_HT_repl_rate) ); gzread( backup_file, &_repl_HT_detach_rate, sizeof(_repl_HT_detach_rate) ); // ------------------------------ Rearrangement rates (without alignements) gzread( backup_file, &_duplication_rate, sizeof(_duplication_rate) ); gzread( backup_file, &_deletion_rate, sizeof(_deletion_rate) ); gzread( backup_file, &_translocation_rate, sizeof(_translocation_rate) ); gzread( backup_file, &_inversion_rate, sizeof(_inversion_rate) ); // --------------------------------- Rearrangement rates (with alignements) gzread( backup_file, &_neighbourhood_rate, sizeof(_neighbourhood_rate) ); gzread( backup_file, &_duplication_proportion, sizeof(_duplication_proportion) ); gzread( backup_file, &_deletion_proportion, sizeof(_deletion_proportion) ); gzread( backup_file, &_translocation_proportion, sizeof(_translocation_proportion) ); gzread( backup_file, &_inversion_proportion, sizeof(_inversion_proportion) ); // ------------------------------------------------------------ Alignements gzread( backup_file, &_align_fun_shape, sizeof(_align_fun_shape) ); gzread( backup_file, &_align_sigm_lambda, sizeof(_align_sigm_lambda) ); gzread( backup_file, &_align_sigm_mean, sizeof(_align_sigm_mean) ); gzread( backup_file, &_align_lin_min, sizeof(_align_lin_min) ); gzread( backup_file, &_align_lin_max, sizeof(_align_lin_max) ); gzread( backup_file, &_align_max_shift, sizeof(_align_max_shift) ); gzread( backup_file, &_align_w_zone_h_len, sizeof(_align_w_zone_h_len) ); gzread( backup_file, &_align_match_bonus, sizeof(_align_match_bonus) ); gzread( backup_file, &_align_mismatch_cost, sizeof(_align_mismatch_cost) ); //ae_align::align_fun_shape = _align_fun_shape; //ae_align::align_sigm_lambda = _align_sigm_lambda; //ae_align::align_sigm_mean = _align_sigm_mean; //ae_align::align_lin_min = _align_lin_min; //ae_align::align_lin_max = _align_lin_max; //ae_align::align_max_shift = _align_max_shift; //ae_align::align_w_zone_h_len = _align_w_zone_h_len; //ae_align::align_match_bonus = _align_match_bonus; //ae_align::align_mismatch_cost = _align_mismatch_cost; } // ================================================================= // Destructors // ================================================================= ae_params_mut::~ae_params_mut( void ) { } // ================================================================= // Public Methods // ================================================================= void ae_params_mut::save( gzFile backup_file ) const { // --------------------------------------------------------- Mutation rates gzwrite( backup_file, &_point_mutation_rate, sizeof(_point_mutation_rate) ); gzwrite( backup_file, &_small_insertion_rate, sizeof(_small_insertion_rate) ); gzwrite( backup_file, &_small_deletion_rate, sizeof(_small_deletion_rate) ); gzwrite( backup_file, &_max_indel_size, sizeof(_max_indel_size) ); // -------------------------------------------- Rearrangements and Transfer int8_t tmp = _with_4pts_trans ? 1 : 0; gzwrite( backup_file, &tmp, sizeof(tmp) ); tmp = _with_alignments ? 1 : 0; gzwrite( backup_file, &tmp, sizeof(tmp) ); tmp = _with_HT ? 1 : 0; gzwrite( backup_file, &tmp, sizeof(tmp) ); tmp = _repl_HT_with_close_points ? 1 : 0; gzwrite( backup_file, &tmp, sizeof(tmp) ); gzwrite( backup_file, &_HT_ins_rate, sizeof(_HT_ins_rate) ); gzwrite( backup_file, &_HT_repl_rate, sizeof(_HT_repl_rate) ); gzwrite( backup_file, &_repl_HT_detach_rate, sizeof(_repl_HT_detach_rate) ); // ------------------------------ Rearrangement rates (without alignements) gzwrite( backup_file, &_duplication_rate, sizeof(_duplication_rate) ); gzwrite( backup_file, &_deletion_rate, sizeof(_deletion_rate) ); gzwrite( backup_file, &_translocation_rate, sizeof(_translocation_rate) ); gzwrite( backup_file, &_inversion_rate, sizeof(_inversion_rate) ); // --------------------------------- Rearrangement rates (with alignements) gzwrite( backup_file, &_neighbourhood_rate, sizeof(_neighbourhood_rate) ); gzwrite( backup_file, &_duplication_proportion, sizeof(_duplication_proportion) ); gzwrite( backup_file, &_deletion_proportion, sizeof(_deletion_proportion) ); gzwrite( backup_file, &_translocation_proportion, sizeof(_translocation_proportion) ); gzwrite( backup_file, &_inversion_proportion, sizeof(_inversion_proportion) ); // ------------------------------------------------------------ Alignements gzwrite( backup_file, &_align_fun_shape, sizeof(_align_fun_shape) ); gzwrite( backup_file, &_align_sigm_lambda, sizeof(_align_sigm_lambda) ); gzwrite( backup_file, &_align_sigm_mean, sizeof(_align_sigm_mean) ); gzwrite( backup_file, &_align_lin_min, sizeof(_align_lin_min) ); gzwrite( backup_file, &_align_lin_max, sizeof(_align_lin_max) ); gzwrite( backup_file, &_align_max_shift, sizeof(_align_max_shift) ); gzwrite( backup_file, &_align_w_zone_h_len, sizeof(_align_w_zone_h_len) ); gzwrite( backup_file, &_align_match_bonus, sizeof(_align_match_bonus) ); gzwrite( backup_file, &_align_mismatch_cost, sizeof(_align_mismatch_cost) ); } // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Non inline accessors // ================================================================= aevol-4.4/src/libaevol/ae_env_segment.h0000644000175000017500000001560712231437075015141 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_ENV_SEGMENT_H__ #define __AE_ENV_SEGMENT_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_env_segment : public ae_object { public : // ================================================================= // Constructors // ================================================================= inline ae_env_segment( double start, double stop, ae_env_axis_feature feature ); inline ae_env_segment( const ae_env_segment& source ); inline ae_env_segment( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= inline virtual ~ae_env_segment( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= inline void save( gzFile backup_file ) const; inline void load( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= double start; double stop; ae_env_axis_feature feature; protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_env_segment( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; //~ ae_env_segment( const ae_env_segment &model ) //~ { //~ printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= }; //############################################################################## // # // Class ae_env_segment # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= //~ inline ae_env_segment::ae_env_segment( void ) //~ { //~ start = X_MIN; //~ stop = X_MAX; //~ feature = NEUTRAL; //~ } inline ae_env_segment::ae_env_segment( double start, double stop, ae_env_axis_feature feature ) { this->start = start; this->stop = stop; this->feature = feature; } inline ae_env_segment::ae_env_segment( const ae_env_segment& source ) { this->start = source.start; this->stop = source.stop; this->feature = source.feature; } inline ae_env_segment::ae_env_segment( gzFile backup_file ) { load( backup_file ); } // ================================================================= // Destructors // ================================================================= inline ae_env_segment::~ae_env_segment( void ) { } // ===================================================================== // Accessors definitions // ===================================================================== // ================================================================= // Public Methods // ================================================================= inline void ae_env_segment::save( gzFile backup_file ) const { gzwrite( backup_file, &start, sizeof(start) ); gzwrite( backup_file, &stop, sizeof(stop) ); int8_t tmp_feature = feature; gzwrite( backup_file, &tmp_feature, sizeof(tmp_feature) ); } inline void ae_env_segment::load( gzFile backup_file ) { gzread( backup_file, &start, sizeof(start) ); gzread( backup_file, &stop, sizeof(stop) ); int8_t tmp_feature; gzread( backup_file, &tmp_feature, sizeof(tmp_feature) ); feature = (ae_env_axis_feature) tmp_feature; } // ================================================================= // Protected Methods // ================================================================= #endif // __AE_ENV_SEGMENT_H__ aevol-4.4/src/libaevol/ae_vis_a_vis.h0000644000175000017500000002436612236655375014625 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_VIS_A_VIS_H__ #define __AE_VIS_A_VIS_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_vis_a_vis : public ae_object { friend class ae_align; public : // ================================================================= // Constructors // ================================================================= ae_vis_a_vis( const ae_dna* chrom_1, const ae_dna* chrom_2, int32_t i_1, int32_t i_2, ae_sense sense = DIRECT ); ae_vis_a_vis( const ae_vis_a_vis & orig ); //~ ae_vis_a_vis( const ae_vis_a_vis * const orig ); // ================================================================= // Destructors // ================================================================= virtual ~ae_vis_a_vis( void ); // ================================================================= // Accessors // ================================================================= inline const ae_dna* get_chrom_1( void ) const; inline const ae_dna* get_chrom_2( void ) const; inline int32_t get_i_1( void ) const; inline int32_t get_i_2( void ) const; inline int16_t get_score( void ) const; inline ae_sense get_sense( void ) const; // ================================================================= // Operators // ================================================================= inline bool operator < ( ae_vis_a_vis &cmp ); inline bool operator <= ( ae_vis_a_vis &cmp ); inline bool operator > ( ae_vis_a_vis &cmp ); inline bool operator >= ( ae_vis_a_vis &cmp ); // ================================================================= // Public Methods // ================================================================= inline bool match( void ); inline void step_fwd( void ); inline void step_back( void ); inline void add( int common_inc ); inline void add( int inc_1, int inc_2 ); inline void sub( int common_inc ); inline void sub( int inc_1, int inc_2 ); inline void swap( void ); inline void copy( ae_vis_a_vis * source ); inline void check_indices( void ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_vis_a_vis( void ) //~ { //~ _chrom_1 = _chrom_2 = new ae_dna(); // const members must be initialized //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; /*ae_vis_a_vis( const ae_vis_a_vis &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= const ae_dna * _chrom_1; const ae_dna * _chrom_2; int32_t _i_1; // Index on chrom_1 int32_t _i_2; // Index on chrom_2 int16_t _score; ae_sense _sense; // Sense (DIRECT or INDIRECT) of the vis_a_vis (alignement) // Say we have the following sequences : // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 // |a|b|c|d|e|f|g|h|i|j| |a|b|c|d|e|f|g|h|i|j| // // The DIRECT vis_a_vis between _i_1 = 3 and _i_2 = 7 is 'd' with 'h' (caracters at indices 3 and 7 resp.). // The corresponding alignment would be "defgh" with "hijkl" // // WARNING! The INDIRECT vis_a_vis between the same _i_1 = 3 and i_2 = 7 is 'd' with 'g' (and not 'h'!). // This is because we are reading backwards (towards the left). Directly left to index 7 is 'g' which corresponds to index 6. // The corresponding alignment would hence be "defgh" with "!g!f!e!d!c" ("!x" means "complementary of x") }; // ===================================================================== // Accessors' definitions // ===================================================================== inline const ae_dna* ae_vis_a_vis::get_chrom_1( void ) const { return _chrom_1; } inline const ae_dna* ae_vis_a_vis::get_chrom_2( void ) const { return _chrom_2; } inline int32_t ae_vis_a_vis::get_i_1( void ) const { return _i_1; } inline int32_t ae_vis_a_vis::get_i_2( void ) const { return _i_2; } inline int16_t ae_vis_a_vis::get_score( void ) const { return _score; } inline ae_sense ae_vis_a_vis::get_sense( void ) const { return _sense; } // ===================================================================== // Operators' definitions // ===================================================================== inline bool ae_vis_a_vis::operator < ( ae_vis_a_vis &cmp ) { return ( _i_1 < cmp._i_1 ); } inline bool ae_vis_a_vis::operator <= ( ae_vis_a_vis &cmp ) { return ( _i_1 <= cmp._i_1 ); } inline bool ae_vis_a_vis::operator > ( ae_vis_a_vis &cmp ) { return ( _i_1 > cmp._i_1 ); } inline bool ae_vis_a_vis::operator >= ( ae_vis_a_vis &cmp ) { return ( _i_1 >= cmp._i_1 ); } // ===================================================================== // Inline functions' definition // ===================================================================== inline bool ae_vis_a_vis::match( void ) { if ( _sense == DIRECT ) { return ( _chrom_1->get_data()[ae_utils::mod(_i_1, _chrom_1->get_length())] == _chrom_2->get_data()[ae_utils::mod(_i_2, _chrom_2->get_length())] ); } else // ( _sense == INDIRECT ) { // Note that we are reading the sequence backwards, The nucleotide corresponding to a breakpoint at point // is hence stored at index // a b c d e f g h i j // |_|_|_|_|_|_|_|_|_|_| // | | | | | | | | | | | // 9 8 7 6 5 4 3 2 1 0 // // The breakpoint F-5 puts into a vis_a_vis the nucleotide at index F on seq1 and that at index 4 (not 5!!!) on seq2 return ( _chrom_1->get_data()[ae_utils::mod(_i_1, _chrom_1->get_length())] != _chrom_2->get_data()[ae_utils::mod(_i_2-1, _chrom_2->get_length())] ); } } inline void ae_vis_a_vis::step_fwd( void ) { if ( _sense == DIRECT ) { _i_1++; _i_2++; } else // ( _sense == INDIRECT ) { _i_1++; _i_2--; } } inline void ae_vis_a_vis::step_back( void ) { if ( _sense == DIRECT ) { _i_1--; _i_2--; } else // ( _sense == INDIRECT ) { _i_1--; _i_2++; } } inline void ae_vis_a_vis::add( int common_inc ) { if ( _sense == DIRECT ) { _i_1 += common_inc; _i_2 += common_inc; } else // ( _sense == INDIRECT ) { _i_1 += common_inc; _i_2 -= common_inc; } } inline void ae_vis_a_vis::add( int inc_1, int inc_2 ) { if ( _sense == DIRECT ) { _i_1 += inc_1; _i_2 += inc_2; } else // ( _sense == INDIRECT ) { _i_1 += inc_1; _i_2 -= inc_2; } } inline void ae_vis_a_vis::sub( int common_inc ) { if ( _sense == DIRECT ) { _i_1 -= common_inc; _i_2 -= common_inc; } else // ( _sense == INDIRECT ) { _i_1 -= common_inc; _i_2 += common_inc; } } inline void ae_vis_a_vis::sub( int inc_1, int inc_2 ) { if ( _sense == DIRECT ) { _i_1 -= inc_1; _i_2 -= inc_2; } else // ( _sense == INDIRECT ) { _i_1 -= inc_1; _i_2 += inc_2; } } inline void ae_vis_a_vis::swap( void ) { const ae_dna * tmp_chrom = _chrom_1; int32_t tmp_i = _i_1; _chrom_1 = _chrom_2; _i_1 = _i_2; _chrom_2 = tmp_chrom; _i_2 = tmp_i; } inline void ae_vis_a_vis::copy( ae_vis_a_vis * source ) { _i_1 = source->_i_1; _i_2 = source->_i_2; _chrom_1 = source->_chrom_1; _chrom_2 = source->_chrom_2; _sense = source->_sense; _score = source->_score; } inline void ae_vis_a_vis::check_indices( void ) { _i_1 = ae_utils::mod( _i_1, _chrom_1->get_length() ); _i_2 = ae_utils::mod( _i_2, _chrom_2->get_length() ); } #endif // __AE_VIS_A_VIS_H__ aevol-4.4/src/libaevol/ae_dna.h0000644000175000017500000002307512242613025013360 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_DNA_H__ #define __AE_DNA_H__ // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_individual; class ae_genetic_unit; class ae_vis_a_vis; class ae_rna; class ae_dna : public ae_string { public : // ================================================================= // Constructors // ================================================================= ae_dna( ae_genetic_unit* gen_unit, int32_t length ); ae_dna( ae_genetic_unit* gen_unit, const ae_dna &model ); ae_dna( ae_genetic_unit* gen_unit, ae_dna* const parent_dna ); ae_dna( ae_genetic_unit* gen_unit, char* seq, int32_t length ); ae_dna( ae_genetic_unit* gen_unit, gzFile backup_file ); ae_dna( ae_genetic_unit* gen_unit, char* organism_file_name ); // ================================================================= // Destructors // ================================================================= virtual ~ae_dna( void ); // ================================================================= // Accessors // ================================================================= // From ae_string // inline const char* get_data( void ) const; // inline void set_data( char* data, int32_t length = -1 ); // inline int32_t get_length( void ) const; inline ae_dna_replic_report* get_replic_report( void ) const; inline void set_replic_report( ae_dna_replic_report * rep ); // for post-treatment only inline ae_genetic_unit * get_genetic_unit( void ) const; inline ae_individual* get_indiv(void) const; char* get_subsequence( int32_t from, int32_t to, ae_strand strand ) const; // WARNING : creates a new char[...] (up to you to delete it!) // ================================================================= // Public Methods // ================================================================= // Perform all the mutations (local mutations, rearrangements and transfer) void perform_mutations( int32_t parent_id ); // Perform all the local mutations (point mutations and indels) of the replication void do_small_mutations( void ); // Perform all the chromosomic rearrangements (duplications, deletions, translocations and inversions) // of the replication void do_rearrangements( void ); void do_rearrangements_with_align( void ); // Perform all transfer (with insertion and with replacement) void do_transfer( int32_t parent_id ); // Perform a single local mutation at a random position ae_mutation* do_switch( void ); ae_mutation* do_small_insertion( void ); ae_mutation* do_small_deletion( void ); // Perform a single local mutation at a specified position (useful to replay the evolution) bool do_switch( int32_t pos ); bool do_small_insertion( int32_t pos, int16_t nb_insert, char * seq ); bool do_small_deletion( int32_t pos, int16_t nb_del ); // Perform a single rearrangement at random positions ae_mutation* do_duplication( void ); ae_mutation* do_deletion( void ); ae_mutation* do_translocation( void ); ae_mutation* do_inter_GU_translocation( void ); ae_mutation* do_inversion( void ); ae_mutation* do_insertion( const char* seq_to_insert, int32_t seq_length = -1 ); // Perform a single rearrangement at specified positions bool do_duplication( int32_t pos_1, int32_t pos_2, int32_t pos_3 ); bool do_deletion( int32_t pos_1, int32_t pos_2 ); bool do_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, bool invert ); bool do_inter_GU_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, bool invert ); bool do_inversion( int32_t pos_1, int32_t pos_2 ); bool do_insertion( int32_t pos, const char* seq_to_insert, int32_t seq_length ); // Perform transfer with the search of alignments ae_mutation* do_ins_HT( int32_t parent_id ); ae_mutation* do_repl_HT( int32_t parent_id ); // Perform a single transfer at specified positions bool do_ins_HT( int32_t pos, const char* seq_to_insert, int32_t seq_length ); bool do_repl_HT( int32_t pos1, int32_t pos2, const char* seq_to_insert, int32_t seq_length ); ae_genetic_unit* extract_into_new_GU( int32_t pos_1, int32_t pos_2 ); ae_genetic_unit* copy_into_new_GU ( int32_t pos_1, int32_t pos_2 ) const; void insert_GU( ae_genetic_unit* GU_to_insert, int32_t pos_B, int32_t pos_D, bool invert ); ae_vis_a_vis* search_alignment( ae_dna* chrom2, int32_t& nb_pairs, ae_sense sense ); ae_vis_a_vis* search_alignment_around_positions( ae_dna* chrom2, int32_t chrom1_pos_1, int32_t chrom1_pos_2, ae_sense sense, int8_t& research_sense); void undergo_this_mutation( ae_mutation * mut ); // useful when we replay the evolution void compute_statistical_data( void ); static void set_GU( ae_list** rna_list, ae_genetic_unit* GU ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_dna( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_dna( const ae_dna &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void ABCDE_to_ADCBE( int32_t pos_B, int32_t pos_C, int32_t pos_D, int32_t pos_E ); void ABCDE_to_ADBpCpE( int32_t pos_B, int32_t pos_C, int32_t pos_D, int32_t pos_E ); void ABCDE_to_ACpDpBE( int32_t pos_B, int32_t pos_C, int32_t pos_D, int32_t pos_E ); void inter_GU_ABCDE_to_ACDBE( int32_t pos_B, int32_t pos_C, int32_t pos_E ); void inter_GU_ABCDE_to_BDCAE( int32_t pos_B, int32_t pos_C, int32_t pos_E ); // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; // From ae_string // char* _data; // int32_t _length; // int32_t _nb_blocks; ae_individual* _indiv; ae_genetic_unit* _gen_unit; // Genetic unit which the genetic unit belongs to ae_dna_replic_report* _replic_report; }; // ===================================================================== // Accessors definitions // ===================================================================== inline ae_dna_replic_report* ae_dna::get_replic_report( void ) const { return _replic_report; } inline ae_individual* ae_dna::get_indiv(void) const { return _indiv; } // for post-treatment only inline void ae_dna::set_replic_report( ae_dna_replic_report * rep ) { _replic_report = rep; } inline ae_genetic_unit * ae_dna::get_genetic_unit( void ) const { return _gen_unit; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_DNA_H__ aevol-4.4/src/libaevol/ae_exp_manager_X11.h0000644000175000017500000001651712302616206015541 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_EXP_SETUP_X11_H__ #define __AE_EXP_SETUP_X11_H__ // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= class ae_exp_setup; class ae_X11_window; enum key_map { KEY_ESCAPE = 0, KEY_F1 = 1, KEY_F2 = 2, KEY_F3 = 3, KEY_F4 = 4, KEY_F5 = 5, KEY_F6 = 6, KEY_F7 = 7, KEY_F8 = 8, KEY_F9 = 9, KEY_F10 = 10, KEY_F11 = 11, KEY_F12 = 12, KEY_A = 13, KEY_Q = 14, KEY_W = 15, KEY_Z = 16, KEY_S = 17, KEY_X = 18, KEY_E = 19, KEY_D = 20, KEY_C = 21, KEY_R = 22, KEY_F = 23, KEY_V = 24, KEY_T = 25, KEY_G = 26, KEY_B = 27, KEY_Y = 28, KEY_H = 29, KEY_N = 30, KEY_U = 31, KEY_J = 32, KEY_I = 33, KEY_K = 34, KEY_O = 35, KEY_L = 36, KEY_P = 37, KEY_M = 38, KEY_1 = 41, KEY_2 = 42, KEY_3 = 43, KEY_4 = 44, KEY_5 = 45, KEY_6 = 46, KEY_7 = 47, KEY_8 = 48, KEY_9 = 49 }; class ae_exp_manager_X11 : public ae_exp_manager { friend class ae_exp_setup; public : // ================================================================= // Constructors // ================================================================= ae_exp_manager_X11( void ); //~ ae_exp_manager_X11( ae_param_overloader* param_overloader = NULL ); //~ ae_exp_manager_X11( char* backup_file_name, bool to_be_run = true, ae_param_overloader* param_overloader = NULL ); // ================================================================= // Destructors // ================================================================= virtual ~ae_exp_manager_X11( void ); // ================================================================= // Accessors // ================================================================= inline bool get_display_on( void ); inline Display * get_display( void ); inline int8_t get_screen( void ); inline Atom * get_atoms ( void ); inline bool get_show_window( int8_t win ); inline bool get_new_show_window( int8_t win ); inline ae_X11_window * get_window( int8_t win ); // ================================================================= // Public Methods // ================================================================= KeyCode* get_key_codes( void ) { return _key_codes; }; virtual void display( void ); void toggle_display_on_off( void ); void handle_events( void ); bool quit_signal_received( void ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_exp_manager_X11( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; ae_exp_manager_X11( const ae_exp_manager_X11 &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void initialize( bool with_grid = false, bool with_plasmids = false ); void set_codes( void ); int8_t identify_window( Window winID ); void draw_window( int8_t win_number ); void refresh_window( int8_t win_number ); // ================================================================= // Protected Attributes // ================================================================= bool _display_on; bool _handle_display_on_off; uint32_t _show_window; // (bitmap) windows that have to be displayed (user switches value pressing F1, F2, ...) uint32_t _new_show_window; // (bitmap) windows that have to be displayed but were not displayed at the last refresh Display* _display; int8_t _screen; Atom* _atoms; KeyCode* _key_codes; ae_X11_window** _win; // Table containing the windows char ** _win_name; // window names unsigned int** _win_size; // window sizes int** _win_pos; // window positions }; // ===================================================================== // Accessors' definitions // ===================================================================== bool ae_exp_manager_X11::get_display_on( void ) { return _display_on; } Display * ae_exp_manager_X11::get_display( void ) { return _display; } bool ae_exp_manager_X11::get_show_window( int8_t win ) { return ( (_show_window >> win) & 1 ); } bool ae_exp_manager_X11::get_new_show_window( int8_t win ) { return ( (_new_show_window >> win) & 1 ); } int8_t ae_exp_manager_X11::get_screen( void ) { return _screen; } Atom* ae_exp_manager_X11::get_atoms( void ) { return _atoms; } ae_X11_window* ae_exp_manager_X11::get_window( int8_t win ) { return _win[win]; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_EXP_SETUP_X11_H__ aevol-4.4/src/libaevol/ae_vis_a_vis.cpp0000644000175000017500000000713612236655375015154 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include //############################################################################## // # // Class ae_vis_a_vis # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_vis_a_vis::ae_vis_a_vis( const ae_dna* chrom_1, const ae_dna* chrom_2, int32_t i_1, int32_t i_2, ae_sense sense /*= DIRECT*/ ) { _chrom_1 = chrom_1; _chrom_2 = chrom_2; _i_1 = i_1; _i_2 = i_2; _sense = sense; _score = 0; } ae_vis_a_vis::ae_vis_a_vis( const ae_vis_a_vis & orig ) { _chrom_1 = orig._chrom_1; _chrom_2 = orig._chrom_2; _i_1 = orig._i_1; _i_2 = orig._i_2; _sense = orig._sense; _score = orig._score; } //~ ae_vis_a_vis::ae_vis_a_vis( const ae_vis_a_vis * orig ) //~ { //~ _chrom_1 = orig->_chrom_1; //~ _chrom_2 = orig->_chrom_2; //~ _i_1 = orig->_i_1; //~ _i_2 = orig->_i_2; //~ _sense = orig->_sense; //~ } // ================================================================= // Destructors // ================================================================= ae_vis_a_vis::~ae_vis_a_vis( void ) { } // ================================================================= // Public Methods // ================================================================= // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_object.h0000644000175000017500000000320112231437075014060 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_OBJECT_H__ #define __AE_OBJECT_H__ #include #include #include #include class ae_object { public : ae_object( void ){}; virtual ~ae_object( void ){}; protected : ae_object( const ae_object &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); assert( false ); exit( EXIT_FAILURE ); }; }; #endif // __AE_OBJECT_H__ aevol-4.4/src/libaevol/ae_gene_mutation.h0000644000175000017500000001415712357231707015467 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /*! \class ae_gene_mutation \brief Currently used only by post-treatments, on a specific lineage, to monitor the fate of paralogs. Each paralog maintains a list of the mutations it underwent. A gene mutation is a mutation, but enriched with the generation when it occurred and the position where it occurred in the coding RNA (relative to the first bp of the promoter). */ #ifndef __AE_GENE_MUTATION_H__ #define __AE_GENE_MUTATION_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include // ================================================================= // Class declarations // ================================================================= enum ae_gene_loss_type { NOT_LOST_YET = 0, LOST_BY_LOCAL_MUTATION = 1, DELETED = 2, BROKEN_BY_REAR = 3, DUPLICATED = 4 }; enum ae_gene_mutation_region { UPSTREAM = 0, CDS = 1, BOTH = 2, }; class ae_gene_mutation : public ae_mutation { friend class ae_gene_tree_node; public : // ================================================================= // Constructors // ================================================================= // Creates a copy of the mutation mut, but enriched with the generation when it occured // and the position where it occurred in the RNA, relative to the first bp of the promoter ae_gene_mutation(ae_mutation const & mut, int32_t gener, int32_t cdsPosBefore, ae_strand strandBefore, ae_gene_mutation_region region ); ae_gene_mutation( const ae_gene_mutation &model ); // ================================================================= // Destructors // ================================================================= virtual ~ae_gene_mutation(); // ================================================================= // Accessors // ================================================================= inline int32_t get_generation() const; inline double get_impact_on_metabolic_error() const; inline ae_gene_mutation_region get_region(); inline void set_impact_on_metabolic_error(double impact); // ================================================================= // Public Methods // ================================================================= void get_description_string_for_gene_mut(char * str); // str must be at least of size 60 int8_t type_of_event(); // 0 if local mut, 1 if rearrangement, 2 if transfer protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_gene_mutation( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; /* ae_gene_mutation( const ae_gene_mutation &model ) */ /* { */ /* printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); */ /* exit( EXIT_FAILURE ); */ /* }; */ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= int32_t* _position_relative_to_shine_dal; /* array of positions similar to the _pos array of the ae_mutation class (size 1 for the switch, 2 for an inversion, etc.) */ int32_t _generation; double _impact_on_metabolic_error; ae_gene_mutation_region _region; }; // ===================================================================== // Inline Accessors' definitions // ===================================================================== inline int32_t ae_gene_mutation::get_generation() const { return _generation; } inline double ae_gene_mutation::get_impact_on_metabolic_error() const { return _impact_on_metabolic_error; } inline void ae_gene_mutation::set_impact_on_metabolic_error(double impact) { _impact_on_metabolic_error = impact; } inline ae_gene_mutation_region ae_gene_mutation::get_region() { return _region; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_GENE_MUTATION_H__ aevol-4.4/src/libaevol/ae_gaussian.h0000644000175000017500000001447712231437075014445 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_GAUSSIAN_H__ #define __AE_GAUSSIAN_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= // ================================================================= // Class declarations // ================================================================= class ae_gaussian : public ae_object { public : // ================================================================= // Constructors // ================================================================= inline ae_gaussian( double heigth, double mean, double width ); inline ae_gaussian( const ae_gaussian &model ); inline ae_gaussian( gzFile backup_file ); // ================================================================= // Destructor // ================================================================= virtual inline ~ae_gaussian( void ); // ================================================================= // Accessors // ================================================================= inline double get_height( void ) const; inline double get_mean( void ) const; inline double get_width( void ) const; inline void set_height( double height ); inline void set_mean( double mean ); inline void set_width( double width ); // ================================================================= // Public Methods // ================================================================= inline double compute_y( double x ); inline void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_gaussian( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= double _height; double _mean; double _width; // In fact half-width to the inflexion points }; // ===================================================================== // Constructors // ===================================================================== inline ae_gaussian::ae_gaussian( double height, double mean, double width ) { _height = height; _mean = mean; _width = width; } inline ae_gaussian::ae_gaussian( const ae_gaussian &model ) { _height = model._height; _mean = model._mean; _width = model._width; } inline ae_gaussian::ae_gaussian( gzFile backup_file ) { gzread( backup_file, &_height, sizeof(_height) ); gzread( backup_file, &_mean, sizeof(_mean) ); gzread( backup_file, &_width, sizeof(_width) ); } // ===================================================================== // Destructor // ===================================================================== inline ae_gaussian::~ae_gaussian( void ) { } // ===================================================================== // Accessors' definitions // ===================================================================== inline double ae_gaussian::get_height( void ) const { return _height; } inline double ae_gaussian::get_mean( void ) const { return _mean; } inline double ae_gaussian::get_width( void ) const { return _width; } inline void ae_gaussian::set_height( double height ) { _height = height; } inline void ae_gaussian::set_mean( double mean ) { _mean = mean; } inline void ae_gaussian::set_width( double width ) { _width = width; } // ===================================================================== // Inline functions' definition // ===================================================================== double ae_gaussian::compute_y( double x ) { return _height * exp( -(x-_mean)*(x-_mean) / (2*_width*_width) ); } void ae_gaussian::save( gzFile backup_file ) { gzwrite( backup_file, &_height, sizeof(_height) ); gzwrite( backup_file, &_mean, sizeof(_mean) ); gzwrite( backup_file, &_width, sizeof(_width) ); } #endif // __AE_GAUSSIAN_H__ aevol-4.4/src/libaevol/ae_dump.cpp0000644000175000017500000002026412364453013014117 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #ifdef __REGUL #include #include #endif //############################################################################## // # // Class ae_dump # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_dump::ae_dump( ae_exp_manager* exp_m ) { _exp_m = exp_m; int status; status = mkdir( "stats/dump/", 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, "stats/dump/" ); } } // ================================================================= // Destructors // ================================================================= // ================================================================= // Public Methods // ================================================================= const char* DUMP_FORMAT = "\t%d\t%d\t%f\n"; void ae_dump::write_current_generation_dump( void ) { // printf("Begin dump\n"); write_fitness_total(); write_secretion_present(); write_fitness_metabolic(); write_secreted_amount(); write_individual_probes(); // printf("End dump\n"); } void ae_dump::write_fitness_total( void ) { if ( _exp_m->is_spatially_structured() ) { sprintf( filename_buffer, "stats/dump/fitness_total_%06"PRId32".out", _exp_m->get_num_gener() ) ; current_file = fopen( filename_buffer, "w+" ); double** map = _exp_m->get_spatial_structure()->get_total_fitness_grid(); fprintf( current_file, "#\tX\tY\tfitness_total(X, Y)\n" ); for( int16_t x = 0 ; x < _exp_m->get_grid_width() ; x++ ) { for( int16_t y = 0 ; y < _exp_m->get_grid_height() ; y++ ) { fprintf( current_file, DUMP_FORMAT, x, y, map [x][y] ); } fprintf( current_file, "\n" ); } fflush( current_file ); fclose( current_file ); // Has been allocated in ae_spatial_structure::get_total_fitness_grid() for ( int16_t x = 0 ; x < _exp_m->get_grid_width() ; x++ ) { delete [] map[x]; } delete [] map; } } void ae_dump::write_secreted_amount ( void ) { if ( _exp_m->is_spatially_structured() ) { sprintf( filename_buffer, "stats/dump/secreted_amount_%06"PRId32".out", _exp_m->get_num_gener() ) ; current_file = fopen( filename_buffer, "w+" ); double** map = _exp_m->get_spatial_structure()->get_secreted_amount_grid(); fprintf( current_file, "#\tX\tY\tsecreted_amount(X, Y)\n" ); for( int16_t x = 0 ; x < _exp_m->get_grid_width() ; x++ ) { for( int16_t y = 0 ; y < _exp_m->get_grid_height() ; y++ ) { fprintf( current_file, DUMP_FORMAT, x, y, map [x][y] ); } fprintf( current_file, "\n" ); } fflush( current_file ); fclose( current_file ); for ( int16_t x = 0; x < _exp_m->get_grid_width() ; x++ ) { delete [] map[x]; } delete [] map; } } void ae_dump::write_fitness_metabolic ( void ) { if ( _exp_m->is_spatially_structured() ) { sprintf( filename_buffer, "stats/dump/fitness_metabolic_%06"PRId32".out", _exp_m->get_num_gener() ) ; current_file = fopen( filename_buffer, "w+" ); double** map = _exp_m->get_spatial_structure()->get_metabolic_fitness_grid(); fprintf( current_file, "#\tX\tY\tfitness_metabolic(X, Y)\n" ); for( int16_t x = 0 ; x < _exp_m->get_grid_width() ; x++ ) { for( int16_t y = 0 ; y < _exp_m->get_grid_height() ; y++ ) { fprintf( current_file, DUMP_FORMAT, x, y, map [x][y] ); } fprintf( current_file, "\n" ); } fflush( current_file ); fclose( current_file ); for ( int16_t x = 0; x < _exp_m->get_grid_width() ; x++ ) { delete [] map[x]; } delete [] map; } } void ae_dump::write_secretion_present ( void ) { if ( _exp_m->is_spatially_structured() ) { sprintf( filename_buffer, "stats/dump/secretion_present_%06"PRId32".out", _exp_m->get_num_gener() ) ; current_file = fopen( filename_buffer, "w+" ); double** map = _exp_m->get_spatial_structure()->get_secretion_present_grid(); fprintf( current_file, "#\tX\tY\tsecretion_present(X, Y)\n" ); for( int16_t x = 0 ; x < _exp_m->get_grid_width() ; x++ ) { for( int16_t y = 0 ; y < _exp_m->get_grid_height() ; y++ ) fprintf( current_file, DUMP_FORMAT, x, y, map [x][y] ); fprintf( current_file, "\n" ); } fflush( current_file ); fclose( current_file ); for ( int16_t x = 0; x < _exp_m->get_grid_width() ; x++ ) { delete [] map[x]; } delete [] map; } } /*! \brief Write the probes (5 int and 5 double) of each individual at a given generation */ void ae_dump::write_individual_probes( void ) { sprintf( filename_buffer, "stats/dump/individual_probes_%06"PRId32".out", _exp_m->get_num_gener() ) ; current_file = fopen( filename_buffer, "w" ); fprintf(current_file, "Id\tInt_Probe_1\tInt_Probe_2\tInt_Probe_3\tInt_Probe_4\tInt_Probe_5\tDouble_Probe_1\tDouble_Probe_2\tDouble_Probe_3\tDouble_Probe_4\tDouble_Probe_5\n"); ae_list_node* indiv_node = _exp_m->get_indivs()->get_first(); ae_individual* indiv = NULL; int32_t* int_probes; double* double_probes; int32_t index; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); index = indiv->get_id(); int_probes = indiv->get_int_probes(); double_probes = indiv->get_double_probes(); fprintf(current_file,"%"PRId32, index); for(int16_t i = 0; i < 5; i++) { fprintf(current_file,"\t%"PRId32,int_probes[i]); } for(int16_t i = 0; i < 5; i++) { fprintf(current_file,"\t%f",double_probes[i]); } fprintf(current_file,"\n"); indiv_node = indiv_node->get_next(); } fflush( current_file ); fclose( current_file ); } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_jumping_mt.h0000644000175000017500000001665612231437075015005 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_JUMPING_MT_H__ #define __AE_JUMPING_MT_H__ // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= // MT_RAND_MAX = 2^32-1 #define MT_RAND_MAX 4294967295.0 #define MT_RAND_MAX_PLUS_1 4294967296.0 class ae_jumping_mt : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_jumping_mt( const uint32_t& simple_seed ); // Initialize with a simple uint32_t ae_jumping_mt( const ae_jumping_mt &model ); // Create a copy of an existing generator ae_jumping_mt( gzFile backup_file ); // Load from a gz backup file // ================================================================= // Destructors // ================================================================= virtual ~ae_jumping_mt( void ); // ================================================================= // Accessors: getters // ================================================================= // ================================================================= // Accessors: setters // ================================================================= // ================================================================= // Operators // ================================================================= // ================================================================= // Public Methods // ================================================================= inline double random( void ); // Double in [0, 1[ (uniform distribution) inline int8_t random( int8_t max ); // ~ inline int16_t random( int16_t max ); // ~ inline int32_t random( int32_t max ); // ~ > Integer in [0, max[ (uniform distribution) inline int64_t random( int64_t max ); // ~ int32_t binomial_random( int32_t nb, double prob ); // Binomial drawing of parameters (nb, prob) double gaussian_random( void ); // Double following a Standard Normal distribution int8_t roulette_random( double* probs, int8_t nb_elts ); // Roulette selection void multinomial_drawing ( int32_t* destination, double* source, int32_t nb_drawings, int32_t colors ); // Multinomial drawing of parameters ( nb, {source[0], source[1], ... source[colors-1]} ) void jump( void ); void save( gzFile backup_file ) const; // ================================================================= // Public Attributes // ================================================================= static int32_t nb_jumps; static double jump_time; protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_jumping_mt( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; /*ae_jumping_mt( const ae_jumping_mt &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= static double gammln( double X ); // ================================================================= // Protected Attributes // ================================================================= sfmt_t* _sfmt; }; // ===================================================================== // Getters' definitions // ===================================================================== // ===================================================================== // Setters' definitions // ===================================================================== // ===================================================================== // Operators' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== /*! Draw a double precision real-number in [0, 1) with a uniform distribution */ inline double ae_jumping_mt::random( void ) { return sfmt_genrand_real2( _sfmt ); } /*! Draw an 8-bit integer in [0, max[ with a uniform distribution */ inline int8_t ae_jumping_mt::random( int8_t max ) { return (int8_t) floor( ((double)max) * sfmt_genrand_real2(_sfmt) ); } /*! Draw an 16-bit integer in [0, max[ with a uniform distribution */ inline int16_t ae_jumping_mt::random( int16_t max ) { return (int16_t) floor( ((double)max) * sfmt_genrand_real2(_sfmt) ); } /*! Draw an 32-bit integer in [0, max[ with a uniform distribution */ inline int32_t ae_jumping_mt::random( int32_t max ) { return (int32_t) floor( ((double)max) * sfmt_genrand_real2(_sfmt) ); } /*! Draw an 64-bit integer in [0, max[ with a uniform distribution */ inline int64_t ae_jumping_mt::random( int64_t max ) { return (int64_t) floor( ((double)max) * sfmt_genrand_real2(_sfmt) ); } #endif // __AE_JUMPING_MT_H__ aevol-4.4/src/libaevol/ae_fuzzy_set_X11.h0000644000175000017500000000775512334625707015334 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_FUZZY_SET_X11_H__ #define __AE_FUZZY_SET_X11_H__ // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_fuzzy_set_X11 : public ae_fuzzy_set { public : // ================================================================= // Constructors // ================================================================= ae_fuzzy_set_X11( void ); ae_fuzzy_set_X11( const ae_fuzzy_set &model ); // ================================================================= // Destructors // ================================================================= virtual ~ae_fuzzy_set_X11( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= virtual void display( ae_X11_window* win, color_map color, bool fill = false, bool bold = false ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= }; // ===================================================================== // Accessors definitions // ===================================================================== #endif // __AE_FUZZY_SET_X11_H__ aevol-4.4/src/libaevol/ae_individual.h0000644000175000017500000012747212364737244014773 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_INDIVIDUAL_H__ #define __AE_INDIVIDUAL_H__ // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_grid_cell; class ae_individual : public ae_object { friend class ae_dna; public : // ================================================================= // Constructors // ================================================================= ae_individual( ae_exp_manager* exp_m, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng, ae_params_mut* param_mut, double w_max, int32_t min_genome_length, int32_t max_genome_length, bool allow_plasmids, int32_t id, char* strain_name, int32_t age ); ae_individual( ae_exp_manager* exp_m, gzFile backup_file ); ae_individual( const ae_individual &model, bool replication_report_copy = false ); ae_individual( ae_individual* const parent, int32_t id, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng ); // ================================================================= // Destructors // ================================================================= virtual ~ae_individual( void ); // ================================================================= // Accessors: Getters // ================================================================= inline const char* get_strain_name(void) const; inline int32_t get_age(void) const; inline ae_exp_manager* get_exp_m( void ) const; inline int16_t get_nb_genetic_units( void ) const; inline int32_t get_amount_of_dna( void ) const; inline ae_genetic_unit* get_genetic_unit( int16_t num_unit ) const; inline double get_dist_to_target_by_feature( ae_env_axis_feature feature ) const; inline double get_fitness( void ) const; inline double get_fitness_by_feature( ae_env_axis_feature feature ) const; inline ae_grid_cell* get_grid_cell( void ) const; inline bool get_placed_in_population( void ) const; inline ae_jumping_mt* get_mut_prng( void ) const; inline ae_jumping_mt* get_stoch_prng( void ) const; inline ae_list* get_genetic_unit_list( void ) const; inline const char* get_genetic_unit_sequence ( int16_t num_unit ) const; inline int32_t get_genetic_unit_seq_length ( int16_t num_unit ) const; inline int32_t get_id( void ) const; inline int32_t get_rank( void ) const; inline ae_fuzzy_set* get_phenotype_activ( void ) const; inline ae_fuzzy_set* get_phenotype_inhib( void ) const; inline ae_phenotype* get_phenotype( void ) const; inline double* get_dist_to_target_by_segment( void ) const; inline ae_replication_report* get_replic_report( void ) const; inline ae_list* get_protein_list( void ) const; inline ae_list* get_rna_list( void ) const; inline int32_t get_nb_plasmids( void ) const; inline int32_t get_nb_gen_units( void ) const; inline double get_w_max( void ) const; // Genome size constraints inline int32_t get_min_genome_length( void ) const; inline int32_t get_max_genome_length( void ) const; // Plasmids settings inline bool get_allow_plasmids( void ) const; // Mutation rates etc... inline double get_point_mutation_rate( void ) const; inline double get_small_insertion_rate( void ) const; inline double get_small_deletion_rate( void ) const; inline int16_t get_max_indel_size( void ) const; inline double get_duplication_rate( void ) const; inline double get_deletion_rate( void ) const; inline double get_translocation_rate( void ) const; inline double get_inversion_rate( void ) const; inline double get_neighbourhood_rate( void ) const; inline double get_duplication_proportion( void ) const; inline double get_deletion_proportion( void ) const; inline double get_translocation_proportion( void ) const; inline double get_inversion_proportion( void ) const; // Transfer inline bool get_with_4pts_trans( void ) const; inline bool get_with_HT( void ) const; inline bool get_repl_HT_with_close_points( void ) const; inline double get_HT_ins_rate( void ) const; inline double get_HT_repl_rate( void ) const; inline double get_repl_HT_detach_rate( void ) const; // ------------------------------------------------------------ Alignements inline bool get_with_alignments(void) const; inline ae_align_fun_shape get_align_fun_shape( void ) const; inline double get_align_sigm_lambda( void ) const; inline int16_t get_align_sigm_mean( void ) const; inline int16_t get_align_lin_min( void ) const; inline int16_t get_align_lin_max( void ) const; // Maximum shift of one seq on the other inline int16_t get_align_max_shift( void ) const; // Work zone half length inline int16_t get_align_w_zone_h_len( void ) const; // Corresponding residues match bonus inline int16_t get_align_match_bonus( void ) const; // Corresponding residues mismatch cost inline int16_t get_align_mismatch_cost( void ) const; // ----------------------------------------------- Phenotypic stochasticity inline bool get_with_stochasticity( void ) const; // Statistical data inline int32_t get_total_genome_size( void ); // TODO: duplicate with get_amount_of_dna? inline int32_t get_nb_coding_RNAs( void ); inline int32_t get_nb_non_coding_RNAs( void ); inline double get_overall_size_coding_RNAs( void ); inline double get_av_size_coding_RNAs( void ); inline double get_overall_size_non_coding_RNAs( void ); inline double get_av_size_non_coding_RNAs( void ); inline int32_t get_nb_genes_activ( void ); inline int32_t get_nb_genes_inhib( void ); inline int32_t get_nb_functional_genes( void ); inline int32_t get_nb_non_functional_genes( void ); inline double get_overall_size_functional_genes( void ); inline double get_av_size_functional_genes( void ); inline double get_overall_size_non_functional_genes( void ); inline double get_av_size_non_functional_genes( void ); inline int32_t get_nb_bases_in_0_CDS( void ); inline int32_t get_nb_bases_in_0_functional_CDS( void ); inline int32_t get_nb_bases_in_0_non_functional_CDS( void ); inline int32_t get_nb_bases_in_0_RNA( void ); inline int32_t get_nb_bases_in_0_coding_RNA( void ); inline int32_t get_nb_bases_in_0_non_coding_RNA( void ); inline int32_t get_nb_bases_in_neutral_regions( void ); inline int32_t get_nb_neutral_regions( void ); inline double get_modularity( void ); // Not const inline int32_t* get_int_probes ( void ) const; inline double* get_double_probes ( void) const; // ================================================================= // Accessors: Setters // ================================================================= inline void set_strain_name(char* name); void set_exp_m( ae_exp_manager* exp_m ); inline void set_id( int32_t id ); inline void set_rank( int32_t rank ); void set_grid_cell( ae_grid_cell* grid_cell ); inline void set_placed_in_population( bool placed_in_population ); inline void set_replication_report( ae_replication_report * rep ); inline void reset_dist_to_target_by_segment( double * dist_to_target_by_segment ); inline void set_w_max( double w_max ); // Genome size constraints inline void set_min_genome_length( int32_t min_genome_length ); inline void set_max_genome_length( int32_t max_genome_length ); inline void add_GU( char * &sequence, int32_t length ); // Mutation rates etc... inline void set_point_mutation_rate( double point_mutation_rate); inline void set_small_insertion_rate( double small_insertion_rate); inline void set_small_deletion_rate( double small_deletion_rate); inline void set_max_indel_size( int16_t max_indel_size); inline void set_duplication_rate( double duplication_rate); inline void set_deletion_rate( double deletion_rate); inline void set_translocation_rate( double translocation_rate); inline void set_inversion_rate( double inversion_rate); inline void set_neighbourhood_rate( double neighbourhood_rate); inline void set_duplication_proportion( double duplication_proportion); inline void set_deletion_proportion( double deletion_proportion); inline void set_translocation_proportion( double translocation_proportion); inline void set_inversion_proportion( double inversion_proportion); // Transfer inline void set_with_4pts_trans( bool with_4pts_trans ); inline void set_with_alignments( bool with_alignments ); inline void set_with_HT( bool with_HT ); inline void set_repl_HT_with_close_points( bool repl_HT_with_close_points); inline void set_HT_ins_rate( double HT_ins_rate ); inline void set_HT_repl_rate( double HT_repl_rate ); inline void set_repl_HT_detach_rate( double repl_HT_detach_rate ); // ----------------------------------------------- Phenotypic stochasticity inline void set_with_stochasticity( bool with_stoch ); inline void set_mut_prng( ae_jumping_mt* prng ); inline void set_stoch_prng( ae_jumping_mt* prng ); //------------------------------------------------ Generic probes inline void set_int_probes ( int32_t* int_probes); inline void set_double_probes ( double* double_probes); // ================================================================= // Public Methods // ================================================================= inline void renew_dist_to_target_by_feature( void ); inline void renew_fitness_by_feature( void ); void inject_GU( ae_individual* donor ); void inject_2GUs( ae_individual* partner ); virtual void evaluate( ae_environment* envir = NULL ); virtual void reevaluate( ae_environment* envir = NULL ); inline void do_transcription_translation_folding( void ); void do_transcription( void ); void do_translation( void ); void do_folding( void ); void compute_phenotype( void ); void compute_distance_to_target( ae_environment* envir ); // Computation of a "proper" fitness value (one that increases when the individual is fitter) // The behaviour of this function depends on many parameters and most notably on whether it is // a "composite" fitness or not, and on the selection scheme. void compute_fitness( ae_environment* envir ); void compute_statistical_data(); void compute_non_coding( void ); virtual void save( gzFile backup_file ) const; int32_t get_nb_terminators( void ); #ifdef DEBUG inline void print_rna_list( void ); inline void print_protein_list( void ); inline void assert_promoters( void ); inline void assert_promoters_order( void ); #endif void compute_experimental_f_nu( int32_t nb_children, double* reproduction_statistics, double* offsprings_statistics = NULL, FILE* replication_file = NULL); double compute_theoritical_f_nu( void ); // These functions compute the probability of neutral reproduction (F_nu). // The first method replicates the individual "nb_children" times and counts how often // a child has the same fitness as its parent (and if second argument not NULL, how often // a child has same or better fitness and stores the result at the adress contained in the // pointer). Results are proportions. // The second is an estimate based on genome structure as defined by Carole. // They have been implemented on the chromosome only ! void remove_non_coding_bases(void); void double_non_coding_bases(void); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_individual( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= virtual void make_protein_list( void ); virtual void make_rna_list( void ); // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; // Name and "Age" of the strain char* _strain_name; int32_t _age; // Random number generator ae_jumping_mt* _mut_prng; ae_jumping_mt* _stoch_prng; // Individual ID and rank of the individual in the population // WARNING : The ID is no longer corresponding to the rank of the individual. // The reason for this change is that we now need an identifier for the individuals // as soon as they are created (the rank is only known when all the individuals have been evaluated). // The rank will now be handled in a specific new attribute. (1 for the worst indiv, POP_SIZE for the best) int32_t _id; // [0 ; POP_SIZE[ int32_t _rank; // [1 ; POP_SIZE] // Total activation (resp. inhibition) of metabolic functions ae_fuzzy_set* _phenotype_activ; ae_fuzzy_set* _phenotype_inhib; // The phenotype, roughly corresponding to the sum of activ and inhib ae_phenotype* _phenotype; // Table containing the partial area of the "gap" (difference between the phenotype and the environment) // for each environmental segment. // Note: if the environment is not segmented, there will be a single cell in this table double* _dist_to_target_by_segment; // This table contains the aggregated area of the gap for each type of segment (ae_env_axis_feature). // When the environment is not segmented, the only meaningfull value will be held in _dist_to_target[METABOLISM] double* _dist_to_target_by_feature; // This table contains the fitness contribution for each type of segment (ae_env_axis_feature). // For metabolic segment, this is the metabolic fitness contribution; // For secretion segment, this is the amount of compound that gets secreted into the environment; // Note: total fitness is the combination of metabolic fitness and the amount of compound present in the environment, // not the amount of compound secreted by the individual. double* _fitness_by_feature; // THE fitness double _fitness; // When using structured population, this is the cell the individual is in ae_grid_cell* _grid_cell; // The chromosome and plasmids (if allowed) ae_list* _genetic_unit_list; // Report of all the mutational events undergone during the individuals creation, // i.e. during the replication that gave birth to this individual ae_replication_report* _replic_report; // Access lists to all the proteins/RNAs of the individual. // Please note that these proteins/RNAs are actually managed (i.e. newed and deleted) via genetic units. ae_list* _protein_list; ae_list* _rna_list; // Generic probes int32_t* _int_probes; // Table of 5 int32_t values to be used as one wishes double* _double_probes; // Table of 5 double values to be used as one wishes // Mutation rates etc... ae_params_mut* _mut_params; // ----------------------------------------------- Phenotypic stochasticity bool _with_stochasticity; // Artificial chemistry double _w_max; // Genome size constraints int32_t _min_genome_length; int32_t _max_genome_length; // Plasmids settings bool _allow_plasmids; // -------------------------------------------------- // "State" of the individual // -------------------------------------------------- // We keep trace of what we have already computed to avoid double computation (mainly in post-treaments) bool _evaluated; bool _transcribed; bool _translated; bool _folded; bool _phenotype_computed; bool _distance_to_target_computed; bool _fitness_computed; bool _statistical_data_computed; bool _non_coding_computed; bool _modularity_computed; bool _placed_in_population; // TODO: spatial ? // ---------------------------------------- // Statistical data // ---------------------------------------- // Genome, RNAs and genes size and stuff int32_t _total_genome_size; // Sum of sizes of the genetic units int32_t _nb_coding_RNAs; // Number of coding RNAs (at least one gene on RNA) int32_t _nb_non_coding_RNAs; // Number of non-coding-RNAs double _overall_size_coding_RNAs; // Average size of coding RNAs double _overall_size_non_coding_RNAs; // Average size of non-coding RNAs int32_t _nb_genes_activ; // Number of genes realizing a function int32_t _nb_genes_inhib; // Number of genes inhibitting a function int32_t _nb_functional_genes; // Number of functional genes int32_t _nb_non_functional_genes; // Number of non-functional genes double _overall_size_functional_genes; // Average size of functional genes double _overall_size_non_functional_genes; // Average size of non-functional genes // Mutation/Rearrangement statistics are managed in the replication report // Coding / non-coding int32_t _nb_bases_in_0_CDS; // Number of bases that are not included in any gene int32_t _nb_bases_in_0_functional_CDS; // Number of bases that are not included in any functional gene int32_t _nb_bases_in_0_non_functional_CDS;// Number of bases that are not included in any degenerated gene int32_t _nb_bases_in_0_RNA; // Number of bases that are not included in any RNA int32_t _nb_bases_in_0_coding_RNA; // Number of bases that are not included in any coding RNA // (RNAs containing at least one CDS) int32_t _nb_bases_in_0_non_coding_RNA; // Number of bases that are not included in any non coding RNA int32_t _nb_bases_in_neutral_regions; // Number of bases that are in a neutral region // A base is considered neutral when neither itself NOR its corresponding base on the other // strand belongs to a coding promoter->terminator region (both included) int32_t _nb_neutral_regions; // Number of neutral regions double _modularity; // Ratio between the pairwise distance between genes whose corresponding // phenotypic triangles overlap and the average intergenic distance // (ignoring non-functional genes)void compute_phenotype( void ); }; // ===================================================================== // Getters' definitions // ===================================================================== /*! TODO */ inline const char* ae_individual::get_strain_name(void) const { return _strain_name; } /*! TODO */ inline int32_t ae_individual::get_age(void) const { return _age; } /*! TODO */ inline int32_t ae_individual::get_id( void ) const { return _id; } /*! TODO */ inline double* ae_individual::get_dist_to_target_by_segment( void ) const { return _dist_to_target_by_segment; } /*! Get the individual's rank in the population (1 for the worst indiv, POP_SIZE for the best) Warning: be sure you call sort_individuals() before using get_rank_in_population */ inline int32_t ae_individual::get_rank( void ) const { return _rank; } /*! TODO */ inline ae_exp_manager* ae_individual::get_exp_m( void ) const { return _exp_m; } /*! TODO */ inline ae_jumping_mt* ae_individual::get_mut_prng( void ) const { return _mut_prng; } /*! TODO */ inline ae_jumping_mt* ae_individual::get_stoch_prng( void ) const { return _stoch_prng; } /*! Returns the number of genetic units */ inline int16_t ae_individual::get_nb_genetic_units( void ) const { return _genetic_unit_list->get_nb_elts(); } /*! TODO */ inline int32_t ae_individual::get_amount_of_dna( void ) const { int32_t amount = 0; ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); amount += gen_unit->get_dna()->get_length(); gen_unit_node = gen_unit_node->get_next(); } return amount; } /*! Returns the list of genetic units */ inline ae_list* ae_individual::get_genetic_unit_list( void ) const { return _genetic_unit_list; } /*! Returns genetic unit number (0 for main chromosome) */ inline ae_genetic_unit* ae_individual::get_genetic_unit( int16_t num_unit ) const { assert( num_unit < _genetic_unit_list->get_nb_elts() ); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); for ( int16_t i = 0 ; i < num_unit ; i++ ) { gen_unit_node = gen_unit_node->get_next(); } return gen_unit_node->get_obj(); } /*! TODO */ inline double ae_individual::get_dist_to_target_by_feature( ae_env_axis_feature feature ) const { assert( _distance_to_target_computed ); return _dist_to_target_by_feature[feature]; } /*! TODO */ inline double ae_individual::get_fitness( void ) const { assert( _fitness_computed ); return _fitness; } /*! TODO */ inline double ae_individual::get_fitness_by_feature( ae_env_axis_feature feature ) const { assert( _fitness_computed ); return _fitness_by_feature[feature]; } /*! TODO */ inline ae_grid_cell* ae_individual::get_grid_cell( void ) const { return _grid_cell; } /*! TODO */ inline bool ae_individual::get_placed_in_population ( void ) const { return _placed_in_population; } /*! Returns the sequence of genetic unit number (0 for main chromosome) */ inline const char* ae_individual::get_genetic_unit_sequence( int16_t num_unit ) const { return get_genetic_unit( num_unit )->get_sequence(); } /*! Returns the sequence length of genetic unit number (0 for main chromosome) */ inline int32_t ae_individual::get_genetic_unit_seq_length( int16_t num_unit ) const { return get_genetic_unit( num_unit )->get_seq_length(); } /*! TODO */ ae_fuzzy_set* ae_individual::get_phenotype_activ( void ) const { return _phenotype_activ; } /*! TODO */ ae_fuzzy_set* ae_individual::get_phenotype_inhib( void ) const { return _phenotype_inhib; } /*! TODO */ ae_phenotype* ae_individual::get_phenotype( void ) const { return _phenotype; } /*! TODO */ ae_replication_report* ae_individual::get_replic_report( void ) const { return _replic_report; } /*! TODO */ inline ae_list* ae_individual::get_protein_list( void ) const { assert( _protein_list ); return _protein_list; } /*! TODO */ inline ae_list* ae_individual::get_rna_list( void ) const { return _rna_list; } /*! TODO */ inline int32_t ae_individual::get_nb_plasmids( void ) const { return _genetic_unit_list->get_nb_elts() - 1; } /*! TODO */ inline int32_t ae_individual::get_nb_gen_units( void ) const { return _genetic_unit_list->get_nb_elts(); } /*! TODO */ inline int32_t ae_individual::get_total_genome_size( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _total_genome_size; } /*! TODO */ inline int32_t ae_individual::get_nb_coding_RNAs( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _nb_coding_RNAs; } /*! TODO */ inline int32_t ae_individual::get_nb_non_coding_RNAs( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _nb_non_coding_RNAs; } /*! TODO */ inline double ae_individual::get_overall_size_coding_RNAs( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _overall_size_coding_RNAs; } /*! TODO */ inline double ae_individual::get_av_size_coding_RNAs( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( _nb_coding_RNAs != 0 ) { return _overall_size_coding_RNAs / _nb_coding_RNAs; } else return 0.0; } /*! TODO */ inline double ae_individual::get_overall_size_non_coding_RNAs( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _overall_size_non_coding_RNAs; } /*! TODO */ inline double ae_individual::get_av_size_non_coding_RNAs( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( _nb_non_coding_RNAs != 0 ) { return _overall_size_non_coding_RNAs / _nb_non_coding_RNAs; } else return 0.0; } /*! TODO */ inline int32_t ae_individual::get_nb_genes_activ( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _nb_genes_activ; } /*! TODO */ inline int32_t ae_individual::get_nb_genes_inhib( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _nb_genes_inhib; } /*! TODO */ inline int32_t ae_individual::get_nb_functional_genes( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _nb_functional_genes; } /*! TODO */ inline int32_t ae_individual::get_nb_non_functional_genes( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _nb_non_functional_genes; } /*! TODO */ inline double ae_individual::get_overall_size_functional_genes( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _overall_size_functional_genes; } /*! TODO */ inline double ae_individual::get_av_size_functional_genes( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( _nb_functional_genes != 0 ) { return _overall_size_functional_genes / _nb_functional_genes; } else return 0.0; } /*! TODO */ inline double ae_individual::get_overall_size_non_functional_genes( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); return _overall_size_non_functional_genes; } /*! TODO */ inline double ae_individual::get_av_size_non_functional_genes( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( _nb_non_functional_genes != 0 ) { return _overall_size_non_functional_genes / _nb_non_functional_genes; } else return 0.0; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_0_CDS( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_CDS; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_0_functional_CDS( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_functional_CDS; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_0_non_functional_CDS( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_non_functional_CDS; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_0_RNA( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_RNA; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_0_coding_RNA( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_coding_RNA; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_0_non_coding_RNA( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_0_non_coding_RNA; } /*! TODO */ inline int32_t ae_individual::get_nb_bases_in_neutral_regions( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_bases_in_neutral_regions; } /*! TODO */ inline int32_t ae_individual::get_nb_neutral_regions( void ) { if ( ! _statistical_data_computed ) compute_statistical_data(); if ( ! _non_coding_computed ) compute_non_coding(); return _nb_neutral_regions; } /*! TODO */ inline double ae_individual::get_modularity( void ) { printf("\n WARNING : modularity measure not yet implemented.\n"); //~ if ( _modularity < 0 ) compute_modularity(); //~ return _modularity; return 0; } /*! TODO */ inline double ae_individual::get_w_max( void ) const { return _w_max; } // ------------------------------------------------------------- Mutation rates /*! TODO */ inline double ae_individual::get_point_mutation_rate( void ) const { return _mut_params->get_point_mutation_rate(); } /*! TODO */ inline double ae_individual::get_small_insertion_rate( void ) const { return _mut_params->get_small_insertion_rate(); } /*! TODO */ inline double ae_individual::get_small_deletion_rate( void ) const { return _mut_params->get_small_deletion_rate(); } /*! TODO */ inline int16_t ae_individual::get_max_indel_size( void ) const { return _mut_params->get_max_indel_size(); } // ---------------------------------- Rearrangement rates (without alignements) /*! TODO */ inline double ae_individual::get_duplication_rate( void ) const { return _mut_params->get_duplication_rate(); } /*! TODO */ inline double ae_individual::get_deletion_rate( void ) const { return _mut_params->get_deletion_rate(); } /*! TODO */ inline double ae_individual::get_translocation_rate( void ) const { return _mut_params->get_translocation_rate(); } /*! TODO */ inline double ae_individual::get_inversion_rate( void ) const { return _mut_params->get_inversion_rate(); } // ------------------------------------- Rearrangement rates (with alignements) /*! TODO */ inline double ae_individual::get_neighbourhood_rate( void ) const { return _mut_params->get_neighbourhood_rate(); } /*! TODO */ inline double ae_individual::get_duplication_proportion( void ) const { return _mut_params->get_duplication_proportion(); } /*! TODO */ inline double ae_individual::get_deletion_proportion( void ) const { return _mut_params->get_deletion_proportion(); } /*! TODO */ inline double ae_individual::get_translocation_proportion( void ) const { return _mut_params->get_translocation_proportion(); } /*! TODO */ inline double ae_individual::get_inversion_proportion( void ) const { return _mut_params->get_inversion_proportion(); } // ---------------------------------------------------------------- Transfer inline bool ae_individual::get_with_4pts_trans( void ) const { return _mut_params->get_with_4pts_trans(); } inline bool ae_individual::get_with_HT( void ) const { return _mut_params->get_with_HT(); } inline bool ae_individual::get_repl_HT_with_close_points( void ) const { return _mut_params->get_repl_HT_with_close_points(); } inline double ae_individual::get_HT_ins_rate( void ) const { return _mut_params->get_HT_ins_rate(); } inline double ae_individual::get_HT_repl_rate( void ) const { return _mut_params->get_HT_repl_rate(); } inline double ae_individual::get_repl_HT_detach_rate( void ) const { return _mut_params->get_repl_HT_detach_rate(); } // ---------------------------------------------------------------- Alignements inline bool ae_individual::get_with_alignments(void) const { return _mut_params->get_with_alignments(); } inline ae_align_fun_shape ae_individual::get_align_fun_shape( void ) const { return _mut_params->get_align_fun_shape(); } inline double ae_individual::get_align_sigm_lambda( void ) const { return _mut_params->get_align_sigm_lambda(); } inline int16_t ae_individual::get_align_sigm_mean( void ) const { return _mut_params->get_align_sigm_mean(); } inline int16_t ae_individual::get_align_lin_min( void ) const { return _mut_params->get_align_lin_min(); } inline int16_t ae_individual::get_align_lin_max( void ) const { return _mut_params->get_align_lin_max(); } inline int16_t ae_individual::get_align_max_shift( void ) const { return _mut_params->get_align_max_shift(); } inline int16_t ae_individual::get_align_w_zone_h_len( void ) const { return _mut_params->get_align_w_zone_h_len(); } inline int16_t ae_individual::get_align_match_bonus( void ) const { return _mut_params->get_align_match_bonus(); } inline int16_t ae_individual::get_align_mismatch_cost( void ) const { return _mut_params->get_align_mismatch_cost(); } /*! TODO */ inline bool ae_individual::get_with_stochasticity( void ) const { return _with_stochasticity; } // Genome size constraints /*! TODO */ inline int32_t ae_individual::get_min_genome_length( void ) const { return _min_genome_length; } /*! TODO */ inline int32_t ae_individual::get_max_genome_length( void ) const { return _max_genome_length; } // Plasmids settings /*! TODO */ inline bool ae_individual::get_allow_plasmids( void ) const { return _allow_plasmids; } /*! \brief Return the _int_probes \return _int_probes */ inline int32_t* ae_individual::get_int_probes ( void ) const { return _int_probes; } /*! \brief Return the _double_probes \return _double_probes */ inline double* ae_individual::get_double_probes ( void) const { return _double_probes; } // ===================================================================== // Setters' definitions // ===================================================================== inline void ae_individual::set_strain_name(char* name) { assert(name && strlen(name) < INT8_MAX); // Conservative, could be <= int8_t name_len = strlen(name); delete [] _strain_name; _strain_name = new char[name_len+1]; memcpy(_strain_name, name, name_len+1); } /*! TODO */ inline void ae_individual::set_id( int32_t id ) { _id = id; if ( _replic_report != NULL ) { _replic_report->set_id( id ); } } /*! TODO */ inline void ae_individual::set_rank( int32_t rank ) { _rank = rank; if ( _replic_report != NULL ) { _replic_report->set_rank( rank ); } } /*! TODO */ inline void ae_individual::set_placed_in_population( bool placed_in_population ) { _placed_in_population = placed_in_population; } /*! Set the individual's replication report To be used by post-treatment only */ inline void ae_individual::set_replication_report( ae_replication_report * rep ) { _replic_report = rep; } /*! TODO */ inline void ae_individual::set_w_max( double w_max ) { _w_max = w_max; } /*! TODO */ inline void ae_individual::add_GU( char * &sequence, int32_t length ) { _genetic_unit_list->add( new ae_genetic_unit( this, sequence, length ) ); } // Genome size constraints /*! TODO */ inline void ae_individual::set_min_genome_length( int32_t min_genome_length ) { _min_genome_length = min_genome_length; } /*! TODO */ inline void ae_individual::set_max_genome_length( int32_t max_genome_length ) { _max_genome_length = max_genome_length; } inline void ae_individual::set_point_mutation_rate( double point_mutation_rate) { _mut_params->set_point_mutation_rate(point_mutation_rate); } inline void ae_individual::set_small_insertion_rate( double small_insertion_rate) { _mut_params->set_small_insertion_rate(small_insertion_rate); } inline void ae_individual::set_small_deletion_rate( double small_deletion_rate) { _mut_params->set_small_deletion_rate(small_deletion_rate); } inline void ae_individual::set_max_indel_size( int16_t max_indel_size) { _mut_params->set_max_indel_size(max_indel_size); } inline void ae_individual::set_duplication_rate( double duplication_rate) { _mut_params->set_duplication_rate(duplication_rate); } inline void ae_individual::set_deletion_rate( double deletion_rate) { _mut_params->set_deletion_rate(deletion_rate); } inline void ae_individual::set_translocation_rate( double translocation_rate) { _mut_params->set_translocation_rate(translocation_rate); } inline void ae_individual::set_inversion_rate( double inversion_rate) { _mut_params->set_inversion_rate(inversion_rate); } inline void ae_individual::set_neighbourhood_rate( double neighbourhood_rate) { _mut_params->set_neighbourhood_rate(neighbourhood_rate); } inline void ae_individual::set_duplication_proportion( double duplication_proportion) { _mut_params->set_duplication_proportion(duplication_proportion); } inline void ae_individual::set_deletion_proportion( double deletion_proportion) { _mut_params->set_deletion_proportion(deletion_proportion); } inline void ae_individual::set_translocation_proportion( double translocation_proportion) { _mut_params->set_translocation_proportion(translocation_proportion); } inline void ae_individual::set_inversion_proportion( double inversion_proportion) { _mut_params->set_inversion_proportion(inversion_proportion); } inline void ae_individual::set_with_4pts_trans( bool with_4pts_trans ) { _mut_params->set_with_4pts_trans(with_4pts_trans); } inline void ae_individual::set_with_alignments( bool with_alignments ) { _mut_params->set_with_alignments(with_alignments); } inline void ae_individual::set_with_HT( bool with_HT ) { _mut_params->set_with_HT(with_HT); } inline void ae_individual::set_repl_HT_with_close_points( bool repl_HT_with_close_points) { _mut_params->set_repl_HT_with_close_points(repl_HT_with_close_points); } inline void ae_individual::set_HT_ins_rate( double HT_ins_rate ) { _mut_params->set_HT_ins_rate(HT_ins_rate); } inline void ae_individual::set_HT_repl_rate( double HT_repl_rate ) { _mut_params->set_HT_repl_rate(HT_repl_rate); } inline void ae_individual::set_repl_HT_detach_rate( double repl_HT_detach_rate ) { _mut_params->set_repl_HT_detach_rate(repl_HT_detach_rate); } inline void ae_individual::set_with_stochasticity( bool with_stoch ) { _with_stochasticity = with_stoch; } inline void ae_individual::set_stoch_prng( ae_jumping_mt* prng ) { _stoch_prng = prng; } inline void ae_individual::set_mut_prng( ae_jumping_mt* prng ) { _mut_prng = prng; } /*! \brief Change the _int_probes \param int_probes 5 int32_t* that constitute a probe */ inline void ae_individual::set_int_probes ( int32_t* int_probes) { _int_probes = int_probes; } /*! \brief Change the _double_probes \param double_probes 5 double* that constitute a probe */ inline void ae_individual::set_double_probes ( double* double_probes) { _double_probes = double_probes; } // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_individual::reset_dist_to_target_by_segment( double* dist_to_target_by_segment ) { if ( _dist_to_target_by_segment != NULL ) delete [] _dist_to_target_by_segment; _dist_to_target_by_segment = dist_to_target_by_segment; } inline void ae_individual::renew_dist_to_target_by_feature( void ) { if ( _dist_to_target_by_feature != NULL ) delete [] _dist_to_target_by_feature; _dist_to_target_by_feature = new double [NB_FEATURES]; } inline void ae_individual::renew_fitness_by_feature( void ) { if ( _fitness_by_feature != NULL ) delete [] _fitness_by_feature; _fitness_by_feature = new double [NB_FEATURES]; } void ae_individual::do_transcription_translation_folding( void ) { if ( _transcribed == true && _translated == true && _folded == true ) return; do_transcription(); do_translation(); do_folding(); make_protein_list(); } #ifdef DEBUG inline void ae_individual::print_rna_list( void ) { ae_list_node* rna_node = _rna_list->get_first(); ae_rna* rna = NULL; while ( rna_node != NULL ) { rna = rna_node->get_obj(); printf( "RNA at pos : %"PRId32" length : %"PRId32" bp\n", rna->get_promoter_pos(), rna->get_transcript_length() ); printf( " strand : %s basal level : %f\n", (rna->get_strand() == LEADING)?"LEADING":"LAGGING", rna->get_basal_level() ); rna_node = rna_node->get_next(); } } inline void ae_individual::print_protein_list( void ) { ae_list_node* prot_node = _protein_list->get_first(); ae_protein* prot = NULL; while ( prot_node != NULL ) { prot = prot_node->get_obj(); char* prot_sequence = prot->get_AA_sequence(); printf( "prot %p at pos : %"PRId32" length : %"PRId32" AAs\n", prot, prot->get_first_translated_pos(), prot->get_length() ); printf( " strand : %s concentration : %f\n", (prot->get_strand() == LEADING)?"LEADING":"LAGGING", prot->get_concentration() ); printf( " sequence : %s\n", prot_sequence ); printf( " mean : %f width : %f height : %f\n", prot->get_mean(), prot->get_width(), prot->get_height() ); delete prot_sequence; prot_node = prot_node->get_next(); } } inline void ae_individual::assert_promoters( void ) { // Perform assertion for each genetic unit ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->assert_promoters(); gen_unit_node = gen_unit_node->get_next(); } } inline void ae_individual::assert_promoters_order( void ) { // Perform assertion for each genetic unit ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->assert_promoters_order(); gen_unit_node = gen_unit_node->get_next(); } } #endif #endif // __AE_INDIVIDUAL_H__ aevol-4.4/src/libaevol/ae_population_X11.h0000644000175000017500000001065612231437075015451 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_POPULATION_X11_H__ #define __AE_POPULATION_X11_H__ // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_population_X11 : public ae_population { public : // ================================================================= // Constructors // ================================================================= ae_population_X11( ae_exp_manager* exp_m ); //~ ae_population_X11( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_population_X11( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= virtual void display( ae_X11_window* win ); virtual void display_grid( ae_X11_window* win, double** cell_grid ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_population_X11( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_population_X11( const ae_population &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void compute_colormap(void); // ================================================================= // Protected Attributes // ================================================================= char ** _col_map; }; // ===================================================================== // Accessors definitions // ===================================================================== #endif // __AE_POPULATION_X11_H__ aevol-4.4/src/libaevol/ae_gene_tree_node.h0000644000175000017500000002015512357231707015566 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /** \class ae_gene_tree_node * \brief Currently used only by post-treatments, on a specific lineage, to monitor the fate of paralogs. * Each node corresponds to a coding RNA. When it is duplicated, two new nodes are added in the tree, * as children of the ancestral version. The left child corresponds to the original DNA segment, while * the right child corresponds to the copy that was reinserted elsewhere, possibly in another genetic * unit. */ #ifndef __AE_GENE_TREE_NODE_H__ #define __AE_GENE_TREE_NODE_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_gene_tree_node : public ae_object { friend class ae_gene_tree; public : // ================================================================= // Constructors // ================================================================= ae_gene_tree_node( int32_t nodeCreationDate, ae_protein * protein); // ================================================================= // Destructors // ================================================================= virtual ~ae_gene_tree_node( void ); // ================================================================= // Accessors // ================================================================= inline ae_list* get_mutation_list() const; inline ae_gene_loss_type get_gene_loss_type() const; // ================================================================= // Public Methods // ================================================================= ae_gene_tree_node * search_in_subtree_leaves(const ae_protein * protein); void print_subtree_to_screen(void); // for debug purposes void write_subtree_to_files(FILE * topologyFile, FILE * nodeAttributesFile, int32_t end_gener); void write_subtree_nodes_in_tabular_file(int32_t treeID, FILE *f); // f must already be open void update_pointers_in_subtree_leaves(ae_genetic_unit * unit); void anticipate_mutation_effect_on_genes_in_subtree_leaves(ae_mutation * mut, int32_t lengthOfGeneticUnit); void register_actual_mutation_effect_on_genes_in_subtree_leaves( ae_gene_tree * tree, ae_mutation * mut, ae_genetic_unit * unit, int32_t gener, double impact_on_metabolic_error); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_gene_tree_node( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_gene_tree_node( const ae_gene_tree_node &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= static int32_t _nextID; int32_t _ID; int32_t _dna_creation_date; // generation when the DNA of this gene copy was created. For left nodes, equals the creation date of the parent node. int32_t _node_creation_date; // generation when this node was created. For right nodes, equals the dna creation date. int32_t _gene_loss_date; // generation when the gene was lost: became a pseudogene, or was deleted, or was broken by a rearrangement ae_gene_loss_type _gene_loss_type; // NOT_LOST_YET or LOST_BY_LOCAL_MUTATION or DELETED or BROKEN_BY_REAR ae_strand _strand; int32_t _shine_dal_position; int32_t _nb_promoters; int32_t * _promoter_positions; ae_protein * _protein_pointer; // for a leaf (current state of a gene), points to the potein object // for an internal node (ancestral state of a gene), points to NULL ae_rna ** _rna_pointers; // for a leaf (current state of a gene), points to the RNA object // for an internal node (ancestral state of a gene), points to NULL ae_list * _mutation_list; // list of ae_gene_mutations since the creation date of the node, i.e. since the last duplication ae_gene_tree_node * _left_child; // NULL until the gene is duplicated, then points to the copy lying on the original DNA segment ae_gene_tree_node * _right_child; // NULL until the gene is duplicated, then points to the copy lying on the duplicated DNA segment // (which was reinserted elsewhere in the genome, possibly on another genetic unit) ae_gene_tree_node * _parent_node; // points to the node that corresponds to the state of the gene before the last duplication (NULL for the root of the gene tree) bool _cds_possibly_modified; bool _cds_completely_deleted; bool _proms_possibly_modified; bool _gene_possibly_duplicated; int32_t _putative_position_for_the_duplicate; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline ae_list* ae_gene_tree_node::get_mutation_list() const { return _mutation_list; } inline ae_gene_loss_type ae_gene_tree_node::get_gene_loss_type() const { return _gene_loss_type; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_GENE_TREE_NODE_H__ aevol-4.4/src/libaevol/ae_gene_tree.h0000644000175000017500000001624212334625707014565 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /** \class ae_gene_tree_node * \brief Currently used only by post-treatments, on a specific lineage, to monitor the fate of paralogs. * Each node corresponds to a coding RNA. When it is duplicated, two new nodes are added in the tree, * as children of the ancestral version. The left child corresponds to the original DNA segment, while * the right child corresponds to the copy that was reinserted elsewhere, possibly in another genetic * unit. */ #ifndef __AE_GENE_TREE_H__ #define __AE_GENE_TREE_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= enum ae_gene_creation_type { INITIALIZATION = 0, LOCAL_MUTATION = 1, REARRANGEMENT = 2, TRANSFER = 3 }; class ae_gene_tree_node; class ae_gene_tree : public ae_object { friend class ae_gene_tree_node; public : // ================================================================= // Constructors // ================================================================= ae_gene_tree( void ); ae_gene_tree( int32_t nodeCreationDate, ae_protein * protein, ae_mutation * mut = NULL ); // Creates a tree with just a root node. // ================================================================= // Destructors // ================================================================= virtual ~ae_gene_tree( void ); // ================================================================= // Accessors // ================================================================= inline ae_gene_creation_type get_creation_type() const; inline int32_t get_begin_gener() const; inline int32_t get_end_gener() const; inline int32_t get_total_nb_nodes() const; inline int32_t get_nb_internal_nodes() const; inline int32_t get_nb_leaves() const; inline int32_t get_nb_active_leaves() const; // ================================================================= // Public Methods // ================================================================= void set_end_gener_if_active_leaves(int32_t gener); void update_pointers_in_tree_leaves(ae_genetic_unit * unit); void anticipate_mutation_effect_on_genes_in_tree_leaves(ae_mutation * mut, int32_t lengthOfGeneticUnit); void register_actual_mutation_effect_on_genes_in_tree_leaves( ae_mutation * mut, ae_genetic_unit * unit, int32_t gener, double impact_on_metabolic_error); /* void duplicate_this_gene(ae_gene_tree_node * node, int32_t duplicDate, ae_protein * newProtein); */ /* void report_gene_mutation(ae_gene_tree_node * node, ae_gene_mutation * geneMut); */ /* void report_gene_loss(ae_gene_tree_node * node, int32_t geneLossDate, ae_gene_loss_type geneLossType); */ ae_gene_tree_node * search_in_leaves(const ae_protein * protein); // Returns NULL if not found void print_to_screen(void); // for debug purposes void write_to_files(const char * topologyFileName, const char * nodeAttributesFileName, int32_t end_gener); // Newick format for the topology file void write_nodes_in_tabular_file(int32_t treeID, FILE * f); // f must already be open // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_gene_tree( const ae_gene_tree &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_gene_tree_node * _root; ae_gene_creation_type _creation_type; int32_t _begin_gener; int32_t _end_gener; int32_t _total_nb_nodes; int32_t _nb_internal_nodes; int32_t _nb_leaves; int32_t _nb_active_leaves; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline ae_gene_creation_type ae_gene_tree::get_creation_type() const { return _creation_type; } inline int32_t ae_gene_tree::get_begin_gener() const { return _begin_gener; } inline int32_t ae_gene_tree::get_end_gener() const { return _end_gener; } inline int32_t ae_gene_tree::get_total_nb_nodes() const { return _total_nb_nodes; } inline int32_t ae_gene_tree::get_nb_internal_nodes() const { return _nb_internal_nodes; } inline int32_t ae_gene_tree::get_nb_leaves() const { return _nb_leaves; } inline int32_t ae_gene_tree::get_nb_active_leaves() const { return _nb_active_leaves; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_GENE_TREE_H__ aevol-4.4/src/libaevol/ae_individual.cpp0000644000175000017500000015124012364737244015314 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #include #ifdef __NO_X #ifdef __REGUL #include #else #include #endif #elif defined __X11 #ifdef __REGUL #include #else #include #endif #endif //############################################################################## // # // Class ae_individual # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= /*! */ ae_individual::ae_individual( ae_exp_manager* exp_m, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng, ae_params_mut* param_mut, double w_max, int32_t min_genome_length, int32_t max_genome_length, bool allow_plasmids, int32_t id, char* strain_name, int32_t age ) { // Experiment manager _exp_m = exp_m; // PRNGs _mut_prng = mut_prng; _stoch_prng = stoch_prng; // Replication Report _replic_report = NULL; // ID and rank of the indiv ; name and "age" of the strain set_id( id ); _rank = -1; // TODO: UNRANKED _age = age; _strain_name = new char[strlen(strain_name)+1]; strcpy(_strain_name, strain_name); _phenotype_activ = NULL; _phenotype_inhib = NULL; _phenotype = NULL; _dist_to_target_by_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; for (int i=0; i(); _protein_list = new ae_list(); _rna_list = new ae_list(); // Generic probes _int_probes = new int32_t[5]; _double_probes = new double[5]; for ( int8_t i = 0 ; i < 5 ; i++ ) { _int_probes[i] = 0; _double_probes[i] = 0.0; } // Mutation rates etc... _mut_params = new ae_params_mut( *param_mut ); // Artificial chemistry _w_max = w_max; // Genome size constraints _min_genome_length = min_genome_length; _max_genome_length = max_genome_length; // Plasmids settings _allow_plasmids = allow_plasmids; // -------------------------------------------------- // "State" of the individual // -------------------------------------------------- _evaluated = false; _transcribed = false; _translated = false; _folded = false; _phenotype_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _statistical_data_computed = false; _non_coding_computed = false; _modularity_computed = false; _placed_in_population = false; // ---------------------------------------- // Statistical data // ---------------------------------------- // Genome, RNAs and genes size and stuff _total_genome_size = 0; _nb_coding_RNAs = 0; _nb_non_coding_RNAs = 0; _overall_size_coding_RNAs = 0.0; _overall_size_non_coding_RNAs = 0.0; _nb_genes_activ = 0; _nb_genes_inhib = 0; _nb_functional_genes = 0; _nb_non_functional_genes = 0; _overall_size_functional_genes = 0.0; _overall_size_non_functional_genes = 0.0; // Coding / non-coding _nb_bases_in_0_CDS = 0; _nb_bases_in_0_functional_CDS = 0; _nb_bases_in_0_non_functional_CDS = 0; _nb_bases_in_0_RNA = 0; _nb_bases_in_0_coding_RNA = 0; _nb_bases_in_0_non_coding_RNA = 0; _nb_bases_in_neutral_regions = 0; _nb_neutral_regions = 0; _modularity = 0.0; } /*! This constructor retreives an individual from a backup file. Since this generation has already been processed, no unnecessary calculation (e.g. fitness) will be done. No transcription, translation or other process of that kind is performed. */ ae_individual::ae_individual( ae_exp_manager* exp_m, gzFile backup_file ) { _exp_m = exp_m; // Retrieve the name and "age" of the strain int8_t strain_string_len; gzread(backup_file, &strain_string_len, sizeof(strain_string_len)); _strain_name = new char[strain_string_len+1]; gzread(backup_file, _strain_name, strain_string_len+1); gzread( backup_file, &_age, sizeof(_age) ); // Retrieve the PRNGs #ifdef DISTRIBUTED_PRNG _mut_prng = new ae_jumping_mt( backup_file ); _stoch_prng = new ae_jumping_mt( backup_file ); #else if (exp_m == NULL) { // Detached mode _mut_prng = NULL; _stoch_prng = NULL; } else { _mut_prng = exp_m->get_pop()->get_mut_prng(); _stoch_prng = exp_m->get_pop()->get_stoch_prng(); } #endif // Retreive id and rank gzread( backup_file, &_id, sizeof(_id) ); gzread( backup_file, &_rank, sizeof(_rank) ); // Retrieve spatial coordinates int16_t x; int16_t y; gzread( backup_file, &x, sizeof(x) ); gzread( backup_file, &y, sizeof(y) ); if ( _exp_m != NULL && _exp_m->is_spatially_structured() ) { set_grid_cell( _exp_m->get_grid_cell( x, y ) ); } // Retreive generic probes _int_probes = new int32_t[5]; _double_probes = new double[5]; gzread( backup_file, _int_probes, 5 * sizeof(*_int_probes) ); gzread( backup_file, _double_probes, 5 * sizeof(*_double_probes) ); // Retrieve mutational parameters _mut_params = new ae_params_mut( backup_file ); // ------------------------------------------------- Phenotypic stochasticity gzread( backup_file, &_with_stochasticity, sizeof(_with_stochasticity) ); // Retrieve artificial chemistry parameters gzread( backup_file, &_w_max, sizeof(_w_max) ); // Retrieve genome size constraints gzread( backup_file, &_min_genome_length, sizeof(_min_genome_length) ); gzread( backup_file, &_max_genome_length, sizeof(_max_genome_length) ); // Retrieve plasmids settings int8_t tmp_allow_plasmids; gzread( backup_file, &tmp_allow_plasmids, sizeof(tmp_allow_plasmids) ); _allow_plasmids = tmp_allow_plasmids ? 1 : 0; // Retreive genetic units _genetic_unit_list = new ae_list(); int16_t nb_gen_units; gzread( backup_file, &nb_gen_units, sizeof(nb_gen_units) ); for ( int16_t i = 0 ; i < nb_gen_units ; i++ ) { _genetic_unit_list->add( new ae_genetic_unit( this, backup_file ) ); } // -------------------------------------------------------------------------------------------- // No more data to retreive, the following are only structural initializations (no data is set) // -------------------------------------------------------------------------------------------- // Create empty fuzzy sets for activation and inhibition _phenotype_activ = NULL; _phenotype_inhib = NULL; _phenotype = NULL; _dist_to_target_by_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } // Replication report, protein list and rna list initialization _replic_report = NULL; // We are reloading from a backup, the replication report for the loaded generation // is already in the tree file corresponding to this generation and needs not be re-written. // NB : If the replication report is needed in future development, it will have to be // loaded from the tree file. _protein_list = new ae_list(); _rna_list = new ae_list(); // Initialize the computational state of the individual _evaluated = false; _transcribed = false; _translated = false; _folded = false; _phenotype_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _statistical_data_computed = false; _non_coding_computed = false; _modularity_computed = false; _placed_in_population = false; // Initialize statistical data _total_genome_size = 0; _nb_coding_RNAs = 0; _nb_non_coding_RNAs = 0; _overall_size_coding_RNAs = 0; _overall_size_non_coding_RNAs = 0; _nb_genes_activ = 0; _nb_genes_inhib = 0; _nb_functional_genes = 0; _nb_non_functional_genes = 0; _overall_size_functional_genes = 0; _overall_size_non_functional_genes = 0; _nb_bases_in_0_CDS = -1; _nb_bases_in_0_functional_CDS = -1; _nb_bases_in_0_non_functional_CDS = -1; _nb_bases_in_0_RNA = -1; _nb_bases_in_0_coding_RNA = -1; _nb_bases_in_0_non_coding_RNA = -1; _nb_bases_in_neutral_regions = -1; _nb_neutral_regions = -1; _modularity = -1; //evaluate(); } // Copy constructor ae_individual::ae_individual( const ae_individual &model, bool replication_report_copy /* = FALSE */ ) { _exp_m = model._exp_m; // PRNGs #ifdef DISTRIBUTED_PRNG _mut_prng = new ae_jumping_mt( *(model._mut_prng) ); _stoch_prng = new ae_jumping_mt( *(model._stoch_prng) ); #else _mut_prng = model._mut_prng; _stoch_prng = model._stoch_prng; #endif int strain_string_len = strlen(model._strain_name); _strain_name = new char[strain_string_len+1]; memcpy(_strain_name, model._strain_name, strain_string_len+1); _age = model._age; _id = model._id; _rank = model._rank; _evaluated = false;//model._evaluated; _transcribed = false;//model._transcribed; _translated = false;//model._translated; _folded = false;//model._folded; _phenotype_computed = model._phenotype_computed; _with_stochasticity = model._with_stochasticity; // Artificial chemistry parameters _w_max = model._w_max; // The distance to target and what results from it depend on the environment // and must hence be recomputed with the (possibly different) environment. _distance_to_target_computed = false; _fitness_computed = false; _statistical_data_computed = model._statistical_data_computed; _non_coding_computed = model._non_coding_computed; _modularity_computed = model._modularity_computed; _placed_in_population = model._placed_in_population; _grid_cell = model._grid_cell; // Create an empty list of genetic units _genetic_unit_list = new ae_list(); // Copy model's genetic units ae_list_node* gen_unit_node = model._genetic_unit_list->get_first(); while ( gen_unit_node != NULL ) { _genetic_unit_list->add( new ae_genetic_unit( this, *(gen_unit_node->get_obj()) ) ); gen_unit_node = gen_unit_node->get_next(); } // Copy phenotype if ( _phenotype_computed ) { _phenotype_activ = new ae_fuzzy_set( *(model._phenotype_activ) ); _phenotype_inhib = new ae_fuzzy_set( *(model._phenotype_inhib) ); _phenotype = new ae_phenotype( this, *(model._phenotype) ); } else { _phenotype_activ = NULL; _phenotype_inhib = NULL; _phenotype = NULL; } // Copy fitness-related stuff _dist_to_target_by_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = model._dist_to_target_by_feature[i]; _fitness_by_feature[i] = model._fitness_by_feature[i]; } _fitness = model._fitness; // Copy statistical data _total_genome_size = model._total_genome_size; _nb_coding_RNAs = model._nb_coding_RNAs; _nb_non_coding_RNAs = model._nb_non_coding_RNAs; _overall_size_coding_RNAs = model._overall_size_coding_RNAs; _overall_size_non_coding_RNAs = model._overall_size_non_coding_RNAs; _nb_genes_activ = model._nb_genes_activ; _nb_genes_inhib = model._nb_genes_inhib; _nb_functional_genes = model._nb_functional_genes; _nb_non_functional_genes = model._nb_non_functional_genes; _overall_size_functional_genes = model._overall_size_functional_genes; _overall_size_non_functional_genes = model._overall_size_non_functional_genes; _nb_bases_in_0_CDS = model._nb_bases_in_0_CDS; _nb_bases_in_0_functional_CDS = model._nb_bases_in_0_functional_CDS; _nb_bases_in_0_non_functional_CDS = model._nb_bases_in_0_non_functional_CDS; _nb_bases_in_0_RNA = model._nb_bases_in_0_RNA; _nb_bases_in_0_coding_RNA = model._nb_bases_in_0_coding_RNA; _nb_bases_in_0_non_coding_RNA = model._nb_bases_in_0_non_coding_RNA; _nb_bases_in_neutral_regions = model._nb_bases_in_neutral_regions; _nb_neutral_regions = model._nb_neutral_regions; _modularity = model._modularity; // Create a new replication report to store mutational events if ( replication_report_copy && _exp_m->get_output_m()->get_record_tree() && (_exp_m->get_output_m()->get_tree_mode() == NORMAL) && (model._replic_report != NULL)) { _replic_report = new ae_replication_report( *model._replic_report ); _replic_report->set_indiv(this); // TODO: remove this after checking it is the old way //_exp_m->get_output_m()->get_tree()->set_replic_report( _id, _replic_report ); } else { _replic_report = NULL; } _protein_list = new ae_list(); _rna_list = new ae_list(); // Generic probes _int_probes = new int32_t[5]; _double_probes = new double[5]; for ( int8_t i = 0 ; i < 5 ; i++ ) { _int_probes[i] = model._int_probes[i]; _double_probes[i] = model._double_probes[i]; } // Mutation rates etc... _mut_params = new ae_params_mut( *(model._mut_params) ); // Genome size constraints _min_genome_length = model._min_genome_length; _max_genome_length = model._max_genome_length; // Plasmids settings _allow_plasmids = model._allow_plasmids; evaluate(); } /*! This constructor creates a new individual with the same genome as it's parent. The location of promoters will be copied but no further process will be performed. The phenotype and the fitness are not set, neither is the statistical data. */ ae_individual::ae_individual( ae_individual* const parent, int32_t id, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng ) { _exp_m = parent->_exp_m; // PRNGs _mut_prng = mut_prng; _stoch_prng = stoch_prng; int strain_string_len = strlen(parent->_strain_name); _strain_name = new char[strain_string_len+1]; memcpy(_strain_name, parent->_strain_name, strain_string_len+1); _age = parent->_age + 1; _id = id; _rank = -1; _evaluated = false; _transcribed = false; _translated = false; _folded = false; _phenotype_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _statistical_data_computed = false; _non_coding_computed = false; _modularity_computed = false; _placed_in_population = false; _grid_cell = NULL; _with_stochasticity = parent->_with_stochasticity; // Artificial chemistry parameters _w_max = parent->_w_max; // Create new genetic units with their DNA copied from here // NOTE : The RNA lists (one per genetic unit) will also be copied so that we don't // need to look for promoters on the whole genome _genetic_unit_list = new ae_list(); ae_list_node* gen_unit_node = parent->_genetic_unit_list->get_first(); while ( gen_unit_node != NULL ) { _genetic_unit_list->add( new ae_genetic_unit( this, gen_unit_node->get_obj() ) ); gen_unit_node = gen_unit_node->get_next(); } _phenotype_activ = NULL; _phenotype_inhib = NULL; _phenotype = NULL; // Initialize all the fitness-related stuff _dist_to_target_by_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } // Create a new replication report to store mutational events if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { _replic_report = new ae_replication_report( this, parent ); // TODO: remove this after checking it is the old way //_exp_m->get_output_m()->get_tree()->set_replic_report( _id, _replic_report ); } else { _replic_report = NULL; } // Create protein and RNA access lists _protein_list = new ae_list(); _rna_list = new ae_list(); // Generic probes _int_probes = new int32_t[5]; _double_probes = new double[5]; for ( int8_t i = 0 ; i < 5 ; i++ ) { _int_probes[i] = parent->_int_probes[i]; _double_probes[i] = parent->_double_probes[i]; } // Mutation rates etc... _mut_params = new ae_params_mut( *(parent->_mut_params) ); // Genome size constraints _min_genome_length = parent->_min_genome_length; _max_genome_length = parent->_max_genome_length; // Plasmids settings _allow_plasmids = parent->_allow_plasmids; // Initialize statistical data _total_genome_size = 0; _nb_coding_RNAs = 0; _nb_non_coding_RNAs = 0; _overall_size_coding_RNAs = 0; _overall_size_non_coding_RNAs = 0; _nb_genes_activ = 0; _nb_genes_inhib = 0; _nb_functional_genes = 0; _nb_non_functional_genes = 0; _overall_size_functional_genes = 0; _overall_size_non_functional_genes = 0; _nb_bases_in_0_CDS = -1; _nb_bases_in_0_functional_CDS = -1; _nb_bases_in_0_non_functional_CDS = -1; _nb_bases_in_0_RNA = -1; _nb_bases_in_0_coding_RNA = -1; _nb_bases_in_0_non_coding_RNA = -1; _nb_bases_in_neutral_regions = -1; _nb_neutral_regions = -1; _modularity = -1; //evaluate(); } // ================================================================= // Destructors // ================================================================= ae_individual::~ae_individual( void ) { #ifdef DISTRIBUTED_PRNG delete _mut_prng; delete _stoch_prng; #endif delete [] _strain_name; // The _replic_report pointer is destroyed, but not the report itself, // it will be deleted later, when the tree is written on disk and emptied. assert( _protein_list != NULL ); _protein_list->erase( false ); delete _protein_list; assert( _rna_list != NULL ); _rna_list->erase( false ); delete _rna_list; assert( _genetic_unit_list != NULL ); _genetic_unit_list->erase( true ); // When the unit is destoyed, its dna is destroyed too, thus the pointer // to the ae_dna_replication_report is destroyed. But the // dna_replic_report object itself is not deleted, its address is // still contained in the global replic_report object in the tree. delete _genetic_unit_list; delete _phenotype_activ; delete _phenotype_inhib; delete _phenotype; if ( _dist_to_target_by_segment != NULL ) delete [] _dist_to_target_by_segment; delete [] _dist_to_target_by_feature; delete [] _fitness_by_feature; // Generic probes delete [] _int_probes; delete [] _double_probes; delete _mut_params; /*if(_replic_report!= NULL) { delete _replic_report; }*/ } // ================================================================= // Non-inline Accessors // ================================================================= void ae_individual::set_exp_m( ae_exp_manager* exp_m ) { _exp_m = exp_m; // Update pointer to exp_manager in each GU ae_list_node* GU_node = _genetic_unit_list->get_first(); while ( GU_node != NULL ) { GU_node->get_obj()->set_exp_m(_exp_m); GU_node = GU_node->get_next(); } } /*! TODO */ void ae_individual::set_grid_cell( ae_grid_cell* grid_cell ) { _placed_in_population = true; _grid_cell = grid_cell; if ( _grid_cell->get_individual() != this ) { _grid_cell->set_individual( this ); } } // ================================================================= // Public Methods // ================================================================= void ae_individual::compute_phenotype( void ) { if ( _phenotype_computed ) return; // Phenotype has already been computed, nothing to do. _phenotype_computed = true; // Make sure the transcription, translation and folding stages have taken place do_transcription_translation_folding(); // We will use two fuzzy sets : // * _phenotype_activ for the proteins realising a set of functions // * _phenotype_inhib for the proteins inhibiting a set of functions // The phenotype will then be given by the sum of these 2 fuzzy sets _phenotype_activ = new ae_fuzzy_set(); _phenotype_inhib = new ae_fuzzy_set(); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); _phenotype_activ->add( gen_unit->get_activ_contribution() ); _phenotype_inhib->add( gen_unit->get_inhib_contribution() ); gen_unit_node = gen_unit_node->get_next(); } _phenotype_activ->add_upper_bound( Y_MAX ); _phenotype_inhib->add_lower_bound( - Y_MAX ); _phenotype = new ae_phenotype(); _phenotype->add( _phenotype_activ ); _phenotype->add( _phenotype_inhib ); _phenotype->add_lower_bound( Y_MIN ); _phenotype->simplify(); } void ae_individual::compute_distance_to_target( ae_environment* envir ) // Compute the areas between the phenotype and the environment for each environmental segment // If the environment is not segmented, the total area is computed { if ( _distance_to_target_computed ) return; // _distance_to_target has already been computed, nothing to do. _distance_to_target_computed = true; if ( ! _phenotype_computed ) compute_phenotype(); // Compute the difference between the (whole) phenotype and the environment ae_fuzzy_set* delta = new ae_fuzzy_set( *_phenotype ); delta->sub( envir ); ae_env_segment** segments = envir->get_segments(); _dist_to_target_by_segment = new double [envir->get_nb_segments()]; for ( int8_t i = 0 ; i < envir->get_nb_segments() ; i++ ) { _dist_to_target_by_segment[i] = 0; } // TODO : We should take into account that we compute the areas in order (from the leftmost segment, rightwards) // => We shouldn't parse the whole list of points on the left of the segment we are considering (we have // already been through them!) for ( int16_t i = 0 ; i < envir->get_nb_segments() ; i++ ) { _dist_to_target_by_segment[i] = delta->get_geometric_area( segments[i]->start, segments[i]->stop ); _dist_to_target_by_feature[segments[i]->feature] += _dist_to_target_by_segment[i]; } delete delta; } /*! Computation of a "proper" fitness value (one that increases when the individual is fitter) Computation of a "proper" fitness value (one that increases when the individual is fitter) The behaviour of this function depends on many parameters and most notably on whether it is a "composite" fitness or not, and on the selection scheme. */ void ae_individual::compute_fitness( ae_environment* envir ) { if ( _fitness_computed ) return; // Fitness has already been computed, nothing to do. _fitness_computed = true; #ifdef NORMALIZED_FITNESS for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { if (envir->get_area_by_feature(i)==0.) { _fitness_by_feature[i] = 0.; } else { _fitness_by_feature[i] = ( envir->get_area_by_feature(i) - _dist_to_target_by_feature[i] ) / envir->get_area_by_feature(i); if ( (_fitness_by_feature[i] < 0.) && (i != METABOLISM) ) // non-metabolic fitness can NOT be lower than zero (we do not want individual to secrete a negative quantity of public good) { _fitness_by_feature[i] = 0.; } } } if ( ( ! _placed_in_population ) || (! _exp_m->get_with_secretion() )) { _fitness = _fitness_by_feature[METABOLISM]; } else { _fitness = _fitness_by_feature[METABOLISM] * ( 1 + _exp_m->get_secretion_contrib_to_fitness() * ( _grid_cell->get_compound_amount() - _exp_m->get_secretion_cost() * _fitness_by_feature[SECRETION] ) ); } if ( _exp_m->get_selection_scheme() == FITNESS_PROPORTIONATE ) // Then the exponential selection is integrated inside the fitness value { _fitness = exp( -_exp_m->get_selection_pressure() * (1 - _fitness) ); } #else for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { if ( i == SECRETION ) { _fitness_by_feature[SECRETION] = exp( - _exp_m->get_selection_pressure() * _dist_to_target_by_feature[SECRETION] ) - exp( - _exp_m->get_selection_pressure() * envir->get_area_by_feature(SECRETION) ); if ( _fitness_by_feature[i] < 0 ) { _fitness_by_feature[i] = 0; } } else { _fitness_by_feature[i] = exp( - _exp_m->get_selection_pressure() * _dist_to_target_by_feature[i] ); } } // Calculate combined, total fitness here! // Multiply the contribution of metabolism and the amount of compound in the environment if ( ( ! _placed_in_population ) || (! _exp_m->get_with_secretion() )) { _fitness = _fitness_by_feature[METABOLISM] ; } else { _fitness = _fitness_by_feature[METABOLISM] * ( 1 + _exp_m->get_secretion_contrib_to_fitness() * _grid_cell->get_compound_amount() - _exp_m->get_secretion_cost() * _fitness_by_feature[SECRETION] ); } #endif } void ae_individual::reevaluate( ae_environment* envir /*= NULL*/ ) { // useful for post-treatment programs that replay mutations // on a single individual playing the role of the successive // ancestors _evaluated = false; _transcribed = false; _translated = false; _folded = false; _phenotype_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _statistical_data_computed = false; _non_coding_computed = false; _modularity_computed = false; if ( envir == NULL ) envir = _exp_m->get_env(); ae_list_node* unit_node = _genetic_unit_list->get_first(); ae_genetic_unit * unit = NULL; while (unit_node != NULL) { unit = unit_node->get_obj(); unit->reset_expression(); unit_node = unit_node->get_next(); } if ( _phenotype_activ != NULL ) { delete _phenotype_activ; _phenotype_activ = NULL; } if (_phenotype_inhib != NULL) { delete _phenotype_inhib; _phenotype_inhib = NULL; } if (_phenotype != NULL) { delete _phenotype; _phenotype = NULL; } // Initialize all the fitness-related stuff delete [] _dist_to_target_by_segment; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } //For each RNA / individual / genetic_unit delete proteins it knows //Deleting the protein it self is made only once _rna_list->erase( false ); _protein_list->erase( false ); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_list_node* rna_node = NULL; ae_rna* rna = NULL; ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); rna_node = (gen_unit->get_rna_list()[LEADING])->get_first(); while(rna_node !=NULL) { rna = rna_node->get_obj(); rna->get_transcribed_proteins()->erase( false ); rna_node = rna_node->get_next(); } rna_node = (gen_unit->get_rna_list()[LAGGING])->get_first(); while(rna_node !=NULL) { rna = rna_node->get_obj(); rna->get_transcribed_proteins()->erase( false ); rna_node = rna_node->get_next(); } (gen_unit->get_protein_list()[LEADING])->erase( true ); (gen_unit->get_protein_list()[LAGGING])->erase( true ); gen_unit_node = gen_unit_node->get_next(); } // Initialize statistical data _total_genome_size = 0; _nb_coding_RNAs = 0; _nb_non_coding_RNAs = 0; _overall_size_coding_RNAs = 0; _overall_size_non_coding_RNAs = 0; _nb_genes_activ = 0; _nb_genes_inhib = 0; _nb_functional_genes = 0; _nb_non_functional_genes = 0; _overall_size_functional_genes = 0; _overall_size_non_functional_genes = 0; _nb_bases_in_0_CDS = -1; _nb_bases_in_0_functional_CDS = -1; _nb_bases_in_0_non_functional_CDS = -1; _nb_bases_in_0_RNA = -1; _nb_bases_in_0_coding_RNA = -1; _nb_bases_in_0_non_coding_RNA = -1; _nb_bases_in_neutral_regions = -1; _nb_neutral_regions = -1; _modularity = -1; evaluate( envir ); } void ae_individual::do_transcription( void ) { if ( _transcribed == true ) return; // Transcription has already been performed, nothing to do. _transcribed = true; ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->do_transcription(); _rna_list->add_list( gen_unit->get_rna_list()[LEADING] ); _rna_list->add_list( gen_unit->get_rna_list()[LAGGING] ); gen_unit_node = gen_unit_node->get_next(); } } void ae_individual::do_translation( void ) { if ( _translated == true ) return; // ARNs have already been translated, nothing to do. _translated = true; if ( _transcribed == false ) do_transcription(); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->do_translation(); _protein_list->add_list( gen_unit->get_protein_list()[LEADING] ); _protein_list->add_list( gen_unit->get_protein_list()[LAGGING] ); gen_unit_node = gen_unit_node->get_next(); } } void ae_individual::do_folding( void ) { if ( _folded == true ) return; // Proteins have already been folded, nothing to do. _folded = true; if ( _translated == false ) do_translation(); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->compute_phenotypic_contribution(); gen_unit_node = gen_unit_node->get_next(); } } void ae_individual::evaluate( ae_environment* envir /*= NULL*/ ) { if ( _evaluated == true ) return; // Individual has already been evaluated, nothing to do. _evaluated = true; if ( envir == NULL ) envir = _exp_m->get_env(); // ---------------------------------------------------------------------- // 1) Transcription - Translation - Folding // ---------------------------------------------------------------------- do_transcription_translation_folding(); //~ print_rna_list(); //~ print_protein_list(); // ---------------------------------------------------------------------- // 2) Compute phenotype and compare it to the environment => fitness // ---------------------------------------------------------------------- compute_phenotype(); compute_distance_to_target( envir ); compute_fitness( envir ); if ( _exp_m->get_output_m()->get_compute_phen_contrib_by_GU() ) { ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->compute_distance_to_target( envir ); gen_unit->compute_fitness( envir ); gen_unit_node = gen_unit_node->get_next(); } } } void ae_individual::inject_GU( ae_individual* donor ) { // Add the GU at the end of the list ae_list_node* gen_unit_node = donor->get_genetic_unit_list()->get_last(); ae_genetic_unit* temp_GU = new ae_genetic_unit( this, *(gen_unit_node->get_obj()) ); _genetic_unit_list->add( temp_GU ); } void ae_individual::inject_2GUs( ae_individual* partner ) { //We swap GUs from the end of the list ae_list_node* gen_unit_node_1 = partner->get_genetic_unit_list()->get_last(); ae_list_node* gen_unit_node_2 = _genetic_unit_list->get_last(); ae_genetic_unit* temp_GU_1 = new ae_genetic_unit( this, *(gen_unit_node_1->get_obj()) ); ae_genetic_unit* temp_GU_2 = new ae_genetic_unit( this, *(gen_unit_node_2->get_obj()) ); _genetic_unit_list->add( temp_GU_1 ); partner->get_genetic_unit_list()->add( temp_GU_2 ); } void ae_individual::compute_statistical_data( void ) { if ( _statistical_data_computed ) return; // Statistical data has already been computed, nothing to do. _statistical_data_computed = true; if ( not _phenotype_computed ) { compute_phenotype(); } ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); _total_genome_size += gen_unit->get_dna()->get_length(); _nb_coding_RNAs += gen_unit->get_nb_coding_RNAs(); _nb_non_coding_RNAs += gen_unit->get_nb_non_coding_RNAs(); _overall_size_coding_RNAs += gen_unit->get_overall_size_coding_RNAs(); _overall_size_non_coding_RNAs += gen_unit->get_overall_size_non_coding_RNAs(); _nb_genes_activ += gen_unit->get_nb_genes_activ(); _nb_genes_inhib += gen_unit->get_nb_genes_inhib(); _nb_functional_genes += gen_unit->get_nb_functional_genes(); _nb_non_functional_genes += gen_unit->get_nb_non_functional_genes(); _overall_size_functional_genes += gen_unit->get_overall_size_functional_genes(); _overall_size_non_functional_genes += gen_unit->get_overall_size_non_functional_genes(); gen_unit_node = gen_unit_node->get_next(); } if ( _replic_report != NULL ) { // Finalize statistical data in the replication report _replic_report->signal_end_of_replication(); } } void ae_individual::compute_non_coding( void ) { if ( _non_coding_computed ) return; // _non_coding has already been computed, nothing to do. _non_coding_computed = true; _nb_bases_in_0_CDS = 0; _nb_bases_in_0_functional_CDS = 0; _nb_bases_in_0_non_functional_CDS = 0; _nb_bases_in_0_RNA = 0; _nb_bases_in_0_coding_RNA = 0; _nb_bases_in_0_non_coding_RNA = 0; _nb_bases_in_neutral_regions = 0; _nb_neutral_regions = 0; ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); _nb_bases_in_0_CDS += gen_unit->get_nb_bases_in_0_CDS(); _nb_bases_in_0_functional_CDS += gen_unit->get_nb_bases_in_0_functional_CDS(); _nb_bases_in_0_non_functional_CDS += gen_unit->get_nb_bases_in_0_non_functional_CDS(); _nb_bases_in_0_RNA += gen_unit->get_nb_bases_in_0_RNA(); _nb_bases_in_0_coding_RNA += gen_unit->get_nb_bases_in_0_coding_RNA(); _nb_bases_in_0_non_coding_RNA += gen_unit->get_nb_bases_in_0_non_coding_RNA(); _nb_bases_in_neutral_regions += gen_unit->get_nb_bases_in_neutral_regions(); _nb_neutral_regions += gen_unit->get_nb_neutral_regions(); gen_unit_node = gen_unit_node->get_next(); } } void ae_individual::save( gzFile backup_file ) const { // Write the name and "age" of the strain int8_t strain_string_len = strlen(_strain_name); gzwrite(backup_file, &strain_string_len, sizeof(strain_string_len)); gzwrite(backup_file, _strain_name, strain_string_len+1); gzwrite(backup_file, &_age, sizeof(_age)); #ifdef DISTRIBUTED_PRNG // Write the PRNG's state _mut_prng->save( backup_file ); _stoch_prng->save( backup_file ); #endif // Write id and rank gzwrite( backup_file, &_id, sizeof(_id) ); gzwrite( backup_file, &_rank, sizeof(_rank) ); // Write the position of the individual (or -1, -1 if there is no spatial structure) int16_t x = -1; int16_t y = -1; if ( _exp_m->is_spatially_structured() ) { x = _grid_cell->get_x(); y = _grid_cell->get_y(); } gzwrite( backup_file, &x, sizeof(x) ); gzwrite( backup_file, &y, sizeof(y) ); // Write generic probes gzwrite( backup_file, _int_probes, 5 * sizeof(*_int_probes) ); gzwrite( backup_file, _double_probes, 5 * sizeof(*_double_probes) ); // Write mutational parameters _mut_params->save( backup_file ); // ------------------------------------------------- Phenotypic stochasticity gzwrite( backup_file, &_with_stochasticity, sizeof(_with_stochasticity) ); // Write artificial chemistry parameters gzwrite( backup_file, &_w_max, sizeof(_w_max) ); // Write genome size constraints gzwrite( backup_file, &_min_genome_length, sizeof(_min_genome_length) ); gzwrite( backup_file, &_max_genome_length, sizeof(_max_genome_length) ); // Write plasmids settings int8_t tmp_allow_plasmids = _allow_plasmids; gzwrite( backup_file, &tmp_allow_plasmids, sizeof(tmp_allow_plasmids) ); // Write genetic units int16_t nb_gen_units = _genetic_unit_list->get_nb_elts(); gzwrite( backup_file, &nb_gen_units, sizeof(nb_gen_units) ); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit; for ( int16_t i = 0 ; i < nb_gen_units ; i++ ) { gen_unit = gen_unit_node->get_obj(); gen_unit->save( backup_file ); gen_unit_node = gen_unit_node->get_next(); } } int32_t ae_individual::get_nb_terminators( void ) { int32_t nb_term = 0; ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); nb_term += gen_unit->get_nb_terminators(); gen_unit_node = gen_unit_node->get_next(); } return nb_term; } /*! \brief Compute reproduction statistics and statistics about the offsprings of the current individual * Make nb_children replications of the current individual. * For each replication, determine if the offsprings is neutral, beneficial or deleterious by comparison of fitness with the current individual (the parent) * If statistics about offsprings are required (offsprings_statistics != NULL), fitness mean, fitness variance, size mean, size variance, functional gene number mean, functional gene number variance fo the nb_children offsprings are computed * If information about each children are required ( replication_file != NULL), fitness, genome_size, nb of functional genes, number of coding bases, number of transcribed but not translated bases, number of non transcribed bases of each offsprings are written in replication_file \param nb_children number of replications made to have the statistics \param reproduction_statistics statistics about the replications (proportion of neutral offsprings, proportion of beneficial offsprings, proportion of deleterious offsprings) \param offsprings_statistics statistics about the nb_children offsprings (fitness mean, fitness variance, size mean, size variance, functional gene number mean, functional gene number variance) compute if not null \param replication_file file with information about each children of the current individual (fitness, genome_size, nb of functional genes, number of coding bases, number of transcribed but not translated bases, number of non transcribed bases) if not null */ void ae_individual::compute_experimental_f_nu( int32_t nb_children, double* reproduction_statistics, double* offsprings_statistics, FILE* replication_file) { double initial_fitness = get_fitness(); if(reproduction_statistics != NULL) { reproduction_statistics[0] = 0; // proportion of neutral offsprings reproduction_statistics[1] = 0; // proportion of beneficial offsprings reproduction_statistics[2] = 0; // proportion of deleterious offsprings } else { printf( "%s:%d: error: reproduction_statistics was not initialized\n", __FILE__, __LINE__); exit( EXIT_FAILURE ); } if(offsprings_statistics != NULL) { offsprings_statistics[0] = 0; // offspring fitness mean offsprings_statistics[1] = 0; // offspring fitness variance offsprings_statistics[2] = 0; // offspring size mean offsprings_statistics[3] = 0; // offspring size variance offsprings_statistics[4] = 0; // offspring functional gene number mean offsprings_statistics[5] = 0; // offspring functional gene number variance } // ------------------------------------------ // Simulate fitness degradation // ------------------------------------------ double fitness_child = 0.0; double metabolic_error_child = 0.0; // replicate this individual to create 'nb_children' children ae_individual * child = NULL; int32_t genome_size = 0; int32_t nb_functional_genes = 0; int32_t nb_bases_in_0_functional_CDS = 0; int32_t nb_bases_in_0_coding_RNA = 0; for (int i = 0; i < nb_children; i++) { child = _exp_m->get_exp_s()->get_sel()->do_replication( this, _id ); fitness_child = child->get_fitness(); metabolic_error_child = child->get_dist_to_target_by_feature( METABOLISM ); if ( fabs(initial_fitness - fitness_child) < 1e-10*std::max(initial_fitness, fitness_child) ) { reproduction_statistics[0] += 1; } else if ( fitness_child > initial_fitness ) { reproduction_statistics[1] += 1; } else { reproduction_statistics[2] += 1; } genome_size = child->get_total_genome_size(); nb_functional_genes = child->get_nb_functional_genes(); nb_bases_in_0_functional_CDS = child->get_nb_bases_in_0_functional_CDS(); nb_bases_in_0_coding_RNA = child->get_nb_bases_in_0_coding_RNA(); if(offsprings_statistics != NULL) { offsprings_statistics[0] += fitness_child; offsprings_statistics[1] += pow(fitness_child,2); offsprings_statistics[2] += (double)genome_size; offsprings_statistics[3] += pow((double)genome_size,2); offsprings_statistics[4] += (double)nb_functional_genes; offsprings_statistics[5] += pow((double)nb_functional_genes,2); } if(replication_file != NULL) { fprintf(replication_file, "%le %le %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", fitness_child, metabolic_error_child, genome_size, nb_functional_genes, genome_size-nb_bases_in_0_functional_CDS, nb_bases_in_0_functional_CDS-nb_bases_in_0_coding_RNA, nb_bases_in_0_coding_RNA); } delete child; } //compute Fv reproduction_statistics[0] /= (double) nb_children; reproduction_statistics[1] /= (double) nb_children; reproduction_statistics[2] /= (double) nb_children; if(offsprings_statistics != NULL) { offsprings_statistics[0] /= (double) nb_children; offsprings_statistics[1] /= (double) nb_children; offsprings_statistics[2] /= (double) nb_children; offsprings_statistics[3] /= (double) nb_children; offsprings_statistics[4] /= (double) nb_children; offsprings_statistics[5] /= (double) nb_children; offsprings_statistics[1] -= pow(offsprings_statistics[0],2); offsprings_statistics[3] -= pow(offsprings_statistics[2],2); offsprings_statistics[5] -= pow(offsprings_statistics[4],2); } } /*! \brief Compute reproduction theoretical proportion of neutral offsprings Compute the theoretical proportion of neutral offsprings given the Carole's formula, based on the mutations and rearrangement rates and not on multiple replications \return theoretical proportion of neutral offsprings */ double ae_individual::compute_theoritical_f_nu( void ) { // We first have to collect information about genome structure. // Abbreviations are chosen according to Carole's formula. // Please notice that compared to the formula we have the beginning // and ends of neutral regions instead of 'functional regions' ae_genetic_unit* chromosome = get_genetic_unit_list()->get_first()->get_obj(); int32_t L = chromosome->get_dna()->get_length(); int32_t N_G = chromosome->get_nb_neutral_regions(); // which is not exactly Carole's original definition int32_t* b_i = chromosome->get_beginning_neutral_regions(); int32_t* e_i = chromosome->get_end_neutral_regions(); int32_t lambda = chromosome->get_nb_bases_in_neutral_regions(); int32_t l = L - lambda; // nb bases in 'functional regions' int32_t* lambda_i = NULL; // nb bases in ith neutral region if ( N_G > 0 ) // all the chromosome may be functional { lambda_i = new int32_t [ N_G ]; for ( int32_t i = 0; i < N_G - 1; i++) { lambda_i[i] = e_i[i] - b_i[i] + 1; } if ( b_i[N_G-1] > e_i[N_G-1] ) // last neutral region is overlapping on the beginning of chromosome { lambda_i[N_G-1] = ( e_i[N_G-1] + L ) - b_i[N_G-1] + 1; } else // no overlap { lambda_i[N_G-1] = e_i[N_G-1] - b_i[N_G-1] + 1; } } // we now compute the probabilities of neutral reproduction for // each type of mutation and rearrangement and update Fv double Fv = 1; // mutation + insertion + deletion double nu_local_mutation = 1 - ((double) l)/L; Fv = pow( 1 - get_point_mutation_rate() * ( 1 - nu_local_mutation ), L); Fv *= pow( 1 - get_small_insertion_rate() * ( 1 - nu_local_mutation ), L); Fv *= pow( 1 - get_small_deletion_rate() * ( 1 - nu_local_mutation ), L); // inversion ~ two local mutations double nu_inversion = nu_local_mutation * nu_local_mutation; Fv *= pow( 1 - get_inversion_rate() * ( 1 - nu_inversion ) , L); // translocation ~ inversion + insertion (mathematically) Fv *= pow( 1 - get_translocation_rate() * ( 1 - nu_inversion * nu_local_mutation ), L); // long deletion double nu_deletion = 0; // if N_G == 0, a deletion is always not neutral for ( int32_t i = 0; i < N_G; i++) { nu_deletion += lambda_i[i] * (lambda_i[i] + 1); } nu_deletion /= ((double) 2*L*L); Fv *= pow( 1 - get_deletion_rate() * ( 1 - nu_deletion ) , L); // duplication ~ big deletion + insertion Fv *= pow( 1 - get_duplication_rate() * ( 1 - nu_deletion * nu_local_mutation ), L); if ( lambda_i != NULL ) delete [] lambda_i; return Fv; } /*! \brief Remove the bases that are not in coding RNA Remove the bases that are not in coding RNA and test at each loss that fitness is not changed */ void ae_individual::remove_non_coding_bases(void) { //reevaluate(_exp_m->get_env()); //double initial_fitness = get_fitness(); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->remove_non_coding_bases(); //reevaluate(_exp_m->get_env()); //assert(get_fitness()==initial_fitness); gen_unit_node = gen_unit_node->get_next(); } _non_coding_computed = false; assert(get_nb_bases_in_0_coding_RNA()==0); } /*! \brief Double the bases that are not in coding RNA Double the bases that are not in coding RNA by addition of random bases and test at each addition that fitness is not changed */ void ae_individual::double_non_coding_bases(void) { //reevaluate(_exp_m->get_env()); //double initial_fitness = get_fitness(); _statistical_data_computed = false; _non_coding_computed = false; _total_genome_size = 0; int32_t initial_non_coding_base_nb = get_nb_bases_in_0_coding_RNA(); ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); gen_unit->double_non_coding_bases(); //reevaluate(_exp_m->get_env()); //assert(get_fitness()==initial_fitness); gen_unit_node = gen_unit_node->get_next(); } _statistical_data_computed = false; _non_coding_computed = false; _total_genome_size = 0; assert(get_nb_bases_in_0_coding_RNA()==2*initial_non_coding_base_nb); } // ================================================================= // Protected Methods // ================================================================= void ae_individual::make_protein_list( void ) { assert( _protein_list != NULL ); // Clean list _protein_list->erase( false ); // Make a copy of each genetic unit's protein list ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); _protein_list->add_list( gen_unit->get_protein_list()[LEADING] ); _protein_list->add_list( gen_unit->get_protein_list()[LAGGING] ); gen_unit_node = gen_unit_node->get_next(); } } void ae_individual::make_rna_list( void ) { assert( _rna_list != NULL ); // Clean list _rna_list->erase( false ); // Make a copy of each genetic unit's rna list ae_list_node* gen_unit_node = _genetic_unit_list->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = gen_unit_node->get_obj(); _rna_list->add_list( gen_unit->get_rna_list()[LEADING] ); _rna_list->add_list( gen_unit->get_rna_list()[LAGGING] ); gen_unit_node = gen_unit_node->get_next(); } } aevol-4.4/src/libaevol/ae_dna.cpp0000644000175000017500000037563112364461376013742 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #include #include //############################################################################## // # // Class ae_dna # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= /** * Creates a random dna sequence of length belonging to . */ ae_dna::ae_dna( ae_genetic_unit* gen_unit, int32_t length ) : ae_string( length ) { _gen_unit = gen_unit; _exp_m = gen_unit->get_exp_m(); _indiv = gen_unit->get_indiv(); _replic_report = NULL; } /** * Creates a new piece of dna identical to the model but belonging to * The replication report is copied if it exists */ ae_dna::ae_dna( ae_genetic_unit* gen_unit, const ae_dna &model ) : ae_string( model ) { _gen_unit = gen_unit; _exp_m = gen_unit->get_exp_m(); _indiv = gen_unit->get_indiv(); if ( ( _exp_m->get_num_gener() > 0 && _exp_m->get_output_m()->get_record_tree() ) && ( model._replic_report != NULL ) ) { _replic_report = new ae_dna_replic_report( *(model._replic_report) ); } else { _replic_report = NULL; } } /** * Creates a new piece of dna identical to the parent's but belonging to * The replication report is set to NULL */ ae_dna::ae_dna( ae_genetic_unit* gen_unit, ae_dna* const parent_dna ) : ae_string( parent_dna->_data, parent_dna->_length ) { _gen_unit = gen_unit; _exp_m = gen_unit->get_exp_m(); _indiv = gen_unit->get_indiv(); _replic_report = NULL; } /** * Creates a new piece of dna with sequence (of length ). * WARNING : will be used directly as the new dna sequence (it will not be copied), * which means the caller must not delete it. * The replication report is set to NULL */ ae_dna::ae_dna( ae_genetic_unit* gen_unit, char* seq, int32_t length ) : ae_string( seq, length, true ) { _gen_unit = gen_unit; _exp_m = gen_unit->get_exp_m(); _indiv = gen_unit->get_indiv(); _replic_report = NULL; } /** * Loads a piece of dna from * The replication report is set to NULL */ ae_dna::ae_dna( ae_genetic_unit* gen_unit, gzFile backup_file ) : ae_string( backup_file ) { _gen_unit = gen_unit; _exp_m = gen_unit->get_exp_m(); _indiv = gen_unit->get_indiv(); _replic_report = NULL; } /** * Creates a dna sequence from a text file * The replication report is set to NULL */ ae_dna::ae_dna( ae_genetic_unit* gen_unit, char* organism_file_name ) : ae_string( organism_file_name ) { _gen_unit = gen_unit; _exp_m = gen_unit->get_exp_m(); _indiv = gen_unit->get_indiv(); _replic_report = NULL; } // ================================================================= // Destructors // ================================================================= ae_dna::~ae_dna( void ) { } // ================================================================= // Non inline Accessors // ================================================================= char* ae_dna::get_subsequence( int32_t from, int32_t to, ae_strand strand ) const { char* subseq = NULL; from = ae_utils::mod( from, _length ); to = ae_utils::mod( to, _length ); if ( strand == LEADING ) { if ( from < to ) { subseq = new char[to-from+1]; subseq[to-from] = '\0'; strncpy( subseq, &(_data[from]), to-from ); } else { subseq = new char[_length-from+to+1]; subseq[_length-from+to] = '\0'; strncpy( subseq, &(_data[from]), _length-from ); strncpy( &subseq[_length-from], _data, to ); } } else // if ( strand == LAGGING ) { if ( from > to ) { subseq = new char[from-to+1]; subseq[from-to] = '\0'; for ( int32_t i = 0 ; i < from - to ; i++ ) { subseq[i] = (_data[from-1-i] == '1') ? '0' : '1'; } } else { subseq = new char[from+_length-to+1]; subseq[from+_length-to] = '\0'; for ( int32_t i = 0 ; i < from ; i++ ) { subseq[i] = (_data[from-1-i] == '1') ? '0' : '1'; } for ( int32_t i = 0 ; i < _length-to ; i++ ) { subseq[from+i] = (_data[_length-1-i] == '1') ? '0' : '1'; } } } return subseq; } // ================================================================= // Public Methods // ================================================================= void ae_dna::perform_mutations( int32_t parent_id ) { if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { _replic_report = new ae_dna_replic_report(); } if(_indiv->get_with_HT()) { do_transfer(parent_id); } if ( _indiv->get_with_alignments() ) { do_rearrangements_with_align(); } else { do_rearrangements(); } do_small_mutations(); // Store mutation events in replication report (temporary lists are emptied) // TODO : next 2 lines //~ new_indiv->_replic_report->set_parent_genome_size( (this->_genome)->get_length() ); // if crossover => please set also donor_index, donor_misadaptation_value and donor_genome_size // TODO!!! //~ new_indiv->_replic_report->compute_statistical_data(); } void ae_dna::do_small_mutations( void ) { // ============================================================== // 1. Compute how many rearrangements this genome will undertake // ============================================================== // // Given the rate p (by nucl.) of insertion - for instance -, the number of // insertions we perform on the genome follows a binomial law B(n, p), with // n = genome length. int32_t nb_swi = _indiv->_mut_prng->binomial_random( _length, _indiv->get_point_mutation_rate() ); int32_t nb_ins = _indiv->_mut_prng->binomial_random( _length, _indiv->get_small_insertion_rate() ); int32_t nb_del = _indiv->_mut_prng->binomial_random( _length, _indiv->get_small_deletion_rate() ); int32_t nb_mut = nb_swi + nb_ins + nb_del; // ==================================================== // 2. Perform those small mutations in a random order // ==================================================== // // We put the '_nb_small_mutations' mutation events in an "urn". Then we repeat a random drawing // of one mutation event in this urn, without replacement, until no mutation // event is left in the urn. Here is the "urn" we use at the beginning: // // ----------------------------------------------------------- // | swi | swi | swi | ins | ins | ins | del | del | del | del | // ----------------------------------------------------------- // ^ ^ ^ // nb_swi nb_swi nb_swi // +nb_ins +nb_ins // +nb_del // // Random draw of one mutation = random draw of one position in this "urn". // Given this position, we know what kind of mutation we have drawn. int32_t random_value; ae_mutation* mut = NULL; for ( int32_t i = nb_mut ; i >= 1 ; i-- ) { random_value = _indiv->_mut_prng->random( i ); if ( random_value < nb_swi ) { mut = do_switch(); assert( mut != NULL || !(_exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL) ); nb_swi--; // updating the urn (no replacement!)... } else if ( random_value < nb_swi + nb_ins ) { mut = do_small_insertion(); nb_ins--; } else // ( random_value >= nb_swi + nb_ins ) => del { mut = do_small_deletion(); nb_del--; } // Record mutation in tree if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { if ( mut != NULL ) { _replic_report->add_mut( mut ); } } else { if ( mut != NULL ) { delete mut; mut = NULL; } } } } void ae_dna::do_rearrangements( void ) { // ============================================================== // 1. Compute how many rearrangements this genome will undertake // ============================================================== // // Given the rate p (by nucl.) of duplication - for instance -, the number of // duplications we perform on the genome follows a binomial law B(n, p), with // n = genome length. int32_t nb_dupl = _indiv->_mut_prng->binomial_random( _length, _indiv->get_duplication_rate() ); int32_t nb_del = _indiv->_mut_prng->binomial_random( _length, _indiv->get_deletion_rate() ); int32_t nb_trans = _indiv->_mut_prng->binomial_random( _length, _indiv->get_translocation_rate() ); int32_t nb_inv = _indiv->_mut_prng->binomial_random( _length, _indiv->get_inversion_rate() ); int32_t nb_rear = nb_dupl + nb_del + nb_trans + nb_inv; // =================================================== // 2. Perform those rearrangements in a random order // =================================================== // // We put the nb_rea rearrangements in an "urn". Then we repeat a random draw // of one rearrangement in this urn, without replacement, until no rearrange- // -ment is left in the urn. Here is the "urn" we use at the beginning: // // ------------------------------------------------------------------------------ // | Dupl | Dupl | Dupl | Del | Del | Del | Del | Trans | Trans | Inv | Inv | Inv | // ------------------------------------------------------------------------------ // ^ ^ ^ ^ // nb_dupl nb_dupl nb_dupl nb_dupl // +nb_del +nb_del +nb_del // +nb_trans +nb_trans // +nb_inv // // Random draw of one rearrangement = random draw of one position in this urn. // Given this position, we know what kind of rearrangement we have drawn. int32_t random_value; ae_mutation* mut = NULL; for ( int32_t i = nb_rear ; i >= 1 ; i-- ) { random_value = _indiv->_mut_prng->random( i ); if ( random_value < nb_dupl ) { mut = do_duplication(); nb_dupl--; // Updating the urn (no replacement!)... } else if ( random_value < nb_dupl + nb_del ) { mut = do_deletion(); nb_del--; } else if ( random_value < nb_dupl + nb_del + nb_trans ) { mut = do_translocation(); nb_trans--; } else { mut = do_inversion(); nb_inv--; } // Record rearrangement in tree if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { if ( mut != NULL ) { _replic_report->add_rear( mut ); } } else { if ( mut != NULL ) { delete mut; mut = NULL; } } } } void ae_dna::do_rearrangements_with_align( void ) { bool direct_sense; // Whether we look for a direct or indirect alignment double rand1 = 0.0; // Determines the type of rearrangement that will be done if an alignment is found int16_t needed_score; // Minimum alignment score needed to recombine (stochastic) int32_t seed1, seed2; // Points defining the sequences between which we will look for an alignment double ttl = 1.0; // Indiv's Time To Live int32_t nb_pairs; // Number of pairs of sequences we will try to align int32_t genome_size = _length; // Keep trace of the original length of the genome ae_mutation* mut = NULL; ae_vis_a_vis* alignment = NULL; ////////////////////////////////////////////////////////////////////////////////////////////////// // For each pair of points to be tested (i.e. while the organism is still "alive"), // 1) Draw a random sense (direct or indirect). // 2) Determine the minimum alignment score needed for a rearrangement to occur. // 3) Test the existence of an alignment with a high enough score. // 4) If such an alignment was found, determine the type of rearrangement to be performed // and proceed (WARNING : translocations require another alignment to be found between // the sequence to be translocated and the rest of the chromosome). // 5) If there was a change in the chromosome's length, update the individual's TTL and nb_pairs // according to new genome size. // 6) If there was a rearrangement, we either save its record in the tree or delete it. ////////////////////////////////////////////////////////////////////////////////////////////////// for ( nb_pairs = (int32_t)( ceil( ttl * _length * _indiv->get_neighbourhood_rate() ) ) ; nb_pairs > 0 ; nb_pairs-- ) { ///////////////////////////////////////////////// // 1) Draw a random sense (direct or indirect) // ///////////////////////////////////////////////// direct_sense = (_indiv->_mut_prng->random() < 0.5); // Determine whether we look for a direct or indirect alignment rand1 = _indiv->_mut_prng->random(); // Determine the type of rearrangement to be done. This is an // anticipation on 4) for optimization purpose (save computation // time if the type of rear is "none" ////////////////////////////////////////////////////////////////////////////////// // 2) Determine the minimum alignment score needed for a rearrangement to occur // ////////////////////////////////////////////////////////////////////////////////// if ( _indiv->get_align_fun_shape() == LINEAR ) { needed_score = (int16_t) ceil( _indiv->get_align_lin_min() + _indiv->_mut_prng->random() * ( _indiv->get_align_lin_max() - _indiv->get_align_lin_min() ) ); } else { // I want the probability of rearrangement for an alignment of score to be // prob = 1 / ( 1 + exp( -(score-mean)/lambda ) ) // The score needed for a rearrangement to take place with a given random drawing is hence // needed_score = ceil( -lambda * log( 1/rand - 1 ) + mean ) needed_score = (int16_t) ceil( - _indiv->get_align_sigm_lambda() * log( 1/_indiv->_mut_prng->random() - 1 ) + _indiv->get_align_sigm_mean() ); if ( needed_score < 0 ) needed_score = 0; //~ //~ FILE* tmp_file = fopen( "scores.out", "a" ); //~ fprintf( tmp_file, "%"PRId16"\n", needed_score ); //~ fclose( tmp_file ); //~ } // Determine where to look for an alignment (draw seeds) seed1 = _indiv->_mut_prng->random( _length ); seed2 = _indiv->_mut_prng->random( _length ); if ( direct_sense ) { if ( rand1 >= _indiv->get_duplication_proportion() + _indiv->get_deletion_proportion() + _indiv->get_translocation_proportion() ) { // rand1 corresponds to "no rearrangement" => Nothing to do continue; } //////////////////////////////////////////////////////////////////// // 3) Test the existence of an alignment with a high enough score // //////////////////////////////////////////////////////////////////// alignment = ae_align::search_alignment_direct( this, seed1, this, seed2, needed_score ); if ( alignment == NULL ) { // No alignment found continue; } //~ printf( "direct needed_score : %"PRId32"\n", needed_score ); //////////////////////////////////////////////////////////////////////// // 4) Determine the type of rearrangement to be performed and proceed // //////////////////////////////////////////////////////////////////////// if ( rand1 < _indiv->get_duplication_proportion() ) { // Remember the length of the segment to be duplicated and of the genome before the duplication int32_t segment_length = ae_utils::mod( alignment->get_i_2() - alignment->get_i_1(), _length ); int32_t gu_size_before = _length; int32_t gu_size_after = gu_size_before + segment_length; int32_t genome_size_before = _indiv->get_amount_of_dna(); int32_t genome_size_after = genome_size_before + segment_length; if ( ( genome_size_after > _indiv->get_max_genome_length() ) || ( gu_size_after > _gen_unit->get_max_gu_length() ) ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" DUPLICATION %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), segment_length, 0, gu_size_before, genome_size_before ); } } else { // Perform in situ (tandem) DUPLICATION do_duplication( alignment->get_i_1(), alignment->get_i_2(), alignment->get_i_2() ); // Report the duplication if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { // Report the insertion mut = new ae_mutation(); mut->report_duplication( alignment->get_i_1(), alignment->get_i_2(), alignment->get_i_2(), segment_length, needed_score ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32" %"PRId16"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(DUPL), segment_length, genome_size_before, needed_score ); } } } else if ( rand1 < _indiv->get_duplication_proportion() + _indiv->get_deletion_proportion() ) { // Remember the length of the segment to be duplicated and of the genome before the deletion int32_t segment_length = ae_utils::mod( alignment->get_i_2() - alignment->get_i_1() - 1, _length ) + 1; int32_t gu_size_before = _length; int32_t gu_size_after = gu_size_before - segment_length; int32_t genome_size_before = _indiv->get_amount_of_dna(); int32_t genome_size_after = genome_size_before - _length; if ( ( genome_size_after < _indiv->get_min_genome_length() ) || ( gu_size_after < _gen_unit->get_min_gu_length() ) ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" DELETION %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), segment_length, 0, gu_size_before, genome_size_before ); } } else { // Perform DELETION do_deletion( alignment->get_i_1(), alignment->get_i_2() ); // Report the deletion if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { // Report the insertion mut = new ae_mutation(); mut->report_deletion( alignment->get_i_1(), alignment->get_i_2(), segment_length, needed_score ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32" %"PRId16"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(DEL), segment_length, genome_size_before, needed_score ); } } } else { assert( rand1 < _indiv->get_duplication_proportion() + _indiv->get_deletion_proportion() + _indiv->get_translocation_proportion() ); // Perform TRANSLOCATION // Make sure the segment to be translocated doesn't contain OriC TODO : is that still necessary? if ( alignment->get_i_1() > alignment->get_i_2() ) { alignment->swap(); } // Remember the length of the segment to be translocated int32_t segment_length = ae_utils::mod( alignment->get_i_2() - alignment->get_i_1(), _length ); // Extract the segment to be translocated ae_genetic_unit* translocated_segment = extract_into_new_GU( alignment->get_i_1(), alignment->get_i_2() ); // Look for an alignment between the segment to be translocated and the rest of the genome bool direct_sense; int16_t needed_score_2; ae_vis_a_vis* alignment_2 = NULL; int32_t seed1, seed2; for ( nb_pairs = (int32_t)( ceil( ttl * _length * _indiv->get_neighbourhood_rate() ) ) ; nb_pairs > 0 ; nb_pairs-- ) { direct_sense = (_indiv->_mut_prng->random() < 0.5); if ( _indiv->get_align_fun_shape() == LINEAR ) { needed_score_2 = (int16_t) ceil( _indiv->get_align_lin_min() + _indiv->_mut_prng->random() * ( _indiv->get_align_lin_max() - _indiv->get_align_lin_min() ) ); } else { needed_score_2 = (int16_t) ceil( - _indiv->get_align_sigm_lambda() * log( 1/_indiv->_mut_prng->random() - 1 ) + _indiv->get_align_sigm_mean() ); if ( needed_score_2 < 0 ) needed_score_2 = 0; } seed1 = _indiv->_mut_prng->random( _length ); seed2 = _indiv->_mut_prng->random( segment_length ); if ( direct_sense ) { alignment_2 = ae_align::search_alignment_direct( this, seed1, translocated_segment->get_dna(), seed2, needed_score_2 ); } else // if indirect { alignment_2 = ae_align::search_alignment_indirect( this, seed1, translocated_segment->get_dna(), seed2, needed_score_2 ); } if ( alignment_2 != NULL ) { //~ printf( "transloc needed_score : %"PRId32"\n", needed_score_2 ); break; } } // If an alignment was found between the segment to be translocated and the rest of the genome, proceed to the // translocation, otherwise, replace the extracted segment at its former position (cancel the translocation event). if ( alignment_2 != NULL ) { // Proceed to the translocation insert_GU( translocated_segment, alignment_2->get_i_1(), alignment_2->get_i_2(), (alignment_2->get_sense() == INDIRECT) ); // Report the translocation if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_translocation( alignment->get_i_1(), alignment->get_i_2(), alignment_2->get_i_1(), alignment_2->get_i_2(), segment_length, (alignment_2->get_sense() == INDIRECT), needed_score, needed_score_2 ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32" %"PRId16"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(TRANS), segment_length, _length, needed_score_2 ); } delete alignment_2; } else { // Cancel the translocation (replace the extracted segment at its former position) insert_GU( translocated_segment, alignment->get_i_1(), 0, false ); } delete translocated_segment; } delete alignment; } else // if indirect { if ( rand1 >= _indiv->get_inversion_proportion() ) { // rand1 corresponds to no rearrangement => Nothing to do continue; } //~ printf( "indirect needed_score : %"PRId32"\n", needed_score ); //////////////////////////////////////////////////////////////////// // 3) Test the existence of an alignment with a high enough score // //////////////////////////////////////////////////////////////////// alignment = ae_align::search_alignment_indirect( this, seed1, this, seed2, needed_score ); if ( alignment == NULL ) { // No alignment found continue; } ///////////////////////////// // 4) Proceed to inversion // ///////////////////////////// // Make sure the segment to be inverted doesn't contain OriC if ( alignment->get_i_1() > alignment->get_i_2() ) { alignment->swap(); } // Remember the length of the segment to be duplicated int32_t segment_length = ae_utils::mod( alignment->get_i_2() - alignment->get_i_1(), _length ); // Proceed do_inversion( alignment->get_i_1(), alignment->get_i_2() ); // Report the inversion if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_inversion( alignment->get_i_1(), alignment->get_i_2(), segment_length, needed_score ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32" %"PRId16"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(INV), segment_length, _length, needed_score ); } delete alignment; } ////////////////////////////////////////////////////////////////////////////// // 5) If there was a change in the chromosome's length, // // update the individual's TTL and nb_pairs according to new genome size // ////////////////////////////////////////////////////////////////////////////// if ( genome_size != _length ) { ttl = ((double)(nb_pairs-1)) / ((double)genome_size) / _indiv->get_neighbourhood_rate(); genome_size = _length; nb_pairs = (int32_t)( ceil( ttl * _length * _indiv->get_neighbourhood_rate() ) ) + 1; } ////////////////////////////////////////////////////////////////////////////////////////// // 6) If there was a rearrangement, we either save its record in the tree or delete it. // ////////////////////////////////////////////////////////////////////////////////////////// if ( mut != NULL ) { if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { _replic_report->add_rear( mut ); mut = NULL; } else { delete mut; mut = NULL; } } } } void ae_dna::do_transfer( int32_t parent_id ) { ae_mutation* mut = NULL; if ( _indiv->get_mut_prng()->random() < _indiv->get_HT_ins_rate() ) { mut = do_ins_HT(parent_id); if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { if ( mut != NULL ) { _replic_report->add_HT( mut ); } } else { if ( mut != NULL ) { delete mut; mut = NULL; } } } if ( _indiv->get_mut_prng()->random() < _indiv->get_HT_repl_rate() ) { mut = do_repl_HT(parent_id); if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { if ( mut != NULL ) { _replic_report->add_HT( mut ); } } else { if ( mut != NULL ) { delete mut; mut = NULL; } } } } ae_mutation* ae_dna::do_switch( void ) { ae_mutation* mut = NULL; int32_t pos = _indiv->_mut_prng->random( _length ); if ( do_switch( pos ) ) { if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { // Report the mutation mut = new ae_mutation(); mut->report_point_mutation( pos ); } } return mut; } ae_mutation* ae_dna::do_small_insertion( void ) { ae_mutation* mut = NULL; // Determine the position and size of the small insertion int32_t pos = _indiv->_mut_prng->random( _length ); int16_t nb_insert; if ( _indiv->get_max_indel_size() == 1 ) { nb_insert = 1; } else { nb_insert = 1 + _indiv->_mut_prng->random( _indiv->get_max_indel_size() ); // must be in [1 ; max_indel_size] } // Check that the insertion won't throw the genome size over the limit if ( ( _indiv->get_amount_of_dna() + nb_insert > _indiv->get_max_genome_length() ) || (_length + nb_insert > _gen_unit->get_max_gu_length()) ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" S_INS %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), nb_insert, 0, _length, _indiv->get_amount_of_dna() ); } return NULL; } // Prepare the sequence to be inserted char* inserted_seq = new char[nb_insert + 1]; char inserted_char; for ( int16_t j = 0 ; j < nb_insert ; j++ ) { inserted_char = (char) '0' + _indiv->_mut_prng->random( NB_BASE ); inserted_seq[j] = inserted_char; } inserted_seq[nb_insert] = '\0'; // Proceed to the insertion and report it if ( do_small_insertion( pos, nb_insert, inserted_seq ) ) { if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { // Report the insertion mut = new ae_mutation(); mut->report_small_insertion( pos, nb_insert, inserted_seq ); } } // Delete the sequence delete [] inserted_seq; return mut; } ae_mutation* ae_dna::do_small_deletion( void ) { ae_mutation* mut = NULL; // Determine the position and size of the small deletion int32_t pos = _indiv->_mut_prng->random( _length ); int16_t nb_del; if ( _indiv->get_max_indel_size() == 1 ) { nb_del = 1; } else { nb_del = 1 + _indiv->_mut_prng->random( _indiv->get_max_indel_size() ); // must be in [1 ; max_indel_size] } // Check that the insertion won't shrink the genome size under the limit nor to nothing if ( ( _indiv->get_amount_of_dna() - nb_del < _indiv->get_min_genome_length() ) || (_length - nb_del < _gen_unit->get_min_gu_length()) ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" S_DEL %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), nb_del, 0, _length, _indiv->get_amount_of_dna() ); } return NULL; } if ( do_small_deletion( pos, nb_del ) ) { if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_small_deletion( pos, nb_del ); } } return mut; } bool ae_dna::do_switch( int32_t pos ) { // Perform the mutation if ( _data[pos] == '0' ) _data[pos] = '1'; else _data[pos] = '0'; // Remove promoters containing the switched base _gen_unit->remove_promoters_around( pos, ae_utils::mod(pos + 1, _length) ); // Look for potential new promoters containing the switched base if ( _length >= PROM_SIZE ) { _gen_unit->look_for_new_promoters_around( pos, ae_utils::mod(pos + 1, _length) ); } return true; } bool ae_dna::do_small_insertion( int32_t pos, int16_t nb_insert, char * seq ) { // Check genome size limit assert(_length + nb_insert <= _gen_unit->get_max_gu_length()); assert(_indiv->get_amount_of_dna() + nb_insert <= _indiv->get_max_genome_length()); // Remove the promoters that will be broken _gen_unit->remove_promoters_around( pos ); // Insert the sequence insert( pos, seq, nb_insert ); // Look for new promoters if ( _length >= PROM_SIZE ) { if ( _length - nb_insert < PROM_SIZE ) { // Special case where the genome was smaller than a promoter before the insertion and greater than (or as big as) a promoter after the insertion. // In that case, we must look for new promoters thoroughly on the whole genome using locate_promoters _gen_unit->locate_promoters(); } else { _gen_unit->move_all_promoters_after( pos, nb_insert ); _gen_unit->look_for_new_promoters_around( pos, ae_utils::mod(pos + nb_insert, _length) ); } } return true; } bool ae_dna::do_small_deletion( int32_t pos, int16_t nb_del ) { // Check genome size limit assert( _length - nb_del >= _gen_unit->get_min_gu_length()); assert( _indiv->get_amount_of_dna() - nb_del >= _indiv->get_min_genome_length() ); // Remove promoters containing at least one nucleotide from the sequence to delete _gen_unit->remove_promoters_around( pos, ae_utils::mod(pos + nb_del, _length) ); // Do the deletion and update promoter list if ( pos + nb_del <= _length ) // the deletion does not contain the replication origin { // Do the deletion remove( pos, pos + nb_del ); // Update promoter list if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( pos, -nb_del ); _gen_unit->look_for_new_promoters_around( ae_utils::mod(pos, _length) ); } } else // the deletion contains the replication origin { // Do the deletion int32_t nb_del_at_pos_0 = nb_del - _length + pos; remove( pos, _length ); remove( 0, nb_del_at_pos_0 ); pos -= nb_del_at_pos_0; // Update promoter list if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( 0, -nb_del_at_pos_0 ); _gen_unit->look_for_new_promoters_around( 0 ); } } return true; } ae_mutation* ae_dna::do_duplication( void ) { ae_mutation* mut = NULL; int32_t pos_1, pos_2, pos_3; pos_1 = _indiv->_mut_prng->random( _length ); pos_2 = _indiv->_mut_prng->random( _length ); pos_3 = _indiv->_mut_prng->random( _length ); // Remember the length of the segment to be duplicated and of the former genome int32_t segment_length = ae_utils::mod( pos_2 - pos_1 - 1, _length ) + 1; int32_t gu_size_before = _length; int32_t gu_size_after = gu_size_before + segment_length; int32_t genome_size_before = _indiv->get_amount_of_dna(); int32_t genome_size_after = genome_size_before + segment_length; if ( (gu_size_after > _gen_unit->get_max_gu_length()) || (genome_size_after > _indiv->get_max_genome_length()) ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" DUPLICATION %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), segment_length, 0, gu_size_before, genome_size_before ); } } else { // Perform the duplication do_duplication( pos_1, pos_2, pos_3 ); // Report the duplication if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_duplication( pos_1, pos_2, pos_3, segment_length ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(DUPL), segment_length, genome_size_before ); } } return mut; } ae_mutation* ae_dna::do_deletion( void ) { ae_mutation* mut = NULL; int32_t pos_1, pos_2; pos_1 = _indiv->_mut_prng->random( _length ); pos_2 = _indiv->_mut_prng->random( _length ); // Remember the length of the segment to be deleted and of the genome before the deletion int32_t segment_length = ae_utils::mod( pos_2 - pos_1 - 1, _length ) + 1; int32_t gu_size_before = _length; int32_t gu_size_after = gu_size_before - segment_length; int32_t genome_size_before = _indiv->get_amount_of_dna(); int32_t genome_size_after = genome_size_before - segment_length; if ( ( gu_size_after < _gen_unit->get_min_gu_length() ) || ( genome_size_after < _indiv->get_min_genome_length() ) ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" DELETION %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), segment_length, 0, gu_size_before, genome_size_before ); } } else { // Perform the deletion do_deletion( pos_1, pos_2 ); // Report the deletion if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_deletion( pos_1, pos_2, segment_length ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(DEL), segment_length, genome_size_before ); } } return mut; } ae_mutation* ae_dna::do_translocation( void ) { ae_mutation* mut = NULL; int32_t pos_1, pos_2, pos_3, pos_4; int32_t segment_length; bool invert; if ( _indiv->get_allow_plasmids() ) { // ----------------------------------------------------------------- // WARNING : This is only valid when there is only 1 plasmid allowed // ----------------------------------------------------------------- int32_t pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel; ae_individual* indiv = _indiv; ae_genetic_unit* chromosome = indiv->get_genetic_unit_list()->get_first()->get_obj(); ae_genetic_unit* plasmid = indiv->get_genetic_unit_list()->get_first()->get_next()->get_obj(); int32_t chrom_length = chromosome->get_dna()->get_length(); int32_t total_amount_of_dna = indiv->get_amount_of_dna(); // 1) What sequence are we translocating? pos_1_rel = _indiv->_mut_prng->random( _length ); pos_2_rel = _indiv->_mut_prng->random( _length ); int32_t segment_length = ae_utils::mod( pos_2_rel - pos_1_rel, _length ); pos_3_rel = ae_utils::mod( pos_1_rel + _indiv->_mut_prng->random( segment_length ), _length ); if ( _gen_unit == chromosome ) { pos_1 = pos_1_rel; pos_2 = pos_2_rel; pos_3 = pos_3_rel; } else // ( _gen_unit == plasmid ) { pos_1 = pos_1_rel + chrom_length; pos_2 = pos_2_rel + chrom_length; pos_3 = pos_3_rel + chrom_length; } // 2) Where are we translocating it? pos_4 = _indiv->_mut_prng->random( total_amount_of_dna - segment_length ); if ( _gen_unit == chromosome ) { if ( pos_1 <= pos_2 ) { if ( pos_4 >= pos_1 ) { pos_4 += segment_length; } } else { if ( pos_4 >= chrom_length - segment_length ) { pos_4 += segment_length; } else { pos_4 += pos_2; } } if ( pos_4 >= chrom_length ) { pos_4_rel = pos_4 - chrom_length; } else { pos_4_rel = pos_4; } } else // ( _gen_unit == plasmid ) { if ( pos_1 <= pos_2 ) { if ( pos_4 >= pos_1 ) { pos_4 += segment_length; } } else { if ( pos_4 >= chrom_length ) { pos_4 += pos_2_rel; } } if ( pos_4 >= chrom_length ) { pos_4_rel = pos_4 - chrom_length; } else { pos_4_rel = pos_4; } } invert = ( _indiv->_mut_prng->random( 2 ) == 0 ); if ( ( _gen_unit == chromosome && pos_4 >= chrom_length ) || // If inter GU translocation ( _gen_unit == plasmid && pos_4 < chrom_length ) ) { //~ printf( "Translocation from the %s to the %s\n", _gen_unit==chromosome?"chromosome":"plasmid", _gen_unit==chromosome?"plasmid":"chromosome" ); //~ printf( " Chromosome length : %"PRId32" Plasmid length : %"PRId32" Total length : %"PRId32"\n", //~ chrom_length, plasmid->get_dna()->get_length(), chrom_length + plasmid->get_dna()->get_length() ); //~ printf( " %"PRId32" %"PRId32" %"PRId32" %"PRId32" (length : %"PRId32")\n", pos_1, pos_2, pos_3, pos_4, segment_length ); //~ printf( " former pos : %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", former_pos_1, former_pos_2, former_pos_3, former_pos_4 ); if ( do_inter_GU_translocation( pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel, invert ) ) { // Report the translocation if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_translocation( pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel, segment_length, invert ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(TRANS), segment_length, _length ); } } } else { if ( pos_1_rel > pos_2_rel ) { } //~ printf( "Translocation intra %s\n", _gen_unit==chromosome?"chromosome":"plasmid" ); //~ printf( " Chromosome length : %"PRId32" Plasmid length : %"PRId32" Total length : %"PRId32"\n", //~ chrom_length, plasmid->get_dna()->get_length(), chrom_length + plasmid->get_dna()->get_length() ); //~ printf( " %"PRId32" %"PRId32" %"PRId32" %"PRId32" (length : %"PRId32")\n", pos_1, pos_2, pos_3, pos_4, segment_length ); //~ printf( " former pos : %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", former_pos_1, former_pos_2, former_pos_3, former_pos_4 ); if ( do_translocation( pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel, invert ) ) { // Report the translocation if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_translocation( pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel, segment_length, invert ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(TRANS), segment_length, _length ); } } } } else // ( ! ae_common::params->get_allow_plasmids() ) { pos_1 = _indiv->_mut_prng->random( _length ); pos_2 = _indiv->_mut_prng->random( _length ); if ( pos_1 == pos_2 ) return NULL; // As it will be seen in do_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, bool invert ), // translocating segment [pos_1, pos_2] is the same as translocating segment [pos_2, pos_1] // Since OriC must be at position 0, we will always translocate segment [pos_1, pos_2] with pos_1 < pos_2 if ( pos_1 > pos_2 ) ae_utils::exchange( pos_1, pos_2 ); segment_length = pos_2 - pos_1; // Generate a position between pos_1 and pos_2 pos_3 = pos_1 + _indiv->_mut_prng->random( segment_length ); // Generate a position that is NOT between pos_1 and pos_2 pos_4 = _indiv->_mut_prng->random( _length - segment_length ); if ( pos_4 >= pos_1 ) pos_4 += segment_length; invert = ( _indiv->_mut_prng->random( 2 ) == 0 ); if ( do_translocation( pos_1, pos_2, pos_3, pos_4, invert ) ) { // Report the translocation if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_translocation( pos_1, pos_2, pos_3, pos_4, segment_length, invert ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(TRANS), segment_length, _length ); } } } return mut; } ae_mutation* ae_dna::do_inversion( void ) { ae_mutation* mut = NULL; int32_t pos_1, pos_2; int32_t segment_length; pos_1 = _indiv->_mut_prng->random( _length ); pos_2 = _indiv->_mut_prng->random( _length ); if ( pos_1 == pos_2 ) return NULL; // Invert everything <=> Invert nothing! if ( pos_1 > pos_2 ) ae_utils::exchange( pos_1, pos_2 ); // Invert the segment that don't contain OriC segment_length = pos_2 - pos_1; if( do_inversion( pos_1, pos_2 ) == true ) { // Report the inversion if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { mut = new ae_mutation(); mut->report_inversion( pos_1, pos_2, segment_length ); } // Write a line in rearrangement logfile if ( _exp_m->get_output_m()->is_logged( LOG_REAR ) == true ) { fprintf( _exp_m->get_output_m()->get_log( LOG_REAR ), "%"PRId32" %"PRId32" %"PRId8" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), int8_t(INV), segment_length, _length ); } } return mut; } ae_mutation* ae_dna::do_insertion( const char* seq_to_insert, int32_t seq_length /*= -1*/ ) { ae_mutation* mut = NULL; // Compute seq_length if not known if ( seq_length == -1 ) { seq_length = strlen( seq_to_insert ); } // Where to insert the sequence int32_t pos = _indiv->_mut_prng->random( _length ); if ( do_insertion( pos, seq_to_insert, seq_length ) ) { if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { // Report the insertion mut = new ae_mutation(); mut->report_insertion( pos, seq_length, seq_to_insert ); } } return mut; } bool ae_dna::do_duplication( int32_t pos_1, int32_t pos_2, int32_t pos_3 ) // Duplicate segment [pos_1; pos_2[ and insert the duplicate before pos_3 { char* duplicate_segment = NULL; int32_t seg_length; if ( pos_1 < pos_2 ) { // // pos_1 pos_2 -> 0- // | | - - // 0---------------------------------> - - // =============== - - pos_1 // tmp (copy) - - // ----- | // pos_2 <-' // seg_length = pos_2 - pos_1; duplicate_segment = new char[seg_length+1]; memcpy( duplicate_segment, &_data[pos_1], seg_length ); duplicate_segment[seg_length] = '\0'; } else // if ( pos_1 >= pos_2 ) { // The segment to duplicate includes the replication origin. // The copying process will be done in two steps. // // ,-> // pos_2 pos_1 | -> 0- // | | - - pos_2 // 0---------------------------------> pos_1 - - // ====== ======= - - // tmp2 tmp1 - - // ----- // // int32_t tmp1_len = _length - pos_1; int32_t tmp2_len = pos_2; seg_length = tmp1_len + tmp2_len; duplicate_segment = new char[seg_length+1]; memcpy( duplicate_segment, &_data[pos_1], tmp1_len ); // Copy tmp1 memcpy( &duplicate_segment[tmp1_len], _data, tmp2_len ); // Copy tmp2 duplicate_segment[seg_length] = '\0'; } // Create a copy of the promoters beared by the segment to be duplicated // (they will be inserted in the individual's RNA list later) ae_list** duplicated_promoters = new ae_list*[2]; duplicated_promoters[LEADING] = new ae_list(); duplicated_promoters[LAGGING] = new ae_list(); _gen_unit->duplicate_promoters_included_in( pos_1, pos_2, duplicated_promoters ); _gen_unit->remove_promoters_around( pos_3 ); insert( pos_3, duplicate_segment, seg_length ); if ( _length >= PROM_SIZE ) { if ( _length - seg_length < PROM_SIZE ) { // Special case where the genome was smaller than a promoter before the insertion and greater than (or as big as) a promoter after the insertion. // In that case, we must look for new promoters thoroughly on the whole genome using locate_promoters _gen_unit->locate_promoters(); } else { _gen_unit->move_all_promoters_after( pos_3, seg_length ); _gen_unit->insert_promoters_at( duplicated_promoters, pos_3 ); _gen_unit->look_for_new_promoters_around( pos_3 ); _gen_unit->look_for_new_promoters_around( pos_3 + seg_length ); } } delete [] duplicate_segment; delete duplicated_promoters[LEADING]; delete duplicated_promoters[LAGGING]; delete [] duplicated_promoters; return true; } bool ae_dna::do_deletion( int32_t pos_1, int32_t pos_2 ) // Delete segment going from pos_1 (included) to pos_2 (excluded) { if ( pos_1 < pos_2 ) { // // pos_1 pos_2 -> 0- // | | - - // 0---------------------------------> - - // =============== - - pos_1 // tmp (copy) - - // ----- | // pos_2 <-' // int32_t segment_length = pos_2 - pos_1; // Remove promoters containing at least one nucleotide from the sequence to delete _gen_unit->remove_promoters_around( pos_1, pos_2 ); // Delete the sequence between pos_1 and pos_2 remove( pos_1, pos_2 ); // Update promoter list if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( pos_1, -segment_length ); _gen_unit->look_for_new_promoters_around( pos_1 ); } } else // if ( pos_1 >= pos_2 ) { // The segment to delete includes the replication origin. // The deletion process will be done in two steps. // // ,-> // pos_2 pos_1 | -> 0- // | | - - pos_2 // 0---------------------------------> pos_1 - - // ===== ======= - - // tmp2 tmp1 - - // ----- // // //int32_t segment_length = _length + pos_2 - pos_1; //useless variable // Remove promoters containing at least one nucleotide from the sequence to delete _gen_unit->remove_promoters_around( pos_1, pos_2 ); // Delete the sequence between pos_1 and pos_2 remove( pos_1, _length ); // delete tmp1 from genome remove( 0, pos_2 ); // delete tmp2 from genome // Update promoter list if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( 0, -pos_2 ); _gen_unit->look_for_new_promoters_around( 0 ); } } return true; } bool ae_dna::do_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, bool invert ) { // Provided that OriC must be at position 0 // // 1) Note that in Case 1 (without inversion), whichever position comes first, translocating segment [pos_1->pos_2] // to pos_4 through pos_3 is always equivalent to rearrange the sequences from an ABCDE order to ADCBE // 2) In Case 2, depending on which position comes first, we may have the following rearrangements : // (ABCDE => ADB'C'E) or (ABCDE => AC'D'BE) where X' stands for "inverted X" // // Case 1 : Without inversion // // A B C D E A D C B E // |----->=======[>=======>-------[>-------| => |----->-------[>=======>=======[>-------| // pos_1 pos_3 pos_2 pos_4 // // A B C D E A D C B E // |=====>-------[>------->=======[>=======| => |=====>=======[>------->-------[>=======| // pos_2 pos_4 pos_1 pos_3 // // A B C D E A D C B E // |====[>========>-------[>------->=======| => |=====[>------->-------[>=======[>=======| // pos_3 pos_2 pos_4 pos_1 // // A B C D E A D C B E // |----[>-------->=======[>=======>-------| => |-----[>=======>=======[>-------[>-------| // pos_4 pos_1 pos_3 pos_2 // // // Case 2 : With inversion // // Case 2.A // // A B C D E A D B' C' E // |----->=======[>=======>-------<]-------| => |----->-------<]=======<=======<]-------| // pos_1 pos_3 pos_2 pos_4 // // A B C D E A D B' C' E // |=====>-------[>------->=======<]=======| => |=====>=======<]-------<-------<]=======| // pos_2 pos_4 pos_1 pos_3 // // // Case 2.B // // A B C D E A C' D' B E // |====[>========>-------<]------->=======| => |=====[>-------<-------[>=======>=======| // pos_3 pos_2 pos_4 pos_1 // // A B C D E A C' D' B E // |----<]-------->=======[>=======>-------| => |-----<]=======>=======<]------->-------| // pos_4 pos_1 pos_3 pos_2 // // Determine which position comes first and do the corresponding rearrangement int32_t pos_min = ae_utils::min( pos_1, ae_utils::min( pos_2, ae_utils::min( pos_3, pos_4 ) ) ); if ( ! invert ) { if ( pos_min == pos_1 ) { ABCDE_to_ADCBE( pos_1, pos_3, pos_2, pos_4 ); } else if ( pos_min == pos_2 ) { ABCDE_to_ADCBE( pos_2, pos_4, pos_1, pos_3 ); } else if ( pos_min == pos_3 ) { ABCDE_to_ADCBE( pos_3, pos_2, pos_4, pos_1 ); } else // if ( pos_min == pos_4 ) { ABCDE_to_ADCBE( pos_4, pos_1, pos_3, pos_2 ); } } else // invert { if ( pos_min == pos_1 ) { ABCDE_to_ADBpCpE( pos_1, pos_3, pos_2, pos_4 ); } else if ( pos_min == pos_2 ) { ABCDE_to_ADBpCpE( pos_2, pos_4, pos_1, pos_3 ); } else if ( pos_min == pos_3 ) { ABCDE_to_ACpDpBE( pos_3, pos_2, pos_4, pos_1 ); } else // if ( pos_min == pos_4 ) { ABCDE_to_ACpDpBE( pos_4, pos_1, pos_3, pos_2 ); } } return true; } bool ae_dna::do_inter_GU_translocation( int32_t pos_1_rel, int32_t pos_2_rel, int32_t pos_3_rel, int32_t pos_4_rel, bool invert ) { // TODO check GU lengths according to positions and size limit int32_t segment_length = ae_utils::mod( pos_2_rel - pos_1_rel, _length ); if ( pos_1_rel == pos_2_rel ) // TODO : should'nt that raise an error? { return false; } // Do not allow translocation if it would decrease the size of the origin GU below a threshold if ( (_length - segment_length ) < _gen_unit->get_min_gu_length() ) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" TRANS %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), segment_length, 0, _length, _indiv->get_amount_of_dna() ); } return false; } // ae_genetic_unit* chromosome = _indiv->get_genetic_unit( 0 ); ae_genetic_unit* plasmid = _indiv->get_genetic_unit( 1 ); ae_genetic_unit* destination_GU = ( _gen_unit == chromosome )? plasmid : chromosome; int32_t dest_gu_size_before = destination_GU->get_seq_length(); // Do not allow translocation if it would increase the size of the receiving GU below a threshold if (dest_gu_size_before + segment_length > destination_GU->get_max_gu_length()) { if ( _exp_m->get_output_m()->is_logged( LOG_BARRIER ) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log( LOG_BARRIER ), "%"PRId32" %"PRId32" TRANS %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), segment_length, 0, dest_gu_size_before, _indiv->get_amount_of_dna() ); } return false; } //~ // Provided that OriC must be at position 0 //~ // //~ // Gen unit 1 Gen unit 2 Gen unit 1 Gen unit 2 //~ // //~ // Case 1: inter_GU_ABCDE_to_ACDBE //~ // //~ // A B C D E A C D B E //~ // |---->=====>----| |----[>----| |---->----| |----[>====[>----| //~ // p1r p2r p4r p1r p4r p4r+(p2r-p1r) //~ // //~ // //~ // Case 2: inter_GU_ABCDE_to_BDCAE //~ // //~ // A B C D E B D C A E //~ // |====>----->====| |----[>----| |-----| |----[>====[>====>----| //~ // p2r p1r p4r p4r //~ // p4r+(_length-p1r) //~ // p4r+(_length-(p1r-p2r)) // Determine which position comes first and do the corresponding rearrangement // int32_t pos_min = ae_utils::min( pos_1, pos_2 ); if ( ! invert ) { if ( pos_1_rel < pos_2_rel ) { // if ( _gen_unit == _indiv->get_genetic_unit( 0 ) /*chromosome*/ ) // { // printf( "do_inter_GU_translocation( %"PRId32", %"PRId32", %"PRId32", %"PRId32", %s ) (sizes : %"PRId32" %"PRId32" %"PRId32")\n", // pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel + _length, invert?"invert":"plain", // _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // _indiv->get_genetic_unit( 1 )->get_dna()->get_length(), // _indiv->get_amount_of_dna() ); // } // else // { // printf( "do_inter_GU_translocation( %"PRId32", %"PRId32", %"PRId32", %"PRId32", %s ) (sizes : %"PRId32" %"PRId32" %"PRId32")\n", // pos_1_rel + _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // pos_2_rel + _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // pos_3_rel + _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // pos_4_rel, invert?"invert":"plain", // _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // _indiv->get_genetic_unit( 1 )->get_dna()->get_length(), // _indiv->get_amount_of_dna() ); // } segment_length = ae_utils::mod( pos_2_rel - pos_1_rel, _length ); inter_GU_ABCDE_to_ACDBE( pos_1_rel, pos_2_rel, pos_4_rel ); } else { // if ( _gen_unit == _indiv->get_genetic_unit( 0 ) /*chromosome*/ ) // { // printf( "do_inter_GU_translocation( %"PRId32", %"PRId32", %"PRId32", %"PRId32", %s ) (sizes : %"PRId32" %"PRId32" %"PRId32")\n", // pos_1_rel, pos_2_rel, pos_3_rel, pos_4_rel + _length, invert?"invert":"plain", // _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // _indiv->get_genetic_unit( 1 )->get_dna()->get_length(), // _indiv->get_amount_of_dna() ); // } // else // { // printf( "do_inter_GU_translocation( %"PRId32", %"PRId32", %"PRId32", %"PRId32", %s ) (sizes : %"PRId32" %"PRId32" %"PRId32")\n", // pos_1_rel + _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // pos_2_rel + _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // pos_3_rel + _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // pos_4_rel, invert?"invert":"plain", // _indiv->get_genetic_unit( 0 )->get_dna()->get_length(), // _indiv->get_genetic_unit( 1 )->get_dna()->get_length(), // _indiv->get_amount_of_dna() ); // } segment_length = ae_utils::mod( pos_1_rel - pos_2_rel, _length ); inter_GU_ABCDE_to_BDCAE( pos_2_rel, pos_1_rel, pos_4_rel ); } } else // invert { if ( pos_1_rel < pos_2_rel ) { segment_length = ae_utils::mod( pos_2_rel - pos_1_rel, _length ); do_inversion( pos_1_rel, pos_2_rel ); inter_GU_ABCDE_to_ACDBE( pos_1_rel, pos_2_rel, pos_4_rel ); } else // pos_1_rel > pos_2_rel { segment_length = ae_utils::mod( pos_1_rel - pos_2_rel, _length ); if (pos_2_rel != 0) { do_inversion( 0, pos_2_rel); } if (pos_1_rel != _length) { do_inversion( pos_1_rel, _length); } inter_GU_ABCDE_to_BDCAE( pos_2_rel, pos_1_rel, pos_4_rel ); } } return true; } bool ae_dna::do_inversion( int32_t pos_1, int32_t pos_2 ) // Invert segment going from pos_1 (included) to pos_2 (excluded) // Exemple : sequence 011101001100 => 110011010001 { if ( pos_1 == pos_2 ) return false; // Invert everything <=> Invert nothing! assert( pos_1 < pos_2 ); // // pos_1 pos_2 -> 0- // | | - - // 0---------------------------------> - - // =============== - - pos_1 // tmp (copy) - - // ----- | // pos_2 <-' // int32_t seg_length = pos_2 - pos_1; // Create the inverted sequence char* inverted_segment = NULL; inverted_segment = new char[seg_length+1]; for ( int32_t i = 0, j = pos_2 - 1 ; i < seg_length ; i++, j-- ) { if ( _data[j] == '0' ) inverted_segment[i] = '1'; else inverted_segment[i] = '0'; } inverted_segment[seg_length] = '\0'; // Remove promoters that included a breakpoint _gen_unit->remove_promoters_around( pos_1 ); _gen_unit->remove_promoters_around( pos_2 ); // Invert the sequence replace( pos_1, inverted_segment, seg_length ); // Update promoter list if ( _length >= PROM_SIZE ) { _gen_unit->invert_promoters_included_in( pos_1, pos_2 ); _gen_unit->look_for_new_promoters_around( pos_1 ); _gen_unit->look_for_new_promoters_around( pos_2 ); } delete [] inverted_segment; return true; } bool ae_dna::do_insertion( int32_t pos, const char* seq_to_insert, int32_t seq_length ) { // Remove the promoters that will be broken _gen_unit->remove_promoters_around( pos ); // Insert the sequence insert( pos, seq_to_insert, seq_length ); // Look for new promoters if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( pos, seq_length ); _gen_unit->look_for_new_promoters_around( pos, pos + seq_length ); } return true; } ae_mutation* ae_dna::do_ins_HT( int32_t parent_id ) { ae_mutation* mut = NULL; int32_t nb_indivs = _exp_m->get_pop()->get_nb_indivs(); // Insertion transfer // Requirements: // * A circular exogenote => an alignment on the donor chromosome // * An alignment between the exogenote and the endogenote // 1) Draw a random donor (uniform drawing). // We use the rank because indivs are sorted by rank (1 for the worst, POP_SIZE for the best). ae_individual * donor = NULL; do donor = _exp_m->get_pop()->get_indiv_by_rank( _exp_m->get_sel()->get_prng()->random( nb_indivs ) + 1 ); while ( donor->get_id() == parent_id ); // 2) Look for an alignment within the donor genome ae_vis_a_vis* alignment_1 = NULL; ae_dna* donor_dna = donor->get_genetic_unit( 0 )->get_dna(); int32_t nb_pairs_1 = (int32_t)( ceil( donor_dna->get_length() * _indiv->get_neighbourhood_rate() ) ); alignment_1 = donor_dna->search_alignment( donor_dna, nb_pairs_1, DIRECT ); if ( alignment_1 != NULL ) { // 3) Make a copy of the sequence to be transferred (the exogenote) ae_genetic_unit* exogenote = donor_dna->copy_into_new_GU( alignment_1->get_i_1(), alignment_1->get_i_2() ); // 4) Look for an alignments between the exogenote and the endogenote ae_vis_a_vis* alignment_2 = NULL; int32_t nb_pairs_2 = (int32_t)( ceil( get_length() * _indiv->get_neighbourhood_rate() ) ); alignment_2 = exogenote->get_dna()->search_alignment( this, nb_pairs_2, BOTH_SENSES ); if ( alignment_2 != NULL ) { int32_t gu_length_before = _length; int32_t gu_length_after = gu_length_before + exogenote->get_dna()->get_length(); int32_t genome_length_before = _indiv->get_amount_of_dna(); int32_t genome_length_after = genome_length_before + exogenote->get_dna()->get_length(); if ( ( genome_length_after > _indiv->get_max_genome_length() ) || ( gu_length_after > _gen_unit->get_max_gu_length() ) ) { if ( _exp_m->get_output_m()->is_logged(LOG_BARRIER) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log(LOG_BARRIER), "%"PRId32" %"PRId32" INS_TRANSFER %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), exogenote->get_dna()->get_length(), 0, gu_length_before, genome_length_before ); } } else { insert_GU( exogenote, alignment_2->get_i_2(), alignment_2->get_i_1(), (alignment_2->get_sense() == INDIRECT) ); //~ fprintf( logfile, "RESULT:\n%s\n\n\n", new_indiv_dna->get_data() ); //~ fflush( logfile ); // Write a line in transfer logfile if ( _exp_m->get_output_m()->is_logged(LOG_TRANSFER) == true ) { fprintf( _exp_m->get_output_m()->get_log(LOG_TRANSFER), "%"PRId32" %"PRId32" %"PRId32" 0 %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId16" %"PRId32" %"PRId32" %"PRId16"\n", _exp_m->get_num_gener(), _indiv->get_id(), donor->get_id(), exogenote->get_dna()->get_length(), 0, genome_length_before, get_length(), alignment_1->get_i_1(), alignment_1->get_i_2(), alignment_1->get_score(), alignment_2->get_i_1(), alignment_2->get_i_2(), alignment_2->get_score() ); } #ifdef BIG_DEBUG ae_common::sim->get_logs()->flush(); _indiv->assert_promoters(); _indiv->assert_promoters_order(); #endif if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { char* donor_seq; if(alignment_2->get_sense() == DIRECT) { donor_seq = exogenote->get_dna()->get_subsequence(alignment_2->get_i_1(),alignment_2->get_i_1(), LEADING); } else { donor_seq = exogenote->get_dna()->get_subsequence(alignment_2->get_i_1(),alignment_2->get_i_1(), LAGGING); } // Report the transfer mut = new ae_mutation(); mut->report_ins_HT( alignment_1->get_i_1(), alignment_1->get_i_2(), alignment_2->get_i_1(), alignment_2->get_i_2(), exogenote->get_dna()->get_length(), alignment_1->get_score(),alignment_2->get_score(), donor->get_id(), alignment_2->get_sense(), donor_seq); delete [] donor_seq; } } delete alignment_2; } delete exogenote; delete alignment_1; } return mut; } ae_mutation* ae_dna::do_repl_HT( int32_t parent_id ) { ae_mutation* mut = NULL; int32_t nb_indivs = _exp_m->get_pop()->get_nb_indivs(); // Replacement transfer // Requirements: // * 2 distinct alignments between the (linear) exogenote and the endogenote //printf("Indiv: %d\n",new_indiv->get_id()); // 1) Draw a random donor (uniform drawing). // We use the rank because indivs are sorted by rank (1 for the worst, POP_SIZE for the best). ae_individual * donor = NULL; do donor = _exp_m->get_pop()->get_indiv_by_rank( _exp_m->get_sel()->get_prng()->random( nb_indivs ) + 1 ); while ( donor->get_id() == parent_id ); // 2) Look for an alignment between the parent genome and the donor genome ae_vis_a_vis* alignment_1 = NULL; ae_vis_a_vis* alignment_2 = NULL; ae_dna* donor_dna = donor->get_genetic_unit( 0 )->get_dna(); ae_sense sense = (_exp_m->get_sel()->get_prng()->random() < 0.5) ? DIRECT : INDIRECT; int32_t nb_pairs_1 = (int32_t)( ceil( get_length() * _indiv->get_neighbourhood_rate() ) ); int32_t nb_pairs_2 = (int32_t)( ceil( get_length() * _indiv->get_neighbourhood_rate() ) ); int8_t research_sense = 0; alignment_1 = search_alignment( donor_dna, nb_pairs_1, sense ); if ( alignment_1 != NULL ) { //printf("\talignement 1: %d %d\n", alignment_1->get_i_1(), alignment_1->get_i_2()); if( _exp_m->get_repl_HT_with_close_points()) { //printf("Id: %d\n",new_indiv->get_id()); alignment_2 = search_alignment_around_positions( donor_dna, alignment_1->get_i_1(), alignment_1->get_i_2(), alignment_1->get_sense(), research_sense); if ( alignment_2 != NULL && alignment_2->get_i_1() == alignment_1->get_i_1() ) { delete alignment_2; alignment_2 = NULL; } if ( alignment_2 != NULL ) { // If the second alignment is found upstream of the first alignment, they are inverse to facilitate if(research_sense == -1) { ae_vis_a_vis* tmp_alignment = new ae_vis_a_vis( *alignment_1 ); alignment_1->copy( alignment_2 ); alignment_2->copy( tmp_alignment ); delete tmp_alignment; } } } else { // Look for a second alignement between the parent and the donor (must be different from alignment_1) while ( alignment_2 == NULL && nb_pairs_2 > 0 ) { alignment_2 = search_alignment( donor_dna, nb_pairs_2, sense ); // Forbid the replacement of the whole genome of the parent if ( alignment_2 != NULL && alignment_2->get_i_1() == alignment_1->get_i_1() ) { delete alignment_2; alignment_2 = NULL; } } } // If both alignments were found, proceed to the transfer if ( alignment_2 != NULL ) { int32_t gu_length_before = _length; int32_t exogenote_length = ae_utils::mod( alignment_2->get_i_2() - alignment_1->get_i_2() - 1, donor_dna->get_length() ) + 1; int32_t replaced_seq_length = ae_utils::mod( alignment_2->get_i_1() - alignment_1->get_i_1() - 1, gu_length_before ) + 1; int32_t gu_length_after = gu_length_before - replaced_seq_length + exogenote_length; int32_t genome_length_before = _indiv->get_amount_of_dna(); int32_t genome_length_after = genome_length_before - replaced_seq_length + exogenote_length; if ( genome_length_after < _indiv->get_min_genome_length() || genome_length_after > _indiv->get_max_genome_length() || gu_length_after < _gen_unit->get_min_gu_length() || gu_length_after > _gen_unit->get_max_gu_length() ) { if ( _exp_m->get_output_m()->is_logged(LOG_BARRIER) == true ) { // Write an entry in the barrier log file fprintf( _exp_m->get_output_m()->get_log(LOG_BARRIER), "%"PRId32" %"PRId32" REPL_TRANSFER %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", _exp_m->get_num_gener(), _indiv->get_id(), exogenote_length, replaced_seq_length, gu_length_before, genome_length_before ); } } else { // 3) Make a copy of the sequence to be transferred (the exogenote) ae_genetic_unit* exogenote = NULL; if ( sense == DIRECT ) { exogenote = donor_dna->copy_into_new_GU( alignment_1->get_i_2(), alignment_2->get_i_2() ); } else { exogenote = donor_dna->copy_into_new_GU( alignment_2->get_i_2(), alignment_1->get_i_2() ); } char* alignment1_parent_dna,* alignment2_parent_dna,* alignment1_donor_dna,* alignment2_donor_dna; if ( _exp_m->get_output_m()->is_logged(LOG_TRANSFER) == true ) { if( sense == DIRECT) { alignment1_parent_dna = get_subsequence( alignment_1->get_i_1(), alignment_1->get_i_1() + 2*_indiv->get_align_w_zone_h_len() + _indiv->get_align_max_shift(), LEADING); alignment2_parent_dna = get_subsequence( alignment_2->get_i_1(), alignment_2->get_i_1() + 2*_indiv->get_align_w_zone_h_len() + _indiv->get_align_max_shift(), LEADING); alignment1_donor_dna = donor_dna->get_subsequence( alignment_1->get_i_2(), alignment_1->get_i_2() + 2*_indiv->get_align_w_zone_h_len() + _indiv->get_align_max_shift(), LEADING); alignment2_donor_dna = donor_dna->get_subsequence( alignment_2->get_i_2(), alignment_2->get_i_2() + 2*_indiv->get_align_w_zone_h_len() + _indiv->get_align_max_shift(), LEADING); } else { alignment1_parent_dna = get_subsequence( alignment_1->get_i_1(), alignment_1->get_i_1() + 2*_indiv->get_align_w_zone_h_len() + _indiv->get_align_max_shift(), LEADING); alignment2_parent_dna = get_subsequence( alignment_2->get_i_1(), alignment_2->get_i_1() + 2*_indiv->get_align_w_zone_h_len() + _indiv->get_align_max_shift(), LEADING); alignment1_donor_dna = donor_dna->get_subsequence( alignment_1->get_i_2(), alignment_1->get_i_2() - 2*_indiv->get_align_w_zone_h_len() - _indiv->get_align_max_shift(), LAGGING); alignment2_donor_dna = donor_dna->get_subsequence( alignment_2->get_i_2(), alignment_2->get_i_2() - 2*_indiv->get_align_w_zone_h_len() - _indiv->get_align_max_shift(), LAGGING); } } // Delete the sequence to be replaced do_deletion( alignment_1->get_i_1(), alignment_2->get_i_1() ); if ( alignment_1->get_i_1() < alignment_2->get_i_1() ) { insert_GU( exogenote, alignment_1->get_i_1(), 0, sense == INDIRECT ); } else { insert_GU( exogenote, 0, 0, sense == INDIRECT ); } // Write a line in transfer logfile if ( _exp_m->get_output_m()->is_logged(LOG_TRANSFER) == true ) { fprintf( _exp_m->get_output_m()->get_log(LOG_TRANSFER), "%"PRId32" %"PRId32" %"PRId32" 1 %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId16" %"PRId32" %"PRId32" %"PRId16" %"PRId32" %"PRId32" %"PRId16" %"PRId16"\n", _exp_m->get_num_gener(), _indiv->get_id(), donor->get_id(), exogenote->get_dna()->get_length(), replaced_seq_length, genome_length_before, get_length(), (int16_t) alignment_1->get_sense(), alignment_1->get_i_1(), alignment_1->get_i_2(), alignment_1->get_score(), alignment_2->get_i_1(), alignment_2->get_i_2(), alignment_2->get_score() , (int16_t) research_sense); fprintf(_exp_m->get_output_m()->get_log(LOG_TRANSFER), "\tAlignment 1:\n\t\t%s\n\t\t%s\n\tAlignment 2:\n\t\t%s\n\t\t%s\n",alignment1_parent_dna, alignment1_donor_dna, alignment2_parent_dna, alignment2_donor_dna); delete [] alignment1_parent_dna; delete [] alignment2_parent_dna; delete [] alignment1_donor_dna; delete [] alignment2_donor_dna; } if ( _exp_m->get_output_m()->get_record_tree() && _exp_m->get_output_m()->get_tree_mode() == NORMAL ) { // Report the transfer char* donor_seq; if(alignment_2->get_sense() == DIRECT) { donor_seq = exogenote->get_dna()->get_subsequence(0,exogenote->get_dna()->get_length(), LEADING); } else { donor_seq = exogenote->get_dna()->get_subsequence(0,exogenote->get_dna()->get_length(), LAGGING); } mut = new ae_mutation(); mut->report_repl_HT( alignment_1->get_i_1(), alignment_1->get_i_2(), alignment_2->get_i_1(), alignment_2->get_i_2(), replaced_seq_length, exogenote->get_dna()->get_length(), alignment_1->get_score(),alignment_2->get_score(), donor->get_id(), alignment_2->get_sense(),donor_seq ); delete [] donor_seq; } delete exogenote; } delete alignment_2; } delete alignment_1; } return mut; } bool ae_dna::do_ins_HT( int32_t pos, const char* seq_to_insert, int32_t seq_length ) { // Remove the promoters that will be broken _gen_unit->remove_promoters_around( pos ); // Insert the sequence insert( pos, seq_to_insert, seq_length ); // Look for new promoters if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( pos, seq_length ); _gen_unit->look_for_new_promoters_around( pos, pos + seq_length ); } return true; } bool ae_dna::do_repl_HT( int32_t pos1, int32_t pos2, const char* seq_to_insert, int32_t seq_length ) { // Remove the promoters that will be broken _gen_unit->remove_promoters_around( pos1 ); // Delete the replaced segment do_deletion( pos1, pos2 ); // Insert the sequence int32_t insertion_position; if(pos1 < pos2) { insertion_position = pos1; } else { insertion_position = 0; } insert(insertion_position, seq_to_insert, seq_length ); // Look for new promoters if ( _length >= PROM_SIZE ) { _gen_unit->move_all_promoters_after( insertion_position, seq_length ); _gen_unit->look_for_new_promoters_around( insertion_position, insertion_position + seq_length ); } return true; } void ae_dna::undergo_this_mutation( ae_mutation * mut ) { if( mut == NULL ) return; int32_t pos1, pos2, pos3, pos4; int32_t length; bool invert; char *seq = NULL; ae_sense sense; switch( mut->get_mut_type() ) { case SWITCH: mut->get_infos_point_mutation( &pos1 ); do_switch( pos1 ); break; case S_INS: mut->get_infos_small_insertion( &pos1, &length ); seq = new char[length + 1]; mut->get_sequence_small_insertion( seq ); do_small_insertion( pos1, length, seq ); delete [] seq; break; case S_DEL: mut->get_infos_small_deletion( &pos1, &length ); do_small_deletion( pos1, length ); break; case DUPL: mut->get_infos_duplication( &pos1, &pos2, &pos3 ); do_duplication( pos1, pos2, pos3 ); break; case DEL: mut->get_infos_deletion( &pos1, &pos2 ); do_deletion( pos1, pos2 ); break; case TRANS: mut->get_infos_translocation( &pos1, &pos2, &pos3, &pos4, &invert ); if ( _indiv->get_with_alignments() ) { // Extract the segment to be translocated ae_genetic_unit* translocated_segment = extract_into_new_GU( pos1, pos2 ); // Reinsert the segment insert_GU( translocated_segment, pos3, pos4, invert ); } else { do_translocation( pos1, pos2, pos3, pos4, invert ); } break; case INV: mut->get_infos_inversion( &pos1, &pos2 ); do_inversion( pos1, pos2 ); break; case INS_HT: mut->get_infos_ins_HT( &pos1, &pos2, &pos3, &pos4, &sense, &length ); seq = new char[length + 1]; mut->get_sequence_ins_HT( seq ); do_ins_HT( pos4, seq, length ); delete [] seq; break; case REPL_HT: mut->get_infos_repl_HT( &pos1, &pos2, &pos3, &pos4, &sense, &length ); seq = new char[length + 1]; mut->get_sequence_repl_HT( seq ); do_repl_HT( pos1, pos3, seq, length ); delete [] seq; break; default : fprintf( stderr, "ERROR, invalid mutation type in file %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } void ae_dna::compute_statistical_data( void ) // ************************************************************************************************* // WARNING Deprecated // ************************************************************************************************* // Values that are computed : // Number of each type of mutations and rearrangements undergone by the individual // Number of small mutations // Number of rearrangements { assert( false ); //~ ae_list_node* mut_node = _replic_report->_mutations->get_first(); //~ ae_mutation* mut; //~ while ( mut_node != NULL ) //~ { //~ mut = mut_node->get_obj(); //~ switch( mut->get_mut_type() ) //~ { //~ case SWITCH : //~ _replic_report->_nb_switch++; //~ break; //~ case S_INS : //~ _replic_report->_nb_small_insertions++; //~ break; //~ case S_DEL : //~ _replic_report->_nb_small_deletions++; //~ break; //~ case DUPL : //~ _replic_report->_nb_duplications++; //~ break; //~ case DEL : //~ _replic_report->_nb_deletions++; //~ break; //~ case TRANS : //~ _replic_report->_nb_translocations++; //~ // TODO : if inter GU ... //~ break; //~ case INV : //~ _replic_report->_nb_inversions++; //~ break; //~ } //~ mut_node = mut_node->get_next(); //~ } } /* static */ void ae_dna::set_GU( ae_list** rna_list, ae_genetic_unit* GU ) { ae_list_node* rna_node = NULL; ae_rna* rna = NULL; for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { rna_node = rna_list[strand]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); rna->set_genetic_unit( GU ); rna_node = rna_node->get_next(); } } } ae_genetic_unit* ae_dna::extract_into_new_GU( int32_t pos_1, int32_t pos_2 ) { assert( pos_1 < pos_2 ); int32_t seq_length = pos_2 - pos_1; // ==================== Remove/Extract promoters from old sequence ==================== // Remove promoters around breakpoints _gen_unit->remove_promoters_around( pos_1 ); _gen_unit->remove_promoters_around( pos_2 ); // Remove promoters belonging to the sequence (to be extracted) from the "old" GU // and put them in a stand-alone promoter list (with indices ranging from 0 to seq_length-1) ae_list** proms_GU_1 = new ae_list*[2]; proms_GU_1[LEADING] = new ae_list(); proms_GU_1[LAGGING] = new ae_list(); _gen_unit->extract_promoters_included_in( pos_1, pos_2, proms_GU_1 ); ae_genetic_unit::shift_promoters( proms_GU_1, -pos_1, _length ); // ==================== Manage sequences ==================== // Copy the sequence in a stand-alone char* (size must be multiple of BLOCK_SIZE) int32_t length_GU_1 = seq_length; char* sequence_GU_1 = new char[nb_blocks( length_GU_1 ) * BLOCK_SIZE]; memcpy( sequence_GU_1, &_data[pos_1], length_GU_1 * sizeof(char) ); sequence_GU_1[length_GU_1] = '\0'; // Remove the sequence from the "old" GU int32_t length_GU_0 = _length - seq_length; char* sequence_GU_0 = new char[nb_blocks( length_GU_0 ) * BLOCK_SIZE]; memcpy( sequence_GU_0, _data, pos_1 * sizeof(char) ); memcpy( &sequence_GU_0[pos_1], &_data[pos_2], (_length - pos_2) * sizeof(char) ); sequence_GU_0[length_GU_0] = '\0'; set_data( sequence_GU_0, length_GU_0 ); // ==================== Create the new genetic unit ==================== ae_genetic_unit* GU_1 = new ae_genetic_unit( _indiv, sequence_GU_1, length_GU_1, proms_GU_1 ); // ==================== Update promoter lists ==================== // Shift the position of the promoters of the "old" GU _gen_unit->move_all_promoters_after( pos_1, -seq_length ); // Look for new promoters around breakpoints _gen_unit->look_for_new_promoters_around( pos_1 ); GU_1->look_for_new_promoters_around( 0 ); return GU_1; } /*! \brief Copy the sequence going from pos_1 (included) to pos_2 (excluded) into a new standalone genetic unit. The new genetic unit's list of promoter is up-to-date. if ( pos_1 == pos_2 ), the whole genome is copied */ ae_genetic_unit* ae_dna::copy_into_new_GU( int32_t pos_1, int32_t pos_2 ) const { int32_t seq_length = ae_utils::mod( pos_2 - pos_1, _length ); if ( seq_length == 0 ) seq_length = _length; // ==================== Copy promoters from old sequence ==================== // Copy the promoters belonging to the sequence to be copied from the "old" GU // into a stand-alone promoter list (with indices ranging from 0 to seq_length-1) ae_list** proms_new_GU = new ae_list*[2]; proms_new_GU[LEADING] = new ae_list(); proms_new_GU[LAGGING] = new ae_list(); _gen_unit->copy_promoters_included_in( pos_1, pos_2, proms_new_GU ); ae_genetic_unit::shift_promoters( proms_new_GU, -pos_1, _length ); // ==================== Manage sequences ==================== // Copy the sequence in a stand-alone char* (size must be multiple of BLOCK_SIZE) int32_t length_new_GU = seq_length; char* sequence_new_GU = new char[nb_blocks( length_new_GU ) * BLOCK_SIZE]; if ( pos_1 < pos_2 ) { memcpy( sequence_new_GU, &_data[pos_1], length_new_GU * sizeof(char) ); } else { memcpy( sequence_new_GU, &_data[pos_1], (_length - pos_1) * sizeof(char) ); memcpy( &sequence_new_GU[_length - pos_1], &_data[0], pos_2 * sizeof(char) ); } sequence_new_GU[length_new_GU] = '\0'; // ==================== Create the new genetic unit ==================== ae_genetic_unit* new_GU = new ae_genetic_unit( _indiv, sequence_new_GU, length_new_GU, proms_new_GU ); // ==================== Update new GU promoter list ==================== // Look for new promoters around breakpoints new_GU->look_for_new_promoters_around( 0 ); return new_GU; } /*! \brief Insert the genetic unit GU_to_insert at pos_B, through pos_D. (sequence is inverted if invert == true) GU to insert: segments C and D, breakpoint pos_D. Current GU: segments A and B, breakpoint pos_B. \verbatim If invert is false, the insertion will render ADCB A B C D A D C B |-------[>-------| + |=====[>========| => |-------[>=====|========[>-------| pos_B pos_D If invert is true, the insertion will render ACpDpB, with Cp (resp. Dp) = inverted C (resp. D). A B C D A Cp Dp B |-------[>-------| + |=====<]========| => |-------[>=====|========[>-------| pos_B pos_D \endverbatim Sequence from GU_to_insert is untouched but its list of promoters is emptied */ void ae_dna::insert_GU( ae_genetic_unit* GU_to_insert, int32_t pos_B, int32_t pos_D, bool invert ) { // Compute segment lengths const char* GUti_data = GU_to_insert->get_dna()->get_data(); int32_t len_A = pos_B; int32_t len_B = _length - pos_B; int32_t len_C = pos_D; int32_t len_D = GU_to_insert->get_dna()->get_length() - pos_D; int32_t len_AB = _length; int32_t len_CD = GU_to_insert->get_dna()->get_length(); int32_t len_ABCD = len_AB + len_CD; //~ printf( "len_A : %"PRId32", len_B : %"PRId32", len_C : %"PRId32", len_D : %"PRId32",\nlen_AB : %"PRId32", len_CD : %"PRId32", len_ABCD : %"PRId32"\n", //~ len_A, len_B, len_C, len_D, len_AB, len_CD, len_ABCD ); // ==================== Insert the sequence ==================== // Create new genome char* new_seq = new char[ BLOCK_SIZE * nb_blocks(len_ABCD) ]; // Insert A memcpy( new_seq, _data, len_A * sizeof(char) ); // Insert C and D (inverted?) if ( invert ) { // Build Cp and Dp char* seq_Cp = new char[pos_D+1]; for ( int32_t i = 0, j = pos_D - 1 ; i < len_C ; i++, j-- ) { if ( GUti_data[j] == '0' ) seq_Cp[i] = '1'; else seq_Cp[i] = '0'; } seq_Cp[len_C] = '\0'; char* seq_Dp = new char[len_D+1]; for ( int32_t i = 0, j = len_CD - 1 ; i < len_D ; i++, j-- ) { if ( GUti_data[j] == '0' ) seq_Dp[i] = '1'; else seq_Dp[i] = '0'; } seq_Dp[len_D] = '\0'; // Insert Cp and DP // TODO : Maybe we should construct Cp and Dp directly at their rightful place... memcpy( &new_seq[len_A], seq_Cp, len_C * sizeof(char) ); memcpy( &new_seq[len_A+len_C], seq_Dp, len_D * sizeof(char) ); delete [] seq_Cp; delete [] seq_Dp; } else // if ( invert == false ) { // Insert D and C memcpy( &new_seq[len_A], &GUti_data[pos_D], len_D * sizeof(char) ); memcpy( &new_seq[len_A+len_D], GUti_data, len_C * sizeof(char) ); } // Insert B memcpy( &new_seq[len_A+len_C+len_D], &_data[pos_B], len_B * sizeof(char) ); new_seq[len_ABCD] = '\0'; // Remove promoters that are astride segments A and B : breakpoint pos_B _gen_unit->remove_promoters_around( pos_B ); set_data( new_seq, len_ABCD ); // ==================== Manage promoters ==================== // Remove promoters that are astride segments C and D : breakpoint pos_D GU_to_insert->remove_promoters_around( pos_D ); // Shift the position of the promoters of segment B _gen_unit->move_all_promoters_after( pos_B, len_CD ); // Extract promoters of segments C and D. // NOTE : We want ALL THE PROMOTERS to be transfered, not only those that are completely included // in segment C or D. Hence, we will use extract_promoters_starting_between() instead of // extract_promoters_included_in(). // NOTE : Once removed the promoters starting on sequence D, the remaining is precisely the promoters // starting on sequence C (and they are at their rightful position). We can hence directly use // the list of promoters from GU_to_insert. ae_list** proms_C = new ae_list*[2]; proms_C[LEADING] = new ae_list(); proms_C[LAGGING] = new ae_list(); ae_list** proms_D = new ae_list*[2]; proms_D[LEADING] = new ae_list(); proms_D[LAGGING] = new ae_list(); if ( pos_D != 0 ) // TODO : Manage this in the different functions? with a parameter WholeGenomeEventHandling ? { GU_to_insert->extract_promoters_starting_between( 0, pos_D, proms_C ); } GU_to_insert->extract_promoters_starting_between( pos_D, len_CD, proms_D ); assert( GU_to_insert->get_rna_list()[LEADING]->is_empty() ); assert( GU_to_insert->get_rna_list()[LAGGING]->is_empty() ); ae_genetic_unit::shift_promoters( proms_D, -len_C, len_D ); if ( invert ) { //~ printf( "+++++++++++++++++++++++++++++++++++++\n" ); //~ ae_genetic_unit::print_rnas( proms_C ); //~ ae_genetic_unit::print_rnas( proms_D ); //~ printf( "//////////////////////////////////////\n" ); ae_genetic_unit::invert_promoters( proms_C, len_C ); ae_genetic_unit::invert_promoters( proms_D, len_D ); //~ ae_genetic_unit::print_rnas( proms_C ); //~ ae_genetic_unit::print_rnas( proms_D ); //~ printf( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" ); _gen_unit->insert_promoters_at( proms_C, len_A ); _gen_unit->insert_promoters_at( proms_D, len_A + len_C ); } else // if ( invert == false ) { _gen_unit->insert_promoters_at( proms_D, len_A ); _gen_unit->insert_promoters_at( proms_C, len_A + len_D ); } // Delete the temporary lists (objects are untouched) delete proms_C[LEADING]; delete proms_C[LAGGING]; delete [] proms_C; delete proms_D[LEADING]; delete proms_D[LAGGING]; delete [] proms_D; // Look for new promoters around breakpoints _gen_unit->look_for_new_promoters_around( pos_B ); _gen_unit->look_for_new_promoters_around( pos_B + len_CD ); set_GU( _gen_unit->get_rna_list(), _gen_unit ); } /*! \brief Looks for an alignment between this and chrom2 in the given sense with max nb_pairs trials. nb_pairs is updated accordingly Performs local alignment searches between this and chrom2 around randomly drawn pairs of points. The minimum score will be generated according to align_fun_shape and associated parameters for each pair of points. The parameter nb_pairs will be updated according to how many trials were necessary for an alignment to be found. The sense of the searched alignment can be either DIRECT, INDIRECT or BOTH_SENSE. \ In the latter case, the sense will be randomly drawn (uniformly between DIRECT and INDIRECT) for each pair of points. */ ae_vis_a_vis* ae_dna::search_alignment( ae_dna* chrom2, int32_t& nb_pairs, ae_sense sense ) { ae_vis_a_vis* alignment = NULL; ae_sense cur_sense = sense; // Which sense (direct or indirect) int16_t needed_score; // Minimum alignement score needed to recombine (stochastic) for ( ; nb_pairs > 0 ; nb_pairs-- ) { /////////////////////////////////////// // 1) Draw random sense (if needed) // /////////////////////////////////////// if ( sense == BOTH_SENSES ) { cur_sense = (_indiv->_mut_prng->random() < 0.5) ? DIRECT : INDIRECT; } ///////////////////////////////////////////////////// // 2) Determine the minimum alignment score needed // ///////////////////////////////////////////////////// if ( _indiv->get_align_fun_shape() == LINEAR ) { needed_score = (int16_t) ceil( _indiv->get_align_lin_min() + _indiv->_mut_prng->random() * ( _indiv->get_align_lin_max() - _indiv->get_align_lin_min() ) ); } else { // I want the probability of rearrangement for an alignment of score to be // prob = 1 / ( 1 + exp( -(score-mean_score)/lambda ) ) // The score needed for a rearrangement to take place with a given random drawing is hence // needed_score = ceil( -lambda * log( 1/rand - 1 ) + mean ) needed_score = (int16_t) ceil( - _indiv->get_align_sigm_lambda() * log( 1/_indiv->_mut_prng->random() - 1 ) + _indiv->get_align_sigm_mean() ); if ( needed_score < 0 ) needed_score = 0; } /////////////////////////////////////////////////////////////// // 3) Determine where to look for an alignement (draw seeds) // /////////////////////////////////////////////////////////////// int32_t seed1 = _indiv->_mut_prng->random( _length ); int32_t seed2 = _indiv->_mut_prng->random( chrom2->get_length() ); //////////////////////////////////////////////////////////////////// // 3) Test the existence of an alignment with a high enough score // //////////////////////////////////////////////////////////////////// if ( cur_sense == DIRECT ) { alignment = ae_align::search_alignment_direct( this, seed1, chrom2, seed2, needed_score ); if ( alignment != NULL ) { return alignment; } } else // if ( cur_sense = INDIRECT ) { alignment = ae_align::search_alignment_indirect( this, seed1, chrom2, seed2, needed_score ); if ( alignment != NULL ) { return alignment; } } } return NULL; } /*! \brief Looks for an alignment between this and chrom2 in the given sense around the given positions Performs local alignment searches between this and chrom2 around the given positions The minimum score will be generated according to align_fun_shape and associated parameters for each pair of points. The parameter nb_pairs will be updated according to how many trials were necessary for an alignment to be found. The sense of the searched alignment can be either DIRECT, INDIRECT or BOTH_SENSE. \ In the latter case, the sense will be randomly drawn (uniformly between DIRECT and INDIRECT) for each pair of points. */ ae_vis_a_vis* ae_dna::search_alignment_around_positions( ae_dna* chrom2, int32_t chrom1_pos_1, int32_t chrom2_pos_1, ae_sense sense, int8_t& research_sense) { ae_vis_a_vis* alignment = NULL; ae_vis_a_vis* tmp_alignment = NULL; ae_sense cur_sense = sense; // Which sense (direct or indirect) int16_t needed_score; // Minimum alignement score needed to recombine (stochastic) int32_t chrom1_pos_for_research; int32_t chrom2_pos_for_research; int32_t size_between_two_alignments = 3 * _indiv->get_align_w_zone_h_len(); /////////////////////////////////////// // 1) Draw random sense (if needed) // /////////////////////////////////////// if ( sense == BOTH_SENSES ) { printf( "WARNING : Alignment could not be searched in both senses in %s:%d\n", __FILE__, __LINE__ ); return(NULL); } ///////////////////////////////////////////////////// // 2) Determine the minimum alignment score needed // ///////////////////////////////////////////////////// if ( _indiv->get_align_fun_shape() == LINEAR ) { needed_score = (int16_t) ceil( _indiv->get_align_lin_min() + _indiv->_mut_prng->random() * ( _indiv->get_align_lin_max() - _indiv->get_align_lin_min() ) ); } else { // I want the probability of rearrangement for an alignment of score to be // prob = 1 / ( 1 + exp( -(score-mean_score)/lambda ) ) // The score needed for a rearrangement to take place with a given random drawing is hence // needed_score = ceil( -lambda * log( 1/rand - 1 ) + mean ) needed_score = (int16_t) ceil( - _indiv->get_align_sigm_lambda() * log( 1/_indiv->_mut_prng->random() - 1 ) + _indiv->get_align_sigm_mean() ); if ( needed_score < 0 ) needed_score = 0; } ///////////////////////////////////////////////////////// // 3) Determine the sense by which the research begins // ///////////////////////////////////////////////////////// int16_t first_research_sense = (_indiv->_mut_prng->random() < 0.5) ? 1 : -1; int16_t second_research_sense = -1*first_research_sense; //////////////////////////////////////////////////////////////////////////////////////// // 4) Test the first sense for the existence of an alignment with a high enough score // //////////////////////////////////////////////////////////////////////////////////////// chrom1_pos_for_research = chrom1_pos_1; chrom2_pos_for_research = chrom2_pos_1; int16_t i = 0; while( _indiv->_mut_prng->random() < 1-_exp_m->get_repl_HT_detach_rate() ) { //printf("%d longueur genome %d\n",i, this->get_length()); //printf("chrom1_pos_for_research : %d, chrom2_pos_for_research : %d\n", chrom1_pos_for_research, chrom1_pos_for_research); chrom1_pos_for_research = ae_utils::mod(chrom1_pos_for_research + first_research_sense * size_between_two_alignments, this->get_length()) ; if ( cur_sense == DIRECT ) { chrom2_pos_for_research = ae_utils::mod(chrom2_pos_for_research + first_research_sense * size_between_two_alignments, chrom2->get_length()); tmp_alignment = ae_align::search_alignment_direct( this, chrom1_pos_for_research, chrom2, chrom2_pos_for_research, needed_score ); } else // if ( cur_sense = INDIRECT ) { chrom2_pos_for_research = ae_utils::mod(chrom2_pos_for_research - first_research_sense * size_between_two_alignments, chrom2->get_length()); tmp_alignment = ae_align::search_alignment_indirect( this, chrom1_pos_for_research, chrom2, chrom2_pos_for_research, needed_score ); } //printf("chrom1_pos_for_research : %d, chrom2_pos_for_research : %d\n", chrom1_pos_for_research, chrom1_pos_for_research); if(tmp_alignment == NULL) { if(alignment != NULL) { //printf("tmp_alignment == NULL alignment != NULL\n",i); research_sense = first_research_sense; return alignment; } else { //printf("tmp_alignment == NULL alignment == NULL\n",i); break; } } else { if(alignment != NULL) { //printf("tmp_alignment != NULL alignment != NULL\n",i); alignment->copy( tmp_alignment ); } else { //printf("tmp_alignment != NULL alignment == NULL\n",i); alignment = new ae_vis_a_vis( *tmp_alignment ); } delete tmp_alignment; chrom1_pos_for_research = alignment->get_i_1(); chrom2_pos_for_research = alignment->get_i_2(); } i++; } if(alignment != NULL) { research_sense = first_research_sense; return alignment; } ///////////////////////////////////////////////////////////////////////////////////////// // 5) Test the second sense for the existence of an alignment with a high enough score // ///////////////////////////////////////////////////////////////////////////////////////// alignment = NULL; chrom1_pos_for_research = chrom1_pos_1; chrom2_pos_for_research = chrom2_pos_1; i = 0 ; while( _indiv->_mut_prng->random() < 1-_exp_m->get_repl_HT_detach_rate() ) { chrom1_pos_for_research = ae_utils::mod(chrom1_pos_for_research + second_research_sense * size_between_two_alignments, this->get_length() ); if ( cur_sense == DIRECT ) { chrom2_pos_for_research = ae_utils::mod(chrom2_pos_for_research + second_research_sense * size_between_two_alignments, chrom2->get_length() ); tmp_alignment = ae_align::search_alignment_direct( this, chrom1_pos_for_research, chrom2, chrom2_pos_for_research, needed_score ); } else // if ( cur_sense = INDIRECT ) { chrom2_pos_for_research = ae_utils::mod(chrom2_pos_for_research - second_research_sense * size_between_two_alignments, chrom2->get_length() ); tmp_alignment = ae_align::search_alignment_indirect( this, chrom1_pos_for_research, chrom2, chrom2_pos_for_research, needed_score ); } if(tmp_alignment == NULL) { if(alignment != NULL) { research_sense = second_research_sense; return alignment; } else { break; } } else { if(alignment != NULL) { alignment->copy( tmp_alignment ); } else { alignment = new ae_vis_a_vis( *tmp_alignment ); } delete tmp_alignment; chrom1_pos_for_research = alignment->get_i_1(); chrom2_pos_for_research = alignment->get_i_2(); } i++; } if(alignment != NULL) { research_sense = second_research_sense; return alignment; } return NULL; } // ================================================================= // Protected Methods // ================================================================= /** * Extract the sequence going from pos_1 (included) to pos_2 (excluded) into a new standalone genetic unit. * Promoter lists are created / updated accordingly */ void ae_dna::ABCDE_to_ADCBE( int32_t pos_B, int32_t pos_C, int32_t pos_D, int32_t pos_E ) { // Rearrange the sequence from ABCDE to ADCBE (complex translocation of segment defined // between positions pos_B and pos_D) // // Segments are identified by pos_x values as shown below. // // WARNING : Segment C includes nucleotide at pos_D // NOTE : WTF??? // // A B C D E A D C B E // |----->=======[>=======>-------[>-------| => |----->-------[>=======>=======[>-------| // pos_B pos_C pos_D pos_E // // Check points' order and range assert( pos_B >= 0 && pos_C >= pos_B && pos_D >= pos_C && pos_E >= pos_D && pos_E <= _length ); // Compute segment lengths int32_t len_A = pos_B; int32_t len_B = pos_C - pos_B; int32_t len_C = pos_D - pos_C; int32_t len_D = pos_E - pos_D; int32_t len_E = _length - pos_E; int32_t len_AD = len_A + len_D; int32_t len_ADC = len_AD + len_C; int32_t len_ADCB = len_ADC + len_B; // Create new sequence char* new_genome = new char[_nb_blocks * BLOCK_SIZE]; memcpy( new_genome, _data, len_A * sizeof(char) ); memcpy( &new_genome[len_A], &_data[pos_D], len_D * sizeof(char) ); memcpy( &new_genome[len_AD], &_data[pos_C], len_C * sizeof(char) ); memcpy( &new_genome[len_ADC], &_data[pos_B], len_B * sizeof(char) ); memcpy( &new_genome[len_ADCB], &_data[pos_E], len_E * sizeof(char) ); new_genome[_length] = '\0'; // Replace sequence // NB : The size of the genome doesn't change. Therefore, we don't need to update _length and _nb_blocks delete [] _data; _data = new_genome; // ========== Update promoter list ========== // 1) Remove promoters that include a breakpoint // 2) Extract promoters that are totally included in each segment to be moved (B, C and D) // 3) Shift these promoters positions // 4) Reinsert the shifted promoters // 5) Look for new promoters including a breakpoint if ( _length >= PROM_SIZE ) { // 1) Remove promoters that include a breakpoint _gen_unit->remove_promoters_around( pos_B ); _gen_unit->remove_promoters_around( pos_C ); _gen_unit->remove_promoters_around( pos_D ); _gen_unit->remove_promoters_around( pos_E ); // Create temporary lists for promoters to move and/or invert ae_list** promoters_B = new ae_list*[2]; promoters_B[LEADING] = new ae_list(); promoters_B[LAGGING] = new ae_list(); ae_list** promoters_C = new ae_list*[2]; promoters_C[LEADING] = new ae_list(); promoters_C[LAGGING] = new ae_list(); ae_list** promoters_D = new ae_list*[2]; promoters_D[LEADING] = new ae_list(); promoters_D[LAGGING] = new ae_list(); // 2) Extract promoters that are totally included in each segment to be moved (B, C and D) if ( len_B >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_B, pos_C, promoters_B ); } if ( len_C >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_C, pos_D, promoters_C ); } if ( len_D >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_D, pos_E, promoters_D ); } // 3) Shift these promoters positions ae_genetic_unit::shift_promoters( promoters_B, len_D + len_C, _gen_unit->get_dna()->get_length() ); ae_genetic_unit::shift_promoters( promoters_C, len_D - len_B, _gen_unit->get_dna()->get_length() ); ae_genetic_unit::shift_promoters( promoters_D, -len_B - len_C, _gen_unit->get_dna()->get_length() ); // 4) Reinsert the shifted promoters _gen_unit->insert_promoters( promoters_B ); _gen_unit->insert_promoters( promoters_C ); _gen_unit->insert_promoters( promoters_D ); // Delete the temporary lists (objects are untouched) delete promoters_B[LEADING]; delete promoters_B[LAGGING]; delete [] promoters_B; delete promoters_C[LEADING]; delete promoters_C[LAGGING]; delete [] promoters_C; delete promoters_D[LEADING]; delete promoters_D[LAGGING]; delete [] promoters_D; // 5) Look for new promoters including a breakpoint _gen_unit->look_for_new_promoters_around( len_A ); _gen_unit->look_for_new_promoters_around( len_AD ); _gen_unit->look_for_new_promoters_around( len_ADC ); _gen_unit->look_for_new_promoters_around( len_ADCB ); } } void ae_dna::ABCDE_to_ADBpCpE( int32_t pos_B, int32_t pos_C, int32_t pos_D, int32_t pos_E ) { // Rearrange the sequence from ABCDE to ADBpCpE (complex translocation with inversion // of segment defined between positions pos_B and pos_D) // Bp (resp Cp) stands for inverted B (resp C) // // Segments are identified by pos_x values as shown below. // // WARNING : Segment C includes nucleotide at pos_D // NOTE : WTF??? // // A B C D E A D Bp Cp E // |----->=======[>=======>-------<]-------| => |----->-------<]=======<=======<]-------| // pos_B pos_C pos_D pos_E // // Check points' order and range assert( pos_B >= 0 && pos_C >= pos_B && pos_D >= pos_C && pos_E >= pos_D && pos_E <= _length ); // Compute segment lengths int32_t len_A = pos_B; int32_t len_B = pos_C - pos_B; int32_t len_C = pos_D - pos_C; int32_t len_D = pos_E - pos_D; int32_t len_E = _length - pos_E; int32_t len_AD = len_A + len_D; int32_t len_ADB = len_AD + len_B; int32_t len_ADBC = len_ADB + len_C; // Create new sequence char* new_genome = new char[_nb_blocks * BLOCK_SIZE]; // Copy segments A and D memcpy( new_genome, _data, len_A * sizeof(char) ); memcpy( &new_genome[len_A], &_data[pos_D], len_D * sizeof(char) ); // Build Bp and put it in the new genome char* inverted_segment = new char[len_B+1]; for ( int32_t i = 0, j = pos_C - 1 ; i < len_B ; i++, j-- ) { if ( _data[j] == '0' ) inverted_segment[i] = '1'; else inverted_segment[i] = '0'; } inverted_segment[len_B] = '\0'; memcpy( &new_genome[len_AD], inverted_segment, len_B * sizeof(char) ); delete [] inverted_segment; // Build Cp and put it in the new genome inverted_segment = new char[len_C+1]; for ( int32_t i = 0, j = pos_D - 1 ; i < len_C ; i++, j-- ) { if ( _data[j] == '0' ) inverted_segment[i] = '1'; else inverted_segment[i] = '0'; } inverted_segment[len_C] = '\0'; memcpy( &new_genome[len_ADB], inverted_segment, len_C * sizeof(char) ); delete [] inverted_segment; // Copy segment E into the new genome memcpy( &new_genome[len_ADBC], &_data[pos_E], len_E * sizeof(char) ); new_genome[_length] = '\0'; // Replace sequence delete [] _data; _data = new_genome; // ========== Update promoter list ========== // 1) Remove promoters that include a breakpoint // 2) Extract promoters that are totally included in each segment to be moved (B, C and D) // 3) Shift (and invert when needed) these promoters positions // 4) Reinsert the shifted promoters // 5) Look for new promoters including a breakpoint if ( _length >= PROM_SIZE ) { // 1) Remove promoters that include a breakpoint _gen_unit->remove_promoters_around( pos_B ); _gen_unit->remove_promoters_around( pos_C ); _gen_unit->remove_promoters_around( pos_D ); _gen_unit->remove_promoters_around( pos_E ); // Create temporary lists for promoters to move and/or invert ae_list** promoters_B = new ae_list*[2]; promoters_B[LEADING] = new ae_list(); promoters_B[LAGGING] = new ae_list(); ae_list** promoters_C = new ae_list*[2]; promoters_C[LEADING] = new ae_list(); promoters_C[LAGGING] = new ae_list(); ae_list** promoters_D = new ae_list*[2]; promoters_D[LEADING] = new ae_list(); promoters_D[LAGGING] = new ae_list(); // 2) Extract promoters that are totally included in each segment to be moved (B, C and D) if ( len_B >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_B, pos_C, promoters_B ); } if ( len_C >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_C, pos_D, promoters_C ); } if ( len_D >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_D, pos_E, promoters_D ); } // 3a) Invert promoters of segments B and C ae_genetic_unit::invert_promoters( promoters_B, pos_B, pos_C ); ae_genetic_unit::invert_promoters( promoters_C, pos_C, pos_D ); // 3b) Shift these promoters positions ae_genetic_unit::shift_promoters( promoters_B, len_D, _gen_unit->get_dna()->get_length() ); ae_genetic_unit::shift_promoters( promoters_C, len_D, _gen_unit->get_dna()->get_length() ); ae_genetic_unit::shift_promoters( promoters_D, -len_B - len_C, _gen_unit->get_dna()->get_length() ); // 4) Reinsert the shifted promoters _gen_unit->insert_promoters( promoters_C ); _gen_unit->insert_promoters( promoters_B ); _gen_unit->insert_promoters( promoters_D ); // Delete the temporary lists (objects are untouched) delete promoters_B[LEADING]; delete promoters_B[LAGGING]; delete [] promoters_B; delete promoters_C[LEADING]; delete promoters_C[LAGGING]; delete [] promoters_C; delete promoters_D[LEADING]; delete promoters_D[LAGGING]; delete [] promoters_D; // 5) Look for new promoters including a breakpoint _gen_unit->look_for_new_promoters_around( len_A ); _gen_unit->look_for_new_promoters_around( len_AD ); _gen_unit->look_for_new_promoters_around( len_ADB ); _gen_unit->look_for_new_promoters_around( len_ADBC ); } } void ae_dna::ABCDE_to_ACpDpBE( int32_t pos_B, int32_t pos_C, int32_t pos_D, int32_t pos_E ) { // Rearrange the sequence from ABCDE to ACpDpBE (complex translocation with inversion // of segment defined between positions pos_C and pos_E) // Cp (resp Dp) stands for inverted C (resp D) // // Segments are identified by pos_x values as shown below. // // WARNING : Segment D includes nucleotide at pos_E // NOTE : WTF??? // // A B C D E A C' D' B E // |----<]-------->=======[>=======>-------| => |-----<]=======>=======<]------->-------| // pos_B pos_C pos_D pos_E // // Check points' order and range assert( pos_B >= 0 && pos_C >= pos_B && pos_D >= pos_C && pos_E >= pos_D && pos_E <= _length ); // Compute segment lengths int32_t len_A = pos_B; int32_t len_B = pos_C - pos_B; int32_t len_C = pos_D - pos_C; int32_t len_D = pos_E - pos_D; int32_t len_E = _length - pos_E; int32_t len_AC = len_A + len_C; int32_t len_ACD = len_AC + len_D; int32_t len_ACDB = len_ACD + len_B; // Create new sequence char* new_genome = new char[_nb_blocks * BLOCK_SIZE]; // Copy segment A memcpy( new_genome, _data, len_A * sizeof(char) ); // Build Cp and put it in the new genome char* inverted_segment = new char[len_C+1]; for ( int32_t i = 0, j = pos_D - 1 ; i < len_C ; i++, j-- ) { if ( _data[j] == '0' ) inverted_segment[i] = '1'; else inverted_segment[i] = '0'; } inverted_segment[len_C] = '\0'; memcpy( &new_genome[len_A], inverted_segment, len_C * sizeof(char) ); delete [] inverted_segment; // Build Dp and put it in the new genome inverted_segment = new char[len_D+1]; for ( int32_t i = 0, j = pos_E - 1 ; i < len_D ; i++, j-- ) { if ( _data[j] == '0' ) inverted_segment[i] = '1'; else inverted_segment[i] = '0'; } inverted_segment[len_D] = '\0'; memcpy( &new_genome[len_AC], inverted_segment, len_D * sizeof(char) ); delete [] inverted_segment; // Copy segments B and E memcpy( &new_genome[len_ACD], &_data[pos_B], len_B * sizeof(char) ); memcpy( &new_genome[len_ACDB], &_data[pos_E], len_E * sizeof(char) ); new_genome[_length] = '\0'; // Replace sequence delete [] _data; _data = new_genome; // ========== Update promoter list ========== // 1) Remove promoters that include a breakpoint // 2) Extract promoters that are totally included in each segment to be moved (B, C and D) // 3) Shift (and invert when needed) these promoters positions // 4) Reinsert the shifted promoters // 5) Look for new promoters including a breakpoint if ( _length >= PROM_SIZE ) { // 1) Remove promoters that include a breakpoint _gen_unit->remove_promoters_around( pos_B ); _gen_unit->remove_promoters_around( pos_C ); _gen_unit->remove_promoters_around( pos_D ); _gen_unit->remove_promoters_around( pos_E ); // Create temporary lists for promoters to move and/or invert ae_list** promoters_B = new ae_list*[2]; promoters_B[LEADING] = new ae_list(); promoters_B[LAGGING] = new ae_list(); ae_list** promoters_C = new ae_list*[2]; promoters_C[LEADING] = new ae_list(); promoters_C[LAGGING] = new ae_list(); ae_list** promoters_D = new ae_list*[2]; promoters_D[LEADING] = new ae_list(); promoters_D[LAGGING] = new ae_list(); // 2) Extract promoters that are totally included in each segment to be moved (B, C and D) if ( len_B >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_B, pos_C, promoters_B ); } if ( len_C >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_C, pos_D, promoters_C ); } if ( len_D >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_D, pos_E, promoters_D ); } // 3a) Invert promoters of segments C and D ae_genetic_unit::invert_promoters( promoters_C, pos_C, pos_D ); ae_genetic_unit::invert_promoters( promoters_D, pos_D, pos_E ); // 3b) Shift these promoters positions ae_genetic_unit::shift_promoters( promoters_B, len_C + len_D, _gen_unit->get_dna()->get_length() ); ae_genetic_unit::shift_promoters( promoters_C, -len_B, _gen_unit->get_dna()->get_length() ); ae_genetic_unit::shift_promoters( promoters_D, -len_B, _gen_unit->get_dna()->get_length() ); // 4) Reinsert the shifted promoters _gen_unit->insert_promoters( promoters_B ); _gen_unit->insert_promoters( promoters_D ); _gen_unit->insert_promoters( promoters_C ); // Delete the temporary lists (objects are untouched) delete promoters_B[LEADING]; delete promoters_B[LAGGING]; delete [] promoters_B; delete promoters_C[LEADING]; delete promoters_C[LAGGING]; delete [] promoters_C; delete promoters_D[LEADING]; delete promoters_D[LAGGING]; delete [] promoters_D; // 5) Look for new promoters including a breakpoint _gen_unit->look_for_new_promoters_around( len_A ); _gen_unit->look_for_new_promoters_around( len_AC ); _gen_unit->look_for_new_promoters_around( len_ACD ); _gen_unit->look_for_new_promoters_around( len_ACDB ); } } void ae_dna::inter_GU_ABCDE_to_ACDBE( int32_t pos_B, int32_t pos_C, int32_t pos_E ) { // Check points' order and range assert( ( pos_B >= 0 && pos_C >= pos_B ) && ( pos_E >= 0 ) ); if ( pos_B != pos_C ) { // Usefull values ae_individual* indiv = _indiv; ae_genetic_unit* chromosome = indiv->get_genetic_unit( 0 ); ae_genetic_unit* plasmid = indiv->get_genetic_unit( 1 ); ae_genetic_unit* destination_GU = ( _gen_unit == chromosome )? plasmid : chromosome; // Compute segment lengths int32_t len_A = pos_B; int32_t len_B = pos_C - pos_B; int32_t len_C = _length - pos_C; int32_t len_D = pos_E; int32_t len_E = destination_GU->get_dna()->get_length() - pos_E; int32_t len_AC = len_A + len_C; int32_t len_DB = len_D + len_B; int32_t len_DBE = len_DB + len_E; // Create the new sequence of this genetic unit int32_t tmp = ae_string::nb_blocks( len_AC ); char* new_sequence_this = new char[tmp * BLOCK_SIZE]; memcpy( new_sequence_this, _data, len_A * sizeof(char) ); memcpy( &new_sequence_this[len_A], &_data[pos_C], len_C * sizeof(char) ); new_sequence_this[len_AC]='\0'; // Create the new sequence of the destination genetic unit tmp = ae_string::nb_blocks(len_DBE) * BLOCK_SIZE; char* new_sequence_dest = new char[tmp]; char* dest_GU_former_seq = (char*) destination_GU->get_dna()->get_data(); memcpy( new_sequence_dest, dest_GU_former_seq, len_D * sizeof(char) ); memcpy( &new_sequence_dest[len_D], &_data[pos_B], len_B * sizeof(char) ); memcpy( &new_sequence_dest[len_DB], &dest_GU_former_seq[pos_E], len_E * sizeof(char) ); new_sequence_dest[len_DBE]='\0'; // ========== Update promoter list ========== // 1) Remove promoters that include a breakpoint // 2) Extract promoters that are totally included in each segment to be moved (B, C and E) // NB : Sequences have to be updated at this stage in order to have the correct lengths when managing new promoter positions // ........ // 3) Shift these promoters positions // 4) Reinsert the shifted promoters // 5) Look for new promoters including a breakpoint // 1) Remove promoters that include a breakpoint _gen_unit->remove_promoters_around( pos_B ); _gen_unit->remove_promoters_around( pos_C ); destination_GU->remove_promoters_around( pos_E ); // Create temporary lists for promoters to move and/or invert ae_list** promoters_B = new ae_list*[2]; promoters_B[LEADING] = new ae_list(); promoters_B[LAGGING] = new ae_list(); // 2) Extract promoters that are totally included in each segment to be moved (B, C and E) if ( len_B >= PROM_SIZE ) { _gen_unit->extract_promoters_included_in( pos_B, pos_C, promoters_B ); } // ========== Replace sequences ========== set_data( new_sequence_this, len_AC ); destination_GU->get_dna()->set_data( new_sequence_dest, len_DBE ); // 3) Shift these promoters positions ae_genetic_unit::shift_promoters( promoters_B, len_D - len_A, destination_GU->get_dna()->get_length() ); // Reassign promoters to their new genetic unit ae_list_node* rna_node; ae_rna* rna; for (int32_t tmp_strand = 0; tmp_strand < 2; tmp_strand++) { rna_node = promoters_B[tmp_strand]->get_first(); while ( rna_node ) { rna = rna_node->get_obj(); rna->set_genetic_unit(destination_GU); rna_node = rna_node->get_next(); } } // Shift the promoters of sequences C and E _gen_unit->move_all_promoters_after( pos_C, -len_B ); destination_GU->move_all_promoters_after( pos_E, len_B ); // 4) Reinsert the shifted promoters destination_GU->insert_promoters( promoters_B ); // Delete the temporary lists (objects are untouched) delete promoters_B[LEADING]; delete promoters_B[LAGGING]; delete [] promoters_B; // 5) Look for new promoters including a breakpoint _gen_unit->look_for_new_promoters_around( 0 ); _gen_unit->look_for_new_promoters_around( len_A ); destination_GU->look_for_new_promoters_around( 0 ); destination_GU->look_for_new_promoters_around( len_D ); destination_GU->look_for_new_promoters_around( len_DB ); } } void ae_dna::inter_GU_ABCDE_to_BDCAE( int32_t pos_B, int32_t pos_C, int32_t pos_E ) { // Check points' order and range assert( ( pos_B >= 0 && pos_C >= pos_B ) && ( pos_E >= 0 ) ); // Compute segment lengths int32_t len_A = pos_B; int32_t len_B = pos_C - pos_B; int32_t len_C = _length - pos_C; //~ int32_t len_ABC = _length; int32_t len_DA = len_A + pos_E; inter_GU_ABCDE_to_ACDBE( 0, pos_B, pos_E ); inter_GU_ABCDE_to_ACDBE( len_B, (len_B+len_C), len_DA); } aevol-4.4/src/libaevol/ae_exp_setup.h0000644000175000017500000003045412234223723014634 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_EXP_SETUP_H__ #define __AE_EXP_SETUP_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include // =========================================================================== // Class declarations // =========================================================================== class ae_param_loader; class ae_param_overloader; class ae_exp_setup : public ae_object { friend class ae_exp_manager; public : // ======================================================================= // Constructors // ======================================================================= ae_exp_setup( ae_exp_manager* exp_m ); // ======================================================================= // Destructors // ======================================================================= virtual ~ae_exp_setup( void ); // ======================================================================= // Accessors: getters // ======================================================================= // ----------------------------------------------------- Selection context inline ae_selection* get_sel( void ) const; // --------------------------------------------------------------- Transfer inline bool get_with_HT( void ) const; inline bool get_repl_HT_with_close_points ( void ) const; inline double get_HT_ins_rate( void ) const; inline double get_HT_repl_rate( void ) const; inline double get_repl_HT_detach_rate( void ) const; // --------------------------------------------------------------- Plasmids // See comments in ae_exp_manager.h on how plasmids are handled inline bool get_with_plasmids( void ) const; inline double get_prob_plasmid_HT( void ) const; inline double get_tune_donor_ability( void ) const; inline double get_tune_recipient_ability( void ) const; inline double get_donor_cost( void ) const; inline double get_recipient_cost( void ) const; inline bool get_swap_GUs( void ) const; // -------------------------------------------------------------- Secretion inline bool get_with_secretion( void ) const; inline double get_secretion_contrib_to_fitness( void ) const; inline double get_secretion_cost( void ) const; // ======================================================================= // Accessors: setters // ======================================================================= // --------------------------------------------------------------- Transfer inline void set_with_HT( bool with_HT ); inline void set_repl_HT_with_close_points( bool repl_HT_with_close_points ); inline void set_HT_ins_rate( double HT_ins_rate ); inline void set_HT_repl_rate( double HT_repl_rate ); inline void set_repl_HT_detach_rate( double repl_HT_detach_rate ); // --------------------------------------------------------------- Plasmids inline void set_with_plasmids( bool with_p ); //~ inline void set_nb_plasmid_HT( int16_t nb_p_HT ); inline void set_prob_plasmid_HT( double prob_p_HT ); inline void set_tune_donor_ability( double tune_donor_ability ); inline void set_tune_recipient_ability( double tune_recipient_ability ); inline void set_donor_cost( double donor_cost ); inline void set_recipient_cost( double recipient_cost ); inline void set_swap_GUs( bool swap_GUs ); // -------------------------------------------------------------- Secretion inline void set_with_secretion( bool with_secretion ); inline void set_secretion_contrib_to_fitness( double secretion_contrib ); inline void set_secretion_cost( double secretion_cost ); // ======================================================================= // Public Methods // ======================================================================= void write_setup_file( gzFile exp_setup_file ) const; void write_setup_file( FILE* exp_setup_file ) const; void save( gzFile backup_file ) const; void load( gzFile setup_file, gzFile backup_file, bool verbose ); void load( FILE* setup_file, gzFile backup_file, bool verbose ); inline void step_to_next_generation( void ); // ======================================================================= // Public Attributes // ======================================================================= protected : // ======================================================================= // Forbidden Constructors // ======================================================================= ae_exp_setup( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_exp_setup( const ae_exp_setup &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ======================================================================= // Protected Methods // ======================================================================= virtual void display( void ) {}; // ======================================================================= // Protected Attributes // ======================================================================= ae_exp_manager* _exp_m; // ----------------------------------------------------- Selection context ae_selection* _sel; // --------------------------------------------------- Transfer parameters bool _with_HT; bool _repl_HT_with_close_points; double _HT_ins_rate; double _HT_repl_rate; double _repl_HT_detach_rate; // --------------------------------------------------- Plasmids parameters bool _with_plasmids; double _prob_plasmid_HT; // Base transfer ability independent of evolvable donor and recipient ability double _tune_donor_ability; // How much the individuals can tune their ability to send plasmids double _tune_recipient_ability; // How much the individuals can tune their ability to receive plasmids double _donor_cost; double _recipient_cost; bool _swap_GUs; // Whether plasmid HT is uni- or bidirectional // -------------------------------------------------- Secretion parameters bool _with_secretion; double _secretion_contrib_to_fitness; double _secretion_cost; }; // ===================================================================== // Getters' definitions // ===================================================================== inline ae_selection* ae_exp_setup::get_sel( void ) const { return _sel; } inline bool ae_exp_setup::get_with_HT( void ) const { return _with_HT; } inline bool ae_exp_setup::get_repl_HT_with_close_points( void ) const { return _repl_HT_with_close_points; } inline double ae_exp_setup::get_HT_ins_rate( void ) const { return _HT_ins_rate; } inline double ae_exp_setup::get_HT_repl_rate( void ) const { return _HT_repl_rate; } inline double ae_exp_setup::get_repl_HT_detach_rate( void ) const { return _repl_HT_detach_rate; } inline bool ae_exp_setup::get_with_plasmids( void ) const { return _with_plasmids; } inline double ae_exp_setup::get_prob_plasmid_HT( void ) const { return _prob_plasmid_HT; } inline double ae_exp_setup::get_tune_donor_ability( void ) const { return _tune_donor_ability; } inline double ae_exp_setup::get_tune_recipient_ability( void ) const { return _tune_recipient_ability; } inline double ae_exp_setup::get_donor_cost( void ) const { return _donor_cost; } inline double ae_exp_setup::get_recipient_cost( void ) const { return _recipient_cost; } inline bool ae_exp_setup::get_swap_GUs( void ) const { return _swap_GUs; } inline bool ae_exp_setup::get_with_secretion( void ) const { return _with_secretion; } inline double ae_exp_setup::get_secretion_contrib_to_fitness( void ) const { return _secretion_contrib_to_fitness; } inline double ae_exp_setup::get_secretion_cost( void ) const { return _secretion_cost; } // ===================================================================== // Setters' definitions // ===================================================================== // --------------------------------------------------------------- Transfer inline void ae_exp_setup::set_with_HT( bool with_HT ) { _with_HT = with_HT; } inline void ae_exp_setup::set_repl_HT_with_close_points( bool repl_HT_with_close_points ) { _repl_HT_with_close_points = repl_HT_with_close_points; } inline void ae_exp_setup::set_HT_ins_rate( double HT_ins_rate ) { _HT_ins_rate = HT_ins_rate; } inline void ae_exp_setup::set_HT_repl_rate( double HT_repl_rate ) { _HT_repl_rate = HT_repl_rate; } inline void ae_exp_setup::set_repl_HT_detach_rate( double repl_HT_detach_rate ) { _repl_HT_detach_rate = repl_HT_detach_rate; } inline void ae_exp_setup::set_with_plasmids( bool with_p ) { _with_plasmids = with_p; } inline void ae_exp_setup::set_prob_plasmid_HT( double prob_p_HT ) { _prob_plasmid_HT = prob_p_HT; } inline void ae_exp_setup::set_tune_donor_ability( double tune_donor_ability ) { _tune_donor_ability = tune_donor_ability; } inline void ae_exp_setup::set_tune_recipient_ability( double tune_recipient_ability ) { _tune_recipient_ability = tune_recipient_ability; } inline void ae_exp_setup::set_donor_cost( double donor_cost ) { _donor_cost = donor_cost; } inline void ae_exp_setup::set_recipient_cost( double recipient_cost ) { _recipient_cost = recipient_cost; } inline void ae_exp_setup::set_swap_GUs( bool swap_GUs ) { _swap_GUs = swap_GUs; } // -------------------------------------------------------------- Secretion inline void ae_exp_setup::set_with_secretion( bool with_secretion ) { _with_secretion = with_secretion; } inline void ae_exp_setup::set_secretion_contrib_to_fitness( double secretion_contrib ) { _secretion_contrib_to_fitness = secretion_contrib; } inline void ae_exp_setup::set_secretion_cost( double secretion_cost ) { _secretion_cost = secretion_cost; } // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_exp_setup::step_to_next_generation( void ) { // Make the individuals reproduce _sel->step_to_next_generation(); } #endif // __AE_EXP_SETUP_H__ aevol-4.4/src/libaevol/ae_string.cpp0000644000175000017500000002050012231437075014454 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_string # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_string::ae_string( void ) { _nb_blocks = 1; _length = 0; _data = new char[_nb_blocks * BLOCK_SIZE * sizeof(char)]; _data[_length] = '\0'; } ae_string::ae_string( const ae_string &model ) { _nb_blocks = model._nb_blocks; _length = model._length; _data = new char[_nb_blocks * BLOCK_SIZE * sizeof(char)]; memcpy( _data, model._data, (_length+1) * sizeof(char) ); } /*! Creates a new ae_string with enough space to store a string of the given length. */ ae_string::ae_string( int32_t length ) { _nb_blocks = nb_blocks( length ); _length = length; _data = new char[_nb_blocks * BLOCK_SIZE]; // Generate a random genome /*for ( int32_t i = 0 ; i < _length ; i++ ) { _data[i] = '0' + ae_common::sim->alea->random( NB_BASE ); } _data[_length] = '\0';*/ } /** * Creates a new ae_string with sequence (having length ) */ ae_string::ae_string( const char* seq, int32_t length ) { _length = length; _nb_blocks = nb_blocks( length ); _data = new char[_nb_blocks * BLOCK_SIZE]; memcpy( _data, seq, (length+1) * sizeof(char) ); } /** * Creates a new ae_string with sequence (having length ). * WARNING : is used directly which means the caller must not delete it. */ ae_string::ae_string( char* seq, int32_t length, bool use_seq ) { assert( use_seq ); _length = length; _nb_blocks = nb_blocks( length ); _data = seq; } ae_string::ae_string( gzFile backup_file ) { gzread( backup_file, &_nb_blocks, sizeof(_nb_blocks) ); //~ printf( "read %d bytes (_nb_blocks : %ld)\n", sizeof(_nb_blocks), _nb_blocks ); _data = new char[_nb_blocks * BLOCK_SIZE]; gzread( backup_file, &_length, sizeof(_length) ); //~ printf( "read %d bytes (_length : %ld)\n", sizeof(_length), _length ); gzread( backup_file, _data, (_length + 1) * sizeof(*_data) ); //~ printf( "read %ld bytes (_data : %s)\n", (_length + 1) * sizeof(*_data), _data ); } ae_string::ae_string( char* organism_file_name ) { FILE* org_file = fopen( organism_file_name, "r" ); int length; if (org_file==NULL) printf ("Error opening organism file\n"); else { fseek (org_file , 0 , SEEK_END); length = ftell (org_file); rewind (org_file); _nb_blocks = nb_blocks( length ); _length = length; _data = new char[_nb_blocks * BLOCK_SIZE]; for ( int32_t i = 0 ; i < _length -1 ; i++ ) { _data[i] = fgetc (org_file); } _data[_length] = '\0'; } fclose ( org_file ); } // ================================================================= // Destructors // ================================================================= ae_string::~ae_string( void ) { delete [] _data; } // ================================================================= // Public Methods // ================================================================= void ae_string::remove( int32_t pos_1, int32_t pos_2 ) // Remove the sequence between positions 'first' and 'last' { assert( pos_1 >= 0 && pos_2 >= pos_1 && pos_2 <= _length ); // Compute size of new genome int32_t new_length = _length - (pos_2 - pos_1); int32_t new_nb_blocks = nb_blocks( new_length ); char* new_genome = new char[new_nb_blocks * BLOCK_SIZE]; // Copy the remaining of the genome in tmp (preceeding and following parts) memcpy( new_genome, _data, pos_1 * sizeof(char) ); memcpy( &new_genome[pos_1], &_data[pos_2], (new_length - pos_1) * sizeof(char) ); new_genome[new_length] = '\0'; // Replace previous genome with the new one //~ printf( "genome before - after delete_block( %ld, %ld ) : \n %s\n %s\n\n", pos_1, pos_2, _data, new_genome ); //~ getchar(); delete [] _data; _data = new_genome; // Update length data _length = new_length ; _nb_blocks = new_nb_blocks; } void ae_string::insert( int32_t pos, const char* seq, int32_t seq_length ) // Insert sequence 'seq' at position 'pos' { assert( pos >= 0 && pos < _length ); // If the sequence's length was not provided, compute it if ( seq_length == -1 ) { seq_length = strlen( seq ); } // Compute size of new genome int32_t new_length = _length + seq_length; int32_t new_nb_blocks = nb_blocks( new_length ); char* new_genome = new char[new_nb_blocks * BLOCK_SIZE]; // Build new genome from previous genome and sequence to insert memcpy( new_genome, _data, pos * sizeof(char) ); memcpy( &new_genome[pos], seq, seq_length * sizeof(char) ); memcpy( &new_genome[pos+seq_length], &_data[pos], (_length - pos) * sizeof(char) ); new_genome[new_length] = '\0'; // Replace the previous genome with the new one delete [] _data; _data = new_genome; // Update length-related data _length = new_length; _nb_blocks = new_nb_blocks; } void ae_string::replace( int32_t pos, char* seq, int32_t seq_length ) // Invert the sequence between positions 'first' and 'last' { // Check pos value assert( pos >= 0 && pos < _length ); // If the sequence's length was not provided, compute it if ( seq_length == -1 ) { seq_length = strlen( seq ); } // Check that the sequence is contiguous assert( pos + seq_length <= _length ); // Perform the replacement memcpy( &_data[pos], seq, seq_length * sizeof(char) ); } void ae_string::save( gzFile backup_file ) { gzwrite( backup_file, &_nb_blocks, sizeof(_nb_blocks) ); //~ printf( "write %d bytes (_nb_blocks : %ld)\n", sizeof(_nb_blocks), _nb_blocks ); gzwrite( backup_file, &_length, sizeof(_length) ); //~ printf( "write %d bytes (_length : %ld)\n", sizeof(_length), _length ); gzwrite( backup_file, &_data[0], (_length + 1) * sizeof(_data[0]) ); //~ printf( "write %ld bytes (_data : %s)\n", (_length + 1) * sizeof(*_data), _data ); } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_jump_poly.h0000644000175000017500000040106712231437075014644 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** /*! \brief Definition of jumping polynomials for various settings of the Mersenne Twister */ #ifndef __AE_JUMP_POLYS_H__ #define __AE_JUMP_POLYS_H__ #if SFMT_MEXP == 607 const char* jump_poly = "2c375358c852082b88bdf47ffe5ac31b6cd4e255a12f271951f250f805d473248be9e75baee81f0474e793983cdc11c198d269b4bd9c34ca9eec3f91cceb172450d9b6001eaa29d97ba1cdb59c50684e"; #elif SFMT_MEXP == 1279 const char* jump_poly = "d9b26ff41ff79250750aa52e7426726d6ade8b9ee66174636bc772ade2aec8f913f573763a809dbeebac14488a5e04da0adc700e064da0ee470935e771d119eb9f08bfa78a3ac74516f4aa8b7885bf212287c03ab64837e8a56c12a0862adfc9a6d054e372b3ae2e11cd2d3c4a3ea924b6beb11f8f96227c61cf8b528b59565b2c040962d5d24d37cf7a0dee5175ca10e0ac797f8f1a3eb99a319ad15d540996"; #elif SFMT_MEXP == 2281 const char* jump_poly = "2b1e867bcc6a7adda82c2a26cb38b0ccb7f236848f6c3179e98b5d8b9db21d7df3bfa37941c8fcc0fa42cc4e244503040bad9575e6b0c138d52fe3f83b851495995a561ce64df116fa918b247e3a43817dd77f41115150cf2802c7a511f4e1487798ae3ee0b3cc2e155f82575731dc3bca3a08df85f511179bd7435c9594bd8dc28068d35251820015cd3ef7a23c8d5a1cabb6149a8e36216d4c9838b3ef79d06cb6e2f6e26daef80c2803f11bc03d06f75c2d69f064b72d3abf526961af2510cf688af3f2bfc56e7e4e11286a6302ee21e1109e0f3fbe328d9ad907976fde4aff6e683e3645e275a09a676ce585532bb21bc75bc4eeaf6643df3e886857411eb19bf93be3684689155441a89b32b070dc7af40e4aecaf632fd5cd7925b16af8"; #elif SFMT_MEXP == 4253 const char* jump_poly = "9da17b7f8b81dd8668afea353420300fc56674207f120d8350c6b565d3a04608ebad52f9826d4f0d30b6547ef0ee6be8bfd85d970ee9d7573c72f44a7a90f2eb86d59528a8146b811407f1b08c61d5e349bda9aac6a04a785ba66736e5160858e123a2d06fdfe59eef6e7093b54da08219a3f179cd2776e4595bce3c72307dc555f3d9485d1f82b2a46dded685d2e200d93584a49eae81b541d2e7eb0a1c3cf8d13ba75119a15e606decbb2067e8a760bd024a3dc2b2c703fae28db65a0fbca2466aa2bac285200cfd1702a9b47b29541ae4375b23734d0ff26254e855ad912e9260713a1d20561457508149557f27d6b5edf5afd4e9d377dac89cadd8d9dd28a3c90eccfd7738a10c3df64346135de4c57a708a7dfd33c28e5a1875b90fc0ee642a7050f974e8b7dc62eceb098a70d1a99158c4ca1d805fb721e4966688a6a0dbf60753baa8ad5e302f8244325b90d5d04bf72e92846141ea44926b141866ee75cf79d2cb944494afb371dc0d74caac434a758823ff05493b219c3c29031520161c84b5ae3c9e0a1451c1e723d7a9c3737e66a289dc18d102c241b28dc0c03ce5ea67253e3540f21477e969716264a6124247bb59b202359b2a371ea4cdc2bffdec81613d9ffb0b8c4ad3bcaeb8c576ede6d67d5629b32cb01d18b4a420de854b97aae9d4e35b3ab04131704eaea7b30a1edf54a11cf9e27df97779b2a86dd5505762c7461c475dec5da0bb2c9d092c792a371ee929788006af05e10ca69c6"; #elif SFMT_MEXP == 11213 const char* jump_poly = "e1fb174eeaec8c048fdd060653c54c0e59746d6bc66ff4cabbbda5f086d06d3796982a80b6467dde91bcd2922b87732361602b2c5610b8146fda7090b5d82aca1c69d40fa235b4f9b44bfc75bf670d089dae22e63f416d009eda5ec00af694026ff7fa0889f830d1ffd0863785190a8c65ff1baa8f5379451d3964766c7e205aa30c66c33f7734a906f8348e008d5d8f1194625711028a77443c986cb71f19b805c9866afdf2f65aed441faa734749dab56e908d1c8edfcba9b0b65752ad5cdafb4efbb18f3bff49974f26cca3a5ac90f97a714fa0b84124f227b4cde80230911be4493a927dc1125bc055230a25c5affb018214d1a6271f3ee92156e12320014aee4321dd246edddb95c56a11b0adeeac677edf7365698f413c9871070ae258c266ed700ed3b4b83843d13d9b5dd149a31520f484da4ff3a0c6e514ed5158b5fdef19c1cb5c7b00c596c59f7175a90ac9b69141a252221bbbcf56fd60c591e34821f8b8b5453329d0b009d635d329e081906aeb61deaee2250806a12dcc235489337e3ba473df5544c6cfa39b455cdfe840fe555765cd8d93a4d6500ec87d4bb5127af2415b59319a044e0fbc9087db8b541c155f1f2e32f03ea91ec0210de1a829a11ed0ffc00d4e4fc93e9817a709cb3a97ae058c05cd57abdd9bacb0426c57acc52191881040682a92ee2342acc7c76d59490888173dc540a2636b485b231b29c07c9e0dbd1faad61f16833e77d64a286afce616657ff87fc6222c5f1cab7751b86b71444eb4adc38e5dd403002c72cd1c6d2e87f1aba5d2a9a3dabebcd7d01552ba6e960fb19bbf9566a3379dfe87e43defcd496640b838294184cde7ab949402d45c38a5e16a21bc56abad8c4422b882cde3b72a00368505afef747a3397db4b27bacee0fc1e228305bdc25216cb90dde8a0e36913f1bfa7c9a73bdd441c1c70522df14b978eca879f3997b91486e7d1159acaaef8d72fa8467d68017adb5d59012b3f950d60e0bd674766c4d104ff011ea7106a87937dd37b8c46fab7bf3e7120c93f657ce93412b15606506491a6e525cb8d0aa79f4e93e40a8bf06daf835b4efc885ba7e45db506d1d3bc4f7a94b0d0f0780f14d540b67f153a13dfc6ce225ac62ddfd8b09565aafdffd3ad82955715b57b55cf70ae2f75be37cc200b6a23c2e96674d11725ff061b18b4504e2f85894e09bb41d507881740258667670134d6ec1a625a92f5cc77d47a10a6d6ab16de5de03cdf5651133cefcd9742ad0f66b6b9395a3c44bf5b30d10527f8d3d12cca4ff4bf00b677780fae1257f10f2f84be5662fc231ffdb1df65c90ffe5910761f775b491b26fe767fca3c1a5506762f8c47a1f30894c3ec300fa4005b81416962044bf0e233b2687403aa0558c168dcc748f3183a59a295aed59ea945304734ccdc439ddcb15784e522e88fd9c21090869db9e1676e2a94f3314b67a3f8f9b9db3680e93f7fac34f5da727548c629db273a650e330d1e7fdd57896fbc4eb0e0baeae249c13ef22e62568c4ea7e7efa1710c4ee39e7cc2df19d83b46dccf96da7b91002dce4548c296c8dcc2cce50ca6ce170e81ae069e6b3f139afe75e75be15d3a9cf20cdc33066a4b43975ad5e36823f71793a0dee97c9995debd2784aa3ad20a386dc99c943ea9324e85c1a457678e0b8f7708339c2b7e9c5056f01e697e7229131b8238d64c02e43c548c1ee141f8f38ad2c34f9aebdf95cf2e821b5513d29d4d0a892fa83bd969c4feb0794d4d72ef5d9076f664fb3776ef4d6d103cc2870e642e3617a75891bf4ae88046b5fa23f9d74543c09546acece46314c4c39cede5073161ad47682268017e85327c5294a2e2835c5aa782c89741d4b783275a5d023f1679e18ee49415ff1361af6bc89adf4f6a6f52acd8da4a24b5c69623cf88ce71bb4dad9fa293dd6c83a5706e91a06b5da2b45570aee388648ffe385028cec042f3ed3ec042066cd9def7"; #elif SFMT_MEXP == 19937 const char* jump_poly = "a23d5563c1fff635b7d3687fe879e3d54f7caddb7371f6174fbd8870d7b7db4aedc6a2c671133f72ab011abf5a98910b1024f2e5c1e89722572831d99320b814b252d58f9433ca547804394c69f4ed2b612068320daad25dc1e0bcef4c59deaa0095329c362103eda909c683e0a9b398efc2b69ac74087f0443842ce5c618d4bb58c66b3046dc752a633f040b2be7b32c7e7de01e17f93a10329d9249bb0a9c25bc41f3831c66a255a61904ce209dee70e7448df9aa741d01da9368ff827915b6f5860cdce17ee9c0e462fdb983709229b4e011796e425d5c0c42079bdae36dcda37603310dbad7b9ec04f9716b95a541350d6df4e62fe62dfcdd185fe90a139c3a56f66be753bfabfa80bb3d52b59c9d1ac03ab01449829dca1fc0a01bdd7c1c9ff22fcfcef818158a3eeb5d4b7eb237e14e781046a5257119651c00aaa6957da10c8490826eed8103192d97d2743f6221e748e29bd7589e1a716f0047cd990230f4d72a0505fc22b48657f56461285b019856c01ed37e3c3f33cad5aee8693c07d0982333d5d19661e74d0f0a0e1f27817abe25aaec92f028d5c082a4ee9038596c7272d6775933b13b516535f0892fe3de01ade7430687be70909c612a8837be4f702165d905ddc005e183a3147a179d6a07e6296a7c36175fb6cdcf725314f77f9d6d96e09d2129a1fc013618033a89352e9388aa7c6ce8da20ed2127e9755789060f1a8a718c1c9474ca379a7a1e916145a173680b78691186ae7a8217a6a918ff612e4763dc9464c98cf82980ceea52dd40fdcea3bc63cbf0acf577495f7ee78a01736ac4532877a5a5adb65af2016b925cc7f60ce45a6aa05db46154d46f9d1ba5f867a94c8fb5b59bf802aafe09b31f94342ea5363e4e7b62f3ee05a588a7b748e39ada7a3168139f6f426860a59a0d6237377a385531a25c0c34b20770ca28589357c92cd5a480f1895a19595e9164f0adb1edbdcfcf3056a2c0e7c8ecd1f1862858239074f49f0b5cec86c71da5371682583a7a3543024946be138e29dc17458e4807c7666503d347e1e0c30d5ae0665d0fcf0ef7379db17c7f4e71258b3f1040ed17496b6549c2e8daa2f95f597ebd88e63e4f58bd9fb6308b3e6f644b33855646c559ceb1fbacab511fbb5073e457a8f10adb16ea6909267e267fc4de62489a71dad8e30164a4a932d07471f2c71836313d8d3a8acfa5fb1aff504ce2e5eb84a06a2a1a402e2f76e300d31b8f92595ab92c724ec1b78d6e80564534f835f05ec931a39bdcc45b29ba8aa44508404bec50d7eac6c03e4c0b9c87ef987c0158f9da3e0116e82ef8004a59a255864c11e3b77756e98947056f1a343e3ac250d544e0d3827d98ca4d6bdedc4605699a2635aa9ea0cf665045b44370f2bf42345cd024d8937457f7263ba26a637f9c3b6f51b4d117a8e2251619d2880c006d34a96273adccbd0cfbf7aa9a769f828cb0641e7d22774b9ecd3f72f3e382b899ccd4e11c31810374172f77ccb3b51f972e9ca26d953a1fce6fe51ad169a1f98f798a49a3825a9ca98bb8d82c48c3cc05a317555a0adc7271e35c14afe06f1217d986d3a5f27b6b6829c3b46b918a72d93783b8df2e33de27c62d5d0a8198687f0c7b2c7285be165fefea6eed24bc4b284ce286cf1e617210fbb5bc403ae3981bc11711c1d291d828c54a6e4087d437dc810d28943e902e673ba7653a0d60d6df420496b57ded084d594e3d43678d4374e81c4616f81261f39c053126c17f5bdb6409d29623bb0aecdce335571dde95b23ec145b5c663aa9a1dd749beafafdabfea1ee05d18ef0f9b0390b2909527e4b010d5a8c18133825ffc7c69fa3879b952498066a0a2de1aca65e753d6891cff04050005c29ccf5f5a293b8910fac6f2f660a3061f8922b21bc4cd3df550abca3805feb2b5c7acbda10579dc90c374b31b619472a004851262d9813193bd01cee9503ce444aefab6f07fbe80a0ef08e62d096581582845b2700824ea65b410dd7a9a6a630f6443d4b8d7d0428cb362b913e1ef380b91a4e9f58b7d97a28d2b704a3c7f8bd228c29b514eddb81b433f30242f61a4b3886b3e19ca8ea8ecccb7981a48e35009acfe59026b1014457b25af997bb4f0cf6c02d7288f21f73981f7e3d13a453d31e59b3d8bb276a8b3215c4aeb0d8b175c98737c5ec5ab482d2161783e22b1fa05e49f5b467cf1803c6bd727cd413c907a3f7ca1cf44b66934dbd1aae65bc496bcd9f935d242e3e46346781ee800afbb6c51d2e5caf6143a8bae08b8144a46adbd03fae129096e3046d907084b23d60ee7bca6557bd9601b6cc3a74aa0c8fd5cd7f4e8fd8d2e274b47d308d35909b127e5a0d728bd35e07fb89af8cc1ecf1fcdf30efdce59dd3805e31667da92341bfe23c95a999da84b15a3bd502e692648154093c16191d2ff5a807ba60e71c2cdc3e13d3ffcb221ef064eedf841ac21946bebc8dc7e3d511d8b2a25d3724d4edcf47dd6dcdb87baaa6957610251b3b84e356ff1d6d58c44555ed278866d7fc6d86e3b32e377adf618e522dc84d840225e05c3586fad0706ccef54e86aac4ad5fade89354fb90ebb46a33cc79c31b416686ee9f784eb3f2404035e2b478d094e6fbde9b19c3ca9cf45c782ad318b61ffb1efaed4edbd9e2f9697ed4db2b3d32d81e7239adfba19cf5c3faf405984de7f2d4957d231c96babfc53f47644593df18a1c438b03d25722be9633018087289469040a5f9c4dede3880a96cd08a75a21e13a7a6dfbc7e48318b2666d52b2263422eac92afe8543a0691ce33a8404cbb99b0006f29d5a0bcb95bd75051813958fd0fa4e61e93633b67d272e8cb1de0ed030cedf0223e18990c9c7e7819696cd9aa53bb84d1f0647d28ea798edc08e671ba30249a96cb4234e42ac3dd6e12472061c024fe5a6c178e9aeccc09f7e89195d34fa17822f901c886fc99ec9ce9843f444a43fc640218ae56c94eb68bfbe0053e9c290bc151c1b6f7a38b21067aca34bdcf00778a10bcafe8d4ac811668b8788a48dbe139f29de1e044bc8c83fbbd4eafc8c33d6797175da24f18bfd06032c37ff7a93cfbba1cad6761d672ade73096b556d4d7432436c186f65abebdca45cc27e99e37651b53ec8561018e40a20fdea434687d0a61b2160be096d3a9d97a9ec3d6c7a6794e70b64cc6194b8649126f192ecadc553daa84262617550c1b78e67bf8ff6c1a5d4eec82c9ae414348a61c9c812b80efb977c5451192bdeb27a47fa1ec1f98acaff71f4d399f50ac567b08477fb140d8505c9097d9c4e9f16d702cfebf9bbad9ff22d4796719babbb4cf95c1ae831e5000b68e154f388567c5ca95f56a3e20547db2426619e5a48883dd55af44c8e9ca3cb3a6f26fb0d272b69f0f537271618bb77a385d2f153d834077dca863f8ef6a705ea296fbea1e669c1aa1c45dd9161a806f9aa053784b734e93ec3a2beb7f910ccf67165aadda29e67096be9cacbafb85740932997f147649dd9cacff18562e1b774f4cd5941ad7"; #elif SFMT_MEXP == 44497 const char* jump_poly = "6caad9646010c6e030ad6486ede1d7e2d0d9122a99553188d1972357e0eeeb500586646c540a925f430cbfef2ec953b259bc21128bc82e8e3fdd29310fc07e48578b710f4002a6bc178b59dbbab4e2d999c2ad41844859541c857e4efb86f1b66ffce0d43aa66a041ec2b48ec669cca2fb86abac00cb2e8323bf3977d0bbb2c7c711b4bed35578d7b8bfb6cd0698ca5112785bd5e94604c825e3a268cf5e83d30cf2f587d5267e7938053291e837ddfa99baa243aa39ea065f893854ff28987163ae1aa0b4c1cfa186c8046add5844d345401f8a56e0b4240484551f0431da0620cbbd33bd9cab2c83304c0df8f0fb53ace27af8ae2063b008f45a4d181ec3c618489ba2e6d6ff9cb200b74743a76d48dc7a93f92ac9987f8b551501958f86985e149f08a63d402d4d2d83cb313e60d88ed6c592dc03ec23f30d2846f29f6baa5d6422b2b0ba1120d939475300d191c67f886ed88a2453e553c4d6165b994fcf08c0d26bb5ce7063bfef50d9cc60fcd5eaf1c21d86acc26595d019bd448a3dc9bfc19216619db9eae34497f06473c5452687620790e093479b4fe780fa6373e72cf84df297c58ee53959c666376c86d863070efbd63f0e7b6fcfab07e2723e3ea9e3de5e1a0c99e58fd0a96066dfd7199ff48b304943655aa7a08222b84d9f5609fcb2f0108cd1aed86aefa9070a46380bfcdfa8a4d522500861446c4817984c165da297e235d41ad75ccbe1e03a8b0932fa588d3ad10244f07cfb8e7c7e3bde230c8d7795975f70ebf0e72a6c1faa6afbb7f19121e9796b48e13a6b0c0a20ccef3f2819e67c9e50bb9b8a11599927b52663eb01be5906d5c5b4a083d35919553f89e68f7ad67038e1d11b230c1ac60526c142deda850aee0fa2dc28e2f4b3fa6d84220b4c4d2521dc571a2bc667b4a1ce6faf013fca0fdf226437dc3f6701d705747a09696ba79f158864b997aeb46a6b76079c5cb48329873cd3e5073d7cab25b5d461fa14f63ea2f4470445977467969bae5ae2fe180a16d663f9fd77501fd944da68b5f6e6ea16d50d77a357e35958ce693cc5998401542e62026087755a2023b2f1822841d117ee6c6bee7d216c6d5e3c34aa2e2d58259e39973d206a9f5a11dbb0248d98a83161c37b578797412a00b218511a3bc6c1b85b74254bafec4242fb3b6118175952b8240d1d42e70dee240b219a0880ba0b230783e8e10f2f3ddd5e14edce7ef68cc4050dfa84c85af24d980e15386e3bd675f75bbe64ec03918c282bcd78ac309d938b35dfa483a47f6584989021d73c587f4a51d61d91d24468049ae0fa2186a1ead3a3eac066b68d3fc94bbc4f43a3cb94a6e692a6c4747d2ef95d7827d81a3abbbd70b7306385a33208c702c050afa8e0aac334c8f048602448be9dcd89f7b5af1ad83b0a102c95a84060b04ba451f875589a7d0a9c13e50cc058c9c57c0386f9a8cd68d9753cc7424d8e1555e0d45de799f551f320e2c523ab5317bf5b5f54b7320e0f6f1bb5be29175013a68e6ef33280a042bf6b37a4143193926c24529901030dbcdcf25eb78d827dd388d362c4d1dd9b19f2c932db9fa23381adad589b89b4f4f75330a0066a8e3770d894a7f91a01901270311009467b6991d036fff42f3a6eab0e6228a641e914c237f989b9f088d6eeb981fd90fa7c682d81fe164742c9f33e7b359d2bd7282cf63fc464591dec41529678c5e75ca71494ce35723bbfccde9ffa6544cfc8c3f616461f64db8cecd8a755d3f9870b5e344eb72216bdeca7f2842f18c9b3f86e803747ed395e3bff3d4c7adf7c2a7152cbb7b63fb8ccb5c610345669a81dd6faebfb6f90aa9967ccf527d16cb34e184df9b1e76c4cecf1b4944144868f1d02095735b75c1439241284b14199e1ba3d70a7fbe30e5da972843e07a5064ccecd768714959f270afe8c7098a54814cdc7c6798f95d5209e692e12491429614426c84d5f33d24175210b87511f346d6d67fb2178009f0797656716653ef0aca961cc6dc35e20315d68fe366a4720ee511a062bca11e1885d5f9db804097cb73ee52602138588bd9251ee304b88dd8dcfc1f0e108ab5bb9305689f335af29c35a713be47acafecfa0db95680df6e0b1ff1217b6fe4054eceadd95ec370c8cdbba5ba6dcbf360567f557783a01a2cc37cd63ff390e313dcaf2887b8f374c78862a316737b44a5c3ef528e0fad177c1cf6ddd1ce34f41d5274fc03e7f55fa108c8724b5c497d58856995454780f013285e71e32338c1482578f878610be1576ddb97ba95e3b9cbe46f049399c128b3346a710d34a3d12f172dd94f7cb01ee060b664c8bebd06638a103c256a3383cf4581d9a71bebd3a1b926686e11ffae27beaff3801fef3d77c750017e8c7176cfc5ea7a984f8309d15e49e551fadbe646947cd9a288b709f6e48b3614d42364a8f0d73330ccc96190204b12f33771822152cca986621e920014870f91fab5d445f947ee47455cdda9c14cc4c728ce01ad2c3725177c5eb49bed09d8a23a9449bbd8abe158c372db81d6bdb3f21e38a0464d099896d3e053b402391ebcbd12da093e5297ff098813f290ffd0056d7a0209244144e04ec568e2eaf8c9970c3217d0fd5d571c11219a4af0d41cc8bbdbc208e28eb71ee628909d3bc962554782271b281289ef851fc2fdab974ccf36f6cc2d2b9a3833ce706047c096b74b41483c190a62e8f2d8a2f09149bf7de80b3349347d3eb9fb446dc50c2bd66d0d4216de4d7499ee9403841d8c541d541816ba731b5ea694c087735062ae86efd6afcab9f00c6fc7a3a4a58ea31ada015743b22f3cf513f36c79405d928492d3d71129ab72c1790bc5bc0c4478dcde93768ce618eac0778c906e2a1d9839ebe6039394f48479f3546e04cd90c053701f89455cdcf15915c679af2e3079d34fc30df422cc07c1e0338f745c9eff8651cdff8cdb9e62890597842212a67c759d7300c79370f29cb49c38a2e44e96a7e8143e2c092441469b6c28dd0e2d06a31b0810bc2bd630548106d7d77bb16bc6ff8ae66c8bff07bac5e9911c10203f278d4e491abfc6cd77c151b84c703f578340f1eca31e9b12c02319f160f883bf4a6fdceedd77d1da6f91996824abb6944c1894b46af9ca3835375ea2b230484cfc9510c80b68054ceb5ae3a2da0c848b5c122dd1dc0ec8bc72199feb82e8130d88c8509d453566c5c0c3c3abeada5f7d399accac6290e3c55430f091c0db390e9dc28c7d53f391dc074cb5cb35aad6f13d4bbe01f4070c8ed235ecb93094685e5d632240e7cbdef7478845cc1b375f011773440e308c55533d3908bf7c2b4a2124c7fcfbc21160b14f7f774a393f6c6d20b5bc11b0e7029ebca0c72f5d219de4baffa3de1e4c49ecfd1a04bef1b0b1f1f4835f3a56f0aa8fdd0cc64d41edde62b5d8d0c5482097a32f47967168dc1c192aeee73954caeef751654a1541e04c534d201672beaab587080c7cb35b2106bd983f5da25266a3370093877f8664f207687e4c5964b9a347b25455d438995057432abc6e34a0c2bca64f1bb440c143db8ec04baf7073097ea7b9b53e794a626f66a26d0073c702fe52df3fdac89d45255d89a7a0d57384723ccd04a741ffb9c294a03afb47e7b3cc097f6c90a4602c7af7ad9439b73f4b797344e425648e20ca0eb2bb6df14bb13498685dd175c3af23686345caf99cc3d7150adc37a4e4a468bc622aebce6032f0bfdeb3114e37802ac95878f75d2a130745092212b494ade5cbc22f8953fbbf1e8317356bd3f893a7391f69ee4b4e9e5400474ed220319844ef0cfbc954f4c674b146c858e97d26882d44dad9417654aaeb0c1c05073575c743df17831cef24e1218a002831c34ff3ea2cec44581532022ba77fb0976c86d6297b16fab26de7f2fe47b18150bdab5384dcc131ea19cbe6d788f9555ea4dcd44a6bf8e857d3edab7ec888d4dc2dbbbb4d14bac32f509600a200c831f4e0a01671221f7a02aaecfdc5523e1569ce021c3f3ba45bfa48a2ff2068bb5ca75029f59cc431a824b038b2cfa00ed28bda882da84c43759f9d05c15c8c959eaf711bab8da7c46a6ee370e001f9a8610f41431d57632bb7cb8f8440b8265e87c1a5a6dff13e8e5f84843d7d6a9d204042251d91e99b532ce3795a4450266e913fa6fac460261204fd9b33419a992208bf9f3f6511752533eff3fd3dec51bfab5fd82db2103942060ee439f40914bf9d4e02b8a2786daa9e02a9ed12995d898074c4e4575b979e28e1daed08b4c914caa90407530b590bba5e19120601a2f3fb70e3f6739e2ef68e8927b5778ee5400ff65e174626063328c86183db7ddeda2d403c6fee16387ee224740613d320c97fb24e9a2b3432e771a361fedab1b61423ef40d64fbfdea7f4e66d8adca2ae6134ac85eaa1799d8a6dfe290825c04741467b606f768269c6877b2df87294849e9da9534fa5023815cdb34c67ed4b1e7c87080b9712d4f1fc42bdc01cf9009573594188bb8715d02e8c89fe5e27677e9b9384f2d1743679c751f443954be0eac01d058dd49a18b19fb735bfecf67d830c5e79fa3191e770f422e26a55be3c866ccf94c614e2d06fd97b09598f750ff78714816b67bc561978f688a7ef7dbf8e1bb67a39a6a2598da50610704aa6f6df46a428fff867f332f5f84bb899f0e934f2d7fe6ed641264763e4480cf0fabdc973af34307e1d583edd01a386fac836e578a7809747930c7bb5ff7e0715ca850f8045c77d1de34308547371da0bf8ff40cd056c38a20561c9a3511051412bc3808aef360ebbc5b36a3a2ab7d60c3a1152fec4b82f5ebe1935bc5fe63592392f01753b0610b8892cb6223456ff020e4225a4f4ff2959ed2189a0bbd41edcbafe8107ab96be7a8c084d3aabe959c101b568c68a0e86e0e51311eb09c6b62837fb46d1bf9ec264e6c1a6d15b3cafc920dcccf4b11295ffc0202d22a1b869c626f1b330b54c64d1b76c91ada174b1fec4c12beeb913903c44a1cb69a92381db3c4c30fdd2140e8c1a1cb2910c4e6f9eb0df346895d5f521def06d1ea8fcfcb7ffb90687a3cf0d10d578567c70f934ae26c9f5adda6613b7b08cd64f308a7bf17c803cbf8301902b9a077d255c3007791b3464b98ad020d4212dd2d402d685224034e097243bfb8dc603c308033812a10edc2db95324d7fe6c586583d33e0c095f0877bf02e1f5ce521600374b1b18926819b0a1dfed2a49bdaf40d619dd30ab15651b07a456419e30310921029899426b367d377de0ce1d60f4e684d8cb8129d14c40d62e505a35dd686ff9dee950b830e7187f9ddd1dba5b7dfaf8360358b7ed1a3c8834751cc6baa18d8e1351840fcad13bb9cb097c14e153a81c042f23b3b1ab91de4d0c484f71b00f03ac2d7d04da4b0cb4ba699a40fe52f90ca1bddcada1aa2e2bc2ac01d557c5f0182ba31a04e3a7b78b3ff63792c384dbe8389af0ed90c2bd3d46026b2f2b74cf883006deec89bbc15a5a61cec0d95b3f4b189b0720ef74143e0a6a86dea0f9bef46607aebbca2deb8c737eae143082b5aed7622d2da4af8ec55ac7d4e27cf5f577dc08f962f2ba5b09ddfc179ee47f249259c33219468fc295e7ce66d7bf588c4e98ce594fb563ac796a2a61c3163c1ef194627fa8a423b5c62d70f155cbdce1cc3a642299d773f791540acef1ce9fefd40601caf8b4cb070fd60d1be926d2808bbe73bb7c1e8de216f17780e2c390a7d371c7a1e0ff7c193bd7ffc5828233e2aba4c38a15184e807c70cbab91ff14f19cacc2c1abc00c57bfec032ebf77189a767d852510c43554dc08e52a2ebc8b5554f05a9655b5e2c86d24ddf82e16e9aa1455635a759c70c7f6ecc7fdeb92fc18a6420a347062e10daa45a52ffa355d20dbec1324109a56eb48e8a0c65a4064f44e64d3013f44b3b77e35b4024058e6c704b9a3b3c5f20108445639f8fb9664ebe38af4459d18fc150648da1bc08581303c6820d57acb368d0e7c5f3358e7fc3da31b75e29b70e4ce0f2fe00bc48494b6a71e855156372cba5f85d26598a5b9b87034b4cbbf9703fea767979592c05780d4f578dfd057c7bc2616316c0eabd9bc4348f0fe2efe0127a52608f1c9fe371499f73503d6acad078f315a068b737ee306699b07701964d15276d1399829731daf970889a09a0d0f95884df708c94721176386f4f61b34d55f891ee95c6fc1943c729aae22739b87d0493c50c4ee06b186ad4915d8849a05336111e8b679f6605184d6023c796aacbc30c9bc1c3c7a4bd1c0addfd5b4283184f7617f826397cd8907d524fb8b7f7b3cdcffa15ea1497dead96a4a574410309ab0468fa6a2ff68af7bbda6a1cdd5a29959ddb454f35604d6ce1eee809935a60b009ea85db057c24e5cae2647c3050db04b2a840cfbafd8d01b4cc79d37ed81d11bba99101b7a184d0951f2f8d67b4ba8ea1b1eaabd336ad9a330ae45c9854c8879d9135bf0eb532877184eaf6c76b37ee679ad395aefc6c0837afab6025eeca505304f8a76985fdd5eb6d088899b21b12a27a9c2f9d4fc202a2c2a5444ea99153fae663ebc344691ddab0cf2f24ab88dfa827006a0e44cfa12f8e656300e6b8881efbe19d9c64784eb7d0ef9ddf45b3846c2a73e97096557c63787e95302c726fcf43c03a3e16b8993e6b43ffc56679f8b701fbe5a06e3760d2e5026f85e6c245d210ca1b9075f6d71f254e706dd576f4fd29101a7db682fa90826cfb58d56bf2fd1c35894c1fa63db637e314e7e00e9cce30b0471601ae787ae60936dd65c9250cbbf05c227829a9196c1d78886aa1fd017a79748e3e16b239417d96a21130cb2f4415feccd310ae276b8bffa85386f4c9be04ff40443a96530892e6644dbbeb7d263e12834aaf9d1da071ccbf0c3f11490960088ed6c10d8571130f7bf9488c3e6c4e8294d96786543aaaa2b7f729b0dace38247b802861a9562f3b6ba38f301bffeda1858c2b0f0152326bb704acf1a3ef217e71665331d7126d841edbee3d2759c1fc7009c6f7e6ed3f677048065788e7a1065d1b8b3152dda8151f1be395a469016bb84e7a13f22d4adb0cfbfb6dfbf3fa36704b56d3b5fd38da1a138ff20666175260abb51bddafdd212891b3fd2111833473a3a53ab9de69ba6e59ff78a1c1149eb7a9ea74dacdea7d6f4b11466dcdac73cda258053bd338a6628be9c51f0e4eaa73c171978d0e9a8a42aa732498bb07190174ed8d53cfe633b9d0db21df231efa314317f8eb1084124d412ca609ff3930ee23ce7302b12e09debf3de83b23db0877495e71216cec52309cf884e11e88695a17b7f60560958d68147d8a4910e08da8019bf26e47213a598a436032c373080abb070d181f9d55c30b7539c45dff71bf0e2ca3c0afdd0c1dbe00a52fbc8bbaafa7c506848d9d2d5160fbe1c592acaf0f9e6cc390bb101079b12a618f4245c3b6d4514f8989ac04cb828555362cf9fc82e69d2157ce52bbd8facb033f34db8ddf7a5bb17cd3a57955068b9ec2c6a2b8e08e6f0acc8bb96f6148223941a34f0be4e7579bd5e7a174eead9f12c098473333397270629b0171492932906c46e691aba5d85f394e897340b0f71f079b45d1cceadd210fcc6c6a4e4882ef71d8190a1b8c28b3c5ca147cc5bce1ef2b84207a61d91e810d037b05a5043cc2f98e974dc6265880205a6dfb47d5ff17b91adfa7ca009e1d44094563fa84281026ea4530ba270bb51ef0de80cd9395bf80bfdaaf202c883e6a0f13e356b6d1201befa7cfa19abe2e58ee490553e4fd8a1d927e1aeb1ff479614aaf9aefa5f0073457ff4f8f98f238aa40367fdffb799dcdb59b3e55d2b976ff3daf46661ef00f641718ca6af830ef3d18d58427f2"; #elif SFMT_MEXP == 86243 const char* jump_poly = "933da3fcceeb5ce9c3b6f2eea0dda398900240ba716aef34723cf6d7417c4318858493833a3cbb3d094d1b5b977c7a87105827de0ac72d586ef73bd385022eb28e52f3ac527785bede4fda45a0f320de350efecae3a0553e56f4aab32e02124bf83b07f989d2b37fbc4b45c994ccd03f909a83e08c7458a8bc79dc5eda62b7667ea1acf094b636e81119b9a9ec0ddadb9c3433de8d0516d456b529e9fa08382f030c411dfa02a7adaf9a16ce5193f0a17b673d4c5f32b296b21a3af5bdc6da5f4043d34599b04c55ac6f0d4f4dc28ea46101bfa35219d2b79a33cfeb9612bfbcd761925e2363d39144c2efd144a1f05d613fa698b496a1106d6220971386c0055b27627885fc02e14b5da1574015dc10a430c04c99eada982b27134ab35d208335ae903f29a9a28e6f6b7c89038c665bad420f9a9d9fa4de757dcf0059e55f70d189f259064f842a059bf4cf50a54dacbc3c46e2e3e948c3ba79378b39dabc6955359c0c8b5a08009d89567f38d3eaa66c323d1a67cb310e306101ec9ac2f6140823976dd3ab8efd9d85130bb993523878d908bf53c41066b138e801a61ac3e4692ba3a79a1f6eaefada0a95651c65059b7465414f285847d6e6ce10096c0a16f048549adcbf03305e94c11321290d84aa2fa70b91e8fb888e9a8a6c1c8c096c3cf34b41ba304deef152beb1f52090c73ce23910960fc486c7cf3f84ae361ca4a37c53a9255777356c9535f152744e27d20547a6c084b6ce398fd05e1db7b66c16d83b4702b2f181dfe39b4d0e84c6806e537ecd3e01a5c21bd22fe64cdf56e3b6e55bfe7e13c2d71e59c7d66755ed9e60b6fda28043e0ab87e5c04acf84d1f81b53d91599fdb0d65c1ffdb2f9f6271e83b637a6f35572028ed18a01eae10e8f6d54c49bd8e2f21157f5cc63aa90045896351e083ac226cb0b7b3cacc83e2279c3b7077fb7acac673d7b3b617ba386253191a556e29a7fb0be11becb27730c99f440208189764717ba4431af1567fd8a1e8eafde6de886b747a7a44d0bb6d15efbb80017913cf20e32f213e16d1bae08c3b2a28208f3654643f39e78628887d6cb4805a90e6a4852ff2d54c46e9ace0d6a8cb96fb6a90262c04fd755468569f54c0df4604dca1ffcc9f1d9f4732a2b7a7c68eb6ef73fc9712fac511332835627fcbaa32bb2071eb7332f0c2588874a8a610a8354c3b126c1c0f0d1f5d241d0c2f4067fe8dd305731300bfdbdde349b1d7e0c10c922c8caa8ea52fbfef1c87be00ebc5ea0876135c2243f0c07371ad40c27df30974d4d7ff84f55898e1e4bbc6c8858b5e48a45b64326b870e27db9971cdc34ec00ec76ac8cd55fe7bb760d34f0390a89ef54cb9e882f4eec29a2fcacc56e09680ca3cd44c4e8828bc8026e5e795304fb63b5cfbcbe7f73398cb796f685b4855554bea8a097c99771766193c1d943974c8c3d371bf6d4490707961e067195540c4c78283a58c7ece961f16e8286c11fb3bc0c9717382bbe7ffee55a89b11e181c46e67f71f340c0f002ae161355bcd1c2b8187e2c7474b47ae60919840c1119cad99478e81a6735486be692d7a5b9ce25d5f53b53d311a5074bbccd1d0ba93fa065765daf3e0406824821ee345faddefc9b0aa95b7640ae20c38e840880b2d4cb18cb290406ba6d97885ddad609ca0a752fdd08563118b3107e2483c6ebd0fee5ff850dc9548373124b8818bd59be7dedd231919a3654e5fe4b7188c812fbbb6edd7cb0dd4e3f567bb8bbba201ea19fe6cbd4bf66ed76b24cdd7c68e896d48f6fcadb01802b4826df1d05bf548c7ae237a0b594a65a8af45caf9d18ec4c7a67fe87d93cda663783da274a852d7fd82403b3f1dbfb786ee20b20ff29537b408ca288c5daf4f002edceb058af10df710e46472616934a2eb67efe70873b504a4244c3ab52eba5d7780a67cdd84f42482be2ed4b7cbee70df6a84bb22b65b11457badffd7608dc92d9694c1136560b0657699878e69b2b787de0bd61894131910aca33a3eb0d26a93bec963f5b482ff04af0190702e028609dccbc1926c4c05052c06cd136d3e5f371a47c37d7281738bb0be5e3fdd48cd77262471ad2d7fae6b3d0262ae3b037670ceef42b4da06374890ff53e95aa944a64006959e46f7227e764df2bff29d5f88e1bb3cf0e2da8ae1df99285c10e6a45ef1f1108c664865d7d6a0a455a8a01f53a5f4aabf38ae259809091d285b4f6c17b19ec31b25cf59769f559022921d5ba972fe4da330ab8f0cb73fe63af38a74590409d4cbdcb64f3fc2a41ee769c5532e808d88c6ad0687d7969d480efec6d7b79692d9db41afabdeca664723c41bda1c51dcc6b36b77fcbd4134132c192112b12ef6757e730bb11127a6dfdf1d875d5546da19e9e2310a49aaec765b6df77a9afb36214fe552dce4d2c52f3b1539c3b21c27aa1e47c9872ec2f575536da458127409ad126f4c2927cb45bc7d328f74739e786a0a09e54582e59ad1fc8c02a87fe4426bf91e1ac8114a991b4c38a6586ccd93d4a9b5bcf21c0ffc27c0d8050694e398aad11400afd7e87eaf04c2494c6009e71fd12ce315bbddc69023daf5823440139de4db0314c460e8311248221c8a0650056dec507ce2f4a04a96e8ff9d6b493d91d1a70b6bdf5d53dd2b4cae372b2c6361ccbb41e3aff2e385d9e93b9d5b68101c2cf1f9d6efe3fcaa6d5eb1fa0c734ea4ee7308649f53ee6e45609f9ac5c3e2716d5473ec5996312316bad007e254bb71087d760ea8e594830e01da3f9ab07f3da4a96021ef234c6f6b995c9bb20639a709d069b6a89b0dcefac4751610ddf05fa795b689c7d7323da19f25e9bc205610d3fbdbbb6804f45daec7af60b73b946af3d902e067305e001e92efd42597ebe45dd0ec9988a555a0b0a06114319f3cf792d46b341b0ba73a42b345ed9b9a5735c6ec10ed425256c11e52c49c5d1a09846361b406541122e6b6967071ea798bca3184c2b2ff9d4e99c9a6beb9bf797665d70e2d9b01e1066db3ef89836267861ddfe61ece8520a911dbf460cbbb08e10b2b1b617bb824403222a01090290a04063d9acce34209a5c3b5a5ff1ac7a01a56a42b23e0d03be99b34016706ed4458c294a72422f4d380a1a516d6679192fd14f284e505a4aa3b48931e2469bcf337f7a60612e8b46db66f951a02a71bb4ba8c554edf1e685bf1351f4a314f941ba45ed049beb650132a1141ec6052814813de5bbec8ac87d711605b30a536910de5ff0fbc3153c893da525774608484338b7b43aae4e744fdf25d1101a59e4a1d43924e54527c041542307f7179c44c1b8429af42a5d494df4b38521763706a9e6bd0aa867902e25d792b9dcc442710f7b70c5d793e6c2660878c8c15a12da82992f836bd742456cfcda30e7ccc84d2447959f0b6210bbcc428a6b33f5254d11e3fac4ee53939e072a33748d42beb24bd13f19ef0034f5013c3c8961b733791848ab0bbb5b88fa06a12c55b0e8f5be8a10bfd37b7e65223e658006001b4da32ed7dca264b657188a8c694fe6fcb6e6064e821e6808859aef0bb35678ccc29127ed7d74fa850f98d5f07920b7c8143fc838ba7dbbd8c4832268678911456b6c72eac0c5ab99fa263d92dfca65a2503cdfa948e3e48223f70597040b73e8bf14534e880fd0e5d8c6e278838870a58a04eb0962f6783587d5d9741f4bd26ef8aab723a2077a059669242adb84d1f80536dc33687132e0fccbb1edb8d314de1e793f4e851aa609eaf59ac05d99b126fb6a782f67eb6a8b854c98651d03a4ece157c782e02b6ff118c4157b44ac7b1e1b76a50bdc067bebe779505a8fc86691becd07a2a34f3d526d89c221e1d52be0df947599d292b289a4d869aca01268fe80a2db201b0b49c36ec99735b8893257c64400edd3707dcfd4c01b7d7f4fbb8d8ee08b3620eeee032e42af32bda8d4ec026da77101671c897bdd58bf709e823bb02a2dad0d744dc93e9669e97a06c3ce73df80432149d0337e1792846d273934b1fad277ac9233bcfef425d53e9e757d793af2babcfdc05700eea266ea61c7f13260c124fa66e7db7bd337c459a2649cd94af8dade401a95dcd7417aed5dfe2cd83e9eaa29467f560d8d9b63b082c412689cb57e91cad2aceb0fbbb9b8ac2506b396791032ad00e33ba5e89e9b55467d5bbdb51ce59dfe061c239e7369141aea59fa9694ab74b8e5d025d6854941ab3a19e998c1b7f468a58cad9b3bdb6d29b2aaed4e58aad4942a707b4bfed362ed6e4b88a0c068c1516644df74e300b9c79b8bf03b07ff25e44cbdaa6c3bb430bee090cce4eaff0ae54b2695464d2cdba60408b084385e31389d652b3dc5f3a480ccea21bd34474528401f42936b52e4b6ed7a0de284018a4c9272e3126f333d0a7eebf7127962dc776fd952c6e4a260868cb953958e86d9bce70a85729583581528f50efd537fb48badb8461f2d1a2092eb939ce46be0be1dd6f8ced266f11703b0fdddd00568afa2183fd8d8449bc4a75c1bcd74b5dc27aa6fc87236382cb750e397893f1f1398382dfc165ab82cb00126764ba00f96950e5e39f43596fab826fbcd10acefee70e47f554679098f9ba1de6eaf777016b27e66c90589fc692bf406b4ed6860fbeffcb7939e1df7ecb3156aa6ec711f8f4d83b20e38d5e563306373296907184b02f0d436d28bd5cb045a67020a79553f4c953d07aa1618bd579725692ea6fc7adc31915f9be89f82ff6ea1b96ad30318753279c9681f44b2f086ba12382bb42b4b7ca552c426eceea0726f26bcfb71164e984f084563cedace82907cb47e61ad9deae8ad70078236d009a9b08079a28e452f9ac25e992aab9b718a8335d8f81a1679c54771f2a7b7de253b3f02a80d73eb9d49cd5a5f2cfa852bea7fd111c21f356f06e56a503c9b2111fc33ba355489baff1ad1eb131f627c4a696aea2db3edb18f00702871d83d062a24d1be0f652269086621734c4a7da9d34341ad05cd8c3d57d243ac9c085e2b7514027304a1b74be458d156c8508b7976e26f6af868a3f540e6513413804f008dbccb39937caf87b1084d791677f65bf077e602a43e419c46d0f06bf6ccc137408541dc6d477b451fe76bfa3e5a83e8161b2054c2771a26298b3679a730381e267a592fbdf76a982c4c2f214aed369fbf5d0f0e31c550122e09e4227e8857576e09edab1a3483f28109bbb9a0408edec12c077d49d93350216877ec8e853aafa3207bb0a798fe2489253029d402c46468a91d93d3d09e767fc2ec3740c690a8e649b9c9a958477a5ea6daba15bb56b83bcdf40727991fc95e2e5834822665ae5cfd2dbaf95bb3b05fa6ed873c3a8dc6e065ef589ce06515b946391f659337d7625c6870b48d7490dc404f3dfaeef407a928a2bf967df03a428febd55278ead920ffba4a1dfe38629b2f73fff881b56b261e2ba4086e29ad793242a780a05b78d980762790a5fa59866c166595f6008acdcd1e41a0e987419ee81da9eb17d7545da1db9529a74be9db9f40818b775447284d9f551fba60ba7ce9ed1a0a1c3172269d65c65659c53f035074cfac3200d381467c588e806cbba1b867fe9e7ce5df6aaee6343d4f30216957592c544202c4426ffbf6fcb8cc783da4331cd9a58562479f85c186c8c7a34075807276d887b87dd783cfc4f49b261c139686f737ec515af4438b6170ef175b0eb0b88621217cf3deda7df548fd8c0f1d84321ddc967005160ee4065f6d29c817c543676fee3a1be70317bf3937f7c852cd5baa3173599813144eb5fe54c17461d235a1e509dd0080a16035ad8d34104d15651f18dc82e8270739fbff49ff562c14dc9a11ff75f32d6393ff8c04b13ac4241454db70f0f20580fd8f68c52c083561e56d9e6c125247bcdda019ac4afc4eef89148980fe127d4a1429676824647e78e3946e125cde20ea36665c00b5629a94d8eb9c9827349004cd1c1c5ed0ec07b3c527766ffb29650b50cd8c7b73de5bb3b57a5926222f8c5647280a6baf45107f23c47733fa58919d70a00a7c1f72394804f2d32ebde3ed17012b1e49d390c378625e7986dfb5e6defb115529744eae56a47e7ae24f6f9cc974ed21ca474b00826aa8fbe30cc81cd52cc8a67a2a5c157b404de5cd6211e367824d862ec3f4dbbc22feabaa94e1757caae1939033148c46f250df319f458399f8d5b9fa8989a7e2fcd9ddc16d65fbb8410943da761943c916fcc5f1dbbf851a2e03c7abbfc23fbd22b33ac6b1cce65dd35ea91925ba0056a8cece361ea6d73a51956bea72f8152883b95ee39680f10062fb95616fd9ff4f947bb317f5bdf8578b06265bc9b707d8d72cce5de98f8b2cb7d1a1ec949ac1a70425630ea06582f1142657dcf37c520d8dde768785893fb2f3857b0106428a2bdcc4ec33338dfeee946b3069662d9b9d71a7449f2cdca116f632d329a91e62e972cb15796d78fa87b562128901fa2ddf6e863b0f926a4b1c1290212655992bd79bb34ff5f42ba87f0d9c615c5e2574506b92f624296fa0b45c2c1753a64690f1328827165d34fb9425b5be80022f2ce31836c78bd2a07478680b07a9d6ee13c1e22c4e89a8227939a45d37c88cc35f6f1f387af8db0989b4e2438ca0f26ab93a884f0264fa4eba3366cf273ce7abdf560f5b0f43713408a18f30dbdf3f01945df3f6497f406f412ef280c76f2c4a0ee1b6d2a1645e0125cb867a932036fe1c898252fba36b31c80dc3bfcfe9f9106ad98ddac3a4bdd288c5aa5eedee6ac079e8aa9f1ae3bb936fc69d8fa4ae3bacdb4eb2da1c71ddb82fa8c254c1e8ed60cf9b2dfae7d2be8126bbe3d7b8331e96eef0566e0cceef9f8ef0a880b2b22a9dda3b16c33b2b5df4e7737302c8da0a85c4cd7f8e7bbc586f0c569369f417bd45a89e0287ab2be14c99f9189eaad9e48682df12db049b4326880b239c3ef6239f5baf0a74eae4d0126f3481bc7d2583d2725abbe8dbe42478769d30e9f39367547867560f274970ba1afd909214718ddec69ae0c158f9db32ecba02a537262fd5b4c232577c417e12acb947239fae4d667ee806fd0bb675fc2d9f5ca44f31784cb10d1f3d8fc8823fbc9cc634370522361299f87b58c17d6f23172dc90b724250a1bae745d2fef5a1753f7911e7990ecf04f8d858d2155e2c4a9e72078384ec1e84066c214563b54fdec9ac8819f4378e2b38075e8c95bbb7a50476de7b4fef2b394540a09e0f06a9e04a9c5292f04143277ddc86fdc0b1cd818d0f0ccba14f1129033ba3e70c75321c81f259260f1df17fc7d27c6d110a2880ae7ea57121d0acd75bc08f19137f34b9d8d3775682d572f76fee7e0bfc67d73ff5c4457f394ab5d96f58e171556e9a4a52ea71c289ee369f20579dfcb119695b62e1e89f771da735b8f95a6ba6d1a2ea62b23652c6390497653f8dff1c23c59eb59fa5e72a3c9a3f62fca7be23ae95e7b78eb6d24d2d04f0ea03922ffd25f649cdf3b1909b8abdb840ef2ee0835b2c70674ed2ef5420417aa4e0abec491ca3be07488c186c4f3b1b6712f82ef2b35c3dd4ef36a8a563a8aace2e0590a1c9a5ae0d0518dc8012183b65d7997de640733f568e094143ac3bdff3355d151c706733fa3dba3bfe61f31e551678c45fc489b271b6b4c3e4fbaf50fb2dd9e8e94974c3603e02562729fba815ef8814dcbf7195b2ace4e058daeb8257389b906d1319b2fc69990b1b36fc61aefe1837631db43279e8f986cd5f2ec2ad58f7672cdae1b47a7c524a187540ec6ba2f9edc9940743f8121e92c05e3f380560fe2778cc4ad4317d0f80dc6128a45d3115c42d4ae62fa849abb6da572de61b4f9ba99bd3567d70ec002813c0e107925cd0fd738eb1ed0bab3f149348bc7b1d12542f2ac788223f8450be7573a76d57b114e885b569259ccf57884fc9a9b8c94fb4de7e63f51fb3a1cd78e41ce1329103e59372db3f0a9fe8c10bffb25477c68f859fb355f66ee7762e6ed983e616bfb6d7f15720df679db8ab3f1a2eca06fae10ecdc0e3ac7dbfabfec738d459e91c101bc96d6388ae2a9c2bf7ce65dfd74340e5e7002a3fd42d77cf554fa23bd9e79f50904e596cab0060c7bae6aa79e0ad92729e6c1c5200ed426d61c6734a21e5b78c07db6f23ebc02a66a371d3a8513746b582386ea8a488ce048ad8cc3635803663d2369f70e825e2b0a0d911e96c86a3dbb31af8113058a092837597018c465d2152d802541bce48e4ca28b91dfe771c7ba310d16ad800fb88133086c1c71e2690f9c936020ce56aff382f54b3d247afb591238ed97bee690b29bf4ca60754ebd46ad3fe0b66dfc1cc5a592114ab5a634adcd3dfc01116ef924365364826c352305ea273653d458915354e7910bd6a8ecdb4439eaf38545ea3ae75bdcf2f91a08026e3f1bcb16c2d7f7ddf584279b8b1e09f6d93dc8f78d8e148784af397c4c77ca040b3e0950d75bc32646332590787f3885d9613c96ad50f85b0210ba1a9e84c57adb1e4fbfd08e97c8c6721a71a05e07971614133bc3e881503b762264a261197e680cad91a039db80bb28004dbc8aa75054a08c4bb187193d1ae396d8a4603cf08ad40b4a8df679c4ec140ec94d73e01bdce011cc2351566bcfba5f3273e994515e4ae1c0f6927e8c0539cae98e3086e85aad23f4a336b492fd9a70738f784026fa2a36c623f06a53e41c178505e652b944d9ad7a3141f3e6cd236402d20f33a9666bbe9582853ef64435879cc9a2d13ff506abfdc3b318a3a0451f6bf5dd5ec129199aa9fd06ab2ae89055e4fb0a791c0b406117ff3736cc18b8b4a82eea7a24c24097fd74da991a1107ebadaaed6849f74bfe85eb32b514a14e7a8ddd3e9dc05b37f6945a9eed0f9242e4cd1b1d7ff4949362e205c74ac3333dff828f62e5b20313de2d6ff1d4b423604aeaf00d646fed13079eec0dd103231de9d3f6ff946d44a025ec5fc3a212fd667b8f432bfe8b0efbf20f84b6c192eb330e9899022cc9a907707c9c6ced0937353eafe220f43d969f7d48690204f25b523bad8ddaaa7d510a5a88f9846c6d8f023448c109f547bb63e468c1852b956c7d4c703dd2caba431ad809c13568eb13ff0f1205abd5c6bcaac92a4d658e04bbd8b8770215789fb4f3a3d86196812b3a03f51e668db6b9f7607d6b2951a7213d4668608c808c7fb95abb91b6c0a0ed029ced0d894f2b0bd8e4e90bfc0ed3a860ffdf6e478e4fba3f8fd5ad3c9a5db7c2c9e0e9656f15a0396c846f906e91ddbee43e86e56662ab6f9338b20cf1c37c0abfd43ac65a8223608cc878f6bd4df62299496e942f5979734358afb5b110981533e442654cc13907e35f9d5db6fdb1920da474e305216592db4a61ffa06e6da9da449958e1cfe124cd4bc0f6ec7f6846be6dc9a34b71ab8c74f7c362cbc29b404361cdb9c99ebbeb3dc24925f803c2a91e7a9236e631e3fa3cd404e0de38ac8e82554810934034540ab40451581f6977c3a61710695cd0cd5e3d2e9a749e334f178ef29610579f10c2aae0be16503e39839f77c1b46053ed19001adaf9d481c10fcc1d370abfd36db524147cc74ddae1649c6bbf5d87a21b7e97d1419b7b826f655202f5e24585f1527d498ee556800f9db08a03f2f645f6756516acf4658e37439588bf32068413f20df406de04c5c92cd6d77a5cf7a19f98f96591e12ca70f32d12bdc1b8603a2aa09fe2718179a397a137a6873d282a35949c382100a6fe254a43f29ba27537d49adfd557194c6c7e34eefd3841dea26e4728b1682f9ecc840f088dd8d31d1e6b0b80bf0860ed508e447a750203776ed9c18d05fa36ff58e6a44838baaf3cfd07d0f41eb6335df480300a9262939f8808985d129f977b50a1131d8c2b65002031c64190c3a29efe991fc5ef2ea71b3a0b69ae22c3971cde5e94d713b98fd4ac6d3ad923cdbf622ae6ed3a260b57e3bcbffbb81de5b7ca4d3ab6d7d04f2deb777dca4ecf44da831be69f1bc45f5715bac6700f83f909da8c196ecbc7b4c35fd0cc593b2ac6501e1f2e74f0fa4a321a7cf5636a696ceb0ed4948259b3939970fd422533b24bf6361afcabdcdc6ca2186da9a53df423c467fd40a39d40310afc121a0a4fae35f0b8f36546e5baea387488fae0c4c1d7eca0ccf4328edb6b95ead45315181d0d80d6bffc4887cfc0204e973f018ad4495335e34feca26519e79df934ad04e64bc04fd826871e232ea11e66067aa95d2db5b8c31c790fe904e226f4d9a375abd2ef5e6e666b586a6333000b4f9eb32abb2a4f761a0f3373de4790224cda53160ef93cd4d47082d9fbe70f15b20fa24633ef9379a6a36222f253e26fa9ffa4bf90f2a4cc4e08f096f46017a198615cd3641c1ba727e3dc0965c8c1a86385e7243dfdc27874224305225fa19ec9f986d35318a4068e7ff02ef9fc4963de89ea531b4f22c88fcefaa7add0ad195631e38a52350d73a41994978a4a5734b53abd5ad4e76872c86d144669e19c58f4df7104995d94059f59f85fa5014e95935755e84290a7402cea6cc9a25a6911a63adab9b7c45945ae3b476be7dc87038f3ef0e28fbb0bf889211863c4ae6bdb19ee2ab1a351d57edb3b5cca9e541570f3bcb4ac4dee6fba80562b32f20b2088e86927517c287db5490a50a68a1adc63d54ef8ccdf24709a2ee8bd044f0614b2e2838f117501538c6c5f5209bfaab7b5711c5f1c924ae856092ebed9767f4afcc7415bc3c1291e2499f13c7d5d3bfe7c07355d53002e7f0b573bc3c307732726236fa0115eaf618329ae079f1e385dcb131c7acaa5a2e2aecb84bdcf81b3f82ec996d10c3ac2b883f72b63ddf2383eb6f070d42dab0b43f5394bdb49633d88b2864fde3d8786eb2a97971ce231ec817e18e352735de450af6cc1243dc4be534d3bf498d86fa587419693dd22f021fe3b1fd0ed13a6462bfb055a38157431e4cc6e35c61a0c2c7eb26a7b630d2b12cb2097465f97c25fe31023f8abb78cbd75255d0f0c3ea0878525c66074aa18223c68699068da082e60971ce6f5fb4b04da32c0ef1f963a3aa96e42efb51c39c335a851670661225fc04397ea5a96f8dc2ce872f0b32eb5bd1c302be551178f8a10fff5325ebe770c4c2ce20673e15d088f2fbfb044a20d91ed4bf7a152aa43a38d9b0256de82e1985875c841382e444d0deb3f34d112d7e0c9c6ce9e228aff9fe71f7ea186720602a48de3a5e1d33a36a4b26d43f85ea6f931c7984e34dd5e27540c2df07ca1ddc095013bcc7950069e9c60f0962bb9b6eef02231218532d0c2e527029e50ff4e700e49f1b936361b74ee878fbdb905826f69f1afb3163d53fae2e23d71fab45a8ef75c97dda24107a67c47a57e967dbc71d94286b2973457c7fab999cb7d50d23993e3193c73098d2babe747224e2de2fb13a0b2dc75b773efe1aac8c4e824f9c95f1d75cde039bf46a6a38881f511ded9b534519434f1d8f7d729b097863d2a92feffd0e13845055d3aa87b80011bdff1641e805bd4af74ea43a91e5cbcf1c10fe75ce9c6b7713df546e2c4f708e21c55beedd730299c37d1be6e2f20971968b246afcacbd33038429f915977bd2c546bba548e671c5c73ba592530e5fa5cc6d609a560bae025d3dda4614596421316de48f38c0ea438a48694410928eead29cb5a204180c559cb39fc1b8526b3ea1aff74e4c9fdc40cbda08fb20dd1e9d2d3d8a5266a91a9f43b8edfc8b3b7628c286b6075dfe1c1369c38b0a15f2a46295fbb5533d46e0e6cd1b4a241642ef23bc24d098f92f00a19dd924bf73751645d87984a88475b3d3b0342448392be45fda03d82ba97b0343392001e652b603c49612fb2ac23ef3c5ea46981872f945f40568c82c5cc942877dbe617392489e3731c0c6b67eca044e3d2dfb6332b80becaeb60fe4385bb61d4102530a173cd9f3b839e6f50ae0e94a122a3d67bed565d084909dadda7a8bd5121c245adcc187b751bd4c17083924f22db8615c92e15cdd27f0221265bcfa0c579090e3e4a822f6bbbb61894984e9736fd570928ef4f1f3f7975f341ab4cfbf7146c54290a853d2f12ddb6a9a38dab7274d1a91fbade28dde7f4db920a39af3a6f452d633a0a211e2c1d8a1ba20174b088335ac68b2dd57647cedc00c65ded099048cbca3c8b50379a3b7762f31072faf524d003aa9fda8d641ff0ab3a9c37c0d995de5f642ea61979ee8f72b3a9d5ac19a01146146c439c74e8c9422f9cc4983cf61efa2c551f9cc2d0a80ab67504b6f877266ef7dc6c9900732c90ccef3528def09cd7b61f00cced268a5f78d7007c6faeed4d95e9e5b31b8fdc89dae354d3d44492fef126bdd6fffe610514a1da767870c5b55ee9a83aff49af3339d3d57755f5719fd41e3386dde7db6b69be97d22cedf56592f0da36324f761415f3dc0e489f15a28891003dff13adc1bcff1c665cb6d9a0c8da5dde59962919789f46179cdd27c21e6ec81be487cee9dc34e61ce56fe6bb8e71263ccb1fd30344650f094f7cad9f41200cde860b9174e8a1a77b2f6613647af8ee6b2e81e8ce32234503f1e8fe2726142aeba9fe5f171639061496849834bff74e80de5c7c7ef683ef9e0cab8bc9c8ee4685e97ce1fb2a6010b77a0cfc6219be970c1a61e2380e5e50da1d31b21a062b9368bd5201c0b7b11f51bd402c0c9731f79d6dd495b3854decf028142683b0f97c021d5a64097ffd16ca5f7b840e3771b848ad49ea1eaa38e33c01c1fa75f4787b8d7ec3d8b9ac8671264a6fe05cdf85ddd56264947dc09f8d12b6c556a9a10f4b33ea0b577eeea7ee19f8e5cf177cda3fbba6e7346867cab38cf4ea60cc340cd841fc3873ad4a27c4f1d0734a05fd4d1d323e5000c953a519d3aea87045bd7a61a31e0d0e652569c35e831d2685f536baad0fa0ec8d5de8e7b411836028398c472eb089ed3c1f17c4cb3d47caf5bfecf89fef33d9954fb16c0d6333be1a0e951d22797e8062f46957e3fb4b0709563158139924c2eb423a985a312906a46541ee95cac5db8c30a4c482c00b6a9676467b9472af5774954144b284f58c1bfb918ba70a292e8cf8c78c6da3b79d72a094b4c2051a44d8dc413f8fdbbd183e2e5ca26810fca0deca73e782857cfe86781fd2371622a487819a33fc351b28abdd054867d449a0ba2bf0f53d5f008fa6f5160e14e816dcc5357fde557778bd37aaa032c9300e03fe2f4e60d99e7db90006f7103ff130f1f6042e0b57964b94536b8d0ff5e7bc4271b84b3286ae69d0e4d9ed706ef4896aa7385cb2bd3fa16f9b093fae1397d7469644f9c8378f843319dece76db49d951b287fa6869c4e3e7f77eb1a6abb6942e8b8cc34900f7942a0bd0e00e3c855b476068d6e9f0ecb884effa8b7dc462e51549da143c2c65a2ba73a735e3629472d6057f44275142a8358f86550988cbc7d730ef11ab019e383f90440c5fa6ab5bd1a55cb43d6cc60c9d998c821d20238b91fe7b091ec2a8fb347e0a0a675fa110562c23b597f144c71ec169c3ec079351c560a49c71642fd336868588ccd8e634dcad6a6de983f64c6727428f2072ce69f9b17d9bcf25909b224efefb64b8dc8590695cacde49c19d58b4699144c5cd411d32d628803bbedf344f3139703eec1289e87b0db7e7c15bf8602eb65fb895a511cdc5ec8e99c436c598918af02f2943a01620d539a0a368944ceb230081036d1e3b682e08a3017682d98bfb668e5a99eaf1f3007c02fa6381682f807f0734b00611143a99f96f254c14abf951c28bfeab6953f3224506c9b45cfd5faf35d826b2d116e2f639af2a1b0862e8a72d1ab776668de7f9a29c39af37757869b59589a399ec6e29ac87f66de14a1a221b719012ec194e11580a6771465bc21130caf9019ee20c4e68ab2795c254057d1fca0e98cb5bcfa86347ca41deb6ecc55618f0def1628edc94bf49f91652911e8414fb362f0c2bde960f35ad9f2e9e63b2acb325be36b91cebe258373003eac9dd35114e04c6c3f389500dc9f28f8d3591f64bd0b96819246d29efa4ba4739651510e5758f3c0880316f27b7c23cc7f6e87dd93fd1e308e48e7769d075ab8e13a476adfdb1c6939f7ab3913bcb86495903ef3cd7115808f45005ae5b868b369ad89af197aa20c7385f4a7a445102eb778fc1e83d62020fd0b7e242586ce0d6daeb317e1eabb656556d23a0687a345a44de80748ed1817f20cccc8643957fb87328ae99f553b8a0459c5750952ecaade9a7e13346f5e2ffaba7052ef834e06883986540436d35bbc0a29baa1b9cf1ac79c54520f303f827d421c04dc3831df241a0042871debcd5e8bf76fdae260a41422633c51e225f2e5c245e2322c93b7ee1cd28a21c2fb8fb95c9a12c10b1b0908942d94c85a5e247c9abe38d2c022adad3c97ed1d66ecc193411af9cd15bf6fea9fca92578b0b96dd877620eaaadbdd5cc9d66a80d41c5909e7908193efada90ab04e9dd61446f91b50f533197b313f8d0961d8679b11886672f7e9f81ba5bf4050add8df0db93ab49ab520287a12a532c550727cd1acc522d214c07d8d756f0f4f5b95cc9a37d59ea518b8fd898d88f6cb4a6ad243f72f5b1c44a161f2a680e93c60fc1db562a9b8022b8fa411d653775fc5380d5a77d3d3ce6688ff32b407d0a59b8014f2ffce22e708bf2dcce12027e7723d1ed9a30deee2b68f9be0858b13a22b72bd5b8067ec035839759b1cc7808e70c3cc2de44631197096dea67fce042e7e78693ade8b1579968d8c6da333d987acfc5ddf7be3673894619b07eb36ea80f1f6ed70a18dfa4a1df447c5def09522955447eb0a428fe33ca9392a7fa2741959b7facfdbfacb3e211913e2bab9a4190c51a3753a1566469d7570595458c23089f23f102ba55210d3750af0104b25e4a2a96c9318fd851e840c16998a22ff58dc715cd2e288d2457d2bc07c7853c630184a7438653b2cdc81e66c3e89de5da160d9985c2c89956edc1cae96d3b7a208db492b0da13738f4e56bc6fbb875e4dad09109d3599f033e8d8c64444205f3923e2248e377d99c8aefe1a525e732fd0eb64264f08a09ba765666672a930d8f7a9d926aecb68420ee1e5b2c6bee9b10b2196d3fca8cb2de81188613bdf2f84ab4686accaeaaaca8ebeef84a2eb78ce6fd6170614012bdb2f20f07320c153e2fa84b4f80819e8f70731d7e1d9e0b13c787057b3e794bbccb88b072546b144cfe58eadfbf0f508a7d42e5059ab3676b5a459f151ae9b6e36f92517e053fc2a56396fb4f04ac480f49d15"; #elif SFMT_MEXP == 132049 const char* jump_poly = "ee86f54b0be59c6204771bea03d614ca275a40a9a3ef32f8a14fea7d0a74faef106b8c6406a8dc468b78b5494b3620ac0b895c23685904c1cefb5c80336caa2ef9d5b595733f2a6f4ba6f1acc44cce80ba67f0da127f98de09e07314c32551a9854d09a8d9a64b9f3feaec4551d7192c49c2f02ecc26f5f2fd1da46a77aa0c3f50576c5cb604105abb3af3acfaa7ba2dbe5df35af84dffe4ae0cebaa2fa8ff5c85ffa5dadb5881d02acaf4c7412a8c1b29503150c96fa2dac1dd44d771fd6751bb3b53082a9723e2a80de276229143bdee8e97ff04330b01b18c045eea05eb2dcde96d4aba501139e5a04f2aa598fffaa37fb86c864ce637932cb85db78086b8eab55901ebb15ccf44f75b98d429f0aaa6dc23330760b2e1fd62e1bf421a8dfbf82b33aef40a6204cd82ea74530ee84a91d18cc4b0db9e1667cf51636f0d4ead28ba60e4c6cf6fb80fe755fda562b88ff69af9b7e6186f2d80ee85ebb261d1b0575e060307678b58b4e20b5a75161b648b93c84e905849322db4add38d92528b2a8c8c0fc862efa9af1416220bf45daf16e6aae8bb483bcfe221fd9dc968f310f3112ea04e2f7a74f95fe76f8243702869e5fd4cae544c00f794c598178db80e974b56d3f319b1d04eb75ec01e7f5302444bca90f04b37430c2ee63637d784e4bfb784e908048bf14b3742738eb689a38a591fc6e998d7703f211d2b732428bea670d244e06e8ee1f852ab9a3f9e5412f12abbd4823c39189984c076df8545c352a7a908355f3ba941f0174a0997d979dbeee10eabf910dfe9bf7875f0548675a0037f3aa2fbf3478e74a438793cfee88519ddc261a9d64b5da7d8ee025ff24fba87a88484af04a5b1517ef7b448685694e5d2ac6532caa93049594d5e3e8412e8a664283c87c551d337825a0ede17725d1328069b99053aabfc7c49e5531127d276344b87b3e3bd98b920ba38716c084c0a7b0fc8e0787b9a743f5719c3eb136d49dac6318af2ca545c5c5a7a93a2ad32a5a048d97c1fc7e6013a61fd2731243cfbb3b6bd8f793cc5d75b021bd5c7bbfbe63441cf794feae5eb26146c86db3d7064e085b8a73596813eb48514b461db5252d7ab2085defb5abcaea42c80155dd03771eed81511e6909f57a2193f4f89143c7b9edf19ea7c30860cb923ba2024e75e16aca442feb2b9a52cd7f23ebc67d84be52392db82e13d531714be8e7979714aa4ff7f028ef51684ac065ba31dd66e021b26a6d30641a7453aa7532e9f55b778714462bedd201dcd37fb253c3ac193f90fdaa9acf7cdec8e951990df65817a6e23cab25a01005643f3cdf8cb0a455f8525bdd2f562a1826e3d8e9e9b92be572c65ea9b11f41a7c4ab56ee914302753bdbcd1f32c37c7976576d67114421d2ba3af7b4d231a58cfe1ff13b3f4e8250a9bfa0eebc56a376ca11d4b4d2a982fef54e10d752f7f725597de30718c33bfae2fe7c90b248495dd42b209ddf072a74938d2a324a1e359c36e16ecc8e79bf3bb4b2d975a82cca1a1f87bd2f54db0d09e5b1b6d66eb1ffaea2e7395fe6d053e6a5617a81c64326b72cd51ef1e40b79781e9bf3ee50ed40e58cbfef3edd7f3e98146d546baeabdf2962d0deea963a2deff9b0b5b5e9f2cff6c12b352ea129d0a556f19741b31bd7dbe7448d4484c19b03ca2bc09e42943f09f964c57e6fd78c7985a89d5eee5824c8118f111f5dc1f5458376d0a53b63f499462bdb500961e3e81d5dc7a5faf8f5fc3aa1fdb7b88067c8c0728412058fcfbed549918e97e6dbad3217cfc44ebd9521f6a81d0c5b43e4d2153b8d9c440067753c347c545037d3558c36e2985c0d9446c61e9caee16b657f47fdc6bcbd9d6798dd9b143824e2cd0bac86b529413fe79c916bb0a6ea32bfad151cd8da32a5ec76d362de1a909a1789bb86ed83d2645cfc6daa8c0d99e05da4f3df715a934a4f5d765e0d7d4423eb5e75c4a05624963144ff430ec2ccf5f952461fac9889ce055e649cbf56e9ca8b7df17b01866952d417e2ccee00e6a6d8734adb6572ddbbb808ba114fe9d79167e7091a395fe66254d408b53651e9d8d6643fb4407cbfe1807ce6b53188f027c119d5c63711cf86a6cc30ed0a595b11bca8e5e18562e653e18ea154ae7400c7103a0999f7dde95b7c99572f28867c3b3f29704683d17cd836d3dc9343877d22c07c53e5a70d8a698c64de80f765b5197418370afb276737f23173ae8dcca3923d3f3e5a0650891aa05b9fcd2ff268cc354afd2572a5680e98bed046ecb3f5a0cd8f80371c863fe4473c82ea44170b73a2d3883d02a161b7d49257b8e2e748d9d52c93778cbb9c65625770b68ffa232ab6abf144f05e04b00e05e1c67ef44858bb05bb4a670c337ff0845f0be8950257a3def235319b54f29e67b1f8d039836d94473c50dc1df7ef85d73057da6f21abd683a91fc73f725a6cb32a525687a0cdf95c2291ef70c366a8d0d3e23183c6518c75fd5fd40d680162d91709576b4c62c5aac877f1376cd6c9d5bb5230e38b5c68893869a5044bc4aa7c6e6d6ac3618d6e22a3c33d94419f8a5d412bd5c0b545b823b7f4484a669a7504e392369456b13172903f73479dee36ad23d8ff3cd1662502c29ee84c9b6887754b40919859f417563c7b870b20645ad505540f0e910350ba21442ee179dd3c0bc61a2666595f6a3dbe38295c9668ed5f6d041e91584499fb4749b626a74253938ee30935fb9d318fafcba84780264479bc2806ce95ec66bb3f002dbf2933e1352fb67ff5380c130cd3cb1e8f442c91fb623dedd544b928fb8be3fc825466da024f456d48867a63032d3a1f1a959aa8eb603b2a1ea5916001ba7b7af6df3795445ddc0efd4a764ef466ced0643330435fb79b18bb7409af5eaa3ac7e3613af81143ca0f3bd53ed09811752d9f8370aec3c98d5392d89d1597b5eda76f7ec0da2732cc390ba80f5b761a030c8908d40a6c68bf2d01def6cae902959a129e799ef9c512097ac681b06a724f57ec51610ab10a83a511bbddad206fc6bc163c8637c8cec1361dc7d3e140431f382aa2beb259f64829e178bb00d58809db17812c5c36fc9ff634a4ab2ac1471c5c7792764e8b7d191cb0d1e8cec3dcd60db8061e28b10d6318df00116ef9d2a61f142cbf338ed649020f89435243b7cffd4756654b886dad9376fb3b4df1c00fc49456a8f75684feb6f2852c16394e6af40504e69442d51ec3e8518a29944aa456aa92da2f429abeaccd259a1d1bcc85f4c70b2f5783275b762722421954a627b9bf29521e24b253edc734885147bfe048f38e5b2efe0339fb06883354518933aab287a20da0732d2efb6c5b3fa9bffb447cb1b11fbceadd12a22019e5438c60060905a74beb45882d7fe763084c3831eb438fd0190e5bb7e6acb6853ac4825c3494cee179981fc2bd73b74e251dec9968368819202daf125612e85c33602feb2bfd5312db2248e0fddee85195b47ba6c473e71e662dcd0f4aa3c3ec54c983b0319d523fae3de82eede4224c6214e2a87debb2df0d51a0529bd87ffe796a25e3497333b71a8b5103fe755d2e3661eaad941847dab95eada5bdc442018c5461074da53542f03cdfc5f82ebd7d1715620e06c17a102c4dab4f87473930fc109e07d427b97d7ee479f15b55bf0172ae2a1ef459edaa4cfb2caa3cd54d4aba3df6ad6cf487921685968e87b6fa65b435a1ef61c29b7862332137776b6f5236184e1bfdc2a1bcbd03bb3e5a0e0c271c1123475329547f052bc4a2febdd6abc0ffdfa04a5bbc5eb5cba03e1ef72be29783092d987273289298da994a421e0e296c2f79d594443218edbba1d44adaa9ae4b8820a5bca8855a26d282a363e06d29e7793722566d5fba340f74352d3ad16bcdc28f66e4b9ad3ac5a53f752ff21e68955da846c222cd1aad25ebd280cc67ac89764d45e7793bbbeb898f540263fc39c722a3cecd4c152b1d9c591db5150d8d16f4feaac937fca89daa4474a81c560f9562e98b3ae28821d7d5d73704180a852c61a53d793e25168476605a96f2f6375714ef9f67485a1916305c602c261ba0d2209f779a03dbd3b5b4e472ea2c61ad0b40f10795665d3aa43bd9e66b4aa8ab091d7d5c3f2384dc618a5f168536ee5ebf214538eb377749868aaaba2e14cf59b3912942c6b8b35271dbd9405899526d2ba1fc07514792b922b7a221a1622b4f5f9af6ddead28dd39570dba661af96f773d86db9c7135b85c9a425902cd2c8a5a96cf9b336d9a7777849c187529baacde6d8de45af50f88ddeea6695b1ba63d9a14d51909e989fee93ae068e7425beb3238aa00661f289df4581ae05876591cb8726de5f270186402c14390e5afad1cdb64adaedc2164cad0dfdee3ba1dec0adf07b8e02e4c3f3d78446396181325cf98aac3f19ee6452cb28fa3707d6d35be95e4705ba16da00ed744774af1434f97a7062b2633a23fa673e6bdd0dab4928f6722fe90874b0eb878b59fa0cb18a44287284da488d6608ea1737a67b8c3d9eb4972e498a76c4aac97a84bfef8f61ce64ffccbbd1a123bd787680ca53957c08b6db94d1d6b49a96fc3b6aa57f3838d9c77a44678d17ac5e6f10eb60cd9f4c83e0deb0546507303d00378f1917f34dc3853c1433509b5b5245ac8cd83d60b9564e24f83cb1b1b03cd06f02ed2a8704d7bf8d7e02d081e8b6155d9845603279cbbf1e2be29977cb7177bf87dcec21b0a84f78565af7e8f4bdbd6973fd846db5de4e91ad40bade291c3be832026ca74d2f2d75eb2f86b1159a681c5491124ae9e95895a08af529880a0b2a81f3ce9813b17ef18b7880cb906dfc1d78e6bc458d6a35ed7a3e0e308365c873251b7486fe85010d74169877663e35c3928d71715017802750505caa937979a7f867ee016326644621c14d72a90ad31476af3e768ffda11a10915187bbd9f0e2d728a2722bd702569079432690e3aa8e5150cc7b1f2d903d916bbfa774887f16808119bb11b803f3a560da89c0552bfa7111cfc9dd801f5456459f5cb81b50238a0ce3f7333b3c979b271188f899f2d4c17cf10e2308cd795c82189e9e66c98578be6b5e9ea39a1ed241c4b402acf1352c4473565e8849b8d7bc5e1f6f655768b37d0e89c163c1b814aba156de27a4320d1b222bab6755bcc72e4d22288486e8892f8d6d0de6919fb69c9ce7ae001df5095821954faf795e045970cf2a6ddd9ad11112c1c0962dd7b8af86a0627f7c4ee5bf112c8edce9d7e2489cddb0b16f768982cb151731858b753ad5c6567a23a7b8cddf16eb0437227de5504fc79f6f79aade265c15a7bafb530fab294a0ed58786cf951608a572676695f797a1558ebe55dd4cf2059f0b4951e63969be28b3caec57174ded4b956ebfdc9643cc86bc341a1094ddf07adf813206abb384c93b5daba5fdd235da04e4210ea6fce8d724ed556f340a51c75044a8d86361b2ce73a1ac1d61f1a8a90d65d2846f0421f1a5a455a78d281249a4f9f1b248baa61ff7bd4d25a941cabd603fbc20216032234b950761b6f925fdebaad4a5d60ce7e2c2ec596cca544b537f61563d24fa916f9e1d6072ec90d9e31c226de1ec4265b10e5d5247ad67e4741167cb16eb270d7d7063e8f311d19c5a152df85d7912974f4a39a4bc8a255eda603e01a4b24faf14fff8aae529fd6ac14d8eb56119050b756f72180e7280fc8219fa4767c85406548b45079cbb9536b047f15a4444fb8b85cb261fba4dfb6efd096b7d2e09221c5cc8a952c90c4d23ced69d754489338df23e51ba4f68564175f2f68fed41fbd8ee823a42c10f8f9f3b85c904abcfc82fc56aa4937bbba2fd32195d70acec4eead69decca1ab4cd498993d76e456373d13bc7077c86f8648cf562bbd25e9eb6923dc22bedbe153f5adf794f325b47d4b5dc4dc78a8f9ac2e3158161d892f424c161c057decdeefe949ff33b5abe083baf7d5b072e1e564357c643d360f35ac51eb0e42fe2a398405b17997a635cc0041b7fb87e1f5d8a0d46c51a0448a20ebfa952a89169cee80d682c74de87e145576d344dfb769d06324634ab6ce4a8b4cf2f23a632cca931ffac9675477ebbbc6eb5ecee65e2713eda01b25d0e47569e7072049c1a987b4427bd6c58e5474e1b5df2889fdcbdc7a93b935b9d0a922705eb4f4568395f36318b37538d75beab617e7e1d6a2f5412c65d5c20e718c8f8e16a21b354526c422779a05e5a52820a24c78bd521f769b7bef12861551930096a04282a4733c12c3c4709f28f2a8c637876a6f0eb1a11bcae25e0bb93dab41c469ed05231457c4af23d60061acf849f0adbe09475da47a42c2b1e316bebccf153a05e7fc1db1b7a094022865e18771943fd5fa2a4a5942455ef99daf41ef7d197d6a0b40fd1fcfaa6ac1ac50a1f80c081b6a23bae4a89b1c92cac6282308ed525d2848e493267db21f2fd338a89d4a5e1d1d351a9f709523b5400bd4d229ef56c47e8276167d3e568df38f2bda90eaac775ebb95fd31586e51e3c49acd952aca6285cf2cc47058ebda0e6ce0eea297b01f7613268b3c12855a3af596e57df9899ce32f997f34a3d2ba12f17a77a9fbea925e9ee66d201b4b513e88373d97c4d04aab9f9352c5aa59736704d53982219de351fd4bc0d1f31f61369f9396a0ce2eda75d86f3f41e5edd21e45f923b149ad3aff149fdab7a359c9b275d3a77235a1f59c91fb1146956b21437f8f561a1b1564051a4d0b6751edb175bbf23cc6f6c6ee3ad87f93fde0d1f4b663efdcb6b44d18901af9005a334076035447413d8e70d36931415f211b5a6c3d479fa4e8559f1c939a2ee800205662bf8d0e460891d7879e04f350d96580731371a2cf50fa8615dbe683bea832fddbdeb8194cd04a594e260b71d791de14b68c037e1f2a0c871fd55dfdd1de928915a788d660440d9253a58d0c027d769ef62a78c199c27a4158a68fce66c687f35c1bbf3c10460f3efa0652b80e31dc903973e3c0d8beebd4da6f41088b3c198d382f50e1ec5835c7d6bd690df92384dc6fddad94247b794b0185fbfed234c89cfa973debfe1471f981b77f9b949f5c6dfe47458f7d3cf68ba8e31c98156bf65e0ca514a18ee4c98f8c40d2f582cbbe3709d956c1d24464626b94f9d1a0bde84eb71aa06d17fcdef184c56d7205ae6dd7a42e76a975710d24b55f9eefcb261288a08aaaa8697a35aaaf059bd90f798e449fdc1f80663870b56ee9efc8a33f09af76257243e1ea3df38e630f85920ef66d61c0662fa376dcd759617ddc017ca4eb2f9c8d41d5af3d7bec57fa6994c672568cf1f2051f3c96a1ae06cd58a782509d485656b3f31b657610e87ad97d5d61964428f27aeb68eb6575dc8f5523bb9df3bc36f2d51816cdfc3d1a38ae0c9c7e4397d32249f5467c83c410c16bc73192b72fcd219fe130212f80ec5b030cb950d43c17b9ae24f2404d24106e3ef1e3d0e580e1969556027ba18dc85f80b3143f75648cd5d04b2783588e5c03a8a246838000925229200fb25ea7ac564dffa58477b682958dc6c57baddfa89042abfdc2a69ce181c6603b3e43d9ecaaf68ad6755be9d67d9826bacd79dfd2f50508701f3aacc07c7b2c046baa7f8b0898c1af45dd7807fd64112dafc93879bc7c0dba05288ef4eef2ae461bbf644ca5b246c8da767ca6890b790fe19023c56bd37545ce62f3b69a15c6419f4eebe13f1aee1d0c3449311058cc117d98303bf0e8fbdffe0337f2881efbdea0f4e7a99f4a7c40f959f40909b5d8530777c05dccb8faf4848c8fc20ac4e7fa511f68c6cff19163c511edf7b5be368b29bfa9dc275af9e4678cb9dbd07970450b2cd0b3a034deb28ccde50cec911063a2c4b0bcf7640147ae0004271ce8ba032bb9ac451ed05e65ccc8decff916a14bc1226f53487d458d9f47b0ff9e94d062811d53591c2b526f0458fde81ae71aff071062d26b6bec7cfe60472b9f07d5ff58546c99d9144941bc6e381061439c4ba9fd9c067947de02c21df9c3157c03b105088ec2de1c4f5bc64adc2a938fff3e1e98f65297bff1d6bc56223b8c5faeffe220d7f020054ce9384c1674d967f1a2f728dc9caf1add8b5999c736c7ad006ef539f7f3b83fa487c451a5a1c84444c1629b01bdcb7c29b92992430f3ba6ea990904ffb0fbc171fd38b5bf98d7c7e15cbc1cbfd2e430eeb1a75765ef2f38463ee29ddd9cac6664194726465897db5cc14dc215713f28214dadbadee44de4f46bf940705f2eef3943fd6682d2da8e0027c0db245a7dd9c316d3b7fd931d2fe1d942fc4bbf5bcb4f4e76ad89c656580ec39d3df72cccfd570844dcab1200cbc6828cbf02e19b5e48329783432ac0479c470d092b1ac281afc7545cf975d2a40711617f4f0ec7623c608b79385a5c388d24bdaac77830c5f9ef16ac06677e7cf1ca624469bbf6b8ee4cfdfc7eb56f489c7f8ee1b1b1c4dea696d573483ff0edc3394884250c9a513dc6679475dbf9e5fbad3461e1b10bdda9a428b665f3c6f54c0c42fc0432415c336ba0f87aeda9c5bb589c3910c7f4df57ad4b4458db4061e6d51bf813a08884ded0a0985d6a060d0b81bfe52864272d54ea894ce945862d668edef1c6ebe1a42dcd975e0c5e9cf9c6372e95ded102038e413a9cf7afcf25910ac0d8b780bf2531bad8c45d27ffb564a95dbef046b5d590d5ed59f8dd05f266ec8105f05f9de8d859e70959d7907ac483c0c6e0df5d6e8d62e3a594ee360808146da53ecd4d0a6634b169a72c4780030937a7f61eba3504f16f8ed8267f19cd140db123d6503e68f0ae55b3e11c0a165a0c38ddabfc13c264f4771249bb780122b9db860fa14c8c12813f35f52330a9faa892632c32f050b3a2ca4dbf9ae6acce7d1b9b92ec8107ef190a95b1cb2ed11454371614595da4179ed181b6c6f3a1eb35d6a86bfa611997838c6d307f15b70229234070640071d4a71021bb83568d1d41cf01bf77c8e0d69d5d68da890c229f269505fdf5c74fbce0c2151a58236a72d8a95dfbeb664233f8935bc995666d7a0d48c5fb65ab950c545ffb7359f13ebc368bec28cc10dbc0a0d99d7191f7d6d2e03e99ca035dc7e515aee94b6ab5d11b3e62c0d21fc4697a6ef420afa1ff445555671b803e175e5ee1e6e7aa561aa83d007909d223f8a460546b5888d83c0f208a2a8bf3d62dd99ed18cc8b818291c8878f93f2c072d017f4043150fd5000e01c24fb89789119229007ab4cfefd24a844bcc9c94883e1562b7708901a8994d9c51ac9461502c940ea1bab4c245e11fb91bab43fe16120e6c0852443732a1f62979fef761325136f06cca214989aff71c45a96e48c546edf494e20f970a44e1dfde6058ca020fce51e4b82c1fc626ef88000b7ae0f2ad96077d0b7c9812f70cc3ac301bb0e444f8cad26f92a7f8eed4ba0d0c317c30f6d6f860cd8f82e12791b13e268a1cb6aa9d1b1b61437d69fd408db8072616ae7c37bbd22feb8babc3c88c4e72eaf1e90a67b3477424eec8ae523ef9403ac26b059acffd3f83488b42006a806b59ee5ead746004ddad0cc22bd8964b0e87ca650be8fcf177a39dfabe049957fba59c03b1cb1258167ad2da55762393c2007b6d464872a1491ef513ae44e0db2c912b91a7d95180b408ad4d63b8e1d816cea6c75d7c2805801932fa6e39a0600ecd231c295ad3db11d3c2ffda19028f3c49282690401be630169f084ccf9cc3f846a992aba60ebac333ab4f14ba341390a48f8f2e837ca5b7552a1a5745f771e7a704d8dabf8ba46f5f406ca8d1b3fe328306d44bad2c5462a661537c4f0609a908e80f0c7acf5ad10631f8d80d3e50b8c2d728da21cb6512adc1f6794ad1a1d4f0ea631ec1f050e4499fc89b988314b5a007d1d746f0c118797759b7e667ff1641a84a48d90473b102391d0bea18337713a9e4d139c9ed0eaed7d3659ec2ad9d0a81e5aacb09e72c4cbe62755b4d5bcc1677018a145effb45e998cc5d7db1e8ef41fd3f9d8b7300c9cd58180ccdafe9734cf6d3d2e5a090b7783a767f15ce1451b63da9f3f85420224deafcbe2f0f53530522ae5dff8d9744fd907995a71905bcb89b3a2f7d986b098bd0732c038ea22d0100a9664aa081f7ee6a81f750799fa8586ca1ff0144c32a7c3056181b2995eef5050a2dcaab66d9a50f4230a4db84314d229b2c0f7346c5c3b54e17f3b7cbe203a2273fa036df0d92db67f48db24c813f15da09d669b904d6b3f169404403bfb8113e05f7af8e5dd8cb67615a20603f9daf01d04abfcc4ca7eab8bb3e6bff5a076e187bb171a9d806166141a56aaa439b0d16e4d58d204ed7958c23325cbdddf2be86af1206e104d76045b0b0670d1efd09a9577272e5eaca6f2f365837dfe038bae8a9c6035dd04822a0d337c1f7c9ccf7bbd338c4e4db55354fa1c8a3a865e0df49e6a98af248b6794e4e16df54f613dbc470a47ea94a0303216c634a7631c20be137205e56a6b19f51daa399d62a6b0a1eea93e358cac662a22195c240f375fd12edd1e0d7ebd7eb78acc8c940750b681f3568abe74c28776be4c5d3ee3dcf348ef3d13623e6cddd426a7e982e155447aa04852375f09c2b00591045a3f01a0efad519051e00964d2012dfb0918c79615e7a1d31f893d7f9b9ec230f958e6c1f74aec38c3675fbb92685951b92b6d0630551bc6c6e84adf14cade58ee0363a01389fecf287290d241fa276a76c9cf67c07413a56be1bde2c463386b03a66c57a6f7dad826fcd7dcb83d37859199b313bb130eb7a15d2b1029ca722785643319870beb1803a6e4d84227ea8a7b8dc4bc80004e5f7d9551ca68e625b1fb6878e0dbf66bf11b4a9c60b5a5b7e13cddde39ead6b57a58653051aea8e830fa9a4629f9d244bd0ce7ce91b90dc58ef7d6aea0749eebbee40999a18f84a3db1243c4ff3d6dbbb6784320ad5870bfbb747fc165e349a0f1dbc131c3a69ebac4e43fba3cf031ab82ad543965483b7caf7f93032b1b1541a8bfb5aba808ce1a84ee575d6a5d9b51282c8ba27e3d0e8ef5540130e7bc2745361bdfda073eb4f347b76b366c97a08874239ba77431682dc416dd47397726f8f3284aac531e7f06db6dd8e4e8c923a574be019ee8e4f1278aef7fb5ae8a6de905fc6a5f8bea39784d0422c25f6ad18173dffebefd434de9fdb86728b0fb757ecf9f39c4cc127a7a80f66148147ad1cfb95c8a98b39f6b97573cd64901c59606a453c53135503d17d2c7183f40e52b15886172637f525fb1dda462982e4eaac77f3343d2fc2ceb8fdd187278403b827500f41b47791de65ca1ddd67b233513ccc789eb2cbad0841a5d7b42aff5e913edf2f96032e8ffe450bedcd64c9c27ad1d0b4056d2ca88e0906d9baad26ff7e4b4c75b0baeb3c694d311395517da4aaffd418ec311fc01349c1cb107000d47cbd434bb7508156e24c8420a83db7764fcab09da3d1b9e0fed7e29f7d373a52dd89f05aaaec4f95bf55945eafa70eaab48805dab3a57c238e446a1c9693b8ae27c7c6dda66646a914b5d1c416238543b3eb5bb96663e6f3f518e41f33b8c2959a9df5fee1b4e12552522047a34fd2e43f44191e58003ff05ad764af14d3495effd6865a479bad6e253d3bbb1d62eb44c10f2e7162ad06099d21445421679cb7c6c8908cf2bdd823caba05b592cce7e1d2f90cadee7a592b5da4d70e62b84638e8af1ca3a8de05552d9efe46a30ea39e3bc4d2bec5837472b9b176d136462639ca246f087d9a2f860ce0a10ad71d9664e5a291e324f0578978af2737cff0c9086a672cabc472b658f7835d7ef1741233f238844f213f0be38b958a15679da8363584b7ade511d0897fca0001a4a3279ec4d7121a529823f4e2d9e80a2c754e46e68883c8dad1a60b6eaaae68ad62af7e9f89275735e9d2c343a8d1994af5a64a120567233b963300d063476698fac4ecac89c26a7829ebc4b991ae8fdd85c7185c2b0a153af3c4783e514faca45f2475f7bbf3dff4fa60b8b45f1dfb8fee6d4a3a7c71b2d10c0f5c11867368789f9e5a754974a2ac5c57739f56ee1e995c38813e515c4fba6a4dbc00fc176ff2f5a30e7a4f377adcbd91b130f8293c7dcd0b6a97594e649b000264e101a3b30523e2cd3c3ecbb2c695321b80857d57a4864ceefaf5235f62dbd93361505ffedca7e453ee7a69939e8b334c6b0101a538f727ec12ee3e576c6be79a1777defc9b37c2c042e2e5528a38738a4984792e5f83a7ee87ba9b89f2082c4a451c79835e400fe6e29ff57229b6edb83675d17f075d39cdec590cc80c1e1955e09e7ef74ff46cee13f996b768bcfda547e25c479f527463d117de9c30329d0b4c01eb009ecf9917383e0b397e725c45b0519d5d8abe6800615ee572f761699435dfe2031ef1de3b17fc18d127224d89fa44da23cc5d6b9ccd4baea7eef573ec508fde25987fd11327775d601478484925b96f06246e8ab94cb466694fdc4561ee5ef5eb948c41f9c1a7b34e4e91b143190e6f0453db8df5734d6dcdd4622e05070f94e143f2f8d366660e7f59313e3415f9c01e640d2d65f4921b32ee950e712c631272badd2b73656888be53f9b0f5c659d73f5c971dcbd5b356862cc664ad75f04afadc3d4bb74edb431cfb55ee9b2f211eec9309cc2317ddd591cc2d2c442426b22d2f2bdd53a5caac10d5b4f89dec4b9950182dfa5f841e72b156ec042501a83fbe030843240f5d5c95cf740e82a6b89fcedec3b5abb5cfa8eafc89f9fda14f67818b4a228068d6fd517c83273d8f9e05bc65cefae5e3f3f57826ced5c1f6f7b7ece7666a9723a90a772716a209b451170ac9e9a1b78ef806b821dcd9f747746615d4cb1b20465c81c9cbc45abd6a2e90aeabd8b8dbd6fb84f3b3b7c614476c0a6b7a19df1d140888fd0aa7391ae186ffb17855b1a99737effe57e8b1f0b56887f64b0f5a1a06e6f4a340da9545f2325705b275c15a0702a50f87758f19b2087f4bfa5882696fbf82fecf489c2c4f21f961d3c14f67c7237be003e90bd9f540bafff970c26f817433ff6f2cf84a443cf0c0e8186eae81a71b0dd240151e217062c5e3e59b2d4bcf6c969d105fe74deaae0d1b95904a4ad9ffdf90050f2b1fbb763302f4324d95ec58bed922bd8a643e64a50e44eb2b1548b08beaf3ac1cfde256e7f66f58de68b6de87d62073e5063216c01a17ee3d576976167659b9b2693469b931e57eb00085800ebd9c6e5839b22d287af066977a6d2ac0ba8a1e50e2fdb70bbe23ec40034bbbdbe204fa2f671a0c8ef2d0949e0bd3b0c683e15d1fed50f193b5f2e0f786a9215f0e19283c24fe4cbf703e210186497f8653fba9c586e10e115ff5b77248f69e4ff523d5bec948e8a3a3a41750b0e5602e0848f009e7f65032b94d56150e0dd43309c0d6fe62a08c9641c1b1d33b706ff44027933fd789b4071630d30b317777bc3c3a6bdf8c59d4703f092f181b23de1979451233ec43c24e813962ba924c75594a5a8ced79c82224962cd1598c5db607daf8964437728cc8d8c45a03411aeaa7117451dc0d1514c2e157b9454cecf8e1ae3d0057abcc6fec1de0faf93f33bd152eebb02c846917792208bb4c6fbddb78e1537de2226c8aeeeabf6519300e9c02701d71f83b429fc032ea456384696c35d8d6f6fc4482a12259cf9c21bee0b15f8380a8b2086814c95474ff0039947167f78572918de67a8e46f05f653401f0b153de614c2ffb74b22c3de08c3cb499ffac3c1cfd38ac15d5c3a8821895fb36ce82f90ba06f0a499883ad9f15c0e0572ba92e8c41df7c47fabeaae94bd3243654deb9da5ee4a06132f00905fee10fc1c627c5474ee327689530c3b55547cf1d832e955b1f4654c8545dcaff53945d036d6f47cce73d2f3cdb7ea8bab5f10c16518af1192214c4e32b5d80340d38db128fd768a2bcf2240e1bff9f8cfe431404f6cd1b589cf012d93cee0a0df64a3695a483e6fa704ab3a896b48cf9a32d87a84faac1e9881584adca70905b99ce83ac6a38df79763bcddd6796ad1bd3bcc8c91afb4bf828c559355cfc93e77fe595ed7e65e80f11d597fc4dda1883aeab7a681400687f9d32a5ad47cfbb3df08b2c1e248f6f59f74446ce73915a0fdc7fc8567d0592cb4cd4e6f94ec027d62525deff193d17b735aa4d65a2ec58567c9ee0b895693eeafea951f22fada65a3e06661011d15a64c4430960b94e980587f5bb0f0f912404faf8b01299f33cf5482d2b5574240ff6ae6a600a38f8c3175147858e3611442040cb9c3216858954e426d1c8e1bc39508a708d0b23b1b64228aa1b98af0ec1a30d4b8613b9b3c9b24575d5d56b6addac9fc65da955e67f35c1c438531cbeed83a7ff8b5bad80391a3da460f732721ffefbfaa4ff7c3b66a38f4c1acbbe9ed2005ad2218ac92785a569eaebb0951c15f80f9e296df6d9406d643fb62e3562fa44bf08b08782c3023997af800f0813a18b535ed5d5c60b5592f8093be0ca97f4bafa45947506e5fc7d2cbbd56872a95f5b099b9629a33cf1ebd2c5d758280aca4883546afaca2c18c61d65e71b65b949b2e29b89deca1a3df91055890d912ca2c12304102a5aa11cba302aa6a24d213d103128a32b12f0ad182b288774a43dd3c5bae4a5aa3cfb8e1c90850a9b75726aef3f7d9390013d3420ac401985e2e497fe554ba5ff89bb51699df4047db064bdee104c3e8abe1adf2831d439468ae2e7130bdbf58e38cf2300d8230b170fe121fc7aaa23af12b709dbaafa7ecd9d4828733c2ee7cd799491d8417bd12fb54484efd5d29a8767626326208bbb4f3930ecb8a5a8dd2cb8e83093a56d9101da913da49f08e36b7d566f5f17897be05286990197b1509d7ee48d05be4dbcd419582e91d14b92a23447fd16608eaa0016b7b829052e25450753930b804f31b4c63678df3a546e94d9a0a0b0abf4942af991bd8a0a8128750f66ffc26ce5442486558aaff724d3f097a065d5bf2a732dbd7a2591787626c1762be890f6ba92ab47ed858d1a8bc7e7f31b44c9ebc3fb47abed5955863ee5a1a140189a841b6387ed88faa532a208344be47da9c85930cb45ae2066c982a1f9443457b066a7342ad68f81c7cda413acde860b03acb96e039fd4b70dddaca565ea87621c82d666e9b4e5953fec6290f1ab7b1952e87658a8a1f740dc88c70af55087ade3fed8c12e69de5963c1bc00b58909787376a388eb739e90c9483ce1b552e18229408120eeb695f2a9b11af04617fe23f8fa9926b5c5a427063bc35d3db418eec3ce692b805a63b3f6cfcceb05aa82c61b467a5a5dae290ec77422ced591ddddbea072c1f3a4506105ce355be8abf2ffed9ae232bf33916110b13e5db94a2823a35f7c874afba2338c0e834f2ea3539a4adaf7a9c1455c1a4c2c4225257f8b474684f21b5d31a9fcd7502d5ecf2a99da2a761bf722675f431cb38467fdb145ff51aef47c7131d8be6141123102beb7baf87863df8bc76393e07be2a53cf178f3747dc308485f15cda286bb48e17cd3b954b703ea35296e66a2dcd506de27cda34e91efa38bba048021f6ce1034fcaaf927db5d3c4d2357e33a21d0cd71dfc2bc13d81a3cc9804ecbcbbed611f305d458092c0165a515df2e69b107e3f8dca7bfa04136b2c002eac6fb72c6140c993bd63db8b02f890abec9a47d146caa2b88b6ba6f80193cbf5efa42471b8b19f20b4c02848a106ecae4b191071baf533207ae2e8bacd0f445c291de04a596646fe491ba6119e6773366e9a10d9098e250aecff093897056c29de1a67bdf9e9668a89fdbaf426aaf15fc9eae09f21e87e1da2b7b4f26c190e1979354ecac6a488baaf389441293ab4a85d57d26abc3e80cc74993992d2cf2d28408eff39d1e65d064349d94f08ed22e15dbdba9d4ad1a3f823e8dc12c603a45faaa0171fe1700f2bdbcea1615381e8950a057001e15110d520616c43633c63e3349f24c340d6c34db658ca58c2d1f5e651b4498d2e50277c06a5b2c895c8f9bf4c92dafb6da867f5e6504cb1e0ece3c639305b1d7c37291f68f3fdc54a42babb4248c5195535ec79a9703756dbd2875bc578ad16528b08ecdc62814ffd3eb0e400458f8d5266820533ce40e29abf268361d094751157fa31691597d517c7dccb5325c5c49231414fd22135c294c3e867977b4343820b9c96c191f9441f7438bc3799668fc101dd341571332b800a9e43e5a00e0679d7dffa3072fecc993ad99e27b92efcaa66ae89e44987f43a98644ce96ccd55b93e4a65f30703e970170bb06c44799660bddfcbe87b361baacfd0b6994f88b96ad7edff5d3fc72381a4b20217b30864daf5942546425e5412dfddaea18babb57438cefddaf5d7da6e5745220b2378556dcf1a3b22d6ddd6e48240dd47b7fa314bf725efab11085af643138f8272ced5f2990c67ca25bf8a37f68435b732a9dbbb598836a74d79c8d3df6fb4017503b3b3199d41403fbb43e86492298cb363ade80ff0e4a6bfb157c47df4e7e2b2973e01323e12be65d86d9767f7cb43079d81bbfee07e6608ec3eb126e82fc836af23fb1fcb4e3bd0c817d1b6b9c2eae8317e0b560330d2104999b03b774878fa753eaf24ae6dfc6f698d0961c4a105b1b049485607406a4a3417f16be1cfac40bfff756ad3d733fe467d9e6da9db6904167a971d8e9354e38d22e494a8e9dd1143e51288ced98df21b1ccc4568db1d930ed45e5673ff5026daa55393972c0bcc52d735851eb022f1e18005d7a341c0794aab34a9bc11af908e159b281bdc3694da4d21902ccac6cbbba95fe487065bac17dd5a3b641eb974c6c147de9cbae16540ff8fdc70c6f9dc6a5efeac24fc63fd91e4d8be8858a26e8f8b430a08364550f87544b410e5d964715a910d7c797d0454552cf3d26b1938dff862f9c49ff659f8c3729953873d95e36c811aae3aa63a921074cd06388ea4e3822677fb6773fb009e4cbff54ab770b0ede8f3c886a26361da2f88aa300b4e3d7a784486fd68cf07e6b8ac9f4703ca8ea880a80809c6d9fb6e490f8841a8b525ef968f38b7c0e54daa01165d6d6aec174c4aa0e59ddbeeb5f5825d71bbac03b5f6cbd66d65bd991aa5002508429082589aa2de9e10739a1faf732127789d50ece7591cd7db5b33ff88cf02d46797cec3bcc2da774da553c837d384b8a692e3175cf92b6161584bdf50348d3c5fde502a04ecaf0e54ecb0db060134e75a36fed5159a3d9a706c4a526e3bfdb6a2d1fd883727a79160fcb8905629e50cd81a006326dee3d1c908119cb3755d616bb05d449be5b90d8f12faa67b0fc347b4d7d124ab3d5f2f7faf63465ed6ca3f177265d7664a9ea1552e7f3cdf88711adb049b4a0c80ed7b4355e50165bb3a85a08c6302ae69fa4990954286f7e805cdade8f709d4c9c78b7ed67d432fcc4ac55e1d7a85235538afe95265785b8b83127163f22989d566b8ee78a0d535a2c46a6ec60cc40fa9ecfb5fd89077e6f75382e141fc7925ee290c303666d5dbc817b7147f289f7e7edec093cd408990a1bbebba35f804a888f0dc0a54dc86a35b21b2439b1cf7c011633bc8b30adb1b1ffbf3faf505519fe8169dad8013129d40d5e2b310f647a86cbf7d64b4417c155c62ea96010a7e31ed72eb5ac83a8300f8f83b7316078c797b86256ae89c8f633bb756609a495f9caba94fb9c8d886fc78cbd3efe8539bc8f346d373ccc0c81b481272e3bf89c4ec1ee963582d64955b1428d36c061b0398986db41b82a0eaf3ba4c044c36f3c8f6524e4ad0d44bb7a28d187d3ce16607e0646e8352c54ce41548e6ddff2a1e406f2b6bcc0b5c91eb3131b201f05614d95dfe4dbbd98b81d251b11ddd938e700c2541fb8705713778596ca0910a90a6c88b750454a46f5f03a015dbe129bb3338310cfe34ad3830c34733a52f00d9eb1a328e95e2f7694beb0cc1d7f054d022b6f2e655275b2fc17da2ec534fbf6ce2116e882b89e9e21cbcd989b4d0caa187ca5877c21724e81c0207730983ad173c6a1f37db20bbd699f8ce7341384e08cc157f5e52f4071c432ed133a718cd0a3a874d574eccb5d96c501cc519c775a1d5170be2387c8babc050e480e600cbbf1a6eb7f0efdf9225a8dc4b5c678097878bac79f1575d05216b006af8267623d6d93618cada554fe8ca5efec1478931e344b088ad6a4b76529f5314e3beb9ac7ff4817009a28a151d6c7349bf18e63dac31f1f058975135ad0308693a19468c9b9db3937fe67daee08519e03352dfc44e4e9cdce912603e8e1b4ec371fc47c8fc2642c88398ba3f2785faffdfa17d9a220694af7f95e115717be84b6a578fa4b90267647c8fa68f45b5db696ea6395c88358a614dff9723ff5e5e22ae9f0631348ecebfff06953c9ed53a5d8121e0f569370d1aab71df8cd0c9a842f349a6e5e9e6b8db4dc568e223adadbe3727c6d3586c57f877ce7b227ddab2fc5478e1851cbdcb15504881f0164cd84c3987f93fc3f53773d4e9c6658ffa197b581ca3dcdd0768b98d57c39ff6bada4951e55c0924dbf8e282be25a0de226cbbbb3324d0362ebc49e67bd6650b3aa101dbc85ba670acebacf284a65a20aab91c74d9c12250ff482785a15afb61437610e505d72c3f586f72c157362b996268919d8672e4c1e0b4daa33f3f0281c684d286c0040be00bac8e8b5dd8499802a22d92e396ea9623b650e280bf96291c588cfd82cdbef264fe0da24d8c3f8d06d9fc1d8f4134f4e79e69b0bccad6cf640a950d982aab0627d5c30164b4ccad0753f3ce405fa2ba02c6bed060be68aaef1400de0c2f87ad61ac72d31e4bd4612c51c1d8f993a3e2c5915a3c2e8cebeb438b61fe137266d009ffa68292b031c8727dd95beb542659b6b843a4b63bf5f1484413b8f7260e6c6825129e5538aa9c5e1fd821aad3dcfe9fbe37ec3822346e6f7529e7d9c12fafbffc586eab4705b76d07637d272686e66fdda218427c5eb15fff29788e8fe2017ce8c8fee49a5927dc5e3f361ac4d5aa4d8717d8b0cb75b1e21d98324c7ed0735ef56002d9babcc032a8735eb584747302bc8f95cc65fe6c9af498f975668cc13b8ff917d8d5d385e200aac945b7a6efd06421ab3c69f3834d315870e5942b88069b7c968c57ea87871fd13b99f32dcd326cf3328f04f73896c8c6c219b8c40c8f973519db02831d1296a5d54844e31aa223f8a99e994e0f03ce340afade338b7aee7b72d85b2c7331e43e3541b226db66e26ed7a0b9c031ff1a1204a4814f0adcd6ebbddc00866ab398998a172eb1e194fefc703f72a3a4a27b540b2207ff84946293d9b05545893d3dd33f36c95a27dc62c172d2377fa18cf34410301abfd7f5368428ecc398cd8af8990dc08ec108236948ba4c6187df0caa36efbedbeaffa1f318322cd39fcec28f017eed906811908c88101e95780b75b30848f0df45a4b67fe7247d4d1f1192a49d48882c792d1677fe94f7e9c98d8c81d22106152aed6fc60c4ad686102c777847fd2704ce093e98dd8aa2471ce9ba594156a4b24daf5d833d1762ab5254daf37547219b3e3531ed67ba3893c3935393c3ed08d05eec1366cb8ee1208b05f040bf02249a8b08f9e000d40fa626a95487027c33bf4eea81cfed68bafc3958395861ec6987c0c8227a2d3f033852adedec74c8fb1c3b6492af60d36a402af0ba4b7811aa570824cae36ff86f19509e94b166ef3ad31309fd9a4b7c9635ee5f0d9ef473d87616f5908945a9a8595c6032c8123630f6e641ab5323790e608b2e1e33df74a914e54f0c37502da863f1a2c2e011f79a5a7ecce1d1c4a097a79a3b462d0a55e36f3d92abc9568a18e18efce37a79b56522e541b40f2076ff7e4f0586716b0602a7e75901962a96de9e76ddc5798659f479c5b61c90c39293e9541c97b656a1123ba0566d7787bef5df69ae2064652fccbe35c5c26af7d1036dd12218a468d0489ed565f3ccf02e14562a89f4fb15347468efd3e0c3cbbe9db3358aea663c09a6f51410d5c9b3aa382a3f376a53d8a18612033947e0d8620d262f67a001afb7e6c147db3ccf1554a5b9617bc0e285e6be71aabddd0b6fbbc0c10b00b294606e7969d0f40eaf1fb72b2c7c0b524575f9cef3f04860a75755eb364cfb278d4b36e09bda11292a6ed40df5abc99de12949e07993a73be5c850490e492df561859bd843710134f38105dd4cbed86da6c4d4524c5f4254b14ef2a9fa506ffe260b3d9c9d1e6b1a0a6fbb186c5f3cd92514916f0a0919c7794385de6253f6e29ef53e9a81bc435e0307de41bb722db5c19b159241d8ff17d5eaebc01bcee013d2851535a31d5b1d4c0dcaf478f067c97dd2eec48e6edd2f456d19e2a94378253389e63bd8f50b802b98cb5a3c0715d542baa727c60b4ededdfd3e7df149227eb1f90216fd88c8311a42715df7225c951d80a791acb89cfb17c75a21855797317134aa2b7f5da08ea4e350cc3214078c53c608494353535c8d7ffbe922113f02421ed807ad6d287e5f0548b79fc33ce460406761205f1b69d60ba830aa4f2f6053467b61f34658bafbc117f8b0acc9abd26058a5755d74868596a58237399c22a6c87fffeadf4842fe6e39428323c57c580a299e888d3be20431b676a192778f25ebfe667b0c3c6c4b569d7588c111be741a3eb2599f40ed94b0dc312ecfad3435f2f436bbc392c03631cb03ddb4ed00ba8e64ed1788281c646197f0e829f62bd301154bc365f2ef40bc9cea22eb2575bd1dcfabfe21de40504500b87fa9431169f585592b7a11ed426de3df113951f8c701a49a17c08ab303a41dda26062d9fa08717558a860e28e21b1ad4e0607c3658172eeed88132e0df088b064466ca3d1287259aabfb61e5537035f5087aa85140a3b06835223800112cf2d708208bd9604c55029b6bc0a396d62e8666a0f1335e1061c1fe9866b3fc702384500dc141f466ef50340ff6d3722b0b66e7280d7f90100c8718802420b6ef5ec12e68dbf889afcf42dfce62fb85bb9ce0d82c548c559c4137c48193918ce95d218a16e4f3016cc00d2756eb34541b384496075b00401b3a509d1bc17726a83c3508a8d8a37b60ce0ccd0272c0da96467ec5e90f4dc111564cb1d3f12ba52f160132f73320063ebc079ad2b40b10fd679e3a61d25b81404130f43b5962f5174ee223700173d1a6ad9d56b4fbfe2bca762c6675e49a9dfeebd9dd887c30e47c3d1bf2b1eee86b6d9120dcc43a54a5d9625748eb158bcff421b4aef885bbd8b724bd55a93dd0a4e6924c92a67c0e25bf9b9a231ad262383fca5d71ad325cd124e012760273295d7a805114c869b8a6c1eb8ecaf213db0bb97e448fb956acb1b5685f2eb5ee277045cd5100adf767f4a01b1bdc8a4a77b17da66ba759d375769cea810ff0514c933c79a2e47ebc48d78b4f029447a76bc8f79d927b62115b570e3b5babba1da95bc73f384f371cfc94b5356c6ca28eb94646d040e531140d368306c0c6d2fd5d25085b876b2b6631ee6bcad14f66083e4fef4a68fcfc64c2cf2847c6c8d56b092fadfb82f2f9962cc1bc0232f274def9d943c7b9fca022a8257c530d85151adbb1a90da85448039bc119ad60f43b6cfd5a743367f65d64a7568f1277d1cdc3d721c72ff6d37250337311430a5c1121b3e69a8b0aaf8aaecfffe72ecb108ae91a80a37e92bac356dd8f6047c8d333da43617b593836ec40d94306acb434d2d3a6e161c1e29c48d80fd58642de198b158380aa018a467ed5fddea2c577c9ac49bc7d1e4fbb7d0c9f7fd2bc27c5ab350929cd51b52c47e606a87fb28464bd2865a41a47cc6a58d4dcec7e6871f00b4e29d7b9bda0d2069d685f9e97cf701cdcb3e0bfa474edb361ea88e669debb84c010b9829fafe1d1954ed993da15fa7033b2c13e19195cdca18d0e54caf17bdb854d134efd167c1d0c0eae0927f08a156c62d1a492873e9ec1f22dfe0f1b19a41d0fc22debe926b6c2b9e5ae0f800be5dd05685e84038d713de5588358ded65489f7b6dbb561ad2cc8ae68107ef3fa0d7a70b7f18ed416940a2f60bef5bcfbccecd924f090b19208623aaed2116094da1d95975a77049150dc78a138ab0f4104413fd82f9722277e3c8de9b97bc34bfef153fa2a8a9c7fa57a03014ff60102a4114d2a4716956d7417aec0ca9729f8a20508cd5f1ffe2c1cd1ed462a4cbc31f8c129cd3fb92d68e1e32373c8670ec56599a73ba4fdc583418f5a434f23709aee2d9ecd145463725708f0cd8bdc53336a7940c59f9f7033da9470d02ba2ac5984a43661732452fab1edaaa42d6647d269c90b75785a23442b874884f25ddcac529a265597d1e7eed8a8762fe1bf549e4fe38111140992b64657c8f642edab2fbee822b78ef8d442f17bc4adae2011885da26bbea550dfafba8719e1daede85983f6f105965480065fb824fe0e34bfcf480ac7970764ee1bd159e0afc65d4c80e67192c369459528fce4712b15d19216bf4a9446f8f26cc138a5196b275ba092a675c1f89b9b97f733db509e0fb9ce6765981780d4be1a52fbef8ae1ad1531aa25cff09e33ec335b9eebaef5ff558e067cea290b5492e125466c0868aa93d7ab6ac4ef0ef9d488bd3d49430797c707b3637f4d8c913b9adc1d5e454b64f7f407d618ccd5ee3176f0c4a5cbc0008ff99229860da34550c7fbfb1812f929747ab84e3f70044d8a8f30220e09eef03e2b6865e21eb9c1907129d71d9ecbeb9485395f1f7e7e2789e5558d418862d93c628128e3a77552e463ee6b63d6901102dedbbe9c927d3a92af0e2e0914b7dd8c855b7ca5a54e02028e893fad932bd2d52a448207c4f8de84e475d132f3b432cc7b863310c81488d6b48b0cabfdd1986867f540d92327ce9a1c1b4f0f90fcf83ac859701037fc0ca32757a09002d43aad5b12eca35033c443b83c4ac331b235ca2851fb4e615612fc46ad063d94e8b599826f3c1d49f3ef6678bcc5242e6bd6baa4c4536f512417716ff272e58f692b129da6c2ba9d3f8f63595479b3935d171112e22c693de2398311d5ee6b877f2b7778388bdb1c9fd3554127938f754a5a68a6a1ffb80ee5aec086bb2923169900ebd1c560772feaddf05ecec07dc60e3267d3672fc719d69ff44ab146b0a5bf1a811cc3921c354b491dcdb0d64daa3477755de9805a36e975af3dbae8b228c961b7bf6553c156951b284df210c47fa0dc5e957d6895aa9c71cb34a913abaafb3b1584223358908477ac9f80321d4ee1f5b6ac3fee2cc2373d69ff80b609303ece865bd7161122fdbae9ae0600dae0791800bad77c4406dcdaf10ed3d366d076f4757ab3b705b31e5cfff1c022267e9c0ee61756d463215be31376aef32c358e385b3ff8d66de6bd038be521"; #elif SFMT_MEXP == 216091 const char* jump_poly = "fabdf682938a008933e7f552cdb0c935af57be5a1b9ad2331f52d39f03f0faf355a359cf9953bb56f515d37ec77c1a681737893e649c9552c7d4b275924c17a7395674d620a389468d1735220fc98d9d562a3a04c82b9155ce8b367353578f378cef6e8da22df79d90d2e6caca511b9fd96d3e6bf03e3b2fdb9d7639999fc77a14373f339f30c3c54d575eb043a38fd1fa1a1b1175ed5f31d40e374b2f1ed6ed98dc24a8a8c0d47a208ab0ac2ec865b4f8ba268081d727ff07965bba7a47fe9500ccf12f4d042613bba5a65fbdaa51b05bd28b0a2839d51e887aadb91ca89c0b627539faeb75f774c2eb2a78a626fb3de25d8f844ffaf4cd14121662b4cda1a1b44a42fcea60d1e9171314660ff9ea7e082fbc8133269c4ef2aef26c787b75d985b498db4aa8c345d39a80596d63b38e0f3673ee6ed2041edbe3e4331677c1c46a84ba5c13a191cd85317ac5f78d4868c11b279517956577212576de76db164e56ec32eee23a04f044cddc80e24037f6a81068b47024ea5585f3815c09501aa9dd041ad74f1806a23eb53cc04ce3306d8883ebe43674a99d3aa2d1ef21bc49916324f303fc4aeaf1f6f0189419b9d971fb1d04902d5a60207edccf7bc68417c2a265d6bc8713358bb8a4d175f60fa2dcd73efcb66bb7a3b52c4b701eeccbb4db6a9c3ce14cd7e5ae6dace5a081c5a3086db41ec923f3df74d01fdb6bb40bf1c383ca92b57dc5f141a5226e404adbab19291897170990588b197d4b0187906700af63bdbe5688e251c430af9f235bd60ad61f2994f5c46b3d6ca5d54e1c04719479acee00a60f1f476185c3e7a1da8c3b61f1da1180ae37115702ff26d9bc3aee553d7fa79d95ed7961db0492a6883163224637f9f0fd80af9cf3ab20ef9f3bd6556fdd08d092cc718f9e885d199d72efda9f504cebf51b9994b23a54fce33ae5bd9bc4a5e9d514f3e37c26ac96ab6c3168971d8b3bfbda3828a18dee71bffa12e4b185bf26f9f418390120e031fe6cc15d33864addffb8e3e8b3e81640adf28b16ca80d8a9ebe3b124ef905cf982bd815f0558bd993406cb89f861ee8098b9076a0d22af92a13f27296b8081fad2b59a1d0aca9eb91e3f788d21ee12bd89848517c6c48cab931df23f4d026302de8d57c0500e1608b711a1af669638c547889860c2d4bef1b08ab6250350d4d97c3c686359f9a2bd84df44872ce78a2e548357c4c5dfebb2cc5279e1035beed56da498ab91c20dbf80e5b19d588b7b087b89b809e8bf629f5b267475aa2d706c9ceca0863bed436c5b484443938b93ace6e69b81b0ee0e18c75658dd91f2f6f55f255c246177889586354d8483fc165fe11ed5bbf950d93b0896d38771ccb28c1136abf4cacb9fab835f586847e094275e45a41590d582d2b2ed87f35f98aa11bd289bbfe089ab15a14dc5fe89d62e9cadb467ab2eec9577ecb508e1f337325d2516b6af20864d723a0e6b1587fbc176f6da7b6e2db9de93dfc7ea56a4ab50c56762372cdb0d3ed827772efb15580b3d04e9480278fd2eb0ba47b654c7ef754b91685d1d60eb54e017ca4313bf2d1776743e3653af13de05344e2a8ea17a3ac456a40f6d3de1c2f797b78abe33a9eab38cb16839fdbc4c8da67e1a115440d39c7084e907f1f8cf32c52e8b7fbff9f7803101f600a60475e36dc9580fa5e184c2ad37bef0eb708b76c656d5c9ded28256d28f75bc61e23d1be27881a24ff31d0530f59340e8e884ac601fbc4de116c077c95e08d47542a3845c0d84f8feaa871631da1fafb2c9de4c9b2b7255fddbd4d157b73cf72e5dc61b6ff706cf95f4df8ae5fb739bdf4d59ebbdf0648c95221cc6f19e7179ad4b50cd74df0af7acbbc551e7ff2e3e541579eafe19fab342c6170f387a14fab262bb88d4d8b2a07d84aa980e6165e67fedc40bd71f532383fdd68f1963ebefb780568f7823b8d66c308f2f195e7e4f5b53ca6390a5f93ef825417493d38d14e91556a30cf2c26df955a76c4e257cbb1269a09d0e990529a419033193f0a24f9230adbcc7bff29aad4c906411be52bf2b5778db3bd23a04681154c373887dcf0efa88dce6af497980160174852cc11e3301c7203c570519adfd7daa555940bf0b1632c481aa86a42e723e6e245bc9de954629ed14cfd184fa46b3098d7999724529b5c85107b6bc353b10a901c1f96cc9a6661f4fc77ce7b35eb0f4fd3c7c087a1f4abd743815c1abcf746f9d2c8ed8e823b1af999aea1d0bb4c56424381437b6cbfb5163b4ea1f1ca67f882336c60335ae5bddcd03576f4c51de5ef81e51db48ad81de769ba1fb9cfe1d7a0e10257740f3de24fb8ca54c2c3ef8bd4356d51f69f363424f41e57fdecfcc532a5296f99293d085e7bd304eece3875a5fecd765c3f13c4f23eb2d041cbd0b26a56e893da31b6611343eef96ee952fc5689b30d1fe1853fec6a8a4941ad2c181098c3f2f02554dcdfd08c6afaf29560094fc1ac7a919946e30c0801e1926026de685c4d8f94c86fcbc201ab00c2e5fa35e7682aaa3670a051264414c7a596afaca4ee452e7de51e25becc0318940ce10a0c04be96d9301441321b11e19ee55f60c65c084cb6ebfff02260454653289e6592eb55d898863d01405f945d056e0ce01ea58e115f28ffed5c64d280819a521b1803bb1e08119f8d00f68ea7bc679e0b241d4b8cf34e7bea1356d640bff91416cd5ddd1c28d28d233ca22ea98fb6ee0868276f7b9b94cdf96166a84cca7f39ded1fad4db74de9a459670771f9f76c5e964a83a478e340cf0e5eb800648565308549de5a64501d1737939e75e20bff4e382c9866c9d733ab2e8074af5f9891da5daf80699deaae708e75d9391e36bab1e6aecb3ee52ffa467dcd705a6825bb13b3ead1dede39c0e91151c0ed040dfadfdbad86e68fb9b5d66ac9a7890aa58f0d9c2407a4043823fdd8576cfbbc431fb5e09fa912b11845a72b7ad98ec681cfac8393c0663293727dc37cd5eff408136302542849898f817a333f55649bc4075d701fd2acebf865201dac779aec72f2cce2f4bc47982a5fe9e0f75e52f1d2c7305fed02b6a3645bad12d8b7eb847eb6444e70131a7a395e1170fdb2e8e91d4b74ef8a69d0fc072ddfce8be80ecd27d4e429c48fa1dd653021da2a606ce47b6e5ea8a9d76cf22beb0a6b23c67e73d885616e800112e892d43af187b74d6f90b03e0972c444f3753d2cd838c0bc810a1805a24b4424e71ec6452f4b8dd8e8bff613414b6c5384216da4539a059a266f892a2c42f5ce247f6ba78343c3ddb4408985e45cceae7d82f27ed3ba7d29bb232598a656e9a2bae27b7d5a78d791335c7f73f0af5b19b796e11e1a969215e96a485bfc0360d82b93b82c7eccb92e939ac02c5ad5842f4fee8abb4c8ccb1f11832a9decb1fd26d49da3c6a0f12e4e2ee55c248551337fad7ff6f0cea7d0dea4425cbf998ca980a7eba838b48cfce9d43ad42ffdb91d68787dbda008e6221c6ecc91e0bd455650bea0ef0d20ad5b4e0f97aedc638a9e930e0081c67a3db974cc323113a4f3df3431431f4fb49ee2d7e81fcbd68a7a1ab3afd021cfe4ff935affe990409404e7d3a0e54f677399c1d96f58115c0e6b722becf99aedd9c779576940cffb3f7361f1cc8ee960953f2a72ff04fb386ea4326f5098432cbc6539372ca3ce4bfda4efbd620c1dae77d5c647bf6f00923af58ed8301b887fd3c8c747ccdb2897e386a2593a8233fde2d4178eef0ec3a77766ff6ee733b75906462f162776190cee130a2110a9f4a71fe076ac583841a0c799abb2c91ba8ec88168e6ec151d6f80cea404a2a4ca722df26287b053aecd690d8b9a105b726757de52cc189123c7d816a4e3551fce1065b1ff6c84308892032a5678b3b06260d2822580849ea63fc684722ffec0dede10af1567125404ec88a9cf7106ccdb0c1b224a1294d198d11c1a96610f8ac76ea5431ff8ad27e8ac61aff3488bf95fb748ebc626457e6dc41e3d431a6388066881c532fa81f2546d0f0af3ac36f40c9e7551e383d487860f6c9a467222991f2759bddf8e7d068995d19f40c67986a33d4d52556d03682e2c49187b3bb9e38d4778e23ab29b630a4752a1560764574c9fb9c600ec67306e374a7c9bfa09c862dee86172a66297e273630471ceea591028897e51f3232d0db61f0464b2241e92ebfa060b1271774cc2ce1001ae1c517ed46ffe06218ea9bc2074bc2eb6df9d431ed38461b9816977d5726087c04271739e997fb593fb71a614413043b7f7b3e9c1ad0d50c205475c0f7fec2f5da6696b599a71b21f3561768d6ce2fedaa3d99d6f271606ab661eb608920c96098d2bfdc07cb76723f08d03e832263f5dd75bea8dc7d00ab3d31d3908451eb79a991b37b6e5793de2823081379d48464168f54a88de3e8cf296d7b8d9c94014b7845b7b3c33eb32f8029bf76040d71496601c7dfbc9501c4c3583ec41721b72a198b960a4e2353a27b8261e7ba9a52ea1697a4c401eaabc1f2d182f2758cf72331d2adbe73bf99b7b3180891247bf0dfaefffc7a7cf9fef96faef5e810acdaecaa24b4dac761618b7d6b228cbd370665329921bd69b7c9ce079879ac43fc920a737088802edc58ee46903e3d17d9154b1c363cca29d7f37bb6da4de8decec1bbde0cc7a7dc768b050e03801861802152595853f4e4d005af3f3fb265152b4956fe604ccbcf753ade637efcc55d557aca89f50ce25614f4845bf2058005c53239d48e17eb1a65930d2b4a84d4335dcd78fca3758fd58fbb38ff188a5059e4dfdbdc1c829dd7b636a42309deb30b26270d696ad123ffdf8073dfe322e78eade26062e5354d3f41ffa810de0ce992261257586db36951f6a9ca1749346478843867daa81919a7e201a9a6d09b2fb86188389c3bf3eeea4b9ffb0efa7e4eaea2053624f17a74afa939f17b32d2273854e6016df47606dc293ec4c5bc798d6c971e97793e4c85f05809f24e3cb6f8cbd8bcd253efa1dbedca88d4c39b83d14e47a063f0f19430af0b250bcf2117ce3a09504487e2764e88cc5327f266d90a47c61a845677060d22b1b2f6a231f5ac6c83055c8eb0f87acafbd5cfe3112ee9be5a1623f3762725ba98a1a2caee15acd22ad0f4a4a5a297410ffddc7287aefcf58e7b6a757a42a3023bb896bcad64c406e23ff42e7aa40d9a7e33be3e73b26160779fd47b5a32a754679d6b4fe008fd3c708d45e036f6b45a2960ed339c4287bfe8856603d89a52a0351f551098ba55709107910a5b30fe0a61c50983a9cb7f293040b75ce3f5a1c71802988ec8c1094cec1960891dab8a543319575f5a42199e9163eb36f06978a3d86ce20ce1bd7d15e655378abaa71e1ac04729ae00eb4ff43dd72ca08867f68d81c307f450ae5a204e045a8ec561dd1ae24adeecd1d3dc60fe32ce6cc7aa1873b75e3304c93120083279f65b3d8d738f8a585eefffb8409348164a65753fb9ae1d4d924f5456f9c851605d5bcd70c2b52519194caf898ca2a5f85e7cc4c2f33b152118d6c654dc2dd6cbf28b92f08ba038f235fbe1a8cc2df943684290246fd42946e89aeea68c8c531245f151720d1ff30afa154f62bb12fc4490f82a8b67d663cf05c9f4d670d27e31ea2e1817ea77364a15b32db719de7cc94d6825cc01e7b6d41a6efb26e1942aa6536595efad1386186d83af5ef6bd7208d23b0ea0baead9422077a24d03e712dc74c1b270ff3b0fd8e481219ec5d6ebae51840bf4ac82e4729448eda34fc2c3c7e25c02e985565f91b4b9d0bb10ade294ba2c778f688a11d8320092df9310c273a6a948806a22a74afdc5ef9580ac07ef56a1b8cd2e304f5d9b91b263dd6cfc5714a7e878fc6e873a065440d9e306a85134e888b83349000c83659fdf53072a627b691f95b09338847fb328c928a9a398cd6e5bca146068c1e015d5f252bc529df089e826e6fbdac93e22a8b186bad993d5b373a8e6edae2d70bebc4663f0a63d5174f3c5d3d953a6ceedb5592f3f08f46e8f09a1a463f81abc62ae891c63b83a212d815d0e043b49d9c8f664321fce8c5fa303fb255a26292e7f015b1c47d5999c44d1120ccdf4e3facfe4865b2a9a3b2955b157e73929a5ebfc506e3f96405eb2a036eb099fdb0aca6443dda555a9efe9d076556cb883f4ec10b52dd259c0485c5ceef2121b7848d602fa286df7515767cf161e4e828c10a49e896ee29bc0c525724ddc7d919bf0c5807aa4413f23d9a8ddd1dd3b08d4737c10814ffd21efe79b03c7b56f9eef244b3e533c99421e4075de4de2509791668e44cc6d5086b1f4ee8a7ef604ec36f2adb3add4254f4d3d01852e5be14f562b9c4190e9314b6659a366bf96b79c33d657d5be5b7ee571f40fbd6edca1c9ff675ef8799bb7fce4106898fcf90cf6a50e88eb81059740e591282d0f964cc8e93cd09f0f953dbab249d18aed1e9f225050a5be4c5ec7aad21d33d637412aebaf4bc033ad79a531da6782e596141f6701a85bb35355cb6fd872a44c5d1c323ea9cfa85f72188f6b52b12b9d920e47513215bfc22dba1e41bf349bd914b5601cc251b6bb697a3a8ce4c65e33bf46458891bd88bad4daeff79b843f0198b3862c0a3c550a713f3a5b483adf4493636a1db53ed1b9650f358cf34603053f8916f0b6892343eccc7b3394f1d056a5f7703aa0860cf0b0e164b0e53649ac1b164ad80b5526c1fc48e10cfa13f5fab699660763d929f692faec2381e658a4534f9d7f122968a2ef837052c83d18595fdc7d6707c9ece962653c8732d3c02b68cbcfb2f99f73d67b79755070a198676ea415e19712f72ad995a8dd028d12a3390babe475d597ba8702981111fb745423d23b0cf13264bfbc956d447b32d3ca9392244333db218d3243cf0c6b3e8f7d45648412a0551e40b3b496e37610f04366d6911f67a779cd7d00ea87669777e9610373ea4e9647852465419b9aa39b0302826f4298142b49f25424488d80241c1e7bf3d0fc6816a66284e37059d2d6d28d2ebebe58db5c236d35566298965f2c2495345b2368929af26f98a46e2892cee3a07058bcadd930526cc7ef62fab0539863d482913cd7dec57f2e8a121c9cee0443b73bb0b967ac486632f0281618c9c780ae8d45f8716c0791c97ef4bdcd2b1e5bd4f8a3713eac4c1cf6ba816863686d49b9c13c17f04b08346348c705e5e97ee8f9e339ede35df7698581d74db54fab0f7c160c1c0c2bc77245cfa740376263b120e96a1b1c4c09c47631c891c9d6994aecd12ac10e932f4a73e7e10ae135abdbdb4b3c9f20b79f906e459bacfbf63a4e54d141fe527ff3a5c978db7adf0554ce64c7532b5e12c0fa9fe20b5f685af51aa851480bf92396943700cdc3d18a14d581648fd8c5c54be57a8e16e80b3095cb8d5b3a9f0987491a00d67e4747af89be3ec8cefdd3b5f41d95be4215c1c65d5d0a03ca4b12049acba0419315fe1c6f4e3bc3a4af13bdb385efdf7ae9ba011a275caf374c44b840ae081fc59ff56729f51c32e8b71e9e87ce8cf690a70cad9d43834a9a01831a34bce70dccdf10814633c9f9d930c2a51db6db8ce75396372db15120c7587e18b9e2854b50f23feb70ca5e315c99a6ada6521cdceb08ddefde1f2464606e3a12d8aac3412d12651cdea6d312f34d7195f2a1795ddfba91fb73e07045edb65a24195e1f646a6cfcb6a13ff045a704df8aacc648fdc18544aab30ecb7146ac772ecaa4cb455651229c8c1e0aa37940734fa5f30d753b0c3f0565ab29eb3871ce92bfab1a2a48dd2f76739ff69285f2c6e217e9f34b33af53112efccfb7ceb4aaa37d37afba3882689163fa4e641621f8cc9b43c3529b4fb2ae818bb6f09ab4dc93f2ac97efe202c67921c6373711e72fb312ad5b4602586605cf26eef2a3f96f99b2dd2960074f63d1fedc45910a0c4755de1f59835c1ac2d3f47537197b6b33b860eab6abe3550ffaee93e2774a4b0ab9620e1772a9cd6bb4d3ca110f21ccef02d1e9ca6cca4a279a926269463553cdeca4f44c0e43e596ea69cdf72d0af668053119d8af50c17fc9acedf0fe7d534a597577547450da8da24929165e75061f43da890930d8b293a6f180717382482541db0edd495a594cb4272045123defac91f2a22030a9c7069623fbd7338858bd2928d57c1b48d8318bd32ea006c02042d57ae565db5ab2d66fcdf2c01a091d1dffb99863d0c712324ff7a6bd69ba295a51801cdc9c31328b9e306fb3e60397716c3d3fd7dcd1e74fc6f8089dfccb6edcd78cec8515f55876fb198df23a482ea5251e5f591707e9b24a4b5df75f8ba46d60866abdb0f6c1bc652baaedafae6b9b0d5948a09cea56b6296fb53ca26bde445c9aabd15d3c3759a361e181cb8dd6c93d9cb72a469a7b83e5a5d533954d99382d42fce341758264be8656ac230b608e336bfdfa555acb0b726d59e369a1d8e772b74c972bf0b01060ffc95450a53dc3f8fa994f461888b4aa3617dbbebb3df670a50c779c0579fee2483fe6e60e4da20afef97aa37912d9a432e97d17420263656d4b5cb93995b91f251b22c09be4b27032a20a02b4b7e48c4185c79a76c6ec93605716ec90a8400e334ccb3c6543b8e6463b2601ab98a0f3bb9715719f866846effbb9719cd3f241aeaa9e552665a6e21c12e8a481c8c0d5f2c26101810d765ca14726def8db5378de85924448f526d1b3edfab93e73e9519739c02986acb077b699a070eee1d144d3eae4adf32c1d5d8fabc51dc9baaf30d25d9f655fe17a6d3f9bae3325a88c9c779d36b778ca6a36166881a96854b909226aca2abb295fdf2887623e35bf3d8544398e30a5611fbaa202c17f291e53aaf3e091f32fbfa9c3629de996721cf9fae98704a3053268b7acad6f1fa488adccb099cf02417b7e936e2154d568501cb9bd1612483f58b138f95411cd5f1664855dc15de64f64e57e5852792cf8bec85ed330fc867a0acd9767538f4733c6fb9df8dfcd21e8e6ab11c7bf306233f3f04e665577e356ec25011ad6d0130b30b3f886f2c6239d0ed2a433a218c6511dd92091d3342043ac04460d3de31ecd59d91c4be64ee3a4dbd5347ce8aa20cc91b5f810ccffbb126805815bcb3d68dd642779bdebcafe090eee29adb6c5b4d335b780c6b50243e37947ce6ade865012df045d4fc84f194e9170561efb977f6c33d1a86d351d90feebc42e13abf9a508077b64aced702f5d6932d3f28c08f93e1a75d07024b1d311155f9a354f13bd9e84d3bbf92ad038a82b89c29789687a7531030a121ae3164379337e9feeff9dab1f899bc4554bdb10638c3a27bc74622dac3779fae0afd5de356e1538f839d6d83ea7773034a351416424ddf1808b3884aadb4b68f8a28ade261322be5b378241af2364ab2a16a1d0d172f0b24ca3c087f862ed0ae67465c94cf8832345f3ace382f052a136e46fdb6dc129a90333783d375ff50e019c0c0dc160110496ebb8f77b01d84e0fa2061707520e572be1c552aa8e17e54ba7dc35e14c9f1c53d56cd4d9657c2d1c32fbf013846c4bd958a15e1b97bd70deaefa77211e744436597bd83141412be69e67c10b50acf931c7ce5154cb6a67e7b4f23ea1494f36e9cd5e7a4048b6cef9a1dcf2028b3734dccadd2d227a9e62d0cdd8c2c39945bbc10216589fb668acbe65d02a2aa14849567ceb1a7182fdbcf5724189e4c18e7ce00051a814353f7e76d8bb161ccc2f49744447723655a25f2f554706953ad854c08ec7aeba8d41f002218abfb35e7cfb97e28836fdd486e8a927f98ea1083974cdb216d47a6b3baf46b665511cd9a678bf35584f9bdb8ee4e0b7e65230a6c0d00e79e4b3fa3d3f583691cdf8228a09717e8dc3b16ce1e5fce46601a6e85bcd82a7692787b0ed969b8badc3cc45d11bea8c7d7e6c4ee139ff449a11b3c599b9a4b3b65503efa30514910dee43318e54ec5b96a13e95251e22c8b0fd5b4d0c0fc5871296c12adb1e29197930b71cd6823aa9ed462cc21681a4b13d9472ebe534681a05c926bcf8a0e052296274071e4c7b9f76e83c8dd500120c8f6146cecf7cdfc17fe14a5644d0fdd0507b873483c37aaf1302d0e0134ff0b7a7645354883904a37e3fc4bfd304890b97307bd0bf82afb4f4837b8dba6d05e9ff5208b1cf80694a759cbec84cec3a5ae370095b0cbb7527f5c98f2c7585fde8f1fc9cb157b1b362fccc55bbb19f9fb607ee5e03d3a17b45b6e05707853794e31a52a0f2dc95be788975129305b3636d719c4f0f243145ea392e25c31003e3a26b1cbd9176db3f40b878fffd662edf30c76a0eae8d7b47f222356da660857727ac47400d5249f3e4596adf967475c4ec9f1888e5f0dbead29eacd829a157f4e30191c42f899ea7984c3fd512a09788129670f2cbb63ea3569de2ddd0a4be83e77805218f9c53134c9485da6cd2768d5bc87debc1aad8386e2327f39c271226f14857e05d2ba5bae2d79e3ca940781af771f27208c260392c04a9eb1327c46190fb90351d7659d83e5892d2ff607b9d0a56f06c31a6a56204e2378cc23f2cf61021b0afe71547e5793e6f0b4cdc7b82792abc63a5a9a7af8737c7dc50746760a423f4d816161be79206f47e5de874c1fc8be845d79c9d21adc7df1d6c743eae5c0da2cc323d1fd3fa6ce9cb56d85da7ef2b9c8dabd47bc80fa5c619fcb94672de661b86f5db18cb4b371a8f25b42ada0c9b6499893541e369ed03cf14da183bed4e08023c205df3ef15843b8850669d0aaf91dabf2598b309ef3ff5131ed5b0e6a1a6e2bcd860cf346682ca4f94d6ed721d590d3c9594eb619e46751eb2421c85aa74c0952e13426b766ee7165fd69051ad0fb8f5f32a33ed2b6f3d8b3a902fbeaa5ead4d02b38f7ac8bbfc3741faa289e588852458b507dd2a33f208620f1b4508c7c6a8e8ca69492c7441711bd02b6737fbcbc92e2144f4a574a5ebe6ad40ef94f5272dd24f53a26310023b996ed8d8ce1a67d11e7f12c2541c3941099afeab6fbe8376193de01a12930ca962e75a5a01638b9936aad0ad0b7e308b903c66df101acc015af4565269ae410a7ad959bba7f61fdb73985126563548068f75dc7cd4c8c3bedd842d2ff3fe2baa7835bbdde2fe6cf687fc06b4074a5bfb35de65c324dd79b786bb74931e22568174bfbaf9d73592ccde5804caf22dc1d810078ed4a16eea303458a375013616390c822309f92c590126fa6c3dced2c259194fc71981bc2ce3f4fb67a2aabba6f4bc3bf1ec8b7a4f9276370df921d0c7828a0d094c3287708f9347cfe476449cbd6897f5d44906dda7dd48058c4b2d476f9c8c2b3548eb90553bba81ababe3f62ccf4cc527eabfa0d52278a6db5e97bd80c1449f8bd3c42ab09c7e9863a8ca6a11428b87ba74e70de4557e76daaa96be490afd245d2425cac55ce26d39bcb1e5b181b2acf72b0506ff94ba744151b2bb928961ba9f6641e76eda4dce2f0b252dcd514d4ffd72a077e7f26e8fdae9c89487c5cd1ca24c5d330005714f486d92e23fbadd456edc870c860dc24b88058ca8b4f149aa3a99f600318a2c36512b484e6648f193b8e262c19bc7b08ea7d752025c85770abcfe8abef952152b62bc04ea762b7fe20f511806dc1a1b3f592dab71942a2e8a00488234754966d7880ae6900b204931627a1326f19553c48a6f6dff4158125bf83bb68802ec2f150dbbf2f074797758d64735cf39b4ec624bfd25c2016e799f42bc5d0bba6841c1074b91c4fd64cca6dc70078a6650788ebcf151b6a23a612f9fa87712746fc5a7ad7264895481cddf9b4587efa5f05c520ba8d9e3330942beb50a1de213768fd19b33391ea4f75de634a6916422b2c7439f33f4730fb3be5b3edd655df5450187c4e0a1fffa741e8b5b5806064c86a7bd09c714b2b5b8e72668319e4c3f80ae67f7043459cb1f56fefff5ac4b5611b1bd11c093c906ff39ce8f6a229ccc8cebd24f39f106bc15b9284281078f36c75e232c21a8f9bb2395b0e7096882ada1bf5f0758a183ba70f88236051e31dfca73f009568bfd7c5139c9bead62991527f10bf4586f3ba8a7fff343953ed8fbe2bec608cf3ac64bad8fe14add860304ba26a56f7c4075f57f251ec5bd99e1bac0c5c1a6302af965a23d0b91eee8788004cc37ff83d7d185c2f45cdb6e1edaf7e4497fcbf0abc1ba5a8d9768f6b0fa406196a8352a8f1a2ce9755f59ff92422754a40ef2f87691895264f6cc935af9bc171be16a01b298f67de34c247fa88ea5a55171b413cb765d08e394f4f07d66f72f72f3874fbd8acc69f4f31d31ae2b10704fac3d50b7a420864afdc5a6daebf243374810c728678410cd299eac3165b6ae3f23b587f09130ae232f5381dac6fec0dc23fb261c7ed2bdc6f2a30a9d8420d47d12e863e3ca76ba6a2e5a70ee77b9fe6e1c6e2eda0d35f17635bc4aa152acf5cf7a8fb23ad78b833022dadf1231e8a8fd848fe6dcd5e1398a617cbb06600448289962df4b45b978f2fc8c2a60d1fee7101c76a7c5f833c93d882ee6161338313a0ea127ef65e63d7921fef54cbc057e9066e7d4ff925173420cd3b52455dd2c5f7063f6431223d89ed99d6f96f6453bb0daaad79d9cece6effb3dbd6eb05c02db29cd40c1a1cb37c9e80ad071ce075f6e6323b2d766f13e4f7d51fd90a5c6e8822010af45e5190c75368a57cc3814226c8d33a7507103f6de900ec25e47646f000212c142b990ebc6fe73924eb6fbf5aed2587d8c10c6b063d1ff658ed07fa2c0ef766f1d45ce6261213df2aa8cf4159284c7099bd21c86f1f69792065a611113f1f9327037cba17634077ad35426166ef5c62d8534a5ff8f3ef9831702d624fb580323d484cc2faff265ec7b8ed439b892c7974fce9862d91a3d0f74595611567a66327a97fcdfd4d2b088598b05b18a72dba082ffe72b3870f1cd020ad2aa4c63525d1be0509c2def589103e2771f325a613d925079bc68a95508de9245c654c2994b09879bd49b2d6a28f62d6349b1c75c5a2fb35e5aa8f10633396c4ed3d9dcaa8e74a5714cc736ffaa728080a1f513a73eafbf0be8bc17f7c2f058ff680966f0cb877f4e131671cfbc67c351eb7c297b18a87a0b494447bfcefac608af0f575b5c77e91478ff9ceb65e3982cf6815b9c2892f9dce4190d93e4299116b1ac96ca0ca40d44bb2e7fd70279688d1dd81837c9edc3d449d11d9317a485ef9f7ceb7b794af6fdd267c7174d82805a6c2377fcaea74456d662758f5b1957274aa50b902295350d0d0404f880556ae1e5a6adce040281138bca72d09139a721232728126e409b37cdcfd0065e2eb6b70bb17eed1fceb09101c34e669177c9a09be6f59a1e72402f973ea53eb6ebc474c058a2ee282a7f93bb43543ed5a64ab5d436f49a0fb01aff6741852a6dfcc9d88fa354a97de5b9c98869b4761e66ec7fc94b8af619b5f751d87c52dce3633e0176345ccc5b92e31cbf8a00a24d7a0ef72a316b3c8d1b110908e48486bb491a3ccaea579673c1a664c05b254145ca8e216bb58d49cad5a87ef1f6b94280dfdf7c51953d91571bd9c3f9e4b763c9a6b4ab0455371fc35351dfb21c7ac4109601560b404b6a963156d389d9d28cbbabac5b0bcb994ee1727ffe834d6cfc4460c7d6be72237e8c6855a5b87a4caeeffb2efb1fbe056e61a5c34940a19118bcb48698ce4e8677352a7b70f1d2c177e2036854c63b770509ec4e4540d8f4d198b3565a1491638c9813f4ecfd376264e2156c74af1da891afc1b55a9c7cdcec64da3f79dcbc40b1bfad5cf52b096a33cbef6f2539ec7903428b5495349f1c9fd603d37c59e370288eee35f5b7ec48539e6d247c0a92181174ec40a9c0830be5fbafb37be103b6b7fe742606515f3311120e2d1897189a50d2ac17f04c59de1f67152327603d98b4afb6d977152984fe817a180c842a7e6cf9b08f836f01f12077440797933a58ff2451fdd8a8e78921aa205ed2d242fbce9f7b69d184e5d4a9e083dfcc976253540fbe6257512dca2824a3bf4ed427b3d93c08432609afdec5bad047ea86bcb8c30200560ac8645c095822d9dbfcdfddc76fa47cedd245304c02e959324a16b94ff69c0aba9e5520149d2ff5fb3bd01b04f227c7d406de796a719284c398fc30337351114a3c89de40cae25c20cfb8080287c09ae10fd90355b999373bda92db2b4a3fdfa81252d476a7d588d0508fee5dd8e3e6f918271733d53fb2bd9ceeb796bc7355d9edccbcfbc013cb0442c33966875ad3abb1778dad30614d264e21e159a3ff5e817a3dd665e7117b511eaaeacbd81cd9fbe0d7ee5d7dd22a7d3ce38c575ed78828f4e443541c7ff84e4430f43c9379d8220512ddb5fac76fbd2c31cd868a90b4fefda5bfba4018c37334e6f03fb96292fce9753cbe803dff080629e0276cf593d1d78e8b9143556d99dc1cf72e091d7d338420f27cfc1f39dcc41b0d016612b756b938d1633ee17c2c4f86930ebcd98b66dc311200df79760b813a6a930723ec9d0f57c6359bd2dfb357a8efcc40bdac1aba323152a8b280499fca1a64f7c2f956e9f698dddeb2605749bd8787feca5fbe60ac2088b8e2223a84dd10a22df0e644491fb6a0f7ff23767bafc433209fa7ff5137b0a1c012763093ed3ef765f2aac449ad59b0975b2d5b9ae8791987ba2cdffda6baf180143e72efbf6099dfd4fcb89068d09f2b3dcb9e55620376d299f19ec70f4be40ee64a5a38154fb441eed3d2f667da12a53b661d9026c6155952927071d2dbde8af36c79755a071a208243a703235846d505c7202f124b3885fc8797229af83f04264ab315cbe2797c0b881dc942ea2a941a6b00f53fe11fa9cdde0f39f008073bc18960ab43af8c9128f39503cd973d06e6c00fd1975bf24c18258c3746b7f43c0b714f042655b435bb03b2d40d34dcac33484413436653d7d749ab8119433311ea532b0d90821ec96a4fe57f99bc19e138a911236541cda3635284b35f87ffb9bfa66e0b835e58eda1732bbc76911313e53e594d918141f7f1292b30af11565af5783b4f9eee8c8d6cd97184a6aac6d5f6fb227fc474ede1017447a6cf17f21fdb71e68feb582d39a99807f9a531327a70a5faa0a1b8eeb691d03fff19ed90ad641bcc4fcabcc6a466d76655ad0e886942a4c8690b3311a4861aa256b863639dde35690592639e0e0b8661d13ff41915f28dcf10e8c1c4300fdb62b0ea1e5dcba8594459d40776f23502887de8a28946fa9162f85dfaef97b13aae4c097a30151b16ea184a741f830808cf87430b9fe917d0ba7f26deb6ca89a6bb02361139479e261add784f0a961151d165abe703845d5b90dd2b5e6e6a022396e192ee6e09dd4eb1ec8a5240d1fbc0443cc1d60d461916d1e133c5cc84341eca15cf67aa592b41a9bd2d888695dafd0c89750260eaff221225b2bb38cba855aa915bd0d6aa69ed6a24117b0a31c8aa7a6117d74ced93682f24567fec71fed58c935a1af34c0737eb4553033f2ce461f1d50315fb708766ea62478c17013ec07332234b9787bd2aaaa3349faca339f4f3e102ba3a4c1c59001f240edbf43638bfc128303e256fbeafd45750ef991e22e7ec3fe49f8b6f20fea27590f9ac01232ad275fe1baada8db74e13696b26bba475091d5adcfabe14d56a2c89aa0619a549b75fb815fbfc3eff692953aae81ffe6dfd985f69df9efaa489a41ac3d0cb2d7a5d0c226605cc0436e89ea69cf47fc29e9498215058be21502321efb7c21e333f8b46295eee5f28e898af9a853d9a383dd6d79bcb34e12104d423abcb6fc35a59169507f1829892c69d6c20918f733e508565cca5506f290cca34952e3c919a45d9e2da2f8f4745bb20ad0703734f916b48e545758af6feb9a8dea4278207fefc50f8227f007987313e5ffeb0bd12fff6347d5d69d78cf3d2ec129acf8cf0b84a69d1ad9a8b63e136e4cc4481015b4a94478b036de89aa9c6e0dced9570ee3a51c989c1566eb4c1ef1b8f9d7b111d4ff6e47238333c328cf18616b761ea420c03dde47b539b3550c61dbba44611e575108e2ce29bac31b69d4b847ddd7f14b1a9ca85ce5e805022101789f189fef87e10ee66d3616955ba763b82268849343dce7e1611d2506a6f2d336a5b14b5a96d9e4df21779e7073de1ab256fc7e656b227c8c638463976af5796027d6230c4d2d6892c73e16666fba8fe1a7ca04c18be0e5f91a2f3bff728e8fe8d47687924f9cb01f9ddb79a83f6305f38fc5c4ed9498996f3c2ac8a30267d73c898e5a3afb466986081aec62f212b07ca54664a355c47f4af7fa8ad31053f152cc92259e8b47963beff73caf3e9e7f40f7fc4bcbd04a75c00c94e3004576cde1c0394b712178e37602fa48db8b10ee8dfea5d1c3ee84cdbe9b3fff6f019059a079ed7a1e008ebcd42b2565503ec836e6225b1fe52492b760462616002f0599e146604054cd8131175d7f8f51635961082379f5377640cd2a225845dd5d14038cdd6cdbc0ee9c38b98c7bce473766b9f5842ef62bf598e0e6c9496790809735456e868961c39f631b69793e1c51b2f3db9005a044290425fa84ea526b187b0f89663cbabe441d5521bf9ad0bb481ba57e70cb1996016da204af7bd33fb72218fc40fbc12a29636fe1fb6e249a4e8da0ddb2c6e5dd51f99d9c4b84734c18bcbad90070d06749f21232d84a3c069112a5ce832dbe63e31511c7f4a84c557871c4d03505022bc03f01698156f5e1fe2089fec881ce9329a7dc87e5e86be5404ef652b09d248bdd31b49142102449becb07ba80d46fbef04f63b85eea54313e70322541f11819584c57059015dd5b130220fc254f89065f032c11fbfd90571571f47b682b473b6591cf1a68a403e40205eb20121236605a76e3610876849af9c7f3f728da8ddb85605e020b146ce4f710ba23e19d52f03af46f685b64cc7724d83041bef877204ad285ffc20c13b6ae4b2e06623efee4001f739eb986b2884da80cd8fc6b2388073f7d6452cb74a79d1644bfecc012e2376527114b7849d13359ad92abb4e3fe12f7bc5dc8c55517ebc700ee9a41b216821e83b6d8249cd36d7518546b6e0cf829c562cf0b395b3226e014d2bf56836fa7f4f81a19c4fe5281cacb1c7afe55790f2b4c1c581223c6a27272cd1f199f3be3f33f42ebe605c5eb03e72d8f7bab02290d40bca51b1fe73fa1efda72f947f5fc5c8bb3eeab963343a9ce323f77624724a4f17b57bd979c1b94e849725a6a13006c5957a558dcb27c3e640f4a9df15cf9cde29e5fce3cc1cac04c3cd07af9999f2922cbafa77d9f5786ddfc62c0caadcfaaf8f9b57d7fc6bcb1e2c2ce2cede5e0f8b8158f802b386bcf7f522b27b6f723f8f52fa5f197a85d82e6c42035e5d70801bb9ee7413a849e8d3b77f4f3d6266177a8a0d5660055cfcbb2fce4a20c5690897720b6d3cc7a7023687322350673ee887ff4b390ffe525489bbe0ea2c38b17dac758b77a8d80426eb0016054ce9f10737e64d6fe2ca838d7fec0b2b4d736f36551213df4c536fecc837d55829a1fdb4435796464b47b881ca2c045ca95e1d7655fe60a4740713aaf39c5b4dd2dc1a7d401d7ecc1fd3831721e6bc5b0aacd9feea1fa3c9698c637b8fa6c919a58ed34c4a471f036e6f3e67be5ad4960c2e302fedfb4c631afd4cbbf777515e3d3a865637f1855d63f9eec8434e3bc2706e80cb2fc74829006c5624d5b6b398382dde1fe1e3d0eaadbacf88c396dee45614764e712a4d7c7403dde7ad15f677c86bd3738e5be2d2b04bc253d4a2909f53a06e3e80234b0518adb2e3cc2b186d112c136c3f328bf9c0ae5896509631eaf9d9de27bf1ff09ac4546a74bab64ef5dfbc2da6a3b1cc699c798cee587a5b97b019658d2b2bc99c50abba62c53b105b7a3335bbd4530e37c824bceb909a5625f634eea5a9aa3d540f7f93fbef01183c522cca64ab9d1201be97793369e03e5f5014dd198b460174721328872779dbdd87a64e024144ea8bb3725d4012c2e50b1133a5ff014675807d399bbc9b5a1e5378cd4464a315b72ed0d022af6bbeba3f329824e9f2cd43c3015c3b4861d215be571f59536a4ea537844061e290e8bfc27be169a829eab6af2854e082d515423849a97f7ca38911371e7514c1458e51eabe2e65b837d2bd251778a087f3c7b5b1d8860be691dfe1c0944161a3ad55d94b9405479a1b2aa3f8856bfa4eaef3401833a413da7e85bbc64ef4272401b0da61b8d8dc5b4e414a2a54d0cb6b023f3969b5eb91977d4646c1c0203645600ced87508cf09b1876ee6094aae3750d8da06deca8e24ea4003cdc5655e17d05bea6b0865df8b754bd5221511c3ab2a626ee63df598919ac141d7be5c731b93a736f011c4165228a7bddfa9fbf329d9075574915613a48a5d9d5ba2b354c8bbcc6f89baa9d654a6b545a5616b7143589d9e0ee6860a10209ec6a698cf89aee83465b004009f96ad2134533c44354122b7f5e39e9526f1dc5086d831a9543cb4865e81be752736c0bf0be1e3d32198ec6f1c7933c435124e677bda8004b0b886642c483320dd08d86421315de81f91400ff57e225c1885ef68fc8cbe6cd77ff983e7aae9df5c61cced2962437679bab2dcc0c83f70115d4c22d1321e368be6a04727f2894dd9d9b77796fea87d5e9fc71a4ebf3ce5323e67683977ef2441d6276fae45076dd2fd70c3e5285e9995efbff644626ed9fc2c53246f2d3d93378cfe427db8f8535d96a36758b024d7a2de7596c2908e7d4e9226883095fd7c460e336058a6f7830df0ceba886733253dcaa81eb7b718ff2739cc4816972cb11fa9afef17c715340efed2e285a290e41f92b5a12ebba184a8f3dc6f39557d02a8fcc1fabb0153116a64e8b1896413064187264d47aa0eee037d33b51598eba9c1e9489bd15f062f61f14f0f4d33644a8e3fcab222465fa76451c3ae96be6c5b9a7f3e55818f786d24fa15c80988888202db005a7a0be8639bae308499a3c930c0015b61e87ba8422e3cce8b754cdee01fe2002f7b0cbd03df3a7d3d78e47b9cf9fcd2984335df9cc8122b2a4da204906d263ff28f74a01547b1b6f1ec3e064a62cf527f4e869140205e744dc2b4bf3038685d38ce76e026de98e501a81feb58ac8b7e9ee7e22e86ae0abd4cd31fa7c003b68bee7722bb19fc1167618dc1872e821d2f6d4eeffd0513d6b564699511ac93194693d408c77f8a7e9d76d5125b5e87e49b24cf2e3e5691db8dcf5f3a7e538f5cbab0a0a65f51bf08190e8041d8e6ba4ee00868c5739e66e9fc08fef8066c1491800018c5d34ad7afeef06ceaf4e997977bddff05c055e071d91c150e8d9a3a8b06398b2983365eb6d993b6dd6ab370eb8c03c22efef3e32841db9a3d6a081eb6c28bef4c50a6aa6299e25394014a5f1223d8f6153a4cb6a19de476bfc9ea105bc6f14aeafa1f1ea59d429418d8c261767df729c6a056118860add05c3a1d156ae54c151ec97961a27293193b530d0ba8cd5b40538b6f324c213d54e086e9fe7bd70eccbfc570f940b016159b54290225b1510224e2ac6ef070bd7a786ae576433b97aad0adbd4bac0fc773da4256cdef79aefe2cc90198af61fc7f1438147a24b54b2da8f0c1b9685e89ede0d5620608859a5e84fdfbd525a83d0793064e49659b06f494009fa3579d9c242d90f1d712bc5aef028fdec46f48dd79d80d7fa7d02a87692ebc08544ef0259a07659456eaeabc9117233a0988d29e6d028506c3335f61b3dfb90af8911888a13a0e5655e54a75535fabd682d191e6a9719a78c590415201e95c75e280aede734e36b36ef3469002ea8cb85e7cfa356c7d15c19a1b3faa3184e55ff0c2180536a8c89dd230bb851d2686f801aa200f77832d10d345bf3dfd4a02400af0e36c97a754e8012e674b80bf5ac4d5db6c8484c94717a260b45267f52eda8af7a1ca096ae9b34cf5cc4666084440958b3b84560a873cf3d25f92c6b2adad20d02947bae4c1f3d697aa9f6494262d68550f4ad6c60b9e1ba178bc5c596f027d45d6548a25bc84439b8073d9e1bc849c63b5c1e074eea665543695169d9ec808b4a75bde086cfc6e697a431f846e5e818aee5593bb446cb79af34a2024225a867aa4a743b886538b40ca37d36bcaee4ffa9e67557f1015cd5e46d0e15fdb51897260e1969efcbed8cef7652c7447f2114772fc62190a6fc0744f49fe2bcfa8636f8ac57d93564d555dca6d28f016af9cd0e4c4efe800a10f214308e041d7c4271853414a337ed9a8d816af7e23323f6a646f5942084faf1817ed66c57225a41607587988d0c8701f2d62b98dae16d17ee649ca6e5fe6e49c38b50f91b3243249c5694c7cc57a37e072d330d8e434007309fb55c234aef8a3477dbfeae2c24956a1c398be41ecdce35856becea7cc8f4dde92842a38501c553890d7a5b3c4dfa5cb125158d9cbff79534f01b5667bac1324b92c3705938150e23e39f6d6f3007ea1687c6b63ccb4ba44bef318040fe0a82cb433cb5e93e4ba37f26654cce5fbbeaf85e8939a0ccf705d8ebd6299c8ae18ce6d0c212dbffc89ba4fc9abe68149e3ece6ccf5cdf9209c2122aa32585fdb5697844c41c6f83a204ee1637a55b7f19c6558e99f79c55d45c915f68c980744bfa7e9caf9adaced049b80ead99b37e1eaf058491875c23a4468daafd597a282ac200dba5cb68162bb03be91192c8eadb600e787a207692cde2d2c1d4640d2d812bd52953a34aa5d84317155c81d340910bc5ecc2f24b530fe4fcccf3e9f1f4f3acc7986c234e366a0e7d02221ccf5c658e1c8fd5c2c2960bbcf428db00a2122ac224ee271ba6257da46a2dd877d5171105a1f199b42fcd918c80a71e58b324a13151b9c1a51225e0aaaf5d28440cea2d7ecd46a68da657639a4be4892be6617ef6f3026bcc307ab8b84fd219fa70c17254701f65dd1fff2446e2ca288bdd0afc4fac3973695e2c7cf17d49a78d88024e073bfbc5c3369ef84e1fc541b8a681204e6ea2b047fe58635174569fbe2a9347eb4616a49f50555a489b6293bb5420636a23c9152a8dd8f93163456f273e0bdf4e1cd7dd4eac6fc9f03b01f0f0ef49417f7a9a4777c59282b29a8981fde4bd0c8a66c8f7b1935634574b3107b26401414684e67a4ca434bd802e65ce415cc11afdc0cb6c96095c4a9fa9608c3483ef20fc3a3e564bff915abc2da4461965b1ab19806b024c9e64bd2ec4b9f4e844abbefdf4fe2ea06aa6bd2bb92a4131c0adbca3d024b3f0b9a7773d8196577995a6e1cceaa85cc823fdbc6cbb1fbcedab741a075b098c4469e223ce0df9dd9799c613f3abf09d6a6341700b4a7d04f63edce54ec30925bf37cf7871a6eca1de638e3560576869cd1c7153328959d25abd5ac7ce742e6e67e46b2b44284191091a93017811390f6795c5e30e1745201bd3e31b12e78c01bdd5c05dd6c58b8b4fbe86cdeea0d200907b8007e1330b2eed1df9b427b3f2203356d90b069f3fdb6633db2ed0273f0b7791511ba44f676bbe4920fa205dc59f5d8cb819461408f625f1a5c306cdd884e2bbbaadc9fe43d3561cb5d9f6452548f5f8615d874befa1b0a21b435fb7efa3b18f3c03b77cc2ace38e74af45587401ec6eb98d777651a77870ea62d3f03f7092137d3e96a3571d53379512b3d7078222488a19deef1eb57215870cbb5fb650c90a70275fc91363fa9e2cf32ca172d8e94fa404a074039f38504d67f9b1693aaf9e0d1af3731d7355d4686aefd45f86998825ddfd060a812fa6d2df7299f4e5c85f1c64c16e4490ac772e81fe1a165c2d1c64a9839b25bb4ac33893d3a2f110bba813d80d9cd9a9a833f397c125e3287b09f87a6f9976bc4917c1eb55036fd1da271246fad5fff8954fad9697caa5916b0bd8f7650d66475cdc20467d6cc3232565a902d5fba090bd6e3d43019cbf0b4facbb8e8a316aede16e2c281501e68a1431915c710aa040eb4e7898cf194b5b7c23039aa3a6419e0bf0d0715a6b9d25068cafb1cfdb4494704b9358ee8f568a0b1600352322ddfbeb55a45cc20f572d0519621aa7ac6aa37003545ceef7f43389aee666be78f80e9815d231e522f64c72ac1a24484aa10721f516bb3cdbbc84183a74ae9be85a8226409d5df1d5d08cc75f4d2b856cfc21f8cfdb7089725f76ec8760253b02cee98e538f73f0cb82e61a8e9861c0878b7ff5e6619be796a96b6058929d5c63912a6ca4de37ad7c1c6a69acd9e093f695aef524af9a727cb1bf49bb968f9b26800669056acc42e6e75174f9380bffb29cf080579a6acee5c318c6780fea7bcf7d1df0c169ccce2b493a6bd8ac659764edb77eae75c09b9aaed9a07ec3bd0bde95a8060b176317d56f07343421ae7d6859e67e0ef6dc352f93055371f2d4e6c27cafa77c94d7cae4ae27a438ffd3d9f6c33adf2a8ed7decfbe2d99b682342191618eca83822f54829c826374ae2472dc33be76c1cb9deb86f6bfa1c3ed90f56a35c1208fa0ab2e46df34420d8ade5fb098ff2309653ac121c1787c0c260c0e1df0af7e273df763b6211bb121a166ac2142d428d5e9baf7213ea0947c99a204ed3207c19f5a26fb6d50326192db05e77ecfa6475d707fd3cfac78c01f184559a917c813a0da83b5f37c45213a77572fdd267ba2b472bc1882fe7196487ceb4a7909174aa48fc2ed14ad94e35e767eed78007d0d215e6a86d317ccb91cdfe02d051c5465343b5f65809b1c2d5c62669cc1bb2b6967f163f02494fa0f64f1a0bbb3be945c3f333fb303e33cba9aa061e3dcc01771da2ee20ca241a913c8c744c0a698404fba467c9ad407980fde345f6349bbf7694d2cbb1d3ba73db5ea0912248ea489e14f8fbb98979fb449f5f2b482fe681d45d4d6ffe82c55eb45b80396fd3e31857318464d89a5125f685bd6d3aaf300f54bbe523411a5995eca67c5136465796a1224173b26a7c2d10208c39212db01de7cc753c6a4c9e190a5d325668320cba6299db3b65969107a2d9282474ef2f50ab6e422bc385a7c37e6b5aa5231ee06fc73ec9e1940eb0e34c0d592bde44224063b82d91672d1e1100274ae0d99e0d1a850a4d817ed08e4c26699a426ea194925de9878187509921675a75f6f78432560cf49b28b07c60e6848cc0db82b543704a97fab6e49f4feb0a0fcebf0bcb7a42b9d3ac0985c354d652340abe0462c3e85588c1f53affe1ec36fcf8d233ea5a1ff2bd124d44b8b994637774bc410d1e2d32a529af4b88ff630c6e118f5731ae452697b0a3f63e286665ea373abc3f0063192ec7c0fe94f617ad7d1edf278d7886545d6c9546b87607c9d0a74b08242a87e734033387acf9fbaffe050d83000383327f8b6144c6e2017751b3ce23cb15f25a88fe68abd0998b00461ee95821751240e731a2d7c48d5be6a64e17ca7fee5e4e7f11776a1bd029d4cbd133c964675ee1e894832152dcf30ecd5f8a20299b631c250cbc004af850d9994ad2f66d726802591e22f342e2b87af44c8d5974e59453580f4014c1517f02557aca600133623c6eb941d8baa07b5b219aae5cf8b52b23b5fafaa4547aac132e909f73c17cc99382ccbd4345a430c56b95d13be801f6ac65f2f149d031854970a03633cb7e41206befe5d31e57f9f838a6a60ee3cf72d914fbef7d1915d8c3e2ad4645cd5292427b7d23eea190f73c54db8f1b983e744d67650ac5eaf2f0a63d5aaa46bb4e6d45378b89c01728fca8bfb2d467cc978d5b28302664a64671849210010cbfe97e87e9aae5a96b11b7669019ea86b419d9de845e8cd4388a4b7bcb6e2d5d5c64262703c6a51a9f46069fcad39095827612769643260b7e7e1eee371babc76cb95f8f153621cb995856e4a76f5bb999303337fb36b98a5cb803cfcbf628e5d4290913a7380761dbd149c9323aea72e480a1a966ee2a3d0732fe1108603f552bbd2d14dd3107d291485d38847b36e144c9d4538a25a4cde2581e9ab119a229bdffc08fde6fb35ac4f7483a706592ab014a82a7668b0f1bfaca6e5bc708446746715f8303b91aa0e418503ab76ed986df84184abfa52608b7374b441d56bce904473ea31e20943c38bd47ce36d9a3a88650a833590c609d2443b0775ef7735afe9633e8e2984f320b8caace25889cc3bb3d02f5aa131fae52707be60bf91ab949fed7386caca158997bc33aaa779e6f9c96d10a77f199b15a8935f7986972e58c6ff33b930d9f55d4a1fb9b26c79b5701d69887f031b0d6e1f0588d94bb5ae90744e57749eccd34a61687603c39422318962109889e59d7c92fc8fe50b988ccd6d13a7a2cc8df9e70a2f55131b73e70750771cdf8b29e9795985f8c8a8dbf756faac2577c197d3e60c612dfdd8fe1df36fc3725d902db5ef1d2366265caf16ffcaae47f4e4154ba235d15748316cf7c3545623afa4a7ef1427b66a1764d39e588c4b6287d23d1de5ab9bc61286ac84a4e1af13a4b93f65d3369d14b2549ffe8e0c2f60cb7119f8750f22a9ae171e306eb455a7737178be468829f7265b592eec4c926d7764eede27864c814bc8e392019f085c2d73b95a586047bb813df61159dfcb44aef0d88fcaa70c9b38802d236465bc8a6717b7d3365931ccf628b58e92aa7907aff2e1403b6052ee3c8deec39158cf953a2f16b5600a50a0f51a8a99eb34cd49882085cb4338e8a9c89ea4ff3ff0dd7c8dbe06c59be383ae427cd3715cd7108fb5c6aa97aab6d608065fc2d8d4c45c3b5355c71a44e9c4c6dc47995f6c4251ee2bf49b394d4ddc80d99db1a182bede1cf67e607991c40936fbc565704c39e405068ea4ab017db439cd5b69b30b9d68ab96ddef459356455f96edf976079c03c49bda0241730f285716f734cefb8bfb9df83808f93848c35ac97785e46056cd6f4e1ecbd45beb4d7bf35bbd8571a51a037749c612d68c09a136f3cb4c68f4c75d026543a94610eea85dbfabc0a7c9b24428ac476eddda7c6ec858811c5b01aca96f95b0ebeca442f47426630f1c5b122480c4c663fcf14553d55c9999ddb6aa285a223a9eda60362252f2ae0c12c19ed5b760c20a58001d1cb87887d15b6ecf68a9169c683f0c737fd207868438647e1623e21cd3d20a53ce6b8895b8d0e6e098bfe13b0c09c1182dcc00454b1eeaf90ca7a815b80d1aa9c4b71231bc6fecce6e585b57bb80e6d1bab40681cc79b56a41c3c7844c893b2007be23780aeca8085572f43563ca0f75a3d52ed5e1c4e1a5149f01ee764b15ea5f2e1859a0ed56311e2584308cfbfb063b267b6188d4e8dfba26a77a5c31e0eb0c7b86de58b933129b9887945cf27ae01180fc9ad6d29a27ed6f0831f2fe1942c25ba27470595c81589ce180cd04f5720eec94a16b716177bf9ffc5ad514b21d7cdb81cd2a557195b84fde9e1f1afaeef818fb0438d20eff834b71cc42acf6c797d708ba28206bd82c942a639cdcbf50d0dc016fa4a958544f38b33679d8ec37d5df025094bac8722dd85b89c50d9316d04d990b8d81bd199eb62b498d1b65f8c13eeffbea64a6343f67719bae2fba925ff1b97e35463ce7c889cba3217ec3c5462ca7f637913d3398f629cb34e55fdaa60b346a73ac800222ac26101135b8c7a8572fc8893692271ee139e0925ed449cc2e87cd9006bc1bdffd54097e0aaa8b96a12cab7a5d5e997dd2f29b66ad97bfafc23dd9efb1777d6a538df6e748517509c7d05b9b62d319a0396451bb05f1df7bdef9a6012dfb0a151450a8ddb1ea30ba32012ceaa8b1b603145b56ef04a904aa2c8f8fc2789b2a4f5e4fae16c0eba84f22c49998f08ce5169ca4fe574bd52cda3e0fe4c41fa4984a8217bc9587628c78b383841a4304c9718be5f6cb60ed28c064222415a27634949b86b1900e8c293503e404c10adb44fc43a725c2c6f660005bb3e9c1c7e4b470b7167ad8017b36d4fe5290c24860f9c6c5b7638323db700a531f6b2c429e8a909fcbe387e83599204852f009c54e8a71f0b87c211a987e7811e21ee1cbc22aaded142fd52f9009ccb9346b94d90276b3c5a1fc431df69d05d7d54701f5c5476b463703d1ad838fdb6beacd393643766c92c1529f8c2e124d9adbd82c7ffd1be33d8939c6f7b71b0db2fe4e1cfb0ea513d09fa7d9822cc228d61a6d252b0f860de0d848a087d25282dcf85c428498c00f5a009e09751c3b7892cb78c2f9be88d5d8f8761c2b23d014c6e8dba4ed08f82a231f7ca86af983e2e4634cdd3a6dba969bc5c1fc34ddbf8a6f5843ad02c158a413c79a5145797502c07041bbc6538dd0c88de5f8b32b422445c83a21232a2fc9f8e39bbddd1b2b675dfee02af4a707c7daf335c6c1ae8ba20ce759e99d1bc3fd0c05e55e078a7b2c3cd3cbf2f73bf8126016774903761aa18da7d9fd1e8f4e68c35f8a2ae0f38e706ded13f1c39600577cefa831443d4349e6960483666af9833637a924ee83ecdda48247778a4966168d02cf03f624e3ce36b30c6864694b13732515f01b4c3c43808e14419a66bda0dcc7bdb655bf10ecabd0318cb29e27f9a4388edde1b15a24b1f521c795d41ca5b8f6cb5c5135eadd972ba001555e5ef5ebc179368cf0edcac0f38e8b7ee989a0c1446dc7f9dd6818520ad2040557aad1088fc03a4e5e59063cbd9bfc438f96651b57432f691dfc8b31698303b3d2ea1ad31aca16bce8001c7e1477052d322ac1b015774afe143919ea130d24ccec5e9d2a6b8af69b8fd5566e4c3987fa847834a457f10c747086ffbf403a56903c7838fbd262574b07e22488241bf2576e7461807a66b8a56a04f865b7b3a50ff52c96b77597f8d12c74a8b1eefc443f733625f3d85bfb781034ddb0a69e2557d7fde18f5e87030400136027053379a6513cceea7a8d1a222cee701a2bc9191203a6cab07d62e96f77677ac72629558ba02dd72770005455c8bdbb3c013384a6cf4f49e5347e411f550c06e0c251bb7c87bec3d2bd1df3cd24adb822d416b99e8b2d4f40db9036944552c1b56f739544fcf352cf257eebf847444219317d482539896df953a3cc00d3da2b001e867205a63e86456648123831f2ee205277137acb43db028f281a111efdb2575e51b9dd71692ff2da2dfde2128622d6cf923b2b5f884cf4611ee7da76e5ae4c716d5ef7705ee77a8ad824015074c665983543f6406579983afa0a74bf9cb436887dd59b6ea5b86acfb41543e010cbad99041a1f22e03db764e8d43b1c46748fa49a0ab958b1dcbb1ae27a448edf68f3711e22af9986b4aecb735e8ae7ff4f0bd21d04cdad9f8aaff478481c1608c95bd35265268eb291d6f684548073b2d938315a16316de73b22f1527850147a344e3123514b8c308addb4eff229dca6fd5c9f0e0ca15d1a328907e61afa7541c74187b04910a6ee290863fc8f2b0b0389b0a42582ff48374c04b7dd8b1245850c2719029530a13564e06af09ee1910d5f48570357c7f591e8be15c6ce8b7b66cdf74a89d7d3b0ea25a465df96fba4959c8af6a32dbecfc88f3a86020029c1977de2657385b2f20465abaf5228de550bb699dcdcdd4bc01b84765280efe5e56f0821b418c0f7480b732ab8a25a48b91513c40abac860ed88b2a2ea30aac097bd669b5ed4eb97630126f8cf9beb08abb89d113dd224ea005ef7bf3c448ca5fd9ebf6d4727c54b838cf69d3dd9b3f7dfe5fbfe2d7b6875b9bef3546a009d7b4b5e160a8b93ff9c8744a367856d57da1cd4886a501e476a9a4cfa9374e872eb46eb314de94d1d7f332deb62b7a541aff44150ce66e54f8ad079a64002f757d02838471bb30d54700ed1b8ba9c5af5dcaf7b1e9dcb74e506de035bcc28637d05951ae11b4d48b970746306fa161bab4b462241fca51188cfe39bd6fcca182d91fcd436a2068e1c66aaaaadcb906a9b4b4aba271f92c784e50bc2dc07a6bdf82628a6bf771aaa76379ec798f122fc9e155cd955c5f7ba4a3455c0c26a22cdc6395d65ff39b425cd647fe71ad5779c5853e1ea43096c1235c9df7949c6bf34b21fb2bf8cb05d43227237fabadaae915a5089ec0e792a846322d49314fb54aae7a0d1781afcd45cef063f8c7982bd9654fe4d424cbf1a855e91a0c1a967345ee0e45d583c2b6e6c84690328365a97ba889867f430e6f1ab26d52fa9ffe9fd04f4b8fbcf9d68011b57e92981aa79be9b11e130244e503e545638a81992946da31d8d200f81f2f19cc3401924b4433014574b6e5ceb1ce7a1989f91fb6fbcb9cce9248c0f93377d675d0268dea281cff66a13ee14ac3478f8d58db584111eae0a07a6d71ae8334d6575822962461adcca49aefcfb59c23028f44ed93c80a8bb069968873c55a041ef688cb7be2cc3f3e96cd1b1a118c927f67d9e57e360665dca1d01a88589fe19ad2195b6443a71e125acaa17708e9aeb8f8b123612eda34f2a69c07bedc460e5a2d0ac501ee11413934872ad759da4f1a788fa642e5449fcf54d1ae521de01c5fea3bfc33ad5742763abc8e051ff69d03c89337fa7568e3cd4d483787d126354215097c9497cf8f135b623ca7a027f42fe65bcc9e87f74ef8e32d69f9f983285af70ff91d92f14d012eaec8f9f0f78621445fd0c8b290977a83672af7e32045a7a68f652d85e1350ca486954f964839e495b67dbcc3e5e9b0cf1cd171949fba8fbc20325f2b2320231252e163f95a29dc28e5e9e73732cf6776332d726d1e8845f15cfc3f5ca7915ae4a79098fe44b086c1c98fbf473688573b1396481e170ced64f1ab910b7c3bb1557c0537e392f416c8b4ac8b8cf653274643d2e16da6f15ef95ebea82026cd92ddba2fa476a79cb9067072fa3c96b10588460e2c165879d40b8d57de5373ac6b809ca89fdc736eadd15f996104799ac60eee416137415081156038e02cd1dfb5d820fd550e6a14a584d680f824e83e512761bcc9ae1fe226ea1248c033c1bed418dfc4b2d73ae1dff67ab1182d55b2e03ba92bac7203873940705c3c54d14221486d4dbe5fb4c32570cefd3ad93383f58b77cab2d820bef4327826dbfcdf0cf0badb0ab37f7ec38cfc283eebf56eb2bb5fcf046df8a4da9d8f4929331b1bc4ebe193aba824386428b42a516c44224ca84e62567989cdb02f07516802658d6b215548e04e8bf36b41e60e8c67514f7d6f6ad6b33d750936fbcef8337cae0e09bdd0ffdfe3b65a756c354d1278067d8bd2e2b928b9b407d45b68902a9ec35811a3154e518d1ab44488ee3ed2422fb7a2c8bb0bbcc03189603df9fbe77ab4f3d46cb0a0b194e85428fa5f33bb2154528e8ce736a29c729450590a715d43734429c22d81c9a7e98fe1fdfa3f3309626ce2005e3778b1d02cb9f549f781ef3dfef17fae72fd29a139ac737618e2ee4b2d9f596e567e74646f6ca8b2350e8f87e9a018ea472a63ea02785972f824e3d9f22ed8291b0276f7779003d01a6501b68ba238c15437fb3c271099f48d3e7ab22d8815ff01b65bb800677a84abfbb382f99f2cc98b1b2a4a95376bea1a7e3adff4a817bbd2fe33d7440a115d2f5bb6c08f397345a9408835840834b187cd5d7a810d06ba24867ea74778018e11ef22e68d79a254ad096b723920372f91adef123d80d85f9d20cef4b761e8f31cb1bca0d2b2ab1a3e925b84510c8fc23aea3780593c174be0bce350e7756d9110540d643274ddd852d3af90ddaad208f7885907ee5d37a9746caef519837828ca69c4571ed30548796f1b8432e0c13515df9ca3927f9dfc97e1a9a819ca5e9d16a6ea9e11d542af3568a47e767279c81db737e75552ac3c28161adb116217e5e8595af842ed23dc70cb46b8aa4c169097eaed2383dfe148c1e6d37d38384fceec2d05cbcc1f012492ccb0ed091a629c3f87561b26ccf33b1b85da357f8589685c791c37d6042dcd9f6d5ccde3143f779252fee5715aea5d500a8913e320b3690787279893ae69c9d50bf7a25eb97d7244593942b281c7046c3372b050f2bede7f43d55c4e80eaa1cadbfa1f2c70f874664957d7c01d4139e7341d4f0938067eed7325b3d2eee9fc839f626f7d0218de243c9d3b3142186888dc8d5b362b7dbfda66b350ca9fde12ac2f4429397f6b3ded4ac4b71a4a6d09a4a620c2c58a7bea0e6ee88707edac23ee4e4ba86a08ab678d7467f0dee1e8f6dbcb9857f0776a85802abf001085e03f65a144a4242783d212ac478515aa0de9cd2660aeb40111cc381b55cede1edfe396e8c6d8df0fb90d99e26fba7c34b509703d6d82f6c3b966ae233869c294cdaf19fe1166d838d1af95436f744d271fb9dcd4f2a84b264ffc875d39face0ea8da8af8f2dcb905db1d08eefdaa172312c11204e0a2398f99b305edcfc5263d370b8c2a57b55835016b68e643ca7e69c1249fa8be027ce5bdf9740f2f4eff8801b182c790d23016d04d7ec9623dd054b8b6406a31b5b746dbf7dce96e3f58f472a73793b7d26dae67dae3640dfdd9112bc81106b166fd4a6f1af815aace46bc4d894bffb7e50c218db008e2af33e543ee26330e326d57ea34b68b812be84213b24e8e6697ccbbce17663238fe200edb62b3f26da5c6e4a0d340f1409f179bf2e4ce574b449d8501a29999cb1e51e81cf4f80e0830ebaf936997756e9b7441209b4e9c5ccd762ef9a6db9fd406a9e9301ebf67b141f00961fc7791ee5e6841eea48c134ad37ce5e5f86b9700dc5a0b09949ff030efe6037462ad0c072345d16f1aed8f953c15398fe96c2bba8ef889f918d45fd33a02ad49fb7df4bf5a55b51170b85cf3f23104da01c516eae4a70daeb5f4a8400ccb251a8e3c0f18f74266b43419744748a811b7cbde3fd5cd59aaba60df5f9509ce7c25354668b65efa51d9c2cbbfcfd069d7494eeb2492d711dfe1044eb4440e4b1e5268473d18321b398a3cd1839c8f741131d894a19b8e1565450756d60bb296a84820192290fae8ec5573c4149482d83fb91db39192201cc15755de51e8552bcbbf3a4921a10636bddad9b0f7b26f770f9ad5916680d98604eb921f4533adc839090f8dd5b895cf75afaabfcbf951d1172dcfc809b2ecf0efc49a70ec7a55f41a39ab239af5849172b3c7b9ec1f67b1abe62065cb9550b5ebb94ef8f93fe3aa777fec06c778ec6c68eb9fb41106bd5e52f40d18c857d1d3382e811915dafc9667e4a809760383c81af16dbbd07a61b90fd3cab4c56b73dba3d6bbeaab274ac079b4184c146a6bcc8eb1b0a75750b35828d737438c1b287d4291ac82314604a8e850fc385f932d8bef44b31ea0fbac32db2e02a3800f38783d1d9b20b90d1d2a7d00691d6e8a3f85a3d5050d804c195a49466964b086b0f81d0cbae8380d0af971ff44d76ccabf420f667ed1741197a72be780e5b88b5e5807fc3bd39e49ce33e3c15860095a7cbf39603421304e2abcb4f4fc8b8d3fd55c7a9607fbaab6b5173c6109ee050a0bdc804565a54a02fc1c9be615d72c0b8f7cf2bcbf0d255db34f921c76ac713310eba60c131a9e3b6ddb277f870c6b88a07251e52d4caa840d823a9d9d8d6af683d0ecae830eff8dc2c4c4927a0d624ef76fbfe8730e31ff757b78e677e9f5ac73e7be8be17c22e3ea1cdd7e0a8b60be33a50fd18b94e4c7e757753b3191fa42da3500258502addbb0a6a40692b3808a26e15f9c001126d9a7737e5c8b9c3190d9160f523c4be5eabb6b9e4263b3a69742611c0a5d46dc341343caa00a32fef86297b79ff3387c311855e0095532bdd738ba4391fa83e18005acf7eccab61f941860c481e935d23ac83eb3c861a429f7056a3f68c744bb4e7d2beffe7c25b2175d228855b101b4c6dfc04765b9296636d2c5092c0ae3eec283e3ac0307b08494a0a7daf143e3a786a5bf0e874f022de82ace45e12c958187626c94227c50b6db44ea875ccb630a3155d254d1252965cd447eeca3c6124d89407dc4b1496eceee990adbeb2d0199153c425dbab429819b21620f96d2ee3fd80a6e280484a5d969c8b7ba1a71502411860e8763b5016c90c4e1a076fc077d7bb8b41c24135f8f9da5d65d1715bcd2a7d4581160dba1ac607a2cf79abe1f0c576a60e042e5bf63bff1c0e6dc5bdf99561e4e3b7e75333f0c8bae35c6aa7bcecc92ef854cf67af9f8a0d45e2c3a67140930924b809084d50b698dd83349d1338ae4d60e28ac2fb870a9372bb91e279b3fb434827a81b93c70576950284e29fa6a84ac4b34156a512881aa2bc25926343f08d2d17bb23c38a3dec43b85345f73f65bc7e2d8f6e9a48df4698160f76f475b6d28aa40bfbebb03bc29392a8801c3d5d6eb4a789aac9434cdb6a1be72263338eef2dae1d46f3f0f02d3e057fdda8accbdaf2449288e44ddc90b15e585535f2441386afc4475b0960a7cd9801e9f25885e12f52e3d5576ec735e2845b189432f7730eaf4f9995c39bb647914395f6bd6196470ece04acd3f2163d175173d6eacb8149355582cdae3724e1777bb054856c4efead0c3e509b17d79f73be24a67b550a7bfa0e203b95cd929b4f413dc9e9d4139d0ec67c34cc79fde593648d344e960149601dc7f3fea1e1449f8df273fb92c1fbafb7b881092952375027cb6441b76532fdb550ca4d5fb27fe0650f6a2e32ebfbb38b6f93905fb395af951a22c0fc4ee1fc6ea2fd16c0cfc7eec540a9991fbd10b494eec7b36ac27146e00061959f5a47ea8dd183ed283f5508051f445c7bd9d42db47e07682051e42e0457ee48776c80c08b77fb1ae521ddf0b825777888a606e1b1556b79478fcbd702f5e022141413cc68f36842acf90aff6eba08a281422affab923674e9fee5a4beaf49d4183f9bbc2e4c422bb602151e9fbdfed150fa6e70335104e55221e796a6d7d982425df724cdbeaf1f58d06eabdaf067bbcac2daa32792dbdb2135c66771da098c17d5a9aba9bf49a1d22d89902919ecabe5dbad93bf7536da56521162d03654ec95337fb3f039c0f84133f048f7a7fbcc5caa91b3c4c7d1468fa99d1875cfd300b20f9c7b8f6492c27c4a98cf20464de14a327f72f454338c185283d42b4000469a56ac28786d4433782dfa5fc8a11f6cb08a634f78201f008c8855b0dd552bcb1e464d4597d849aafaae70a921ac8ace010d74bb5d5cd338965131b62ed47e1a4d762dd3ab9450da48714c1ae13c86108729f0b253f5df2aaaa1218fa6e244ada669673cf6f5ad9aa2dda99d97699f0375f5a729f24a08cadaa3129d627160ac2c8592683419272432f9abd1802a364a2ddd8f760a672962330b4b11924eeae47da388dc9d48a6959399fd8d28e1a373b883ec16eb7757163b1c951b46c50ecb3a62419aa0c0a5208ca822b4fc716b9dfb81417c92fd180e29f87cd3a7795c21b8cc47c23c30fff63856827597abe7170c666ab2e0a0e42a213ce58840570d2e1c16e9020e0bc499c56128a6f4bde568b51b758ab45ce4328d09591721fa8bc41b4e242df44582771aca6ead2b1bc06db8d5fba3132efa72750e676802dd29498cf180684a9d2c915f0267af824580530ea3ff0320fa1e9b5e7d456721bed800434dc4dcffe87d04917750ef6706ae7c14e8502e10f3c147f0796fabede5c01b5abb7a45f9ccdd9b365333f9bcd19e232bbca63571a9a4f8d5e4bd5d068e4f7bada44a6cd5388b2ff1176753d048939478df3c8731aaca062c7bc21e94f5cd2b78d6e6851c4607ff8960e1cdc1904adb28bc75e91184dcbbf09ea855cfc3d84b57ac5551fe869c2cb19be39071c3047b907f1125715f34061f970847938c08ba64676e191cb19f8cb91dfffabb6f791318c2aff7fd4f3b3f4f7c44be02c5811280500f926578fd098d5fe2c2f635c5824943ead2ac2c120cd4d9c19d1ef74bed1c6e77f26db27b79a5366556dd1dbb21115863294ab59312d4f52f790f4d03f72d768cd3ddebbca2e10343de4671395fbdc5351f2c51a864ccbc24a20ed7c40a75b5847c1eb638dfc8d00ebc701f7358f94b55be253c31951012c843046a7ea857a762aeb007447020d43bdecf6e8c88d20880afa0bcc8f0f9402db607c33991415def9a2e1f19e8fc86601a9109c2b21b1684fff29149e74b4fca5e855f97fcfdb9bc7d413b55000146d425bc02dbef24caacdcb5005ada87be46b5e44cb33f7699004442231ce0a6abc7156b5404aa0a78679ebaf7dce0b34c025be80e063af5efa7d4036d58cea548a0a25fec89f790e7138c129b11a82907320c185b98e6e8df8e0419363f68a5298b3e169687c3b8d718fd8c8245c58a497c227f222cac1cd6367d6a87490787498cf7668be42bdfb3b69e7e48561637e9ed4d4cfd0b988110d1d0a221cb9f4b8f5fc9a9873bc6f01d12cf119c060aa570cd3fd957066786b5f156c2801d3d5e8848f9bfcb51c112095403dd156d3bcbc7017b98afebce6eb9b35371b00bdb7c9a56ac4abae2e9430e5eaa7d0a01aaf638e33cc26425c2c7612611a12e20b0c908c2759777d60412c06b58accec0f91016d52c6f82e42d8687283f20e29e786075c83913ab335a146c4d666e8960ed1e515bb9cf98984aa8314634c49e4f8f84f2eb7109a6bb9335061bb04bb8b88f3a7d6aef6fb566695fbfbf1ef407a7c8d159b4105348d7435ff92446aaccd7b0d6ab60b26d0bc018b485d13e18f06510fe17403557b2adaa66e820c598c5d2f5069bcdcc9a96bcb03342b4e4a3213378467c81b0a8d87a7c2f339fbf582637e244577233b7905006b572615cc592452ecd45873f50f7dfe3b450db99a63baafa09889e1a196b36b104b6255023f26157a7552fc4302229284e5040229f14a7a57b024f737e8078987923024173ac79bb0774495e4a7e1c0e78b9e786c3b3037cd5711bc6851b30c7b5a91120e809a79038cbbf51ac8dd6e3cf645ff1259bf0121300908e5ee3535d7254e90af0ea38cfce4331825b5938846390da380fd85508583e730f0812c02bfeb5a7ccd9f62d2a09b569a748f9d967547dda5f83dee16448f65c9df4c03ee1bec0929764293e0093d9cb94ebc167c89161fed9035bfa6d6171ccbbf59b400e7c68ba6ab807888ff54e5850ea4323d465f0b6a0d3f32287b6d646b79c3615b7ea67a215f880f6abaffdd5cbc22c93fb350bcd5a67f8e3faf670cb16795a6d49c8605dee919a03e83aa859299222b6b004b04edd4b98f9e10f68280fbee989c0050e6af28997445610c43861b62825ed493d40194396c3fecb4cdbe32b3cfb895c81c70cae067c54a5b40925bbcf28ada12a1c3da4bc261683395896e77d234eec1946d81a58e8464e7abfc466f00faec847c6bba107262b84ca21b22afad8b9abbcf2f678ed8972f7e5ca713f46cdbf734afcff2523663e605215abbc7f7f2744dcb3ce4edcc35e87113dc0b06773328a19d6a1e5c74cc76d10a68cf574c5083003ab310346fe89eb324c420a56daf19c395af09bcb7eeeef0a954798e22737c3d0437b7e364c9c41005121730174ad9b5db11aa3e5feb8cf35420b07665ba2948381215b5267b5a73dfe6e946699d1d9ab9d891b310d88948bf4dec9a688337accb1e6d3a96c6e216b870c51a6c970abd9c057600df09d1723bb4ac5a8c1d46ed30df9f18265a6033c3ffd2443893fa103b38f1e59e27a2f26a97434c2878de14ed8a03a5238ce0fc6d4b6ba98a4a678a314797f3ba067c8a182d61433fb97444c5e4c2df034490d9d36e7360921a409996bcc827a3c11a9a2926903ecfa3ffca6fc11f17d5039e2baf0755a46e2c76786d0160230c8e6f89aa00211956f92bb0fdccf604e2db742a2fdd114b11ede807d3c558b714e3840bdbb4d1e0a6f4c9a2ff2a72f37abfcb2563122eb3ee3bfc2c0d85bc192ca3cd4a6a15e7045e5975de985b2479cf41f5ff38c462453bcf985c3ec1d3fe847264e661644ee1fa43b2fecbc356f9f115559970097524589051a406b3bb9f9aba862fc1d67ed85fe24ceb18285fe1f617152e730adac8947c74efff43b3c9a3d68d1304a1a5ba9b079565d2ccd969c2f8332119ec1f57cc1c49cdea2f632b4c480f3888957f1aeee3d667aa360b53b73dde2fcaada5be24021651a64bf9a690ed70a91b73f999235303ccd830387663658735787fb85e72cd6ea3576d48e1accbbea4759ec57ab20b9e98bb3ec900204a2d8aaf4fe254d7855916f00397cc6e7f748575f4fc0c891e006cc309fc15a0976a105ff71d9a2af3df9a5de0204ac658e4e0bb6e963a5b50468656b609906db55441e82fd41e0b8874a1296015c83bcec6ab749b918b74fb12baaf10f136629869307079974437e3b9c87b50bcf9b16c4dc261657a5d41226ca4e82b30ee98eb07055c4022285fbecfc78362a5cfc6bfefd5353a28715081d9ab4f337b080dbeb2fbc415ee0bdfc91ab48a1c7137d8ff927cb2a894ea44f06bd732df3b10179b4791dbd17c744ef0a88d16f8e5398c69fd69b3eafe67dd23fad5da8f633df6c0fa42a14e2fce33c5f2ca4e5e0904780b7c48ff03d950af6d602103efa4189d1d861bcf2d92cdf60a6ef504ebc517dc8081dd9a32f135a8eaac1432646fde24642184e42bc1f11814443b0307d530b1031ea66f76a183092248b594c3580804a0fc0043e32ca71045f27ffba05a7fc533341cb30e5e74aa00440553486cfb314815301375bc6d8ef95dbc2b2eb4bbe49b58596b5da265d3dbdf6b891ec4aeaf8c411acc3aa5f50a535c5dd5a7987aa7f03fe7d0040804a9a0f4e6c7829b98ca4a17de4378c8a90ee1445ff7033541fb404574914a21e7237d57c60c4b5d3d78cda8dbc634e5236b6e390afe2d3d2be920f1ec717d0fc1f5fc3108a7add66cfe6a2390f4dd654c4160e8493e629834e24e1f71e837bd980ca07a99ce1fec4999a71a587e0f24d328db01d2a337d1a77447121098018c0f4308e79c2ddd7fc0e45ada5d5fb3d1a7e66d726758d66aa8cdb1d0d8a7b9b743574187650a042056bfe93ccdb5b6d4cfdf777a1e2e50fa8e589f54d549ef5ef80068c55f9d224d03c824d32e742cbb5c4acf086840e74cd17fe7fc508279d3302efa786da7fd2e71a02f2bd0203d9ad517b186c056d0fc1c8b914dbe83f06cd6754300a7592669de06f9ede70efd034e31f318565561a4270bac129b16a453d39ca68801f744a32a83b9cca447aec4476740bfb5d2fda9cb5bf8b2be0f75d9d7e231c807d9f028039a26b474f8d28ad1dfbca9069d620e32d9822fa3a6f3fb985cf65eeaafed28c06414771eda69c77692711e86eb3520270fb3606885880b680d946f3312e79f644a1e43f0c4ba6b962a2b74a3b29608684f5514322392b20d17077764d5136d977964d8c6be016c0b2f01c7c0bbbff785a427f78b06ef570846dccbffb244f8648478de8afa71380f4e0f94c775cdbc7eda76dbe51aa6c51c34c2d49270d0b8fa3d43f57f6144ac9baf5232e4f26617d2ebfd9642cef57ace5b0a6aa83754d58057f5286024638d94956a8a1c4c1bdaf642330b284ec195dc8cd943eda16a3ad64d85d12acf725e0fedd8937794bc680674052d8a970bda4138334ed257460aab17d1a6f6ea81037bbffc86c3ad2192c8901c3bf1afc2efa55efdeb36bdcfe7b6029bb506f7f9a7ce4e94d4664aecf686a9b751406f33429250d50babde20c61cfe0d90f4bdc84790cec6d1421814f4eb91df27454b430450589bda54bea8e93e09c5f63401646ab9ecb61c33d660837db08ba664a728d56cb35a162566977a69f7ddb9b80717896feaedad98eed85b1e823887531ce5134bed58edb06f2e7f58619aa7d4504cdc99c5c8d7278fc63938241dfdf92f7fbefecfed4614f9859932437646ed5fdc7eae65d3716de3872dfe6a11acdeefadeb36800a49bb8754449d4fd89cece4910107e791e3815e8e564a28b61b86d4b953b5c78ea2036ffce137350aeff9aff66f86c1f52af6b3488291a6a439c56cd9d7051f9adeeb38d4c4777d1fa78d71d1fc8ed0e313a7c165df26d5fef59ff3dda17b265bdfaf40fcf7b063b738d5b7995405fd7272f243e0ec11c56b4419c8cd75aec4e786fb8047ddee8847b5acf43b35035e849cd09983b3519cd70fc1162a3070c6181874edd221dbece3868677dcef1feedab2ec4e0efc3073752f1653143d7b7e69d467bbb97dfc64f79115a5bf08ff0f8927f4392f248170b7affbb26e0461c54b55b5676c4822dd90d465c2b13d3b7392ae3b1a6ddf57324469c939e4278c5ac599fb46df89ef4b7c29b8754b4f3e25e406b2c9e3fc1581251a4665e0483cf6928d672896db3835bfec49edb738f1824d8b7557a"; #endif #endif // __AE_JUMP_POLYS_H__ aevol-4.4/src/libaevol/ae_phenotype.cpp0000644000175000017500000000704612231437075015173 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_phenotype # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_phenotype::ae_phenotype( void ) : #ifdef __NO_X ae_fuzzy_set() #elif defined __X11 ae_fuzzy_set_X11() #else #error You must specify a graphic option #endif { _indiv = NULL; } ae_phenotype::ae_phenotype( ae_individual* indiv, const ae_phenotype &model ) : #ifdef __NO_X ae_fuzzy_set( model ) #elif defined __X11 ae_fuzzy_set_X11( model ) #else #error You must specify a graphic option #endif { _indiv = indiv; } ae_phenotype::ae_phenotype( ae_individual* indiv ) : #ifdef __NO_X ae_fuzzy_set() #elif defined __X11 ae_fuzzy_set_X11() #else #error You must specify a graphic option #endif { _indiv = indiv; } // ================================================================= // Destructors // ================================================================= ae_phenotype::~ae_phenotype( void ) { } // ================================================================= // Public Methods // ================================================================= // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_stats.cpp0000644000175000017500000010240712303132205014276 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #include #ifdef __REGUL #include #include #endif //############################################################################## // # // Class ae_stats # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= /*! Create a NEW stat manager */ ae_stats::ae_stats( ae_exp_manager* exp_m, bool best_indiv_only, const char * prefix /* = "stat" */ ) { _exp_m = exp_m; init_data(); set_file_names( prefix, best_indiv_only ); open_files(); write_headers(); } /*! Create a stat manager to append existing stats */ ae_stats::ae_stats( ae_exp_manager* exp_m, int32_t num_gener, bool best_indiv_only, const char * prefix /* = "stat" */, bool addition_old_stats /* = true */, bool delete_old_stats /* = true */) { _exp_m = exp_m; init_data(); set_file_names( prefix, best_indiv_only ); // --------------------------------------------------------------------------- // Make a backup copy (named .old) of each file // and copy its content into the new stat file untill is reached // --------------------------------------------------------------------------- if(addition_old_stats) { char* old_file_name = new char[100]; FILE* old_file; char* cur_file_name; // Syntaxic sugar for _stat_files_names[][][] FILE* cur_file; // Syntaxic sugar for _stat_files[][][] char line[500]; char* trash; for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { cur_file_name = _stat_files_names[chrom_or_GU][best_or_glob][stat_type]; if ( cur_file_name != NULL ) { sprintf( old_file_name, "%s.old", cur_file_name ); int8_t exist_file = rename( cur_file_name, old_file_name ); if ( exist_file != 0 ) { printf( "ERROR : Could not rename %s as %s.\n", cur_file_name, old_file_name ); exit( EXIT_FAILURE ); } old_file = fopen( old_file_name, "r" ); cur_file = fopen( cur_file_name, "w" ); // Copy file header trash = fgets( line, 500, old_file ); while ( !feof( old_file ) && line[0] == '#' ) { fputs( line, cur_file ); trash = fgets( line, 500, old_file ); } // Copy the empty line between the header and the values fputs( line, cur_file ); // Copy stats until num_gener (included) trash = fgets( line, 500, old_file ); while ( (int32_t)atol(line) < _exp_m->get_first_gener() && !feof(old_file) ) { fputs( line, cur_file ); trash = fgets( line, 500, old_file ); } fclose( old_file ); _stat_files[chrom_or_GU][best_or_glob][stat_type] = cur_file; if ( delete_old_stats ) { remove( old_file_name ); } } } } } delete [] old_file_name; } else // ancstat case { open_files(); write_headers(true); } // Flush the new stat files flush(); } // ================================================================= // Destructors // ================================================================= ae_stats::~ae_stats( void ) { for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { if( _stat_files_names[chrom_or_GU][best_or_glob][stat_type] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][stat_type] != NULL ); fclose( _stat_files[chrom_or_GU][best_or_glob][stat_type] ); _stat_files[chrom_or_GU][best_or_glob][stat_type] = NULL; delete [] _stat_files_names[chrom_or_GU][best_or_glob][stat_type]; _stat_files_names[chrom_or_GU][best_or_glob][stat_type] = NULL; } } delete [] _stat_files[chrom_or_GU][best_or_glob]; _stat_files[chrom_or_GU][best_or_glob] = NULL; delete [] _stat_files_names[chrom_or_GU][best_or_glob]; _stat_files_names[chrom_or_GU][best_or_glob] = NULL; } delete [] _stat_files[chrom_or_GU]; _stat_files[chrom_or_GU] = NULL; delete [] _stat_files_names[chrom_or_GU]; _stat_files_names[chrom_or_GU] = NULL; } delete [] _stat_files; _stat_files = NULL; delete [] _stat_files_names; _stat_files_names = NULL; } // ================================================================= // Public Methods // ================================================================= inline double sqr( double x ) { return x*x; } inline double rsqr( double x ) { return (x < 0.00000001) ? 0. : sqrt(x); } void ae_stats::write_headers( bool ancstats_stats /* = false */ ) { // Column key in the stat files int8_t key; // -------------------------------------- // Write headers in FITNESS_STATS files // -------------------------------------- for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { if( ancstats_stats) { write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], "----------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], " Lineage individuals fitness statistics " ); write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], "----------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], "" ); } else { if ( _stat_files_names[chrom_or_GU][BEST][FITNESS_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], "---------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], " Fittest individual fitness statistics " ); write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], "---------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][FITNESS_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][GLOB][FITNESS_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][GLOB][FITNESS_STATS], "------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][FITNESS_STATS], " Average fitness statistics over the population " ); write_header( _stat_files[chrom_or_GU][GLOB][FITNESS_STATS], "------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][FITNESS_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][SDEV][FITNESS_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][SDEV][FITNESS_STATS], "------------------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][SDEV][FITNESS_STATS], " Standard deviation, fitness statistics over the population " ); write_header( _stat_files[chrom_or_GU][SDEV][FITNESS_STATS], "------------------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][SDEV][FITNESS_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][SKEW][FITNESS_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][SKEW][FITNESS_STATS], "--------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][SKEW][FITNESS_STATS], " Skewness statistics, fitness over the population " ); write_header( _stat_files[chrom_or_GU][SKEW][FITNESS_STATS], "--------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][SKEW][FITNESS_STATS], "" ); } } for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][FITNESS_STATS] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS] != NULL ); key = 1; write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Generation", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Population size", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Fitness", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Genome size (amount of DNA)", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Metabolic error", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Parent's metabolic error", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Metabolic fitness", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Secretion error", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Parent's secretion error", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Secretion fitness", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Amount of compound present in the grid-cell", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Int probe", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Double probe", key++ ); #ifdef __REGUL write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Number of links in the regulation graph", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Number of positive links in the regulation graph", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Number of negative links in the regulation graph", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Average value of links in the regulation graph", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Average value of positive links in the regulation graph", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], "Average value of negative links in the regulation graph", key++ ); #endif write_header( _stat_files[chrom_or_GU][best_or_glob][FITNESS_STATS], ""); } } } // --------------------------------------- // Write headers in MUTATION_STATS files // --------------------------------------- for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { if( ancstats_stats) { write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], "-----------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], " Lineage individuals mutation statistics " ); write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], "-----------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], "" ); } else { if ( _stat_files_names[chrom_or_GU][BEST][MUTATION_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], "----------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], " Fittest individual mutation statistics " ); write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], "----------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][MUTATION_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][GLOB][MUTATION_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][GLOB][MUTATION_STATS], "-------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][MUTATION_STATS], " Average mutation statistics over the population " ); write_header( _stat_files[chrom_or_GU][GLOB][MUTATION_STATS], "-------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][MUTATION_STATS], "" ); } } for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][MUTATION_STATS] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS] != NULL ); key = 1; write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Generation", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of local mutations undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of chromosomic rearrangements undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of switch undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of indels undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of duplications undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of deletions undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of translocations undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], "Number of inversions undergone", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][MUTATION_STATS], ""); } } } // --------------------------------------- // Write headers in GENES_STATS files // --------------------------------------- for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { if( ancstats_stats) { write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], "-------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], " Lineage individuals gene statistics " ); write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], "-------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], "" ); } else { if ( _stat_files_names[chrom_or_GU][BEST][GENES_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], "------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], " Fittest individual gene statistics " ); write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], "------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][GENES_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][GLOB][GENES_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][GLOB][GENES_STATS], "---------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][GENES_STATS], " Average gene statistics over the population " ); write_header( _stat_files[chrom_or_GU][GLOB][GENES_STATS], "---------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][GENES_STATS], "" ); } } for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][GENES_STATS] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS] != NULL ); key = 1; write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Generation", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Number of coding RNAs (at least one gene on RNA)", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Number of non-coding RNAs", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Average size of coding RNAs (at least one gene on RNA)", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Average size of non-coding RNAs", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Number of functional genes", key++ ); // Non functional genes are those with _width == 0 or _height == 0 or those that lack one kind of codons (M, W or H) write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Nb of non functional genes", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Average size of functional genes", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], "Average size of non functional genes (WARNING : bias towards 0)", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][GENES_STATS], ""); } } } // --------------------------------------- // Write headers in BP_STATS files // --------------------------------------- for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { if( ancstats_stats ) { write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], "-------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], " Lineage individuals non-coding statistics " ); write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], "-------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], "" ); } else { if ( _stat_files_names[chrom_or_GU][BEST][BP_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], "------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], " Fittest individual non-coding statistics " ); write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], "------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][BP_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][GLOB][BP_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], "---------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], " Average non-coding statistics over the population " ); write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], "---------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], "" ); write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], " This data is not available"); write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], " Computing bp stats for all individuals is extremely costly computationaly" ); write_header( _stat_files[chrom_or_GU][GLOB][BP_STATS], "" ); // Mark file as "not to be written into" and close it delete [] _stat_files_names[chrom_or_GU][GLOB][BP_STATS]; _stat_files_names[chrom_or_GU][GLOB][BP_STATS] = NULL; fclose( _stat_files[chrom_or_GU][GLOB][BP_STATS] ); _stat_files[chrom_or_GU][GLOB][BP_STATS] = NULL; } } for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][BP_STATS] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][BP_STATS] != NULL ); key = 1; write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Generation", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of bp not included in any CDS", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of bp not included in any functional CDS", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of bp not included in any non functional CDS", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of bp not included in any RNA", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of bp not included in any coding RNA", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of bp not included in any non coding RNA", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of non essential bp", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "Number of non essential bp including non fonctional genes", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], ""); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], "NOTE: a bp is considered \"essential\" when it is part of any [functional] CDS"); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], " or any promoter or terminator corresponding to an RNA transcribing a [functional] CDS."); write_header( _stat_files[chrom_or_GU][best_or_glob][BP_STATS], ""); } } } // --------------------------------------- // Write headers in REAR_STATS files // --------------------------------------- for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { if( ancstats_stats) { write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], "----------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], " Lineage individuals rearrangement statistics " ); write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], "----------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], "" ); } else { if ( _stat_files_names[chrom_or_GU][BEST][REAR_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], "---------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], " Fittest individual rearrangement statistics " ); write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], "---------------------------------------------" ); write_header( _stat_files[chrom_or_GU][BEST][REAR_STATS], "" ); } if ( _stat_files_names[chrom_or_GU][GLOB][REAR_STATS] != NULL ) { write_header( _stat_files[chrom_or_GU][GLOB][REAR_STATS], "------------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][REAR_STATS], " Average rearrangement statistics over the population " ); write_header( _stat_files[chrom_or_GU][GLOB][REAR_STATS], "------------------------------------------------------" ); write_header( _stat_files[chrom_or_GU][GLOB][REAR_STATS], "" ); } } for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][REAR_STATS] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS] != NULL ); key = 1; write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], "Generation", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], "Actual duplication rate", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], "Actual deletion rate", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], "Actual translocation rate", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], "Actual inversion rate", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], "Average alignment score (needed score)", key++ ); write_header( _stat_files[chrom_or_GU][best_or_glob][REAR_STATS], ""); } } } flush(); } void ae_stats::write_current_generation_statistics( void ) { ae_stat_record** stat_records; for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { stat_records = new ae_stat_record* [NB_BEST_OR_GLOB]; stat_records[BEST] = new ae_stat_record( _exp_m, _exp_m->get_best_indiv(), (chrom_or_gen_unit) chrom_or_GU ); stat_records[GLOB] = new ae_stat_record( _exp_m, _exp_m->get_pop(), (chrom_or_gen_unit) chrom_or_GU ); stat_records[SDEV] = new ae_stat_record( _exp_m, _exp_m->get_pop(), stat_records[GLOB], (chrom_or_gen_unit) chrom_or_GU ); stat_records[SKEW] = new ae_stat_record( _exp_m, _exp_m->get_pop(), stat_records[GLOB], stat_records[SDEV], (chrom_or_gen_unit) chrom_or_GU ); for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][stat_type] != NULL ) { stat_records[best_or_glob]->write_to_file( _stat_files[chrom_or_GU][best_or_glob][stat_type], (stats_type) stat_type ); } } delete stat_records[best_or_glob]; } delete [] stat_records; } } void ae_stats::write_statistics_of_this_indiv( ae_individual * indiv, int32_t num_gener ) { ae_stat_record* stat_record; for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { stat_record = new ae_stat_record( _exp_m, indiv, (chrom_or_gen_unit) chrom_or_GU, true, num_gener ); for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { if ( _stat_files_names[chrom_or_GU][BEST][stat_type] != NULL ) { assert( _stat_files[chrom_or_GU][BEST][stat_type] != NULL ); stat_record->write_to_file( _stat_files[chrom_or_GU][BEST][stat_type], (stats_type) stat_type ); } } delete stat_record; } } void ae_stats::flush( void ) { for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][stat_type] != NULL ) { assert( _stat_files[chrom_or_GU][best_or_glob][stat_type] != NULL ); fflush( _stat_files[chrom_or_GU][best_or_glob][stat_type] ); } } } } } // ================================================================= // Protected Methods // ================================================================= /** * Allocate memory and initialize file handlers and file names to NULL */ void ae_stats::init_data( void ) { _stat_files = new FILE***[NB_CHROM_OR_GU]; _stat_files_names = new char***[NB_CHROM_OR_GU]; for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { _stat_files[chrom_or_GU] = new FILE**[NB_BEST_OR_GLOB]; _stat_files_names[chrom_or_GU] = new char**[NB_BEST_OR_GLOB]; for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { _stat_files[chrom_or_GU][best_or_glob] = new FILE*[NB_STATS_TYPES]; _stat_files_names[chrom_or_GU][best_or_glob] = new char*[NB_STATS_TYPES]; for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { _stat_files[chrom_or_GU][best_or_glob][stat_type] = NULL; _stat_files_names[chrom_or_GU][best_or_glob][stat_type] = NULL; } } } } /** * Construct file names * NB: Here is where we "choose" which files we will write. * Files that are not wanted must be left with a NULL name (don't new char[] them) * There is an exception though: for the non-coding file for the population, we will * give it a name temporarily so that we can write the warning headers. Once this * is done, the name will be deleted to mark the file as "not to be written into" */ void ae_stats::set_file_names( const char * prefix, bool one_lambda_indiv_only ) { // 1) Create stats directory int status; status = mkdir( STATS_DIR, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, STATS_DIR ); } const char* chrom_or_gu_name[NB_CHROM_OR_GU] = { "", "_chromosome", "_plasmids" }; const char* best_or_glob_name[NB_BEST_OR_GLOB] = { "_best", "_glob", "_sdev", "_skew" }; const char* stat_type_name[NB_STATS_TYPES] = { "_fitness", "_mutation", "_genes", "_bp", "_rear"}; for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { // If plasmids are not allowed, don't issue "chromosome" and "plasmids" files if ( not _exp_m->get_with_plasmids() && chrom_or_GU > 0 ) continue; for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { if ( one_lambda_indiv_only && best_or_glob != BEST ) continue; for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { //~ // We don't want REAR_STATS when rearrangements are done without alignments //~ if ( stat_type == REAR_STATS && ! _exp_m->get_with_alignments() ) continue; // For now, we only want sdev and skew for fitness data if ( best_or_glob > GLOB && stat_type > FITNESS_STATS) continue; if ( (chrom_or_GU != ALL_GU || best_or_glob != GLOB) && stat_type > REAR_STATS) continue; _stat_files_names[chrom_or_GU][best_or_glob][stat_type] = new char[255]; // Construct the correct name if ( one_lambda_indiv_only ) { sprintf( _stat_files_names[chrom_or_GU][best_or_glob][stat_type], STATS_DIR"/%s%s%s.out", prefix, stat_type_name[stat_type], chrom_or_gu_name[chrom_or_GU] ); } else { sprintf( _stat_files_names[chrom_or_GU][best_or_glob][stat_type], STATS_DIR"/%s%s%s%s.out", prefix, stat_type_name[stat_type], chrom_or_gu_name[chrom_or_GU], best_or_glob_name[best_or_glob] ); } } } } } /** * Open files that have a non NULL name */ void ae_stats::open_files( void ) { for ( int8_t chrom_or_GU = 0 ; chrom_or_GU < NB_CHROM_OR_GU ; chrom_or_GU++ ) { for ( int8_t best_or_glob = 0 ; best_or_glob < NB_BEST_OR_GLOB ; best_or_glob++ ) { for ( int8_t stat_type = 0 ; stat_type < NB_STATS_TYPES ; stat_type++ ) { if ( _stat_files_names[chrom_or_GU][best_or_glob][stat_type] != NULL ) { _stat_files[chrom_or_GU][best_or_glob][stat_type] = fopen( _stat_files_names[chrom_or_GU][best_or_glob][stat_type], "w" ); } } } } } aevol-4.4/src/libaevol/ae_enums.h0000644000175000017500000000442512322771742013755 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_ENUMS_H__ #define __AE_ENUMS_H__ enum ae_align_fun_shape { LINEAR = 0, SIGMOID = 1 }; enum ae_env_axis_feature { NEUTRAL = 0, METABOLISM = 1, SECRETION = 2, DONOR = 3, RECIPIENT = 4 }; #define NB_FEATURES 5 // This is used to know how many possible features exist to make them easy to parse. enum ae_env_var { NO_VAR = 0, AUTOREGRESSIVE_MEAN_VAR = 1, AUTOREGRESSIVE_HEIGHT_VAR = 2, LOCAL_GAUSSIANS_VAR = 3 }; enum ae_env_noise { NO_NOISE = 0, FRACTAL = 1 }; enum ae_init_method { ONE_GOOD_GENE = 0x01, CLONE = 0x02, WITH_INS_SEQ = 0x04 }; enum ae_sense { DIRECT = 0, INDIRECT = 1, BOTH_SENSES = 2 }; enum ae_selection_scheme { RANK_LINEAR = 0, RANK_EXPONENTIAL = 1, FITNESS_PROPORTIONATE = 2, FITTEST = 3 }; enum ae_strand { LEADING = 0, LAGGING = 1 }; enum ae_tree_mode { LIGHT = 0, NORMAL = 1 }; enum ae_log_type { LOG_TRANSFER = 0x01, LOG_REAR = 0x02, LOG_BARRIER = 0x04, //LOG_LOADS = 0x08 }; #endif // __AE_ENUMS_H__ aevol-4.4/src/libaevol/ae_utils.h0000644000175000017500000000540112231437075013756 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_UTILS_H__ #define __AE_UTILS_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= // ================================================================= // Class declarations // ================================================================= class ae_utils { public : static inline int32_t mod( int32_t a, int32_t b ); static inline int32_t min( int32_t a, int32_t b ); static inline int32_t max( int32_t a, int32_t b ); static inline void exchange( int32_t &a, int32_t &b ); static inline int16_t hamming( const char* str1, const char* str2 ); protected : ae_utils( const ae_utils &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; }; inline int32_t ae_utils::mod( int32_t a, int32_t b ) { assert( b > 0 ); while ( a < 0 ) a += b; while ( a >= b ) a -= b; return a; } inline int32_t ae_utils::min( int32_t a, int32_t b ) { return ((a < b)? a : b); } inline int32_t ae_utils::max( int32_t a, int32_t b ) { return ((a > b)? a : b); } inline void ae_utils::exchange( int32_t &a, int32_t &b ) { int32_t tmp = a; a = b; b = tmp; } #endif // __AE_UTILS_H__ aevol-4.4/src/libaevol/ae_dna_replic_report.cpp0000644000175000017500000001450312242613025016640 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_dna_replic_report # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_dna_replic_report::ae_dna_replic_report( void ) { _mutations = new ae_list(); _rearrangements = new ae_list(); _HT = new ae_list(); _nb_mut[SWITCH] = 0; _nb_mut[S_INS] = 0; _nb_mut[S_DEL] = 0; _nb_mut[DUPL] = 0; _nb_mut[DEL] = 0; _nb_mut[TRANS] = 0; _nb_mut[INV] = 0; _nb_mut[INS_HT] = 0; _nb_mut[REPL_HT]= 0; } ae_dna_replic_report::ae_dna_replic_report( const ae_dna_replic_report &model ) { // Initialize trivial attributes _nb_mut[SWITCH] = model._nb_mut[SWITCH]; _nb_mut[S_INS] = model._nb_mut[S_INS]; _nb_mut[S_DEL] = model._nb_mut[S_DEL]; _nb_mut[DUPL] = model._nb_mut[DUPL]; _nb_mut[DEL] = model._nb_mut[DEL]; _nb_mut[TRANS] = model._nb_mut[TRANS]; _nb_mut[INV] = model._nb_mut[INV]; _nb_mut[INS_HT] = model._nb_mut[INS_HT]; _nb_mut[REPL_HT]= model._nb_mut[REPL_HT]; // Copy _mutations and _rearrangements _mutations = new ae_list(); ae_list_node* mut_node = (model._mutations)->get_first(); ae_mutation* mut = NULL; while ( mut_node != NULL ) { mut = mut_node->get_obj(); _mutations->add( new ae_mutation( *mut ) ); mut_node = mut_node->get_next(); } _rearrangements = new ae_list(); ae_list_node* rear_node = (model._rearrangements)->get_first(); ae_mutation* rear = NULL; while ( rear_node != NULL ) { rear = rear_node->get_obj(); _rearrangements->add( new ae_mutation( *rear ) ); rear_node = rear_node->get_next(); } _HT = new ae_list(); ae_list_node* HT_node = (model._HT)->get_first(); ae_mutation* HT = NULL; while ( HT_node != NULL ) { HT = HT_node->get_obj(); _HT->add( new ae_mutation( *HT ) ); HT_node = HT_node->get_next(); } } // ================================================================= // Destructors // ================================================================= ae_dna_replic_report::~ae_dna_replic_report( void ) { _mutations->erase( true ); _rearrangements->erase( true ); _HT->erase( true ); delete _mutations; delete _rearrangements; delete _HT; } // ================================================================= // Public Methods // ================================================================= void ae_dna_replic_report::compute_stats( void ) { // useful when we inspect a tree file // because stats are not saved in the file _nb_mut[SWITCH] = 0; _nb_mut[S_INS] = 0; _nb_mut[S_DEL] = 0; _nb_mut[DUPL] = 0; _nb_mut[DEL] = 0; _nb_mut[TRANS] = 0; _nb_mut[INV] = 0; _nb_mut[INS_HT] = 0; _nb_mut[REPL_HT]= 0; ae_list_node* event_node = _HT->get_first(); ae_mutation* event = NULL; while ( event_node != NULL ) { event = event_node->get_obj(); assert( event->get_mut_type() == INS_HT || event->get_mut_type() == REPL_HT ); _nb_mut[ event->get_mut_type() ]++; event_node = event_node->get_next(); } event_node = _rearrangements->get_first(); event = NULL; while ( event_node != NULL ) { event = event_node->get_obj(); assert( event->get_mut_type() == DUPL || event->get_mut_type() == DEL || event->get_mut_type() == TRANS || event->get_mut_type() == INV ); _nb_mut[ event->get_mut_type() ]++; event_node = event_node->get_next(); } event_node = _mutations->get_first(); event = NULL; while ( event_node != NULL ) { event = event_node->get_obj(); assert( event->get_mut_type() == SWITCH || event->get_mut_type() == S_INS || event->get_mut_type() == S_DEL ); _nb_mut[ event->get_mut_type() ]++; event_node = event_node->get_next(); } } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_align.cpp0000644000175000017500000003033612235721077014252 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include #include //############################################################################## // # // Class ae_align # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= //bool ae_align::with_alignments; //ae_align_fun_shape ae_align::align_fun_shape; //double ae_align::align_sigm_lambda; //int16_t ae_align::align_sigm_mean; //int16_t ae_align::align_lin_min; //int16_t ae_align::align_lin_max; //int16_t ae_align::align_max_shift; //int16_t ae_align::align_w_zone_h_len; //int16_t ae_align::align_match_bonus; //int16_t ae_align::align_mismatch_cost; // ================================================================= // Constructors // ================================================================= // ================================================================= // Destructors // ================================================================= // ================================================================= // Public Methods // ================================================================= ae_vis_a_vis* ae_align::search_alignment_direct( const ae_dna* chrom_1, const int32_t seed_1, const ae_dna* chrom_2, const int32_t seed_2, const int16_t needed_score ) { ae_vis_a_vis * best_alignment = NULL; int16_t nb_diags = 2 * chrom_1->get_indiv()->get_align_max_shift() + 1; ae_vis_a_vis * cur_vav = NULL; // TODO : As ae_vis_a_vis now contains its score, we should adapt the code to make it more integrated int16_t cur_score; // Zone 1 (Indice on the chromosome) int32_t w_zone_1_first = seed_1 - chrom_1->get_indiv()->get_align_w_zone_h_len(); // First base in working zone 1 int32_t w_zone_1_last = seed_1 + chrom_1->get_indiv()->get_align_w_zone_h_len(); // Last base in working zone 1 int32_t x_zone_1_first = w_zone_1_first - chrom_1->get_indiv()->get_align_max_shift(); // First base in extended zone 1 //~ int32_t x_zone_1_last = w_zone_1_last + align_max_shift; // Last base in extended zone 1 // Zone 2 (Indice on the chromosome) int32_t w_zone_2_first = seed_2 - chrom_2->get_indiv()->get_align_w_zone_h_len(); // First base in working zone 2 int32_t w_zone_2_last = seed_2 + chrom_2->get_indiv()->get_align_w_zone_h_len(); // Last base in working zone 2 //~ int32_t x_zone_2_first = w_zone_2_first - align_max_shift; // First base in extended zone 2 //~ int32_t x_zone_2_last = w_zone_2_last + align_max_shift; // Last base in extended zone 2 int32_t w_zone_2_shifted_first = w_zone_2_first + chrom_2->get_indiv()->get_align_max_shift(); // This doesn't represent any point of interest // in the sequence but will spare some calculation // Parse diagonals for ( int16_t cur_diag = 0 ; cur_diag < nb_diags ; cur_diag++ ) { // Initialize cur_vav according to the diagonal we are on if ( cur_diag < chrom_1->get_indiv()->get_align_max_shift() ) { cur_vav = new ae_vis_a_vis( chrom_1, chrom_2, x_zone_1_first + cur_diag, w_zone_2_first, DIRECT ); } else if ( cur_diag > chrom_1->get_indiv()->get_align_max_shift() ) { cur_vav = new ae_vis_a_vis( chrom_1, chrom_2, w_zone_1_first, w_zone_2_shifted_first - cur_diag, DIRECT ); } else // Central diagonal { cur_vav = new ae_vis_a_vis( chrom_1, chrom_2, w_zone_1_first, w_zone_2_first, DIRECT ); } // A sequence against itself is not an alignment if ( chrom_1 == chrom_2 && ae_utils::mod(cur_vav->_i_1, chrom_1->get_length()) == ae_utils::mod(cur_vav->_i_2, chrom_2->get_length()) ) { delete cur_vav; continue; } cur_score = 0; // Parse current diagonal while ( cur_vav->_i_1 <= w_zone_1_last || cur_vav->_i_2 <= w_zone_2_last ) { // Re-initialize score and potential alignment starting point if score <= 0 if ( cur_score <= 0 ) { cur_score = 0; if ( best_alignment != NULL ) { best_alignment->copy( cur_vav ); } else { best_alignment = new ae_vis_a_vis( *cur_vav ); } } // Update Score if ( cur_vav->match() ) { cur_score += chrom_1->get_indiv()->get_align_match_bonus(); // Check whether score is high enough to rearrange if ( cur_score >= needed_score ) { delete cur_vav; best_alignment->check_indices(); best_alignment->_score = cur_score; return best_alignment; } } else { cur_score -= chrom_1->get_indiv()->get_align_mismatch_cost(); } // Step forward cur_vav->step_fwd(); } delete cur_vav; } if ( best_alignment != NULL ) { delete best_alignment; } return NULL; // Didn't find any alignment with sufficient score. } ae_vis_a_vis* ae_align::search_alignment_indirect( const ae_dna* chrom_1, const int32_t seed_1, const ae_dna* chrom_2, const int32_t seed_2, const int16_t needed_score ) { ae_vis_a_vis * best_alignment = NULL; int16_t nb_diags = 2 * chrom_1->get_indiv()->get_align_max_shift() + 1; int16_t cur_score; ae_vis_a_vis * cur_vav = NULL; // Zone 1 (Indice on the chromosome) int32_t w_zone_1_first = seed_1 - chrom_1->get_indiv()->get_align_w_zone_h_len(); // First base in working zone 1 int32_t w_zone_1_last = seed_1 + chrom_1->get_indiv()->get_align_w_zone_h_len(); // Last base in working zone 1 int32_t x_zone_1_first = w_zone_1_first - chrom_1->get_indiv()->get_align_max_shift(); // First base in extended zone 1 //~ int32_t x_zone_1_last = w_zone_1_last + align_max_shift; // Last base in extended zone 1 // Zone 2 (Indice on the chromosome) // ********** WARNING ********** // Because we are reading backwards, every read is shifted by -1. // // 0 1 2 3 4 5 6 7 8 9 // |_|_|_|_|_|_|_|_|_|_| On this sequence, if you consider index 5, the nucleotide you need to consider // for a backards read is seq[4], NOT seq[5]. // // This is managed by class ae_vis_a_vis. // // a b c d e f g h i j Creating a new ae_vis_a_vis( F, 5, LAGGING ); // |_|_|_|_|_|_|_|_|_|_| and then asking: my_vis_a_vis->match() will compare seq1[F] and seq2[4] // | | | | | | | | | | | (i.e. its "real" vis_a_vis). // 9 8 7 6 5 4 3 2 1 0 my_vis_a_vis->match() returns true if (seq1[F] == complementary( seq2[4] )) // // In this example and with a align_w_zone_h_len of 2 and a max_shift of 1, the working_zone and extended_zone will be defined by // w_zone_1_first = d // (f-2) // w_zone_1_last = h // (f+2) // x_zone_1_first = c // (f-2-1) // w_zone_2_first = 7 // The "real" vis_a_vis for d (5+2) // w_zone_2_last = 3 // The "real" vis_a_vis for h (5-2) // w_zone_2_shifted_first = 4 // (5-1). // // It is worth noting that the working zone is defined as follows: // // d e f g h Hence, while 'd' and 'h' do correspond to the zone's first and last nucleotides' indices, // |_|_|_|_|_| '7' and '3' are indeed shifted and it seems they don't correspond to anything. // | | | | | | I should have coded the limits (i.e. 'd' and 'i' + '7' and '2') in the first place... // 6 5 4 3 2 // int32_t w_zone_2_first = seed_2 + chrom_2->get_indiv()->get_align_w_zone_h_len(); // First base in working zone 2 int32_t w_zone_2_last = seed_2 - chrom_2->get_indiv()->get_align_w_zone_h_len(); // Last base in working zone 2 //~ int32_t x_zone_2_first = w_zone_2_first + align_max_shift; // First base in extended zone 2 //~ int32_t x_zone_2_last = w_zone_2_last - align_max_shift; // Last base in extended zone 2 int32_t w_zone_2_shifted_first = w_zone_2_first - chrom_2->get_indiv()->get_align_max_shift(); // This doesn't represent any interesting point // in the sequence but will spare some calculation // Parse diagonals for ( int16_t cur_diag = 0 ; cur_diag < nb_diags ; cur_diag++ ) { // Initialize cur_vav according to the diagonal we are on if ( cur_diag < chrom_1->get_indiv()->get_align_max_shift() ) { cur_vav = new ae_vis_a_vis( chrom_1, chrom_2, x_zone_1_first + cur_diag, w_zone_2_first, INDIRECT ); } else if ( cur_diag > chrom_1->get_indiv()->get_align_max_shift() ) { cur_vav = new ae_vis_a_vis( chrom_1, chrom_2, w_zone_1_first, w_zone_2_shifted_first + cur_diag, INDIRECT ); } else // Central diagonal { cur_vav = new ae_vis_a_vis( chrom_1, chrom_2, w_zone_1_first, w_zone_2_first, INDIRECT ); } cur_score = 0; // Parse diagonal while ( cur_vav->_i_1 <= w_zone_1_last || cur_vav->_i_2 >= w_zone_2_last ) { // Re-initialize score and potential alignment starting point if score <= 0 if ( cur_score <= 0 ) { cur_score = 0; if ( best_alignment != NULL ) { best_alignment->copy( cur_vav ); } else { best_alignment = new ae_vis_a_vis( *cur_vav ); } } // Update Score if ( cur_vav->match() ) { cur_score += chrom_1->get_indiv()->get_align_match_bonus(); // Check whether score is high enough to rearrange if ( cur_score >= needed_score ) { delete cur_vav; best_alignment->check_indices(); best_alignment->_score = cur_score; return best_alignment; } } else { cur_score -= chrom_1->get_indiv()->get_align_mismatch_cost(); } // Step forward cur_vav->step_fwd(); } delete cur_vav; } if ( best_alignment != NULL ) { delete best_alignment; } return NULL; // Didn't find any alignment with sufficient score. } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_stats.h0000644000175000017500000001446412303132205013750 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** /*! \class ae_stats \brief Manage statistics files */ #ifndef __AE_STATS_H__ #define __AE_STATS_H__ // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_stats : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_stats( ae_exp_manager* exp_m, bool best_indiv_only = false, const char * prefix = "stat" ); ae_stats( ae_exp_manager* exp_m, int32_t num_gener, bool best_indiv_only = false, const char * prefix = "stat", bool addition_old_stats = true, bool delete_old_stats = true ); // ================================================================= // Destructors // ================================================================= virtual ~ae_stats( void ); // ================================================================= // Accessors: getters // ================================================================= // ================================================================= // Accessors: setters // ================================================================= inline void set_exp_m( ae_exp_manager* exp_m); // ================================================================= // Public Methods // ================================================================= void write_current_generation_statistics( void ); void write_statistics_of_this_indiv( ae_individual* indiv, int32_t num_gener ); void flush( void ); void write_headers( bool ancstats_stats = false ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_stats( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_stats( const ae_stats &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void init_data( void ); void set_file_names( const char * prefix, bool best_indiv_only ); void open_files( void ); inline void write_header( FILE* file_name, const char* header ); inline void write_header( FILE* file_name, const char* header, int8_t key ); // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; // 3D tables of stat files (FILE*) and their names (char*) // Dimensions are given by: // * genetic unit (ALL_GU, CHROM or PLASMIDS) // * BEST or GLOB // * stat type (FITNESS_STATS, MUTATION_STATS, GENES_STATS, BP_STATS or REAR_STATS) // Files that are not wanted MUST have their name set to NULL. // The files themselves are also NULL because we don't fopen() them. FILE**** _stat_files; char**** _stat_files_names; }; // ===================================================================== // Accessors' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_stats::set_exp_m( ae_exp_manager* exp_m) { _exp_m = exp_m; } inline void ae_stats::write_header( FILE* file_name, const char* header ) { if ( file_name != NULL) fprintf( file_name, "# %s\n", header ); } inline void ae_stats::write_header( FILE* file_name, const char* header, int8_t key ) { if ( file_name != NULL) fprintf( file_name, "# %2d. %s\n", key, header ); } #endif // __AE_STATS_H__ aevol-4.4/src/libaevol/ae_replication_report.cpp0000644000175000017500000003253212271674030017060 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include #include #include #include //############################################################################## // # // Class ae_replication_report # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_replication_report::ae_replication_report( ae_individual * indiv, ae_individual * parent, ae_individual * donor /* = NULL */ ) { _indiv = indiv; _id = indiv->get_id(); _rank = indiv->get_rank(); _parent_id = parent->get_id(); // _donor_id is set further down _genome_size = 0; _metabolic_error = 0.0; _nb_genes_activ = 0; _nb_genes_inhib = 0; _nb_non_fun_genes = 0; _nb_coding_RNAs = 0; _nb_non_coding_RNAs = 0; _parent_metabolic_error = parent->get_dist_to_target_by_feature( METABOLISM ); _parent_secretion_error = parent->get_dist_to_target_by_feature( SECRETION ); _parent_genome_size = parent->get_total_genome_size(); _mean_align_score = 0.0; if ( donor == NULL ) { _donor_id = -1; _donor_metabolic_error = 0.0; _donor_secretion_error = 0.0; _donor_genome_size = 0; } else { _donor_id = donor->get_id(); _donor_metabolic_error = donor->get_dist_to_target_by_feature( METABOLISM ); _donor_secretion_error = donor->get_dist_to_target_by_feature( SECRETION ); _donor_genome_size = donor->get_total_genome_size(); } _dna_replic_reports = new ae_list(); } // Creates an independent copy of the original report ae_replication_report::ae_replication_report( const ae_replication_report &model ) { _parent_id = model._parent_id; _donor_id = model._donor_id; _id = model._id; _rank = model._rank; _genome_size = model._genome_size; _metabolic_error = model._metabolic_error; _nb_genes_activ = model._nb_genes_activ; _nb_genes_inhib = model._nb_genes_inhib; _nb_non_fun_genes = model._nb_non_fun_genes; _nb_coding_RNAs = model._nb_coding_RNAs; _nb_non_coding_RNAs = model._nb_non_coding_RNAs; _parent_metabolic_error = model._parent_metabolic_error; _parent_secretion_error = model._parent_secretion_error; _donor_metabolic_error = model._donor_metabolic_error; _donor_secretion_error = model._donor_secretion_error; _parent_genome_size = model._parent_genome_size; _donor_genome_size = model._donor_genome_size; _mean_align_score = model._mean_align_score; _dna_replic_reports = new ae_list(); ae_list_node* node = (model._dna_replic_reports)->get_first(); ae_dna_replic_report * dnarep = NULL; while ( node != NULL ) { dnarep = node->get_obj(); _dna_replic_reports->add( new ae_dna_replic_report(*dnarep) ); node = node->get_next(); } } ae_replication_report::ae_replication_report( gzFile tree_file, ae_individual * indiv ) { _indiv = indiv; gzread( tree_file, &_id, sizeof(_id) ); gzread( tree_file, &_rank, sizeof(_rank) ); gzread( tree_file, &_parent_id, sizeof(_parent_id) ); gzread( tree_file, &_donor_id, sizeof(_donor_id) ); gzread( tree_file, &_genome_size, sizeof(_genome_size) ); gzread( tree_file, &_metabolic_error, sizeof(_metabolic_error) ); gzread( tree_file, &_nb_genes_activ, sizeof(_nb_genes_activ) ); gzread( tree_file, &_nb_genes_inhib, sizeof(_nb_genes_inhib) ); gzread( tree_file, &_nb_non_fun_genes, sizeof(_nb_non_fun_genes) ); gzread( tree_file, &_nb_coding_RNAs, sizeof(_nb_coding_RNAs) ); gzread( tree_file, &_nb_non_coding_RNAs, sizeof(_nb_non_coding_RNAs) ); int32_t nb_dna_replic_reports; gzread( tree_file, &nb_dna_replic_reports, sizeof(nb_dna_replic_reports) ); _dna_replic_reports = new ae_list(); int32_t mydnareport, myevent; int32_t nb_rears, nb_muts, nb_HT; ae_dna_replic_report * dnareport = NULL; ae_mutation * event = NULL; for ( mydnareport = 0 ; mydnareport < nb_dna_replic_reports ; mydnareport++ ) { dnareport = new ae_dna_replic_report(); gzread( tree_file, &nb_HT, sizeof(nb_HT) ); for ( myevent = 0 ; myevent < nb_HT ; myevent++ ) { event = new ae_mutation( tree_file ); dnareport->add_HT( event ); } gzread( tree_file, &nb_rears, sizeof(nb_rears) ); for ( myevent = 0 ; myevent < nb_rears ; myevent++ ) { event = new ae_mutation( tree_file ); dnareport->get_rearrangements()->add( event ); } gzread( tree_file, &nb_muts, sizeof(nb_muts) ); for(myevent = 0 ; myevent < nb_muts ; myevent++ ) { event = new ae_mutation( tree_file ); dnareport->get_mutations()->add( event ); } dnareport->compute_stats(); _dna_replic_reports->add( dnareport ); } _parent_metabolic_error = -1; _parent_secretion_error = -1; _donor_metabolic_error = -1; _parent_genome_size = -1; _donor_genome_size = -1; _mean_align_score = 0.0; } // ================================================================= // Destructors // ================================================================= ae_replication_report::~ae_replication_report( void ) { _dna_replic_reports->erase( true ); delete _dna_replic_reports; } // ================================================================= // Public Methods // ================================================================= /** * Method called at the end of the replication. Actions such as finalize the calculation of average values can be done here. */ void ae_replication_report::signal_end_of_replication( void ) { // Retreive data from the individual _genome_size = _indiv->get_total_genome_size(); _metabolic_error = _indiv->get_dist_to_target_by_feature( METABOLISM ); _nb_genes_activ = _indiv->get_nb_genes_activ(); _nb_genes_inhib = _indiv->get_nb_genes_inhib(); _nb_non_fun_genes = _indiv->get_nb_functional_genes(); _nb_coding_RNAs = _indiv->get_nb_coding_RNAs(); _nb_non_coding_RNAs = _indiv->get_nb_non_coding_RNAs(); // Compute the mean alignment score int32_t nb_align = 0; ae_list_node* dna_rep_node = _dna_replic_reports->get_first(); ae_dna_replic_report* dna_rep = NULL; ae_list_node* rear_node = NULL; ae_mutation* rear = NULL; ae_mutation_type mut_type; int32_t* int32_trash = new int32_t; bool* bool_trash = new bool; int16_t* align_scores = new int16_t[2]; while ( dna_rep_node != NULL ) { dna_rep = dna_rep_node->get_obj(); nb_align += dna_rep->get_nb_duplications(); nb_align += dna_rep->get_nb_deletions(); nb_align += 2 * dna_rep->get_nb_translocations(); nb_align += dna_rep->get_nb_inversions(); rear_node = dna_rep->get_rearrangements()->get_first(); while ( rear_node != NULL ) { rear = rear_node->get_obj(); mut_type = rear->get_mut_type(); switch( mut_type ) { case DUPL: { rear->get_infos_duplication( int32_trash, int32_trash, int32_trash, &align_scores[0] ); _mean_align_score += align_scores[0]; break; } case DEL: { rear->get_infos_deletion( int32_trash, int32_trash, &align_scores[0] ); _mean_align_score += align_scores[0]; break; } case TRANS: { rear->get_infos_translocation( int32_trash, int32_trash, int32_trash, int32_trash, bool_trash, &align_scores[0], &align_scores[1] ); _mean_align_score += align_scores[0] + align_scores[1]; break; } case INV: { rear->get_infos_inversion( int32_trash, int32_trash, &align_scores[0] ); _mean_align_score += align_scores[0]; break; } default: { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } rear_node = rear_node->get_next(); } dna_rep_node = dna_rep_node->get_next(); } if ( nb_align != 0 ) { _mean_align_score /= nb_align; } else { assert( _mean_align_score == 0.0 ); } delete int32_trash; delete bool_trash; delete [] align_scores; } void ae_replication_report::write_to_tree_file( gzFile tree_file ) const { // Store individual identifiers and rank gzwrite( tree_file, &_id, sizeof(_id) ); gzwrite( tree_file, &_rank, sizeof(_rank) ); gzwrite( tree_file, &_parent_id, sizeof(_parent_id) ); gzwrite( tree_file, &_donor_id, sizeof(_donor_id) ); gzwrite( tree_file, &_genome_size, sizeof(_genome_size) ); gzwrite( tree_file, &_metabolic_error, sizeof(_metabolic_error) ); gzwrite( tree_file, &_nb_genes_activ, sizeof(_nb_genes_activ) ); gzwrite( tree_file, &_nb_genes_inhib, sizeof(_nb_genes_inhib) ); gzwrite( tree_file, &_nb_non_fun_genes, sizeof(_nb_non_fun_genes) ); gzwrite( tree_file, &_nb_coding_RNAs, sizeof(_nb_coding_RNAs) ); gzwrite( tree_file, &_nb_non_coding_RNAs, sizeof(_nb_non_coding_RNAs) ); // For each genetic unit, write the mutations and rearrangements undergone during replication int32_t nb_dna_replic_reports = _dna_replic_reports->get_nb_elts(); gzwrite( tree_file, &nb_dna_replic_reports, sizeof(nb_dna_replic_reports) ); //~ printf( " nb_dna_replic_reports : %"PRId32"\n", nb_dna_replic_reports ); ae_list_node* report_node = _dna_replic_reports->get_first(); ae_dna_replic_report* report = NULL; while ( report_node != NULL ) { report = report_node->get_obj(); // Store HT int32_t nb_HT = report->get_nb_HT(); gzwrite( tree_file, &nb_HT, sizeof(nb_HT) ); ae_list_node* HT_node = report->get_HT()->get_first(); while ( HT_node != NULL ) { HT_node->get_obj()->save( tree_file ); HT_node = HT_node->get_next(); } // Store rearrangements int32_t nb_rears = report->get_nb_rearrangements(); gzwrite( tree_file, &nb_rears, sizeof(nb_rears) ); //~ printf( " nb_rears : %"PRId32"\n", nb_rears ); ae_list_node* rear_node = report->get_rearrangements()->get_first(); while ( rear_node != NULL ) { rear_node->get_obj()->save( tree_file ); rear_node = rear_node->get_next(); } // Store mutations int32_t nb_muts = report->get_nb_small_mutations(); gzwrite( tree_file, &nb_muts, sizeof(nb_muts) ); //~ printf( " nb_muts : %"PRId32"\n", nb_muts ); ae_list_node* mut_node = report->get_mutations()->get_first(); while ( mut_node != NULL ) { mut_node->get_obj()->save( tree_file ); mut_node = mut_node->get_next(); } report_node = report_node->get_next(); } } // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Non inline accessors // ================================================================= aevol-4.4/src/libaevol/ae_output_manager.h0000644000175000017500000002106212231437075015651 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_OUPUT_MANAGER_H__ #define __AE_OUPUT_MANAGER_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_output_manager { public : // ================================================================= // Constructors // ================================================================= ae_output_manager( ae_exp_manager* exp_m ); // ================================================================= // Destructors // ================================================================= virtual ~ae_output_manager( void ); // ================================================================= // Accessors: getters // ================================================================= // Backup inline int32_t get_backup_step(void) const; inline int32_t get_big_backup_step(void) const; // Tree inline bool get_record_tree( void ) const; inline int32_t get_tree_step( void ) const; inline ae_tree_mode get_tree_mode( void ) const; inline ae_tree* get_tree( void ) const; // Logs inline FILE* get_log( ae_log_type log_type ) const; inline bool is_logged( ae_log_type log_type ) const; // Stats inline bool get_compute_phen_contrib_by_GU( void ) const; // ================================================================= // Accessors: setters // ================================================================= inline void set_backup_step( int32_t backup_step ); inline void set_big_backup_step( int32_t big_backup_step ); inline void init_tree( ae_exp_manager* exp_m, ae_tree_mode _tree_mode, int32_t _tree_step ); inline void set_dump_step( int32_t dump_step ); inline void set_compute_phen_contrib_by_GU( bool compute_phen_contrib_by_GU ); inline void set_logs (int8_t logs); // ================================================================= // Operators // ================================================================= // ================================================================= // Public Methods // ================================================================= void write_setup_file( gzFile setup_file ) const; void write_setup_file( FILE* setup_file ) const; void load( gzFile file, bool verbose, bool to_be_run ); void load( FILE* file, bool verbose, bool to_be_run ); void write_current_generation_outputs( void ) const; inline void flush( void ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_output_manager( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_output_manager( const ae_output_manager &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void write_tree( void ) const; // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; // Backups int32_t _backup_step; int32_t _big_backup_step; // Stats ae_stats* _stats; bool _compute_phen_contrib_by_GU; // Tree bool _record_tree; ae_tree* _tree; // Dumps bool _make_dumps; int32_t _dump_step; ae_dump* _dump; // Logs ae_logs* _logs; }; // ===================================================================== // Getters' definitions // ===================================================================== // Backup inline int32_t ae_output_manager::get_backup_step(void) const { return _backup_step; } inline int32_t ae_output_manager::get_big_backup_step(void) const { return _big_backup_step; } // Tree inline bool ae_output_manager::get_record_tree( void ) const { return _record_tree; } inline int32_t ae_output_manager::get_tree_step( void ) const { return _tree->get_tree_step(); } inline ae_tree_mode ae_output_manager::get_tree_mode( void ) const { return _tree->get_tree_mode(); } inline ae_tree* ae_output_manager::get_tree( void ) const { return _tree; } // Logs inline FILE* ae_output_manager::get_log( ae_log_type log_type ) const { return _logs->get_log( log_type ); } inline bool ae_output_manager::is_logged( ae_log_type log_type ) const { return _logs->is_logged( log_type ); } // Stats inline bool ae_output_manager::get_compute_phen_contrib_by_GU( void ) const { return _compute_phen_contrib_by_GU; } // ===================================================================== // Setters' definitions // ===================================================================== inline void ae_output_manager::set_backup_step( int32_t backup_step ) { _backup_step = backup_step; } inline void ae_output_manager::set_big_backup_step( int32_t big_backup_step ) { _big_backup_step = big_backup_step; } inline void ae_output_manager::init_tree( ae_exp_manager* exp_m, ae_tree_mode _tree_mode, int32_t _tree_step ) { _record_tree = true; _tree = new ae_tree( exp_m, _tree_mode, _tree_step ); } inline void ae_output_manager::set_dump_step( int32_t dump_step ) { _make_dumps = true; _dump_step = dump_step; } inline void ae_output_manager::set_compute_phen_contrib_by_GU( bool compute_phen_contrib_by_GU ) { _compute_phen_contrib_by_GU = compute_phen_contrib_by_GU; } inline void ae_output_manager::set_logs (int8_t logs) { _logs->set_logs(logs); } // ===================================================================== // Operators' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== inline void ae_output_manager::flush( void ) { _stats->flush(); } #endif // __AE_OUPUT_MANAGER_H__ aevol-4.4/src/libaevol/ae_rna.h0000644000175000017500000001633212363702064013402 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_RNA_H__ #define __AE_RNA_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_individual; class ae_genetic_unit; class ae_rna : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_rna( ae_genetic_unit* gen_unit, const ae_rna &model ); ae_rna( ae_genetic_unit* gen_unit ); ae_rna( ae_genetic_unit* gen_unit, ae_strand strand, int32_t index, int8_t diff ); //ae_rna( ae_rna* parent ); // ================================================================= // Destructors // ================================================================= virtual ~ae_rna( void ); // ================================================================= // Accessors // ================================================================= // void check( ae_genetic_unit* gen_unit ) { assert( gen_unit == _gen_unit ); }; //~ void* get_indiv( void ) const { return (void*)_indiv; }; // inline ae_genetic_unit * get_genetic_unit( void ) const; inline void set_genetic_unit( ae_genetic_unit* gen_unit ); inline ae_strand get_strand( void ) const; inline void set_strand( ae_strand strand ); inline int32_t get_promoter_pos( void ) const; inline void set_promoter_pos( int32_t pos ); inline double get_basal_level( void ) const; inline int32_t get_transcript_length( void ) const; // The promoter is NOT transcribed. inline void set_transcript_length( int32_t length ); inline bool is_coding( void ) const; inline ae_list* get_transcribed_proteins( void ) const; // ================================================================= // Public Methods // ================================================================= int32_t get_first_transcribed_pos( void ) const; // The promoter is NOT transcribed. int32_t get_last_transcribed_pos( void ) const; // The terminator is transcribed. inline void add_transcribed_protein( ae_protein* prot ); inline void shift_position( int32_t delta_pos, int32_t genome_length ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_rna( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_rna( const ae_rna &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_genetic_unit* _gen_unit; ae_strand _strand; int32_t _pos; // Index of the promoter on the genome. // The promoter itself is NOT transcribed // The terminator is transcribed. int32_t _transcript_length; double _basal_level; ae_list* _transcribed_proteins; }; // ===================================================================== // Accessors' definitions // ===================================================================== inline ae_genetic_unit * ae_rna::get_genetic_unit( void ) const { return _gen_unit; } inline void ae_rna::set_genetic_unit( ae_genetic_unit* gen_unit ) { _gen_unit = gen_unit; } inline ae_strand ae_rna::get_strand( void ) const { return _strand; } inline void ae_rna::set_strand( ae_strand strand ) { _strand = strand; } inline void ae_rna::set_promoter_pos( int32_t pos ) { _pos = pos; } inline int32_t ae_rna::get_promoter_pos( void ) const { return _pos; } inline double ae_rna::get_basal_level( void ) const { return _basal_level; } inline int32_t ae_rna::get_transcript_length( void ) const { return _transcript_length; } inline void ae_rna::set_transcript_length( int32_t transcript_length ) { _transcript_length = transcript_length; } inline ae_list* ae_rna::get_transcribed_proteins( void ) const { return _transcribed_proteins; } inline bool ae_rna::is_coding( void ) const { return ( !get_transcribed_proteins()->is_empty() ); } // ===================================================================== // Inline functions' definition // ===================================================================== void ae_rna::add_transcribed_protein( ae_protein* prot ) { _transcribed_proteins->add( prot ); } void ae_rna::shift_position( int32_t delta_pos, int32_t genome_length ) { _pos = ae_utils::mod( _pos + delta_pos, genome_length ); } #endif // __AE_RNA_H__ aevol-4.4/src/libaevol/ae_population_X11.cpp0000644000175000017500000001765212364050651016005 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include //############################################################################## // # // Class ae_population_X11 # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_population_X11::ae_population_X11( ae_exp_manager* exp_m ) : ae_population( exp_m ) { compute_colormap(); } //~ ae_population_X11::ae_population_X11( gzFile backup_file ) : ae_population( backup_file ) //~ { //~ compute_colormap(); //~ } // ================================================================= // Destructors // ================================================================= ae_population_X11::~ae_population_X11( void ) { delete [] _col_map; } // ================================================================= // Public Methods // ================================================================= // Display unstructured population void ae_population_X11::display( ae_X11_window* win ) { char generation[40]; sprintf( generation, "Generation = %"PRId32, _exp_m->get_num_gener() ); win->draw_string( 15, 15, generation ); } // Display a grid of values void ae_population_X11::display_grid( ae_X11_window* win, double** cell_grid ) { assert( _exp_m->is_spatially_structured() ); // printf("display grid\n"); char gener[40]; int num_colors = 50; sprintf( gener, "Generation = %"PRId32, _exp_m->get_num_gener() ); win->draw_string( 15, 15, gener ); const int grid_width = _exp_m->get_grid_width(); const int grid_height = _exp_m->get_grid_height(); int nb_slots_in_a_row = (int) grid_height; int slot_width = 200/nb_slots_in_a_row; int x1 = 50 + 50 + slot_width/2; int y1 = 75 + 50 + slot_width/2; // create the colormap colors to be used for grid plotting int cell_size = 5; // draw the color scale for fitness int y_step_size = grid_height*cell_size/num_colors; for ( int i = 0; i < num_colors; i++ ) { win->fill_rectangle( x1 - 30, y1 - 80 + y_step_size * i, cell_size * 5, y_step_size, _col_map[num_colors-1-i] ); } // find min/max of the matrix double grid_max = 0; double grid_min = 1000000; for ( int x = 0 ; x < grid_width ; x++ ) { for ( int y = 0 ; y < grid_height ; y++ ) { if (cell_grid[x][y] > grid_max) {grid_max = cell_grid[x][y];} if (cell_grid[x][y] < grid_min) {grid_min = cell_grid[x][y];} } } double col_sec_interval = (grid_max - grid_min)/49; char scale_txt[40]; sprintf(scale_txt,"%.2e", grid_max); win->draw_string(x1-80, y1-80,scale_txt); sprintf(scale_txt,"%.2e", grid_min); win->draw_string(x1-80, y1-80+grid_height*cell_size,scale_txt); for (int x = 0; x < grid_width; x++) { for (int y = 0; y < grid_height; y++) { char * col_string; // calculate the color int new_col; if (col_sec_interval==0) { new_col = 0; } else { new_col = (int) floor((cell_grid[x][y] - grid_min) / col_sec_interval); } col_string = _col_map[new_col]; // draw a colored rectangle for each cell win->fill_rectangle( x1 + 50 + x*cell_size, y1 - 80 + y*cell_size, cell_size, cell_size, col_string ); } } } void ae_population_X11::compute_colormap( void ) { _col_map = new char* [50]; _col_map[0] = (char*)"RGBi:1.0/0.0/0.0"; _col_map[1] = (char*)"RGBi:1.0/0.1/0.0"; _col_map[2] = (char*)"RGBi:1.0/0.2/0.0"; _col_map[3] = (char*)"RGBi:1.0/0.3/0.0"; _col_map[4] = (char*)"RGBi:1.0/0.4/0.0"; _col_map[5] = (char*)"RGBi:1.0/0.5/0.0"; _col_map[6] = (char*)"RGBi:1.0/0.6/0.0"; _col_map[7] = (char*)"RGBi:1.0/0.7/0.0"; _col_map[8] = (char*)"RGBi:1.0/0.8/0.0"; _col_map[9] = (char*)"RGBi:1.0/0.9/0.0"; _col_map[10] = (char*)"RGBi:0.9/1.0/0.0"; _col_map[11] = (char*)"RGBi:0.8/1.0/0.0"; _col_map[12] = (char*)"RGBi:0.7/1.0/0.0"; _col_map[13] = (char*)"RGBi:0.6/1.0/0.0"; _col_map[14] = (char*)"RGBi:0.5/1.0/0.0"; _col_map[15] = (char*)"RGBi:0.4/1.0/0.0"; _col_map[16] = (char*)"RGBi:0.3/1.0/0.0"; _col_map[17] = (char*)"RGBi:0.2/1.0/0.0"; _col_map[18] = (char*)"RGBi:0.1/1.0/0.0"; _col_map[19] = (char*)"RGBi:0.0/1.0/0.0"; _col_map[20] = (char*)"RGBi:0.0/1.0/0.1"; _col_map[21] = (char*)"RGBi:0.0/1.0/0.2"; _col_map[22] = (char*)"RGBi:0.0/1.0/0.3"; _col_map[23] = (char*)"RGBi:0.0/1.0/0.4"; _col_map[24] = (char*)"RGBi:0.0/1.0/0.5"; _col_map[25] = (char*)"RGBi:0.0/1.0/0.6"; _col_map[26] = (char*)"RGBi:0.0/1.0/0.7"; _col_map[27] = (char*)"RGBi:0.0/1.0/0.8"; _col_map[28] = (char*)"RGBi:0.0/1.0/0.9"; _col_map[29] = (char*)"RGBi:0.0/1.0/1.0"; _col_map[30] = (char*)"RGBi:0.0/0.9/1.0"; _col_map[31] = (char*)"RGBi:0.0/0.8/1.0"; _col_map[32] = (char*)"RGBi:0.0/0.7/1.0"; _col_map[33] = (char*)"RGBi:0.0/0.6/1.0"; _col_map[34] = (char*)"RGBi:0.0/0.5/1.0"; _col_map[35] = (char*)"RGBi:0.0/0.4/1.0"; _col_map[36] = (char*)"RGBi:0.0/0.3/1.0"; _col_map[37] = (char*)"RGBi:0.0/0.2/1.0"; _col_map[38] = (char*)"RGBi:0.0/0.1/1.0"; _col_map[39] = (char*)"RGBi:0.0/0.0/1.0"; _col_map[40] = (char*)"RGBi:0.1/0.0/1.0"; _col_map[41] = (char*)"RGBi:0.2/0.0/1.0"; _col_map[42] = (char*)"RGBi:0.3/0.0/1.0"; _col_map[43] = (char*)"RGBi:0.4/0.0/1.0"; _col_map[44] = (char*)"RGBi:0.5/0.0/1.0"; _col_map[45] = (char*)"RGBi:0.6/0.0/1.0"; _col_map[46] = (char*)"RGBi:0.7/0.0/1.0"; _col_map[47] = (char*)"RGBi:0.8/0.0/1.0"; _col_map[48] = (char*)"RGBi:0.9/0.0/1.0"; _col_map[49] = (char*)"RGBi:1.0/0.0/1.0"; } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/tests/0000755000000000000000000000000012365454434013176 500000000000000aevol-4.4/src/libaevol/tests/Test_ae_jumping_mt.h0000644000175000017500000001360112231437075017131 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef TEST_AE_JUMPING_MT #define TEST_AE_JUMPING_MT // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include // =========================================================================== // Declare Used Namespaces // =========================================================================== using namespace CppUnit; using namespace std; class Test_ae_jumping_mt : public TestFixture { CPPUNIT_TEST_SUITE( Test_ae_jumping_mt ); CPPUNIT_TEST( test1 ); CPPUNIT_TEST( test2 ); CPPUNIT_TEST_SUITE_END(); public : // ======================================================================= // Enums // ======================================================================= // ======================================================================= // Constructors // ======================================================================= Test_ae_jumping_mt( void ); // ======================================================================= // Destructors // ======================================================================= virtual ~Test_ae_jumping_mt( void ); // ======================================================================= // Accessors: getters // ======================================================================= // ======================================================================= // Accessors: setters // ======================================================================= // ======================================================================= // Operators // ======================================================================= // ======================================================================= // Public Methods // ======================================================================= void setUp( void ); void tearDown( void ); void test1( void ); void test2( void ); // ======================================================================= // Public Attributes // ======================================================================= protected : // ======================================================================= // Forbidden Constructors // ======================================================================= /*Test_ae_jumping_mt( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; Test_ae_jumping_mt( const Test_ae_jumping_mt &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ======================================================================= // Protected Methods // ======================================================================= // ======================================================================= // Protected Attributes // ======================================================================= ae_jumping_mt* obj1; ae_jumping_mt* obj2; }; // =========================================================================== // Getters' definitions // =========================================================================== // =========================================================================== // Setters' definitions // =========================================================================== // =========================================================================== // Inline Operators' definitions // =========================================================================== // =========================================================================== // Inline functions' definition // =========================================================================== #endif // TEST_AE_JUMPING_MT aevol-4.4/src/libaevol/tests/Test_ae_individual.h0000644000175000017500000001403412237160575017115 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef TEST_AE_INDIVIDUAL #define TEST_AE_INDIVIDUAL // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include // =========================================================================== // Declare Used Namespaces // =========================================================================== using namespace CppUnit; using namespace std; class Test_ae_individual : public TestFixture { CPPUNIT_TEST_SUITE( Test_ae_individual ); CPPUNIT_TEST( test1 ); CPPUNIT_TEST( test2 ); CPPUNIT_TEST( test3 ); CPPUNIT_TEST( test4 ); CPPUNIT_TEST_SUITE_END(); public : // ======================================================================= // Enums // ======================================================================= // ======================================================================= // Constructors // ======================================================================= Test_ae_individual( void ); // ======================================================================= // Destructors // ======================================================================= virtual ~Test_ae_individual( void ); // ======================================================================= // Accessors: getters // ======================================================================= // ======================================================================= // Accessors: setters // ======================================================================= // ======================================================================= // Operators // ======================================================================= // ======================================================================= // Public Methods // ======================================================================= void setUp( void ); void tearDown( void ); void test1( void ); void test2( void ); void test3( void ); void test4( void ); // ======================================================================= // Public Attributes // ======================================================================= protected : // ======================================================================= // Forbidden Constructors // ======================================================================= /*Test_ae_individual( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; Test_ae_individual( const Test_ae_individual &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ======================================================================= // Protected Methods // ======================================================================= // ======================================================================= // Protected Attributes // ======================================================================= ae_individual* indiv1; ae_individual* indiv2; ae_individual* indiv3; ae_individual* indiv4; }; // =========================================================================== // Getters' definitions // =========================================================================== // =========================================================================== // Setters' definitions // =========================================================================== // =========================================================================== // Inline Operators' definitions // =========================================================================== // =========================================================================== // Inline functions' definition // =========================================================================== #endif // TEST_AE_INDIVIDUAL aevol-4.4/src/libaevol/tests/run_tests.cpp0000644000175000017500000000602712364737116015707 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include "Test_ae_jumping_mt.h" #include "Test_ae_individual.h" #include "Test_ae_list.h" // =========================================================================== // Declare Used Namespaces // =========================================================================== using namespace CppUnit; // =========================================================================== // Declare Miscellaneous Functions // =========================================================================== int main( int argc, char* argv[] ) { // Print message cout << "Running regression tests"; // Get the top level suite from the registry Test *suite = TestFactoryRegistry::getRegistry().makeTest(); // Adds the test to the list of test to run TextUi::TestRunner runner; runner.addTest( suite ); // Change the default outputter to a compiler error format outputter runner.setOutputter( new CompilerOutputter( &runner.result(), cerr ) ); // Run the tests. bool wasSucessful = runner.run(); // Return error code 1 if the one of test failed. return wasSucessful ? 0 : 1; } // =========================================================================== // Define Miscellaneous Functions // =========================================================================== aevol-4.4/src/libaevol/tests/Makefile.in0000644000000000000000000006557512365454415015204 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @WITH_CPPUNIT_TRUE@check_PROGRAMS = run_tests$(EXEEXT) subdir = src/libaevol/tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__run_tests_SOURCES_DIST = run_tests.cpp Test_ae_jumping_mt.cpp \ Test_ae_jumping_mt.h Test_ae_list.cpp Test_ae_list.h \ Test_ae_individual.cpp Test_ae_individual.h @WITH_CPPUNIT_TRUE@am_run_tests_OBJECTS = \ @WITH_CPPUNIT_TRUE@ run_tests-run_tests.$(OBJEXT) \ @WITH_CPPUNIT_TRUE@ run_tests-Test_ae_jumping_mt.$(OBJEXT) \ @WITH_CPPUNIT_TRUE@ run_tests-Test_ae_list.$(OBJEXT) \ @WITH_CPPUNIT_TRUE@ run_tests-Test_ae_individual.$(OBJEXT) run_tests_OBJECTS = $(am_run_tests_OBJECTS) run_tests_LDADD = $(LDADD) am__DEPENDENCIES_1 = @WITH_CPPUNIT_TRUE@run_tests_DEPENDENCIES = \ @WITH_CPPUNIT_TRUE@ $(top_srcdir)/src/libaevol/libaevol.a \ @WITH_CPPUNIT_TRUE@ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a \ @WITH_CPPUNIT_TRUE@ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(run_tests_SOURCES) DIST_SOURCES = $(am__run_tests_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ############################################ # Set a few variables # ############################################ ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX @WITH_CPPUNIT_TRUE@AM_CPPFLAGS = $(AEVOLCPPFLAGS) $(CPPUNIT_CFLAGS) \ @WITH_CPPUNIT_TRUE@ -I$(top_srcdir)/src/libaevol \ @WITH_CPPUNIT_TRUE@ -D__STDC_FORMAT_MACROS \ @WITH_CPPUNIT_TRUE@ -D__STDC_CONSTANT_MACROS \ @WITH_CPPUNIT_TRUE@ -D__STDC_LIMIT_MACROS @WITH_CPPUNIT_TRUE@AM_CXXFLAGS = $(AEVOLCXXFLAGS) @WITH_CPPUNIT_TRUE@AM_LDFLAGS = $(AEVOLLDFLAGS) \ @WITH_CPPUNIT_TRUE@ -L$(top_srcdir)/src/libaevol ############################################ # Set aevol library to use # ############################################ @WITH_CPPUNIT_TRUE@LDADD = $(top_srcdir)/src/libaevol/libaevol.a \ @WITH_CPPUNIT_TRUE@ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a \ @WITH_CPPUNIT_TRUE@ $(CPPUNIT_LIBS) @WITH_CPPUNIT_TRUE@CLEANFILES = $(check_PROGRAMS) @WITH_CPPUNIT_TRUE@TESTS = $(check_PROGRAMS) # The target_CPPFLAGS for each target may look useless, it is here to force automake to create # prefixed object files so that we don't use an object file built for another set of macrodefinitions # e.g. We don't want to use an object file created with NO_X when building the X11 lib @WITH_CPPUNIT_TRUE@run_tests_SOURCES = run_tests.cpp Test_ae_jumping_mt.cpp Test_ae_jumping_mt.h Test_ae_list.cpp Test_ae_list.h Test_ae_individual.cpp Test_ae_individual.h @WITH_CPPUNIT_TRUE@run_tests_CPPFLAGS = $(AM_CPPFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libaevol/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libaevol/tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) run_tests$(EXEEXT): $(run_tests_OBJECTS) $(run_tests_DEPENDENCIES) $(EXTRA_run_tests_DEPENDENCIES) @rm -f run_tests$(EXEEXT) $(CXXLINK) $(run_tests_OBJECTS) $(run_tests_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_tests-Test_ae_individual.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_tests-Test_ae_jumping_mt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_tests-Test_ae_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_tests-run_tests.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` run_tests-run_tests.o: run_tests.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-run_tests.o -MD -MP -MF $(DEPDIR)/run_tests-run_tests.Tpo -c -o run_tests-run_tests.o `test -f 'run_tests.cpp' || echo '$(srcdir)/'`run_tests.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-run_tests.Tpo $(DEPDIR)/run_tests-run_tests.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='run_tests.cpp' object='run_tests-run_tests.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-run_tests.o `test -f 'run_tests.cpp' || echo '$(srcdir)/'`run_tests.cpp run_tests-run_tests.obj: run_tests.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-run_tests.obj -MD -MP -MF $(DEPDIR)/run_tests-run_tests.Tpo -c -o run_tests-run_tests.obj `if test -f 'run_tests.cpp'; then $(CYGPATH_W) 'run_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/run_tests.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-run_tests.Tpo $(DEPDIR)/run_tests-run_tests.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='run_tests.cpp' object='run_tests-run_tests.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-run_tests.obj `if test -f 'run_tests.cpp'; then $(CYGPATH_W) 'run_tests.cpp'; else $(CYGPATH_W) '$(srcdir)/run_tests.cpp'; fi` run_tests-Test_ae_jumping_mt.o: Test_ae_jumping_mt.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-Test_ae_jumping_mt.o -MD -MP -MF $(DEPDIR)/run_tests-Test_ae_jumping_mt.Tpo -c -o run_tests-Test_ae_jumping_mt.o `test -f 'Test_ae_jumping_mt.cpp' || echo '$(srcdir)/'`Test_ae_jumping_mt.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-Test_ae_jumping_mt.Tpo $(DEPDIR)/run_tests-Test_ae_jumping_mt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Test_ae_jumping_mt.cpp' object='run_tests-Test_ae_jumping_mt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-Test_ae_jumping_mt.o `test -f 'Test_ae_jumping_mt.cpp' || echo '$(srcdir)/'`Test_ae_jumping_mt.cpp run_tests-Test_ae_jumping_mt.obj: Test_ae_jumping_mt.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-Test_ae_jumping_mt.obj -MD -MP -MF $(DEPDIR)/run_tests-Test_ae_jumping_mt.Tpo -c -o run_tests-Test_ae_jumping_mt.obj `if test -f 'Test_ae_jumping_mt.cpp'; then $(CYGPATH_W) 'Test_ae_jumping_mt.cpp'; else $(CYGPATH_W) '$(srcdir)/Test_ae_jumping_mt.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-Test_ae_jumping_mt.Tpo $(DEPDIR)/run_tests-Test_ae_jumping_mt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Test_ae_jumping_mt.cpp' object='run_tests-Test_ae_jumping_mt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-Test_ae_jumping_mt.obj `if test -f 'Test_ae_jumping_mt.cpp'; then $(CYGPATH_W) 'Test_ae_jumping_mt.cpp'; else $(CYGPATH_W) '$(srcdir)/Test_ae_jumping_mt.cpp'; fi` run_tests-Test_ae_list.o: Test_ae_list.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-Test_ae_list.o -MD -MP -MF $(DEPDIR)/run_tests-Test_ae_list.Tpo -c -o run_tests-Test_ae_list.o `test -f 'Test_ae_list.cpp' || echo '$(srcdir)/'`Test_ae_list.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-Test_ae_list.Tpo $(DEPDIR)/run_tests-Test_ae_list.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Test_ae_list.cpp' object='run_tests-Test_ae_list.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-Test_ae_list.o `test -f 'Test_ae_list.cpp' || echo '$(srcdir)/'`Test_ae_list.cpp run_tests-Test_ae_list.obj: Test_ae_list.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-Test_ae_list.obj -MD -MP -MF $(DEPDIR)/run_tests-Test_ae_list.Tpo -c -o run_tests-Test_ae_list.obj `if test -f 'Test_ae_list.cpp'; then $(CYGPATH_W) 'Test_ae_list.cpp'; else $(CYGPATH_W) '$(srcdir)/Test_ae_list.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-Test_ae_list.Tpo $(DEPDIR)/run_tests-Test_ae_list.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Test_ae_list.cpp' object='run_tests-Test_ae_list.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-Test_ae_list.obj `if test -f 'Test_ae_list.cpp'; then $(CYGPATH_W) 'Test_ae_list.cpp'; else $(CYGPATH_W) '$(srcdir)/Test_ae_list.cpp'; fi` run_tests-Test_ae_individual.o: Test_ae_individual.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-Test_ae_individual.o -MD -MP -MF $(DEPDIR)/run_tests-Test_ae_individual.Tpo -c -o run_tests-Test_ae_individual.o `test -f 'Test_ae_individual.cpp' || echo '$(srcdir)/'`Test_ae_individual.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-Test_ae_individual.Tpo $(DEPDIR)/run_tests-Test_ae_individual.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Test_ae_individual.cpp' object='run_tests-Test_ae_individual.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-Test_ae_individual.o `test -f 'Test_ae_individual.cpp' || echo '$(srcdir)/'`Test_ae_individual.cpp run_tests-Test_ae_individual.obj: Test_ae_individual.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT run_tests-Test_ae_individual.obj -MD -MP -MF $(DEPDIR)/run_tests-Test_ae_individual.Tpo -c -o run_tests-Test_ae_individual.obj `if test -f 'Test_ae_individual.cpp'; then $(CYGPATH_W) 'Test_ae_individual.cpp'; else $(CYGPATH_W) '$(srcdir)/Test_ae_individual.cpp'; fi` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/run_tests-Test_ae_individual.Tpo $(DEPDIR)/run_tests-Test_ae_individual.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Test_ae_individual.cpp' object='run_tests-Test_ae_individual.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(run_tests_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o run_tests-Test_ae_individual.obj `if test -f 'Test_ae_individual.cpp'; then $(CYGPATH_W) 'Test_ae_individual.cpp'; else $(CYGPATH_W) '$(srcdir)/Test_ae_individual.cpp'; fi` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/src/libaevol/tests/Test_ae_list.h0000644000175000017500000001430012364737116015736 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef TEST_AE_LIST #define TEST_AE_LIST // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include // =========================================================================== // Declare Used Namespaces // =========================================================================== using namespace CppUnit; using namespace std; class Test_ae_list : public TestFixture { CPPUNIT_TEST_SUITE( Test_ae_list ); CPPUNIT_TEST( basic_tests1 ); CPPUNIT_TEST( basic_tests2 ); CPPUNIT_TEST( test_extract_sublist ); CPPUNIT_TEST_SUITE_END(); public : // ======================================================================= // Enums // ======================================================================= // ======================================================================= // Constructors // ======================================================================= Test_ae_list( void ); // ======================================================================= // Destructors // ======================================================================= virtual ~Test_ae_list( void ); // ======================================================================= // Accessors: getters // ======================================================================= // ======================================================================= // Accessors: setters // ======================================================================= // ======================================================================= // Operators // ======================================================================= // ======================================================================= // Public Methods // ======================================================================= void setUp( void ); void tearDown( void ); void basic_tests1( void ); void basic_tests2( void ); void test_extract_sublist( void ); // ======================================================================= // Public Attributes // ======================================================================= protected : // ======================================================================= // Forbidden Constructors // ======================================================================= /*Test_ae_list( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; Test_ae_list( const Test_ae_list &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ======================================================================= // Protected Methods // ======================================================================= template void assert_equal(const ae_list* expected, const ae_list* actual, SourceLine SL); //void assert_equal(ae_list* int_list1, ae_list* int_list2); // ======================================================================= // Protected Attributes // ======================================================================= ae_list* int_list; static const int INT_LIST_SIZE; }; // =========================================================================== // Getters' definitions // =========================================================================== // =========================================================================== // Setters' definitions // =========================================================================== // =========================================================================== // Inline Operators' definitions // =========================================================================== // =========================================================================== // Inline functions' definition // =========================================================================== #endif // TEST_AE_LIST aevol-4.4/src/libaevol/tests/Test_ae_jumping_mt.cpp0000644000175000017500000001132712231437075017467 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= // ================================================================= // Project Files // ================================================================= #include "Test_ae_jumping_mt.h" // =========================================================================== // Declare Used Namespaces // =========================================================================== //############################################################################ // # // Class Test_ae_jumping_mt # // # //############################################################################ CPPUNIT_TEST_SUITE_REGISTRATION( Test_ae_jumping_mt ); // =========================================================================== // Static attributes // =========================================================================== // =========================================================================== // Constructors // =========================================================================== Test_ae_jumping_mt::Test_ae_jumping_mt( void ) { } // =========================================================================== // Destructors // =========================================================================== Test_ae_jumping_mt::~Test_ae_jumping_mt( void ) { } // =========================================================================== // Operators // =========================================================================== // =========================================================================== // Public Methods // =========================================================================== void Test_ae_jumping_mt::setUp( void ) { obj1 = new ae_jumping_mt( 56873 ); obj2 = new ae_jumping_mt( *obj1 ); } void Test_ae_jumping_mt::tearDown( void ) { delete obj1; delete obj2; } void Test_ae_jumping_mt::test1( void ) { for ( int i = 0 ; i < 10 ; i++ ) { obj1->random(); obj2->random(); } CPPUNIT_ASSERT( obj1->random() == obj2->random() ); CPPUNIT_ASSERT( obj1->random( (int8_t) INT8_MAX ) == obj2->random( (int8_t) INT8_MAX ) ); CPPUNIT_ASSERT( obj1->random( (int16_t) INT16_MAX ) == obj2->random( (int16_t) INT16_MAX ) ); CPPUNIT_ASSERT( obj1->random( (int32_t) INT32_MAX ) == obj2->random( (int32_t) INT32_MAX ) ); CPPUNIT_ASSERT( obj1->random( (int64_t) INT64_MAX ) == obj2->random( (int64_t) INT64_MAX ) ); CPPUNIT_ASSERT( obj1->binomial_random( 435, 0.5 ) == obj2->binomial_random( 435, 0.5 ) ); CPPUNIT_ASSERT( obj1->gaussian_random() == obj2->gaussian_random() ); } void Test_ae_jumping_mt::test2( void ) { CPPUNIT_ASSERT( true ); } // =========================================================================== // Protected Methods // =========================================================================== // =========================================================================== // Non inline accessors // =========================================================================== aevol-4.4/src/libaevol/tests/Test_ae_individual.cpp0000644000175000017500000003031112364426356017447 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include "Test_ae_individual.h" #include #include #include #include #include // =========================================================================== // Declare Used Namespaces // =========================================================================== //############################################################################ // # // Class Test_ae_individual # // # //############################################################################ CPPUNIT_TEST_SUITE_REGISTRATION( Test_ae_individual ); // =========================================================================== // Static attributes // =========================================================================== // =========================================================================== // Constructors // =========================================================================== Test_ae_individual::Test_ae_individual( void ) { } // =========================================================================== // Destructors // =========================================================================== Test_ae_individual::~Test_ae_individual( void ) { } // =========================================================================== // Operators // =========================================================================== // =========================================================================== // Public Methods // =========================================================================== void Test_ae_individual::setUp( void ) { // Build ad-hoc genomes // (and reverse to test the same things on the lagging strand.): // // indiv1: (AS + prom + AS + AG + AS + term + AS + prom + AS) // indiv2: reverse // indiv3: (AS + AG + AS + term + AS + prom + AS) // indiv4: reverse // // AS = Arbitrary Sequence // AG = Arbitrary Gene // Do not modify the sequences ! char as[5][10] = { "0011", "11101", "110011", "11000", "000101" }; char gene[255]; sprintf(gene, "%s0011000100110110010001", SHINE_DAL_SEQ); char term[TERM_SIZE+1] = "01000001101"; char prom[2][23] = { "0101010001110110010110", // dist from consensus: 2 => basal level: 0.6 "0101011001110010010010" // dist from consensus: 1 => basal level: 0.8 }; char* genome = new char[1024]; sprintf( genome, "%s%s%s%s%s%s%s%s%s", as[0], prom[0], as[1], gene, as[2], term, as[3], prom[1], as[4]); // Build indiv1 ae_params_mut params_mut; indiv1 = new ae_individual(NULL, NULL, NULL, ¶ms_mut, 1.0, 10, 1000, false, 1, "anon-strain-1", 0); indiv1->add_GU(genome, strlen(genome)); genome = NULL; // Do transcription and translation indiv1->do_transcription(); indiv1->do_translation(); // Build indiv2 genome = indiv1->get_genetic_unit(0)->get_dna()->get_subsequence(0,0,LAGGING); indiv2 = new ae_individual(NULL, NULL, NULL, ¶ms_mut, 1.0, 10, 1000, false, 1, "anon-strain-2", 0); indiv2->add_GU(genome, strlen(genome)); genome = NULL; // Do transcription and translation indiv2->do_transcription(); indiv2->do_translation(); // Build indiv3 genome = new char[1024]; sprintf( genome, "%s%s%s%s%s%s%s", as[0], gene, as[1], term, as[2], prom[1], as[3]); indiv3 = new ae_individual(NULL, NULL, NULL, ¶ms_mut, 1.0, 10, 1000, false, 1, "anon-strain-3", 0); indiv3->add_GU(genome, strlen(genome)); genome = NULL; // Do transcription and translation indiv3->do_transcription(); indiv3->do_translation(); // Build indiv4 genome = indiv3->get_genetic_unit(0)->get_dna()->get_subsequence(0,0,LAGGING); indiv4 = new ae_individual(NULL, NULL, NULL, ¶ms_mut, 1.0, 10, 1000, false, 1, "anon-strain-4", 0); indiv4->add_GU(genome, strlen(genome)); genome = NULL; // Do transcription and translation indiv4->do_transcription(); indiv4->do_translation(); // *************************************************************************** // The following commented code allows to print stuff about rnas and proteins // printf("%"PRId32" rnas and %"PRId32" prots\n", indiv4->get_rna_list()->get_nb_elts(), indiv4->get_protein_list()->get_nb_elts()); // ae_list_node* rna_node = indiv4->get_rna_list()->get_first(); // while (rna_node != NULL) // { // printf("%s rna at pos %"PRId32" (%f, %"PRId32")\n", // rna_node->get_obj()->get_strand() == LEADING ? "LEADING":"LAGGING", // rna_node->get_obj()->get_promoter_pos(), // rna_node->get_obj()->get_basal_level(), // rna_node->get_obj()->get_transcript_length()); // rna_node = rna_node->get_next(); // } // ae_list_node* protein_node = indiv4->get_protein_list()->get_first(); // while (protein_node != NULL) // { // printf("%s protein at pos %"PRId32" (length: %"PRId32", concentr: %f, nb_rnas: %"PRId32")\n", // protein_node->get_obj()->get_strand() == LEADING ? "LEADING":"LAGGING", // protein_node->get_obj()->get_shine_dal_pos(), // protein_node->get_obj()->get_length(), // protein_node->get_obj()->get_concentration(), // protein_node->get_obj()->get_rna_list()->get_nb_elts()); // protein_node = protein_node->get_next(); // } } void Test_ae_individual::tearDown( void ) { delete indiv1; delete indiv2; delete indiv3; delete indiv4; } void Test_ae_individual::test1( void ) { // Check genome size CPPUNIT_ASSERT( indiv1->get_amount_of_dna() == 109 ); CPPUNIT_ASSERT( indiv1->get_genetic_unit_seq_length(0) == 109 ); // Check RNA list ae_list* rna_list = indiv1->get_rna_list(); CPPUNIT_ASSERT( rna_list->get_nb_elts() == 2 ); ae_rna* rna = rna_list->get_first()->get_obj(); CPPUNIT_ASSERT( rna->get_strand() == LEADING ); CPPUNIT_ASSERT( rna->get_promoter_pos() == 4 ); CPPUNIT_ASSERT( rna->get_basal_level() == 0.6 ); CPPUNIT_ASSERT( rna->get_transcript_length() == 50 ); rna = rna_list->get_last()->get_obj(); CPPUNIT_ASSERT( rna->get_strand() == LEADING ); CPPUNIT_ASSERT( rna->get_promoter_pos() == 81 ); CPPUNIT_ASSERT( rna->get_basal_level() == 0.8 ); CPPUNIT_ASSERT( rna->get_transcript_length() == 82 ); // Check protein list ae_list* prot_list = indiv1->get_protein_list(); CPPUNIT_ASSERT( prot_list->get_nb_elts() == 1 ); ae_protein* prot = prot_list->get_first()->get_obj(); CPPUNIT_ASSERT( prot->get_strand() == LEADING ); CPPUNIT_ASSERT( prot->get_shine_dal_pos() == 31 ); CPPUNIT_ASSERT( prot->get_length() == 4 ); CPPUNIT_ASSERT( prot->get_concentration() == 1.4 ); CPPUNIT_ASSERT( prot->get_rna_list()->get_nb_elts() == 2 ); } void Test_ae_individual::test2( void ) { // Check genome size CPPUNIT_ASSERT( indiv2->get_amount_of_dna() == 109 ); CPPUNIT_ASSERT( indiv2->get_genetic_unit_seq_length(0) == 109 ); // Check RNA list ae_list* rna_list = indiv2->get_rna_list(); CPPUNIT_ASSERT( rna_list->get_nb_elts() == 2 ); ae_rna* rna = rna_list->get_first()->get_obj(); CPPUNIT_ASSERT( rna->get_strand() == LAGGING ); CPPUNIT_ASSERT( rna->get_promoter_pos() == 104 ); CPPUNIT_ASSERT( rna->get_basal_level() == 0.6 ); CPPUNIT_ASSERT( rna->get_transcript_length() == 50 ); rna = rna_list->get_last()->get_obj(); CPPUNIT_ASSERT( rna->get_strand() == LAGGING ); CPPUNIT_ASSERT( rna->get_promoter_pos() == 27 ); CPPUNIT_ASSERT( rna->get_basal_level() == 0.8 ); CPPUNIT_ASSERT( rna->get_transcript_length() == 82 ); // Check protein list ae_list* prot_list = indiv2->get_protein_list(); CPPUNIT_ASSERT( prot_list->get_nb_elts() == 1 ); ae_protein* prot = prot_list->get_first()->get_obj(); CPPUNIT_ASSERT( prot->get_strand() == LAGGING ); CPPUNIT_ASSERT( prot->get_shine_dal_pos() == 77 ); CPPUNIT_ASSERT( prot->get_length() == 4 ); CPPUNIT_ASSERT( prot->get_concentration() == 1.4 ); CPPUNIT_ASSERT( prot->get_rna_list()->get_nb_elts() == 2 ); } void Test_ae_individual::test3( void ) { // Check genome size CPPUNIT_ASSERT( indiv3->get_amount_of_dna() == 81 ); CPPUNIT_ASSERT( indiv3->get_genetic_unit_seq_length(0) == 81 ); // Check RNA list ae_list* rna_list = indiv3->get_rna_list(); CPPUNIT_ASSERT( rna_list->get_nb_elts() == 1 ); ae_rna* rna = rna_list->get_first()->get_obj(); CPPUNIT_ASSERT( rna->get_strand() == LEADING ); CPPUNIT_ASSERT( rna->get_promoter_pos() == 54 ); CPPUNIT_ASSERT( rna->get_basal_level() == 0.8 ); CPPUNIT_ASSERT( rna->get_transcript_length() == 42 ); // Check protein list ae_list* prot_list = indiv3->get_protein_list(); CPPUNIT_ASSERT( prot_list->get_nb_elts() == 1 ); ae_protein* prot = prot_list->get_first()->get_obj(); CPPUNIT_ASSERT( prot->get_strand() == LEADING ); CPPUNIT_ASSERT( prot->get_shine_dal_pos() == 4 ); CPPUNIT_ASSERT( prot->get_length() == 4 ); CPPUNIT_ASSERT( prot->get_concentration() == 0.8 ); CPPUNIT_ASSERT( prot->get_rna_list()->get_nb_elts() == 1 ); } void Test_ae_individual::test4( void ) { // Check genome size CPPUNIT_ASSERT( indiv4->get_amount_of_dna() == 81 ); CPPUNIT_ASSERT( indiv4->get_genetic_unit_seq_length(0) == 81 ); // Check RNA list ae_list* rna_list = indiv4->get_rna_list(); CPPUNIT_ASSERT( rna_list->get_nb_elts() == 1 ); ae_rna* rna = rna_list->get_first()->get_obj(); CPPUNIT_ASSERT( rna->get_strand() == LAGGING ); CPPUNIT_ASSERT( rna->get_promoter_pos() == 26 ); CPPUNIT_ASSERT( rna->get_basal_level() == 0.8 ); CPPUNIT_ASSERT( rna->get_transcript_length() == 42 ); // Check protein list ae_list* prot_list = indiv4->get_protein_list(); CPPUNIT_ASSERT( prot_list->get_nb_elts() == 1 ); ae_protein* prot = prot_list->get_first()->get_obj(); CPPUNIT_ASSERT( prot->get_strand() == LAGGING ); CPPUNIT_ASSERT( prot->get_shine_dal_pos() == 76 ); CPPUNIT_ASSERT( prot->get_length() == 4 ); CPPUNIT_ASSERT( prot->get_concentration() == 0.8 ); CPPUNIT_ASSERT( prot->get_rna_list()->get_nb_elts() == 1 ); } // =========================================================================== // Protected Methods // =========================================================================== // =========================================================================== // Non inline accessors // =========================================================================== aevol-4.4/src/libaevol/tests/Test_ae_list.cpp0000644000175000017500000002254612365453523016302 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include "Test_ae_list.h" // =========================================================================== // Declare Used Namespaces // =========================================================================== //############################################################################ // # // Class Test_ae_list # // # //############################################################################ CPPUNIT_TEST_SUITE_REGISTRATION( Test_ae_list ); // =========================================================================== // Static attributes // =========================================================================== // Don't change value (hard use in some tests) const int Test_ae_list::INT_LIST_SIZE = 20; // =========================================================================== // Constructors // =========================================================================== Test_ae_list::Test_ae_list( void ) { } // =========================================================================== // Destructors // =========================================================================== Test_ae_list::~Test_ae_list( void ) { } // =========================================================================== // Operators // =========================================================================== // =========================================================================== // Public Methods // =========================================================================== void Test_ae_list::setUp( void ) { int_list = new ae_list(); for (int i = 0 ; i < INT_LIST_SIZE ; i++) { int_list->add(new int(i + 1)); } } void Test_ae_list::tearDown( void ) { int_list->erase(true); delete int_list; } void Test_ae_list::basic_tests1( void ) { // Manually check the content of int_list (checks add(T*)) ae_list_node* node = int_list->get_first(); int32_t nb_elts = 0; while (node != NULL) { CPPUNIT_ASSERT_EQUAL(++nb_elts, *node->get_obj()); node = node->get_next(); } CPPUNIT_ASSERT_EQUAL(INT_LIST_SIZE, nb_elts); // Construct the same list using add_front ae_list* expected = new ae_list(); for (int i = INT_LIST_SIZE ; i > 0 ; i--) { expected->add_front(new int(i)); } assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); expected->erase(true); delete expected; // Check erase and is_empty int_list->erase(true); CPPUNIT_ASSERT(int_list->is_empty()); CPPUNIT_ASSERT_EQUAL(0, int_list->get_nb_elts()); CPPUNIT_ASSERT_EQUAL((void*)NULL, (void*)int_list->get_first()); CPPUNIT_ASSERT_EQUAL((void*)NULL, (void*)int_list->get_last()); } void Test_ae_list::basic_tests2( void ) { // Check get_object(int32_t pos) CPPUNIT_ASSERT_EQUAL((void*)NULL, (void*)int_list->get_object(-1)); CPPUNIT_ASSERT_EQUAL((void*)NULL, (void*)int_list->get_object(INT_LIST_SIZE)); for (int i = 0 ; i < INT_LIST_SIZE ; i++) { CPPUNIT_ASSERT_EQUAL(i + 1, *(int_list->get_object(i))); } // Check get_node(int32_t pos) CPPUNIT_ASSERT_EQUAL((void*)NULL, (void*)int_list->get_node(-1)); CPPUNIT_ASSERT_EQUAL((void*)NULL, (void*)int_list->get_node(INT_LIST_SIZE)); for (int i = 0 ; i < INT_LIST_SIZE-1 ; i++) { CPPUNIT_ASSERT_EQUAL(i + 1, *(int_list->get_node(i)->get_obj())); } // Check remove(node) (remove first, last and arbitrary elt) int_list->remove(int_list->get_node(0), true, true); int_list->remove(int_list->get_node(INT_LIST_SIZE-2), true, true); int_list->remove(int_list->get_node(INT_LIST_SIZE/2), true, true); ae_list* expected = new ae_list(); for (int i = 0 ; i < INT_LIST_SIZE/2 ; i++) { expected->add(new int(i + 2)); } for (int i = INT_LIST_SIZE/2 ; i < INT_LIST_SIZE-3 ; i++) { expected->add(new int(i + 3)); } assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); expected->erase(true); delete expected; } void Test_ae_list::test_extract_sublist( void ) { // Construct the same list as int_list ae_list* expected = new ae_list(); for (int i = 0 ; i < INT_LIST_SIZE ; i++) { expected->add(new int(i + 1)); } // Initial check assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); //printf("HERE %d %d\n", expected->get_nb_elts(), int_list->get_nb_elts()); // ************************************************************************** // Extract the first element ae_list* int_list2 = int_list->extract_sublist(0, 1); ae_list* expected2 = new ae_list(); expected->remove(expected->get_first(), true, true); expected2->add(new int(1)); assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); assert_equal(expected2, int_list2, CPPUNIT_SOURCELINE()); expected2->erase(true); int_list2->erase(true); delete int_list2; // ************************************************************************** // Extract elements 10 through 13 int_list2 = int_list->extract_sublist(10, 4); for (int i = 0 ; i < 4 ; i++) { expected->remove(expected->get_node(10), true, true); expected2->add(new int(12 + i)); } assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); assert_equal(expected2, int_list2, CPPUNIT_SOURCELINE()); expected2->erase(true); int_list2->erase(true); delete int_list2; // ************************************************************************** // Extract last 4 elements int_list2 = int_list->extract_ending_sublist(4); for (int i = 0 ; i < 4 ; i++) { expected->remove(expected->get_last(), true, true); expected2->add(new int(17 + i)); } assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); assert_equal(expected2, int_list2, CPPUNIT_SOURCELINE()); expected2->erase(true); int_list2->erase(true); delete int_list2; // ************************************************************************** // Extract first 3 elements int_list2 = int_list->extract_starting_sublist(3); for (int i = 0 ; i < 3 ; i++) { expected2->add(new int(*expected->get_first()->get_obj())); expected->remove(expected->get_first(), true, true); } assert_equal(expected, int_list, CPPUNIT_SOURCELINE()); assert_equal(expected2, int_list2, CPPUNIT_SOURCELINE()); expected2->erase(true); int_list2->erase(true); delete int_list2; } // =========================================================================== // Protected Methods // =========================================================================== template void Test_ae_list::assert_equal(const ae_list* expected, const ae_list* actual, SourceLine SL) { // Build message string char* msg = new char[256]; sprintf(msg, "From %s:%d", SL.fileName().c_str(), SL.lineNumber()); CPPUNIT_ASSERT_EQUAL_MESSAGE(msg, expected->get_nb_elts(), actual->get_nb_elts()); ae_list_node* node1 = expected->get_first(); ae_list_node* node2 = actual->get_first(); int32_t nb_elts = 0; while (node1 != NULL && node2 != NULL) { CPPUNIT_ASSERT_EQUAL_MESSAGE(msg, *node1->get_obj(), *node2->get_obj()); nb_elts++; node1 = node1->get_next(); node2 = node2->get_next(); } CPPUNIT_ASSERT_EQUAL_MESSAGE(msg, expected->get_nb_elts(), nb_elts); delete msg; } // =========================================================================== // Non inline accessors // =========================================================================== aevol-4.4/src/libaevol/tests/Makefile.am0000644000175000017500000000345512365452043015205 00000000000000if WITH_CPPUNIT ############################################ # Set a few variables # ############################################ AM_CPPFLAGS = $(AEVOLCPPFLAGS) $(CPPUNIT_CFLAGS) AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) AM_CPPFLAGS += -I$(top_srcdir)/src/libaevol AM_LDFLAGS += -L$(top_srcdir)/src/libaevol ############################################ # Set aevol library to use # ############################################ LDADD = $(top_srcdir)/src/libaevol/libaevol.a LDADD += $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a $(CPPUNIT_LIBS) ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS ############################################ # Set programs to build # ############################################ check_PROGRAMS = run_tests CLEANFILES = $(check_PROGRAMS) TESTS = $(check_PROGRAMS) # The target_CPPFLAGS for each target may look useless, it is here to force automake to create # prefixed object files so that we don't use an object file built for another set of macrodefinitions # e.g. We don't want to use an object file created with NO_X when building the X11 lib run_tests_SOURCES = run_tests.cpp Test_ae_jumping_mt.cpp Test_ae_jumping_mt.h Test_ae_list.cpp Test_ae_list.h Test_ae_individual.cpp Test_ae_individual.h run_tests_CPPFLAGS = $(AM_CPPFLAGS) endif aevol-4.4/src/libaevol/ae_mutation.h0000644000175000017500000001773312271674030014467 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_MUTATION_H__ #define __AE_MUTATION_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include // ================================================================= // Class declarations // ================================================================= enum ae_mutation_type { SWITCH = 0, S_INS = 1, S_DEL = 2, DUPL = 3, DEL = 4, TRANS = 5, INV = 6, INSERT = 7, INS_HT = 8, REPL_HT = 9 }; class ae_mutation : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_mutation( void ); ae_mutation( const ae_mutation &model ); ae_mutation( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_mutation( void ); // ================================================================= // Accessors: Getters // ================================================================= inline ae_mutation_type get_mut_type( void ); inline int32_t get_length( void ); void get_infos_point_mutation( int32_t* pos ); void get_infos_small_insertion( int32_t* pos, int32_t* length ); // everything except the sequence void get_sequence_small_insertion( char* seq ); // seq must be a char array, large enough to contain _length+1 characters void get_infos_small_deletion( int32_t* pos, int32_t* length ); void get_infos_duplication( int32_t* pos1, int32_t* pos2, int32_t* pos3, int16_t* align_score = NULL ); void get_infos_deletion( int32_t* pos1, int32_t* pos2, int16_t* align_score = NULL ); void get_infos_translocation( int32_t* pos1, int32_t* pos2, int32_t* pos3, int32_t* pos4, bool* invert, int16_t* align_score_1 = NULL, int16_t* align_score_2 = NULL ); void get_infos_inversion( int32_t* pos1, int32_t* pos2, int16_t* align_score = NULL ); void get_infos_insertion( int32_t* pos, int32_t* length ); void get_sequence_insertion( char* seq ); void get_infos_ins_HT( int32_t* pos1, int32_t* pos2, int32_t* pos3, int32_t* pos4, ae_sense* sense, int32_t* length ); void get_sequence_ins_HT( char* seq ); void get_infos_repl_HT( int32_t* pos1, int32_t* pos2, int32_t* pos3, int32_t* pos4, ae_sense* sense, int32_t* length ); void get_sequence_repl_HT( char* seq ); // ================================================================= // Accessors: Setters // ================================================================= // ================================================================= // Public Methods // ================================================================= void report_point_mutation( int32_t pos ); void report_small_insertion( int32_t pos, int32_t length, const char* seq ); void report_small_deletion( int32_t pos, int32_t length ); void report_duplication( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t length, int16_t align_score = -1 ); void report_deletion( int32_t pos_1, int32_t pos_2, int32_t length, int16_t align_score = -1 ); void report_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, int32_t length, bool invert, int16_t align_score_1 = -1, int16_t align_score_2 = -1 ); void report_inversion( int32_t pos_1, int32_t pos_2, int32_t length, int16_t align_score = -1 ); void report_insertion( int32_t pos, int32_t length, const char* seq ); void report_ins_HT(int32_t alignment_1_donor_pos_1, int32_t alignment_1_donor_pos_2, int32_t alignment_2_ind_pos, int32_t alignment_2_donor_pos, int32_t length, int16_t alignment_1_score, int16_t alignment_2_score, int32_t donor_id, ae_sense sense, const char* seq); void report_repl_HT(int32_t alignment_1_donor_pos_1, int32_t alignment_1_donor_pos_2, int32_t alignment_2_ind_pos, int32_t alignment_2_donor_pos, int32_t repl_seq_length, int32_t donor_seq_length, int16_t alignment_1_score, int16_t alignment_2_score, int32_t donor_id, ae_sense sense, const char* seq); void get_generic_description_string( char * str ); /* DEPRECATED, use get_length instead */ int32_t segment_length( int32_t gen_unit_len ); void save( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= //~ ae_mutation( void ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_mutation_type _mut_type; int32_t* _pos; int32_t* _length; char* _seq; bool _invert; int16_t* _align_score; int32_t _donor_id; // CK: There should also be another int to indicate which genetic unit in the donor ae_sense _sense; }; // ===================================================================== // Accessors' definitions // ===================================================================== ae_mutation_type ae_mutation::get_mut_type( void ) { return _mut_type; } inline int32_t ae_mutation::get_length( void ) { return _length[0]; } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_MUTATION_H__ aevol-4.4/src/libaevol/ae_genetic_unit.cpp0000644000175000017500000042453212363702064015637 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include #ifdef __REGUL #include #else #include #endif // ================================================================= // Miscellaneous Functions // ================================================================= int compare_prot_pos( const void* pos, const void* prot ) // This function has to be a plain int // to comply with the definition of bsearch() { if ( ((ae_protein*)prot)->get_shine_dal_pos() == *(int32_t*)pos ) return 0; else return 1; } //############################################################################## // # // Class ae_genetic_unit # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= /*! \brief Create a new genetic unit for indiv with a random DNA sequence of length length Promoters will be looked for on the whole sequence but no further process will be performed. */ ae_genetic_unit::ae_genetic_unit( ae_individual* indiv, int32_t length ) { _indiv = indiv; _exp_m = indiv->get_exp_m(); _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _min_gu_length = -1; _max_gu_length = -1; _dna = new ae_dna( this, length ); // Create empty rna and protein lists _rna_list = new ae_list*[2]; _rna_list[LEADING] = new ae_list(); _rna_list[LAGGING] = new ae_list(); _protein_list = new ae_list*[2]; _protein_list[LEADING] = new ae_list(); _protein_list[LAGGING] = new ae_list(); // Create empty fuzzy sets for the phenotypic contributions _activ_contribution = new ae_fuzzy_set(); _inhib_contribution = new ae_fuzzy_set(); _phenotypic_contribution = NULL; // NB : _phenotypic_contribution is only an indicative value, // it is not used for the whole phenotype computation // _dist_to_target_per_segment depends on the segmentation of the environment // and will hence be newed at evaluation time _dist_to_target_per_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } // Look for promoters locate_promoters(); init_statistical_data(); } /*! \brief Create a new genetic unit for indiv with sequence seq [of size length] [and containing promoters prom_list] Promoters will be looked for if prom_list is not provided (this may take some time). WARNING : seq will be used directly which means the caller must not delete it The same goes for prom_list if it is provided. */ ae_genetic_unit::ae_genetic_unit( ae_individual* indiv, char* seq, int32_t length, ae_list** prom_list /*= NULL*/ ) { _exp_m = indiv->get_exp_m(); _indiv = indiv; _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _min_gu_length = -1; _max_gu_length = -1; _dna = new ae_dna( this, seq, length ); if ( prom_list != NULL ) { // Copy rna lists _rna_list = prom_list; ae_dna::set_GU( _rna_list, this ); } else { // Create empty rna lists _rna_list = new ae_list*[2]; _rna_list[LEADING] = new ae_list(); _rna_list[LAGGING] = new ae_list(); // Look for promoters locate_promoters(); } // Create empty protein lists _protein_list = new ae_list*[2]; _protein_list[LEADING] = new ae_list(); _protein_list[LAGGING] = new ae_list(); // Create empty fuzzy sets for the phenotypic contributions _activ_contribution = new ae_fuzzy_set(); _inhib_contribution = new ae_fuzzy_set(); _phenotypic_contribution = NULL; // NB : _phenotypic_contribution is only an indicative value, // it is not used for the whole phenotype computation // Initialize all the fitness-related stuff _dist_to_target_per_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } init_statistical_data(); } /*! \brief Copy constructor. Copies the DNA and recomputes all the rest. It is slower than copying as much as possible and regenerate only what is necessary but it works whatever the state of the model GU. */ ae_genetic_unit::ae_genetic_unit( ae_individual* indiv, const ae_genetic_unit &model ) { _exp_m = indiv->get_exp_m(); _indiv = indiv; _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; _distance_to_target_computed = model._distance_to_target_computed; _fitness_computed = model._fitness_computed; _min_gu_length = model._min_gu_length; _max_gu_length = model._max_gu_length; // Copy DNA _dna = new ae_dna( this, *(model._dna) ); // Create empty rna and protein lists _rna_list = new ae_list*[2]; _rna_list[LEADING] = new ae_list(); _rna_list[LAGGING] = new ae_list(); _protein_list = new ae_list*[2]; _protein_list[LEADING] = new ae_list(); _protein_list[LAGGING] = new ae_list(); // Create empty fuzzy sets for the phenotypic contributions _activ_contribution = new ae_fuzzy_set(); _inhib_contribution = new ae_fuzzy_set(); _phenotypic_contribution = NULL; // NB : _phenotypic_contribution is only an indicative value, not used for the whole phenotype computation _dist_to_target_per_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } // Compute everything init_statistical_data(); locate_promoters(); do_transcription(); do_translation(); compute_phenotypic_contribution(); } ae_genetic_unit::ae_genetic_unit( ae_individual* indiv, ae_genetic_unit* const parent ) { _exp_m = indiv->get_exp_m(); _indiv = indiv; _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _min_gu_length = parent->_min_gu_length; _max_gu_length = parent->_max_gu_length; // Copy DNA _dna = new ae_dna( this, parent->_dna ); // Copy promoter list (_rna_list) // Note that the length of the RNA will have to be recomputed (do_transcription) _rna_list = new ae_list*[2]; for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { _rna_list[strand] = new ae_list(); ae_list_node* rna_node = parent->_rna_list[strand]->get_first(); ae_rna* rna; while ( rna_node != NULL ) { rna = rna_node->get_obj(); #ifndef __REGUL _rna_list[strand]->add( new ae_rna( this, *rna ) ); #else _rna_list[strand]->add( new ae_rna_R( this, *(dynamic_cast(rna)) ) ); #endif rna_node = rna_node->get_next(); } } // Create an empty protein list _protein_list = new ae_list*[2]; _protein_list[LEADING] = new ae_list(); _protein_list[LAGGING] = new ae_list(); // Create empty fuzzy sets for the phenotypic contributions _activ_contribution = new ae_fuzzy_set(); _inhib_contribution = new ae_fuzzy_set(); _phenotypic_contribution = NULL; // NB : _phenotypic_contribution is only an indicative value, not used for the whole phenotype computation // Initialize all the fitness-related stuff _dist_to_target_per_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } init_statistical_data(); } ae_genetic_unit::ae_genetic_unit( ae_individual* indiv, gzFile backup_file ) { _exp_m = indiv->get_exp_m(); _indiv = indiv; _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _dna = new ae_dna( this, backup_file ); gzread( backup_file, &_min_gu_length, sizeof(_min_gu_length) ); gzread( backup_file, &_max_gu_length, sizeof(_max_gu_length) ); _rna_list = new ae_list*[2]; _rna_list[LEADING] = new ae_list(); _rna_list[LAGGING] = new ae_list(); _protein_list = new ae_list*[2]; _protein_list[LEADING] = new ae_list(); _protein_list[LAGGING] = new ae_list(); // Create empty fuzzy sets for the phenotypic contributions _activ_contribution = new ae_fuzzy_set(); _inhib_contribution = new ae_fuzzy_set(); _phenotypic_contribution = NULL; // NB : _phenotypic_contribution is only an indicative value, not used for the whole phenotype computation // Initialize all the fitness-related stuff _dist_to_target_per_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } // Look for promoters locate_promoters(); init_statistical_data(); } /*! \brief Create a new genetic unit for indiv with a sequence saved in a text file Promoters will be looked for on the whole sequence but no further process will be performed. */ ae_genetic_unit::ae_genetic_unit( ae_individual* indiv, char* organism_file_name ) { _exp_m = indiv->get_exp_m(); _indiv = indiv; _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; _distance_to_target_computed = false; _fitness_computed = false; _dna = new ae_dna( this, organism_file_name ); // Create empty rna and protein lists _rna_list = new ae_list*[2]; _rna_list[LEADING] = new ae_list(); _rna_list[LAGGING] = new ae_list(); _protein_list = new ae_list*[2]; _protein_list[LEADING] = new ae_list(); _protein_list[LAGGING] = new ae_list(); // Create empty fuzzy sets for the phenotypic contributions _activ_contribution = new ae_fuzzy_set(); _inhib_contribution = new ae_fuzzy_set(); _phenotypic_contribution = NULL; // NB : _phenotypic_contribution is only an indicative value, // it is not used for the whole phenotype computation // Initialize all the fitness-related stuff _dist_to_target_per_segment = NULL; _dist_to_target_by_feature = new double [NB_FEATURES]; _fitness_by_feature = new double [NB_FEATURES]; for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { _dist_to_target_by_feature[i] = 0.0; _fitness_by_feature[i] = 0.0; } // Look for promoters locate_promoters(); init_statistical_data(); } // ================================================================= // Destructors // ================================================================= ae_genetic_unit::~ae_genetic_unit( void ) { assert( _protein_list != NULL ); assert( _protein_list[LEADING] != NULL ); assert( _protein_list[LAGGING] != NULL ); _protein_list[LEADING]->erase( true ); _protein_list[LAGGING]->erase( true ); delete _protein_list[LEADING]; delete _protein_list[LAGGING]; delete [] _protein_list; assert( _rna_list != NULL ); assert( _rna_list[LEADING] != NULL ); assert( _rna_list[LAGGING] != NULL ); _rna_list[LEADING]->erase( true ); _rna_list[LAGGING]->erase( true ); delete _rna_list[LEADING]; delete _rna_list[LAGGING]; delete [] _rna_list; delete _dna; delete _activ_contribution; delete _inhib_contribution; if ( _phenotypic_contribution != NULL ) delete _phenotypic_contribution; delete [] _dist_to_target_per_segment; assert( _dist_to_target_by_feature != NULL ); delete [] _dist_to_target_by_feature; assert( _fitness_by_feature != NULL ); delete [] _fitness_by_feature; delete [] _beginning_neutral_regions; delete [] _end_neutral_regions; } // ================================================================= // Public Methods // ================================================================= void ae_genetic_unit::locate_promoters( void ) { // Look for promoters in the genome and create a new ae_rna // in the corresponding strand's RNA list int8_t dist; // Hamming distance of the sequence from the promoter consensus // Empty RNA list _rna_list[LEADING]->erase( true ); _rna_list[LAGGING]->erase( true ); if ( _dna->get_length() >= PROM_SIZE ) { for ( int32_t i = 0 ; i < _dna->get_length() ; i++ ) { if ( is_promoter( LEADING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { #ifndef __REGUL _rna_list[LEADING]->add( new ae_rna( this, LEADING, i, dist ) ); #else _rna_list[LEADING]->add( new ae_rna_R( this, LEADING, i, dist ) ); #endif } if ( is_promoter( LAGGING, _dna->get_length() - i - 1, dist ) ) { #ifndef __REGUL _rna_list[LAGGING]->add( new ae_rna( this, LAGGING, _dna->get_length() - i - 1, dist ) ); #else _rna_list[LAGGING]->add( new ae_rna_R( this, LAGGING, _dna->get_length() - i - 1, dist ) ); #endif } } } } void ae_genetic_unit::do_transcription( void ) { if ( _transcribed ) return; _transcribed = true; ae_list_node* rna_node = NULL; ae_rna* rna = NULL; int32_t transcript_start = -1; int32_t genome_length = _dna->get_length(); // If the genome is not long enough to bear a promoter and a terminator, // we set all its RNAs to a length of -1 if ( genome_length < PROM_SIZE + TERM_SIZE ) { rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL ) { rna_node->get_obj()->set_transcript_length( -1 ); rna_node = rna_node->get_next(); } rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL ) { rna_node->get_obj()->set_transcript_length( -1 ); rna_node = rna_node->get_next(); } return; } // ---------------- // LEADING strand // ---------------- rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); transcript_start = rna->get_first_transcribed_pos(); rna->set_transcript_length( -1 ); int32_t i; for ( i = 0 ; i < genome_length ; i++ ) { if ( is_terminator( LEADING, transcript_start + i ) ) { // Found terminator => set transcript's length rna->set_transcript_length( i + TERM_SIZE ); // Deduce the length of all the RNAs that share the same terminator // These are the RNAs whose promoter is entirely (and strictly) included // between the promoter and the terminator of the RNA we have just treated. // They are hence the RNAs whose promoter starts at most i bases after the // current rna's promoter ae_list_node* rna_node_2 = rna_node->get_next(); ae_rna* rna_2 = NULL; while ( rna_node_2 != NULL ) { rna_2 = rna_node_2->get_obj(); // We know rna_2 is after rna => rna_2->pos > rna->pos (LEADING strand) because the list is sorted if ( rna_2->get_promoter_pos() - rna->get_promoter_pos() <= i ) { rna_2->set_transcript_length( i - (rna_2->get_promoter_pos() - rna->get_promoter_pos()) + TERM_SIZE ); // Step forward in RNA list rna_node = rna_node_2; } else { // The promoter of rna_2 is after (or contains a part of) the terminator of rna, // we will need to search its own terminator break; } rna_node_2 = rna_node_2->get_next(); } // Terminator found for this RNA, nothing else to do (for this RNA) break; } } if (i == genome_length) { // We have searched the whole genome and found no terminator for this promoter. // We consider that no RNA can actually be produced, hence we set the transcript // length to -1. This will prevent the search for coding sequences downstream of this promoter. // However, we do not destroy the ae_rna object, it must still be kept in memory and // transmitted to the offspring in case a mutation recreates a terminator. rna->set_transcript_length( -1 ); } rna_node = rna_node->get_next(); } // ---------------- // LAGGING strand // ---------------- rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); transcript_start = rna->get_first_transcribed_pos(); rna->set_transcript_length( -1 ); int32_t i; for ( i = 0 ; i < genome_length ; i++ ) { if ( is_terminator( LAGGING, transcript_start - i ) ) { // Found terminator => set transcript's length rna->set_transcript_length( i + TERM_SIZE ); // Deduce the length of all the RNAs that share the same terminator // These are the RNAs whose promoter is entirely (and strictly) included // between the promoter and the terminator of the RNA we have just treated. // They are hence the RNAs whose promoter starts at most i bases after the // current rna's promoter ae_list_node* rna_node_2 = rna_node->get_next(); ae_rna* rna_2 = NULL; while ( rna_node_2 != NULL ) { rna_2 = rna_node_2->get_obj(); // We know rna_2 is after rna => rna_2->pos < rna->pos (LAGGING strand) because the list is sorted if ( rna->get_promoter_pos() - rna_2->get_promoter_pos() <= i ) { rna_2->set_transcript_length( i - (rna->get_promoter_pos() - rna_2->get_promoter_pos()) + TERM_SIZE ); // Step forward in RNA list rna_node = rna_node_2; } else { // The promoter of rna_2 is after (or contains a part of) the terminator of rna, // we will need to search its own terminator break; } rna_node_2 = rna_node_2->get_next(); } // Terminator found for this RNA, nothing else to do (for this RNA) break; } } if (i == genome_length) { // We have searched the whole genome and found no terminator for this promoter. // We consider that no RNA can actually be produced, hence we set the transcript // length to -1. This will prevent the search for coding sequences downstream of this promoter. // However, we do not destroy the ae_rna object, it must still be kept in memory and // transmitted to the offspring in case a mutation recreates a terminator. rna->set_transcript_length( -1 ); } rna_node = rna_node->get_next(); } /******************** DEBUG (print rnas' sequences, positions and strands ********************/ /*for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { rna_node = _rna_list[strand]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); char* seq = new char[PROM_SIZE + rna->get_transcript_length() + 1]; //~ if ( rna->get_promoter_pos() + PROM_SIZE + rna->get_transcript_length() < _dna->get_length() ) //~ { //~ memcpy( seq, &_dna->get_data()[rna->get_promoter_pos()], PROM_SIZE + rna->get_transcript_length() ); //~ } //~ else //~ { //~ memcpy( seq, &_dna->get_data()[rna->get_promoter_pos()], _dna->get_length() - rna->get_promoter_pos() ); //~ memcpy( &seq[_dna->get_length() - rna->get_promoter_pos()], _dna->get_data(), //~ PROM_SIZE + rna->get_transcript_length() - (_dna->get_length() - rna->get_promoter_pos()) ); //~ } //~ seq[PROM_SIZE + rna->get_transcript_length() ] = '\0'; //~ printf( "rna seq : %s\n", seq ); printf( "RNA at pos : %"PRId32" length : %"PRId32"\n", rna->get_promoter_pos(), rna->get_transcript_length() ); printf( " strand : %s basal_level : %f\n", (rna->get_strand() == LEADING)?"LEADING":"LAGGING", rna->get_basal_level() ); //~ getchar(); rna_node = rna_node->get_next(); } }*/ /******************** END DEBUG ********************/ } void ae_genetic_unit::do_translation( void ) { if ( _translated ) return; _translated = true; if ( ! _transcribed ) do_transcription(); ae_list_node* rna_node = NULL; ae_rna* rna = NULL; int32_t transcript_start = -1; int32_t transcript_length = -1; int32_t genome_length = _dna->get_length(); // ---------------- // LEADING strand // ---------------- rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); transcript_start = rna->get_first_transcribed_pos(); transcript_length = rna->get_transcript_length(); // Try every position where a translation process could occur // Minimum number of bases needed is SHINE_DAL_SIZE + SHINE_START_SPACER + 3 * CODON_SIZE // (3 codons for START + STOP + at least one amino-acid) for ( int32_t i = 0 ; transcript_length - i >= SHINE_DAL_SIZE + SHINE_START_SPACER + 3 * CODON_SIZE ; i++ ) { if ( ( is_shine_dalgarno( LEADING, ae_utils::mod(transcript_start + i, genome_length) ) ) && ( is_start( LEADING, ae_utils::mod(transcript_start + i + SHINE_DAL_SIZE + SHINE_START_SPACER, genome_length) ) ) ) { // We found a translation initiation, we can now build the protein until we find a STOP codon or until we reach the end // of the transcript (in which case the protein is not valid) // First of all, we will check whether this CDS has already been translated (because it is present on another RNA // In that case, we don't need to tranlate it again, we only need to increase the protein's concentration according to // the promoter transcription level int32_t shine_dal_pos = ae_utils::mod(transcript_start + i, genome_length); ae_list_node* protein_node = _protein_list[LEADING]->bsearch( &shine_dal_pos, compare_prot_pos ); if ( protein_node != NULL ) { ae_protein* protein = protein_node->get_obj(); protein->add_RNA( rna ); rna->add_transcribed_protein( protein ); } else { // Build codon list and make new protein when stop found int32_t j = i + SHINE_DAL_SIZE + SHINE_START_SPACER + CODON_SIZE; // next codon to examine ae_codon* codon; ae_list* codon_list = new ae_list(); //~ int32_t nb_m, nb_w, nb_h; // Number of M, W, H-codons found in the gene //~ nb_m = nb_w = nb_h = 0; // TODO : usefull? while ( (transcript_length - j >= CODON_SIZE) ) { codon = new ae_codon( _dna, LEADING, ae_utils::mod(transcript_start + j, genome_length) ); if ( codon->is_stop() ) { if ( codon_list->is_empty() == false ) // at least one amino-acid { // The protein is valid, create the corresponding object ae_protein* protein; #ifndef __REGUL protein = new ae_protein( this, codon_list, LEADING, shine_dal_pos, rna ); #else protein = new ae_protein_R( this, codon_list, LEADING, shine_dal_pos, rna ); #endif // The codon list will be kept in the protein codon_list = NULL; _protein_list[LEADING]->add( protein ); rna->add_transcribed_protein( protein ); if ( protein->get_is_functional() ) { _nb_fun_genes++; //~ _overall_size_fun_genes += ( protein->get_length() + 2 ) * CODON_SIZE; _overall_size_fun_genes += protein->get_length() * CODON_SIZE; if ( protein->get_height() > 0 ) _nb_genes_activ++; else _nb_genes_inhib++; } else { _nb_non_fun_genes++; //~ _overall_size_non_fun_genes += ( protein->get_length() + 2 ) * CODON_SIZE; _overall_size_non_fun_genes += protein->get_length() * CODON_SIZE; } } delete codon; break; } else { codon_list->add( codon ); } j += CODON_SIZE; } // The codon list is no longer useful, delete it with all its items // TODO : memory leek in RAEVOL? // #ifndef __REGUL if ( codon_list != NULL ) { codon_list->erase( true ); delete codon_list; } // #endif } } } // Statistics if ( ! rna->get_transcribed_proteins()->is_empty() ) // coding RNA { _nb_coding_RNAs++; _overall_size_coding_RNAs += rna->get_transcript_length(); } else // non-coding RNA { _nb_non_coding_RNAs++; _overall_size_non_coding_RNAs += rna->get_transcript_length(); } rna_node = rna_node->get_next(); } // ---------------- // LAGGING strand // ---------------- rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); transcript_start = rna->get_first_transcribed_pos(); transcript_length = rna->get_transcript_length(); // Try every position where a translation process could occur // Minimum number of bases needed is SHINE_DAL_SIZE + SHINE_START_SPACER + 3 * CODON_SIZE // (3 codons for START + STOP + at least one amino-acid) for ( int32_t i = 0 ; transcript_length - i >= SHINE_DAL_SIZE + SHINE_START_SPACER + 3 * CODON_SIZE ; i++ ) { if ( ( is_shine_dalgarno( LAGGING, ae_utils::mod(transcript_start - i, genome_length) ) ) && ( is_start( LAGGING, ae_utils::mod(transcript_start - i - SHINE_DAL_SIZE - SHINE_START_SPACER, genome_length) ) ) ) { // We found a translation initiation, we can now build the protein until we find a STOP codon or until we reach the end // of the transcript (in which case the protein is not valid) // First of all, we will check whether this CDS has already been translated (because it is present on another RNA // In that case, we don't need to tranlate it again, we only need to increase the protein's concentration according to // the promoter strength int32_t shine_dal_pos = ae_utils::mod(transcript_start - i, genome_length); ae_list_node* protein_node = _protein_list[LAGGING]->bsearch( &shine_dal_pos, compare_prot_pos ); if ( protein_node != NULL ) { ae_protein* protein = protein_node->get_obj(); protein->add_RNA( rna ); rna->add_transcribed_protein( protein ); } else { // Build codon list and make new protein when stop found int32_t j = i + SHINE_DAL_SIZE + SHINE_START_SPACER + CODON_SIZE; // next codon to examine ae_codon* codon; ae_list* codon_list = new ae_list(); //~ int32_t nb_m, nb_w, nb_h; // Number of M, W, H-codons found in the gene //~ nb_m = nb_w = nb_h = 0; while ( (transcript_length - j >= CODON_SIZE) ) { codon = new ae_codon( _dna, LAGGING, ae_utils::mod(transcript_start - j, genome_length) ); if ( codon->is_stop() ) { if ( codon_list->is_empty() == false ) // at least one amino-acid { // The protein is valid, create the corresponding object ae_protein* protein; #ifndef __REGUL protein = new ae_protein( this, codon_list, LAGGING, shine_dal_pos, rna ); #else protein = new ae_protein_R( this, codon_list, LAGGING, shine_dal_pos, rna ); #endif // The codon list will be kept in the protein codon_list = NULL; _protein_list[LAGGING]->add( protein ); rna->add_transcribed_protein( protein ); if ( protein->get_is_functional() ) { _nb_fun_genes++; //~ _overall_size_fun_genes += ( protein->get_length() + 2 ) * CODON_SIZE; _overall_size_fun_genes += protein->get_length() * CODON_SIZE; if ( protein->get_height() > 0 ) _nb_genes_activ++; else _nb_genes_inhib++; } else { _nb_non_fun_genes++; _overall_size_non_fun_genes += ( protein->get_length() + 2 ) * CODON_SIZE; } } delete codon; break; } else { codon_list->add( codon ); } j += CODON_SIZE; } // The codon list is no longer useful, delete it with all its items // TODO : memory leek in RAEVOL? // #ifndef __REGUL if ( codon_list != NULL ) { codon_list->erase( true ); delete codon_list; } // #endif } } } // Statistics if ( ! rna->get_transcribed_proteins()->is_empty() ) // coding RNA { _nb_coding_RNAs++; _overall_size_coding_RNAs += rna->get_transcript_length(); } else // non-coding RNA { _nb_non_coding_RNAs++; _overall_size_non_coding_RNAs += rna->get_transcript_length(); } rna_node = rna_node->get_next(); } } void ae_genetic_unit::compute_phenotypic_contribution( void ) { if ( _phenotypic_contributions_computed ) return; _phenotypic_contributions_computed = true; if ( ! _translated ) do_translation(); ae_list_node* prot_node; ae_protein* prot; // LEADING strand prot_node = _protein_list[LEADING]->get_first(); while ( prot_node != NULL ) { prot = prot_node->get_obj(); if ( prot->get_is_functional() ) { if ( prot->get_height() > 0 ) { _activ_contribution->add_triangle( prot->get_mean(), prot->get_width(), prot->get_height() * prot->get_concentration() ); } else { _inhib_contribution->add_triangle( prot->get_mean(), prot->get_width(), prot->get_height() * prot->get_concentration() ); } } prot_node = prot_node->get_next(); } // LAGGING strand prot_node = _protein_list[LAGGING]->get_first(); while ( prot_node != NULL ) { prot = prot_node->get_obj(); if ( prot->get_is_functional() ) { if ( prot->get_height() > 0 ) { _activ_contribution->add_triangle( prot->get_mean(), prot->get_width(), prot->get_height() * prot->get_concentration() ); } else { _inhib_contribution->add_triangle( prot->get_mean(), prot->get_width(), prot->get_height() * prot->get_concentration() ); } } prot_node = prot_node->get_next(); } // It is not necessary to add a lower bound to _activ_contribution as there can be no negative y // The same goes for the upper bound for _inhib_contribution _activ_contribution->add_upper_bound( Y_MAX ); _inhib_contribution->add_lower_bound( - Y_MAX ); _activ_contribution->simplify(); _inhib_contribution->simplify(); if ( _exp_m->get_output_m()->get_compute_phen_contrib_by_GU() ) { _phenotypic_contribution = new ae_phenotype(); _phenotypic_contribution->add( _activ_contribution ); _phenotypic_contribution->add( _inhib_contribution ); _phenotypic_contribution->simplify(); } } /*! \brief Compute the areas between the phenotype and the environment for each environmental segment. If the environment is not segmented, the total area is computed */ void ae_genetic_unit::compute_distance_to_target( ae_environment* env ) { if ( _distance_to_target_computed ) return; // _distance_to_target has already been computed, nothing to do. _distance_to_target_computed = true; compute_phenotypic_contribution(); // Compute the difference between the (whole) phenotype and the environment ae_fuzzy_set* delta = new ae_fuzzy_set( *_phenotypic_contribution ); delta->sub( env ); ae_env_segment** segments = env->get_segments(); // TODO : We should take into account that we compute the areas in order (from the leftmost segment, rightwards) // => We shouldn't parse the whole list of points on the left of the segment we are considering (we have // already been through them!) if ( _dist_to_target_per_segment == NULL ) { _dist_to_target_per_segment = new double [env->get_nb_segments()]; // Can not be allocated in constructor because number of segments is then unknow } for ( int16_t i = 0 ; i < env->get_nb_segments() ; i++ ) { _dist_to_target_per_segment[i] = delta->get_geometric_area( segments[i]->start, segments[i]->stop ); _dist_to_target_by_feature[segments[i]->feature] += _dist_to_target_per_segment[i]; } delete delta; } /*! \brief Compute a "proper" fitness value (one that increases when the individual is fitter). The behaviour of this function depends on many parameters and most notably on whether it is a "composite" fitness or not, and on the selection scheme. */ void ae_genetic_unit::compute_fitness( ae_environment* env ) { if ( _fitness_computed ) return; // Fitness has already been computed, nothing to do. _fitness_computed = true; #ifdef NORMALIZED_FITNESS for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { if (env->get_area_by_feature(i)==0.) { _fitness_by_feature[i] = 0.; } else { _fitness_by_feature[i] = ( env->get_area_by_feature(i) - _dist_to_target_by_feature[i] ) / env->get_area_by_feature(i); if ( (_fitness_by_feature[i] < 0.) && (i != METABOLISM) ) // non-metabolic fitness can NOT be lower than zero (we do not want individual to secrete a negative quantity of public good) { _fitness_by_feature[i] = 0.; } } } if ((! _indiv->get_placed_in_population()) || (! _exp_m->get_with_secretion() )) { _fitness = _fitness_by_feature[METABOLISM]; } else { _fitness = _fitness_by_feature[METABOLISM] * ( 1 + _exp_m->get_secretion_contrib_to_fitness() * ( _indiv->get_grid_cell()->get_compound_amount() - _exp_m->get_secretion_cost() * _fitness_by_feature[SECRETION] ) ); } if ( _exp_m->get_selection_scheme() == FITNESS_PROPORTIONATE ) // Then the exponential selection is integrated inside the fitness value { _fitness = exp( -_exp_m->get_selection_pressure() * (1 - _fitness) ); } #else for ( int8_t i = 0 ; i < NB_FEATURES ; i++ ) { if ( i == SECRETION ) { _fitness_by_feature[SECRETION] = exp( -_exp_m->get_selection_pressure() * _dist_to_target_by_feature[SECRETION] ) - exp( -_exp_m->get_selection_pressure() * env->get_area_by_feature(SECRETION) ); if ( _fitness_by_feature[i] < 0 ) { _fitness_by_feature[i] = 0; } } else { _fitness_by_feature[i] = exp( -_exp_m->get_selection_pressure() * _dist_to_target_by_feature[i] ); } } // Calculate combined, total fitness here! // Multiply the contribution of metabolism and the amount of compound in the environment if ((! _indiv->get_placed_in_population()) || (! _exp_m->get_with_secretion() )) { _fitness = _fitness_by_feature[METABOLISM] ; } else { _fitness = _fitness_by_feature[METABOLISM] * ( 1 + _exp_m->get_secretion_contrib_to_fitness() * _indiv->get_grid_cell()->get_compound_amount() - _exp_m->get_secretion_cost() * _fitness_by_feature[SECRETION] ); } #endif } void ae_genetic_unit::reset_expression( void ) { // useful if the DNA sequence has changed (cf post-treatment programs // which replay mutations) _transcribed = false; _translated = false; _phenotypic_contributions_computed = false; _non_coding_computed = false; // I do not erase the RNA lists, because they were updated // during the mutations (cf ae_dna::undergo_this_mutation) // TODO : Reinitialize _transcribed proteins ? _protein_list[LEADING]->erase(true); _protein_list[LAGGING]->erase(true); if ( _activ_contribution != NULL ) { delete _activ_contribution; _activ_contribution = new ae_fuzzy_set(); } if ( _inhib_contribution != NULL ) { delete _inhib_contribution; _inhib_contribution = new ae_fuzzy_set(); } if ( _phenotypic_contribution != NULL ) { delete _phenotypic_contribution; // Not re-created now, will be conditionally allocated in compute_phenotypic_contribution } init_statistical_data(); } void ae_genetic_unit::print_coding_rnas() { printf( " LEADING \n" ); ae_list_node* a_node = _rna_list[LEADING]->get_first(); ae_rna * rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; printf("Promoter at %"PRId32", last transcribed position at %"PRId32"\n", rna->get_promoter_pos(), rna->get_last_transcribed_pos()); } printf( " LAGGING \n" ); a_node = _rna_list[LAGGING]->get_first(); rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; printf("Promoter at %"PRId32", last transcribed position at %"PRId32"\n", rna->get_promoter_pos(), rna->get_last_transcribed_pos()); } } void ae_genetic_unit::print_rnas( ae_list* rnas, ae_strand strand ) { ae_list_node* rna_node = NULL; ae_rna* rna = NULL; printf( " %s ( %"PRId32" )\n", strand == LEADING ? "LEADING" : "LAGGING", rnas->get_nb_elts() ); rna_node = rnas->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); assert( rna->get_strand() == strand ); printf( " Promoter on %s at %"PRId32"\n", strand == LEADING ? "LEADING" : "LAGGING", rna->get_promoter_pos() ); //~ printf( " length %"PRId32" basal_level %f\n", rna->get_transcript_length(), rna->get_basal_level() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::print_proteins( void ) const { ae_list_node* prot_node = NULL; ae_protein* prot = NULL; printf( " LEADING ( %"PRId32" )\n", _protein_list[LEADING]->get_nb_elts() ); prot_node = _protein_list[LEADING]->get_first(); while ( prot_node != NULL ) { prot = prot_node->get_obj(); printf( " Gene on LEADING at %"PRId32" (%"PRId32") (%f %f %f) (%f) %s\n", prot->get_shine_dal_pos(), prot->get_length(), prot->get_mean(), prot->get_width(), prot->get_height(), prot->get_concentration(), prot->get_is_functional() ? "functional" : "non functional" ); prot_node = prot_node->get_next(); } printf( " LAGGING ( %"PRId32" )\n", _protein_list[LAGGING]->get_nb_elts() ); prot_node = _protein_list[LAGGING]->get_first(); while ( prot_node != NULL ) { prot = prot_node->get_obj(); printf( " Gene on LAGGING at %"PRId32" (%"PRId32") (%f %f %f) (%f) %s\n", prot->get_shine_dal_pos(), prot->get_length(), prot->get_mean(), prot->get_width(), prot->get_height(), prot->get_concentration(), prot->get_is_functional() ? "functional" : "non functional" ); prot_node = prot_node->get_next(); } } bool ae_genetic_unit::is_promoter( ae_strand strand, int32_t pos, int8_t& dist ) const { //~ printf( "=============================================== is_promoter\n" ); //~ printf( "pos : %"PRId32"\n", pos ); const char* genome = _dna->get_data(); int32_t len = _dna->get_length(); dist = 0; if ( strand == LEADING ) { //~ printf( "LEADING\n" ); for ( int16_t i = 0 ; i < PROM_SIZE ; i++ ) { //~ printf( " i : %"PRId32" dist : %"PRId8"\n", i, dist ); if ( genome[(pos+i)%len] != PROM_SEQ[i] ) { dist++; if ( dist > PROM_MAX_DIFF ) { //~ printf( "=============================================== END is_promoter\n" ); return false; } } } } else // ( strand == LAGGING ) { //~ printf( "LAGGING\n" ); for ( int16_t i = 0 ; i < PROM_SIZE ; i++ ) { //~ printf( " i : %"PRId32" dist : %"PRId8"\n", i, dist ); if ( genome[ae_utils::mod((pos-i),len)] == PROM_SEQ[i] ) // == and not != because we are on the complementary strand... { dist++; if ( dist > PROM_MAX_DIFF ) { //~ printf( "=============================================== END is_promoter\n" ); return false; } } } } //~ printf( "=============================================== END is_promoter\n" ); return true; } bool ae_genetic_unit::is_terminator( ae_strand strand, int32_t pos ) const { const char* genome = _dna->get_data(); int32_t len = _dna->get_length(); if ( strand == LEADING ) { for ( int16_t i = 0 ; i < TERM_STEM_SIZE ; i++ ) { if ( genome[ae_utils::mod(pos+i,len)] == genome[ae_utils::mod(pos+(TERM_SIZE-1)-i,len)] ) return false; } } else // ( strand == LAGGING ) { for ( int16_t i = 0 ; i < TERM_STEM_SIZE ; i++ ) { if ( genome[ae_utils::mod(pos-i,len)] == genome[ae_utils::mod(pos-(TERM_SIZE-1)+i,len)] ) return false; } } return true; } bool ae_genetic_unit::is_shine_dalgarno( ae_strand strand, int32_t pos ) const { const char* genome = _dna->get_data(); int32_t len = _dna->get_length(); if ( strand == LEADING ) { for ( int8_t i = 0 ; i < SHINE_DAL_SIZE ; i++ ) { if ( genome[ae_utils::mod((pos+i),len)] != SHINE_DAL_SEQ[i] ) { return false; } } } else // ( strand == LAGGING ) { for ( int8_t i = 0 ; i < SHINE_DAL_SIZE ; i++ ) { if ( genome[ae_utils::mod((pos-i),len)] == SHINE_DAL_SEQ[i] ) // == and not != because we are on the complementary strand... { return false; } } } return true; } int8_t ae_genetic_unit::get_codon( ae_strand strand, int32_t pos ) const { const char* genome = _dna->get_data(); int32_t len = _dna->get_length(); int8_t codon = 0; if ( strand == LEADING ) { for ( int8_t i = 0 ; i < CODON_SIZE ; i++ ) { if ( genome[ae_utils::mod((pos+i),len)] == '1' ) { codon += 1 << ( CODON_SIZE - i - 1 ); //pow( 2, CODON_SIZE - i - 1 ); } } } else // ( strand == LAGGING ) { for ( int8_t i = 0 ; i < CODON_SIZE ; i++ ) { if ( genome[ae_utils::mod((pos-i),len)] != '1' ) // == and not != because we are on the complementary strand... { codon += 1 << ( CODON_SIZE - i - 1 ); //pow( 2, CODON_SIZE - i - 1 ); } } } return codon; } void ae_genetic_unit::compute_non_coding( void ) { if ( _non_coding_computed ) return; _non_coding_computed = true; // Create a table of bools initialized to false (non-coding) int32_t genome_length = _dna->get_length(); // Including Shine-Dalgarno, spacer, START and STOP bool* belongs_to_CDS; bool* belongs_to_functional_CDS; bool* belongs_to_non_functional_CDS; // non-functional CDSs are those that have a null area or that lack a kind of codons (M, W or H) // Including Promoters and terminators bool* belongs_to_RNA; bool* belongs_to_coding_RNA; bool* belongs_to_non_coding_RNA; // Genes + prom + term (but not UTRs) bool* is_essential_DNA; bool* is_essential_DNA_including_nf_genes; // Adds non-functional genes + promoters & terminators bool* is_not_neutral; // prom + term + everything in between (as opposed to neutral) belongs_to_CDS = new bool[genome_length]; belongs_to_functional_CDS = new bool[genome_length]; belongs_to_non_functional_CDS = new bool[genome_length]; belongs_to_RNA = new bool[genome_length]; belongs_to_coding_RNA = new bool[genome_length]; belongs_to_non_coding_RNA = new bool[genome_length]; is_essential_DNA = new bool[genome_length]; is_essential_DNA_including_nf_genes = new bool[genome_length]; is_not_neutral = new bool[genome_length]; memset( belongs_to_CDS, 0, genome_length ); memset( belongs_to_functional_CDS, 0, genome_length ); memset( belongs_to_non_functional_CDS, 0, genome_length ); memset( belongs_to_RNA, 0, genome_length ); memset( belongs_to_coding_RNA, 0, genome_length ); memset( belongs_to_non_coding_RNA, 0, genome_length ); memset( is_essential_DNA, 0, genome_length ); memset( is_essential_DNA_including_nf_genes, 0, genome_length ); memset( is_not_neutral, 0, genome_length ); // Parse protein lists and mark the corresponding bases as coding for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { ae_list_node* prot_node = _protein_list[strand]->get_first(); ae_protein* prot = NULL; while ( prot_node != NULL ) { prot = prot_node->get_obj(); int32_t first; int32_t last; if ( strand == LEADING ) { first = prot->get_shine_dal_pos(); last = prot->get_last_STOP_base_pos(); } else // ( strand == LAGGING ) { last = prot->get_shine_dal_pos(); first = prot->get_last_STOP_base_pos(); } if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_CDS[i] = true; if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_CDS[i] = true; if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_CDS[i] = true; if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } } // Include the promoter and terminator to essential DNA // Mark everything between promoter and terminator as not neutral ae_list_node* rna_node = prot->get_rna_list()->get_first(); ae_rna* rna = NULL; while ( rna_node != NULL ) { rna = rna_node->get_obj(); int32_t prom_first; int32_t prom_last; int32_t term_first; int32_t term_last; int32_t rna_first; int32_t rna_last; if ( strand == LEADING ) { prom_first = rna->get_promoter_pos(); prom_last = ae_utils::mod( prom_first + PROM_SIZE - 1, _dna->get_length() ); term_last = rna->get_last_transcribed_pos(); term_first = ae_utils::mod( term_last - TERM_SIZE + 1, _dna->get_length() ); rna_first = prom_first; rna_last = term_last; } else { prom_last = rna->get_promoter_pos(); prom_first = ae_utils::mod( prom_last - PROM_SIZE + 1, _dna->get_length() ); term_first = rna->get_last_transcribed_pos(); term_last = ae_utils::mod( term_first + TERM_SIZE - 1, _dna->get_length() ); rna_first = term_first; rna_last = prom_last; } //~ printf( "\n" ); //~ if ( strand == LEADING ) printf( "LEADING\n" ); //~ else printf( "LAGGING\n" ); //~ printf( "prom_first : %ld prom_last %ld (size %ld)\n", prom_first, prom_last, _dna->get_length() ); //~ printf( "term_first : %ld term_last %ld (size %ld)\n", term_first, term_last, _dna->get_length() ); //~ getchar(); // Let us begin with "non-neutral" regions... if ( rna_first <= rna_last ) { for ( int32_t i = rna_first ; i <= rna_last ; i++ ) { is_not_neutral[i] = true; } } else { for ( int32_t i = rna_first ; i < genome_length ; i++ ) { is_not_neutral[i] = true; } for ( int32_t i = 0 ; i <= rna_last ; i++ ) { is_not_neutral[i] = true; } } // ...and go on with essential DNA //~ printf( "prom " ); if ( prom_first <= prom_last ) { for ( int32_t i = prom_first ; i <= prom_last ; i++ ) { //~ printf( "%ld ", i ); if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } } else { for ( int32_t i = prom_first ; i < genome_length ; i++ ) { //~ printf( "%ld ", i ); if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } for ( int32_t i = 0 ; i <= prom_last ; i++ ) { //~ printf( "%ld ", i ); if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } } //~ printf( "\n" ); //~ printf( "term " ); if ( term_first <= term_last ) { for ( int32_t i = term_first ; i <= term_last ; i++ ) { //~ printf( "%ld ", i ); if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } } else { for ( int32_t i = term_first ; i < genome_length ; i++ ) { //~ printf( "%ld ", i ); if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } for ( int32_t i = 0 ; i <= term_last ; i++ ) { //~ printf( "%ld ", i ); if ( prot->get_is_functional() ) is_essential_DNA[i] = true; is_essential_DNA_including_nf_genes[i] = true; } } //~ printf( "\n" ); //~ getchar(); rna_node = rna_node->get_next(); } if ( prot->get_is_functional() ) { if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_functional_CDS[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_functional_CDS[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_functional_CDS[i] = true; } } } else // degenerated protein { if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_non_functional_CDS[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_non_functional_CDS[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_non_functional_CDS[i] = true; } } } prot_node = prot_node->get_next(); } } // Parse RNA lists and mark the corresponding bases as coding (only for the coding RNAs) for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { ae_list_node* rna_node = _rna_list[strand]->get_first(); ae_rna* rna = NULL; while ( rna_node != NULL ) { rna = rna_node->get_obj(); int32_t first; int32_t last; if ( strand == LEADING ) { first = rna->get_promoter_pos(); last = rna->get_last_transcribed_pos(); } else // ( strand == LAGGING ) { last = rna->get_promoter_pos(); first = rna->get_last_transcribed_pos(); } if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_RNA[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_RNA[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_RNA[i] = true; } } if ( ! rna->get_transcribed_proteins()->is_empty() ) // coding RNA { if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_coding_RNA[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_coding_RNA[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_coding_RNA[i] = true; } } } else // non coding RNA { if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_non_coding_RNA[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_non_coding_RNA[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_non_coding_RNA[i] = true; } } } rna_node = rna_node->get_next(); } } // Count non-coding bases _nb_bases_in_0_CDS = 0; _nb_bases_in_0_functional_CDS = 0; _nb_bases_in_0_non_functional_CDS = 0; _nb_bases_in_0_RNA = 0; _nb_bases_in_0_coding_RNA = 0; _nb_bases_in_0_non_coding_RNA = 0; _nb_bases_non_essential = 0; _nb_bases_non_essential_including_nf_genes = 0; _nb_bases_in_neutral_regions = 0; _nb_neutral_regions = 0; // We do not know how many neutral regions there will be, but // there should be less than _nb_coding_RNAs + 1 // As we will see, there may be a shift in values so we take size _nb_coding_RNAs + 2 int32_t* tmp_beginning_neutral_regions = new int32_t [ _nb_coding_RNAs + 2 ]; int32_t* tmp_end_neutral_regions = new int32_t [ _nb_coding_RNAs + 2 ]; memset( tmp_beginning_neutral_regions, -1, _nb_coding_RNAs + 2 ); memset( tmp_end_neutral_regions, -1, _nb_coding_RNAs + 2 ); for ( int32_t i = 0 ; i < genome_length ; i++ ) { if ( belongs_to_CDS[i] == false ) { _nb_bases_in_0_CDS++; } if ( belongs_to_functional_CDS[i] == false ) { _nb_bases_in_0_functional_CDS++; } if ( belongs_to_non_functional_CDS[i] == false ) { _nb_bases_in_0_non_functional_CDS++; } if ( belongs_to_RNA[i] == false ) { _nb_bases_in_0_RNA++; } if ( belongs_to_coding_RNA[i] == false ) { _nb_bases_in_0_coding_RNA++; } if ( belongs_to_non_coding_RNA[i] == false ) { _nb_bases_in_0_non_coding_RNA++; } if ( is_essential_DNA[i] == false ) { _nb_bases_non_essential++; } if ( is_essential_DNA_including_nf_genes[i] == false ) { _nb_bases_non_essential_including_nf_genes++; } if ( is_not_neutral[i] == false ) { _nb_bases_in_neutral_regions++; } if ( i != 0 ) { if ( is_not_neutral[i] != is_not_neutral[i-1] ) { if ( is_not_neutral[i-1] == true ) // beginning of a neutral region { tmp_beginning_neutral_regions [ _nb_neutral_regions ] = i; } else // end of a neutral region { tmp_end_neutral_regions [ _nb_neutral_regions ] = i-1; _nb_neutral_regions++; } } } else // i = 0 { // we arbitrarily set 0 as the beginning of a neutral region (linkage with end of genetic unit // will be done later) if ( is_not_neutral[0] == false ) { tmp_beginning_neutral_regions [ _nb_neutral_regions ] = 0; } } } // we have to treat specifically the last base of the genetic unit in order to link neutral regions // at the end and the beginning of genetic unit int32_t shift = 0; if ( is_not_neutral[genome_length-1] == false ) { if ( is_not_neutral[0] == true ) // end of a neutral region { tmp_end_neutral_regions[ _nb_neutral_regions ] = genome_length-1; _nb_neutral_regions++; } else // neutral region goes on after base 0, linkage to be done { if ( _nb_neutral_regions != 0 ) { tmp_end_neutral_regions[ _nb_neutral_regions ] = tmp_end_neutral_regions[ 0 ]; // the first neutral region is only a subpart of the last one, it should not be // taken into account. When we transfer values to the final array, we introduce a shift shift = 1; // we do not ++ _nb_neutral_regions as it was already counted } else // no neutral region detected until now -> all the genetic unit is neutral { // as all the chromosome is neutral, we indicate 0 as the beginning of the region // and genome_length - 1 as its end tmp_end_neutral_regions[ 0 ] = genome_length - 1; _nb_neutral_regions++; } } } // now that we know how many neutral regions there are, we can transfer data to correctly sized arrays assert( _nb_neutral_regions <= _nb_coding_RNAs + 1 ); if ( _beginning_neutral_regions != NULL ) { delete [] _beginning_neutral_regions; } if ( _end_neutral_regions != NULL ) { delete [] _end_neutral_regions; } if ( _nb_neutral_regions > 0 ) // as unlikely as it seems, there may be no neutral region { _beginning_neutral_regions = new int32_t [ _nb_neutral_regions ]; _end_neutral_regions = new int32_t [ _nb_neutral_regions ]; // transfer from tmp to attributes for (int32_t i = 0; i < _nb_neutral_regions; i++) { _beginning_neutral_regions[i] = tmp_beginning_neutral_regions[i+shift]; _end_neutral_regions[i] = tmp_end_neutral_regions[i+shift]; } } else // _nb_neutral_regions == 0 { _beginning_neutral_regions = NULL; _end_neutral_regions = NULL; } delete [] tmp_beginning_neutral_regions; delete [] tmp_end_neutral_regions; delete [] belongs_to_CDS; delete [] belongs_to_functional_CDS; delete [] belongs_to_non_functional_CDS; delete [] belongs_to_RNA; delete [] belongs_to_coding_RNA; delete [] belongs_to_non_coding_RNA; delete [] is_essential_DNA; delete [] is_essential_DNA_including_nf_genes; delete [] is_not_neutral; } void ae_genetic_unit::duplicate_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** duplicated_promoters ) { // 1) Get promoters to be duplicated get_promoters_included_in( pos_1, pos_2, duplicated_promoters ); // 2) Set RNAs' position as their position on the duplicated segment ae_list_node* rna_node = NULL; // -- LEADING -- rna_node = duplicated_promoters[LEADING]->get_first(); while ( rna_node != NULL ) { #ifndef __REGUL // Make a copy of current RNA ae_rna* copy = new ae_rna( this, *(rna_node->get_obj()) ); #else // Make a copy of current RNA ae_rna_R* copy = new ae_rna_R( this, *(rna_node->get_obj()) ); #endif // Set RNA's position as it's position on the duplicated segment copy->shift_position( -pos_1, _dna->get_length() ); // Replace current object by the copy // Do not delete the replaced object as it is still a valid promoter in the individual's promoter list rna_node->set_obj( copy ); rna_node = rna_node->get_next(); } // -- LAGGING -- rna_node = duplicated_promoters[LAGGING]->get_first(); while ( rna_node != NULL ) { #ifndef __REGUL // Make a copy of current RNA ae_rna* copy = new ae_rna( this, *(rna_node->get_obj()) ); #else // Make a copy of current RNA ae_rna_R* copy = new ae_rna_R( this, *(rna_node->get_obj()) ); #endif // Set RNA's position as it's position on the duplicated segment copy->shift_position( -pos_1, _dna->get_length() ); // Replace current object by the copy (don't delete the replaced object as it is still a valid promoter) rna_node->set_obj( copy ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::get_promoters_included_in( int32_t pos_1, int32_t pos_2, ae_list** promoters ) { assert( pos_1 >= 0 && pos_1 <= _dna->get_length() && pos_2 >= 0 && pos_2 <= _dna->get_length() ); if ( pos_1 < pos_2 ) { int32_t seg_length = pos_2 - pos_1; if ( seg_length >= PROM_SIZE ) { get_leading_promoters_starting_between( pos_1, pos_2 - PROM_SIZE + 1, promoters[LEADING] ); get_lagging_promoters_starting_between( pos_1 + PROM_SIZE - 1, pos_2, promoters[LAGGING] ); } } else { int32_t seg_length = _dna->get_length() + pos_2 - pos_1; if ( seg_length >= PROM_SIZE ) { bool is_near_end_of_genome = ( pos_1 + PROM_SIZE > _dna->get_length() ); bool is_near_beginning_of_genome = ( pos_2 - PROM_SIZE < 0 ); if ( !is_near_end_of_genome && !is_near_beginning_of_genome ) { get_leading_promoters_starting_after( pos_1, promoters[LEADING] ); get_leading_promoters_starting_before( pos_2 - PROM_SIZE + 1, promoters[LEADING] ); get_lagging_promoters_starting_before( pos_2, promoters[LAGGING] ); get_lagging_promoters_starting_after( pos_1 + PROM_SIZE - 1, promoters[LAGGING] ); } else if ( !is_near_end_of_genome ) // => && is_near_beginning_of_genome { get_leading_promoters_starting_between( pos_1, pos_2 + _dna->get_length() - PROM_SIZE + 1, promoters[LEADING] ); get_lagging_promoters_starting_before( pos_2, promoters[LAGGING] ); get_lagging_promoters_starting_after( pos_1 + PROM_SIZE - 1, promoters[LAGGING] ); } else if ( !is_near_beginning_of_genome ) // => && is_near_end_of_genome { get_leading_promoters_starting_after( pos_1, promoters[LEADING] ); get_leading_promoters_starting_before( pos_2 - PROM_SIZE + 1, promoters[LEADING] ); get_lagging_promoters_starting_between( pos_1 - _dna->get_length() + PROM_SIZE - 1, pos_2, promoters[LAGGING] ); } else // is_near_end_of_genome && is_near_beginning_of_genome { get_leading_promoters_starting_between( pos_1, pos_2 + _dna->get_length() - PROM_SIZE + 1, promoters[LEADING] ); get_lagging_promoters_starting_between( pos_1 - _dna->get_length() + PROM_SIZE - 1, pos_2, promoters[LAGGING] ); } } } } void ae_genetic_unit::get_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* leading_promoters ) { assert( pos_1 >= 0 && pos_1 < pos_2 && pos_2 <= _dna->get_length() ); // Go to first RNA after pos_1 ae_list_node* rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_1 ) { rna_node = rna_node->get_next(); } // Add RNAs to new_list until we pass pos_2 (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { leading_promoters->add( rna_node->get_obj() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::get_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* lagging_promoters ) { assert( pos_1 >= 0 && pos_1 < pos_2 && pos_2 <= _dna->get_length() ); // Go to first RNA before pos_2 ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_2 ) { rna_node = rna_node->get_next(); } // Add RNAs to new_list until we pass pos_1 (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_1 ) { lagging_promoters->add( rna_node->get_obj() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::get_leading_promoters_starting_after( int32_t pos, ae_list* leading_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); // Go to first RNA after pos ae_list_node* rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { rna_node = rna_node->get_next(); } // Add RNAs to new_list until we reach the end of the list while ( rna_node != NULL ) { leading_promoters->add( rna_node->get_obj() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::get_leading_promoters_starting_before( int32_t pos, ae_list* leading_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = _rna_list[LEADING]->get_first(); // Add RNAs to new_list until we pass pos (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { leading_promoters->add( rna_node->get_obj() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::get_lagging_promoters_starting_before( int32_t pos, ae_list* lagging_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); // Go to first RNA before pos ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { rna_node = rna_node->get_next(); } // Add RNAs to new_list until we reach the end of the list while ( rna_node != NULL ) { lagging_promoters->add( rna_node->get_obj() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::get_lagging_promoters_starting_after( int32_t pos, ae_list* lagging_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); // Add RNAs to new_list until we pass pos (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { lagging_promoters->add( rna_node->get_obj() ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::invert_promoters_included_in( int32_t pos_1, int32_t pos_2 ) { assert( pos_1 >= 0 && pos_1 <= pos_2 && pos_2 <= _dna->get_length() ); int32_t segment_length = pos_2 - pos_1; if ( segment_length >= PROM_SIZE ) { ae_list** inverted_promoters = new ae_list*[2]; inverted_promoters[LEADING] = new ae_list(); inverted_promoters[LAGGING] = new ae_list(); //~ print_rnas(); // 1) Extract the promoters completely included on the segment to be inverted extract_promoters_included_in( pos_1, pos_2, inverted_promoters ); //~ print_rnas( inverted_promoters ); // 2) Invert segment's promoters ae_genetic_unit::invert_promoters( inverted_promoters, pos_1, pos_2 ); // 3) Reinsert the inverted promoters insert_promoters( inverted_promoters ); delete inverted_promoters[LEADING]; delete inverted_promoters[LAGGING]; delete [] inverted_promoters; } } /*! \brief Invert all the promoters of promoter_lists for a sequence of length seq_length. */ /*static*/ void ae_genetic_unit::invert_promoters( ae_list** promoter_lists, int32_t seq_length ) { ae_genetic_unit::invert_promoters( promoter_lists, 0, seq_length ); } /*! \brief Invert all the promoters of promoter_lists knowing that they represent the promoters of a subsequence beginning at pos_1 and ending at pos_2. WARNING : This function is pretty specific, make sure you understand its precise behaviour before using it. */ /*static*/ void ae_genetic_unit::invert_promoters( ae_list** promoter_lists, int32_t pos_1, int32_t pos_2 ) { assert( pos_1 >= 0 && pos_1 <= pos_2 ); // Could check (pos_2 < length) but another parameter would be necessary // Exchange LEADING and LAGGING lists ae_list* tmp = promoter_lists[LEADING]; promoter_lists[LEADING] = promoter_lists[LAGGING]; promoter_lists[LAGGING] = tmp; // Update the position and strand of each promoter to be inverted... ae_list_node* rna_node = NULL; ae_rna* rna = NULL; // ...on the former LAGGING strand (becoming the LEADING strand) rna_node = promoter_lists[LEADING]->get_first(); int i = 0; while ( rna_node != NULL ) { i++; rna = rna_node->get_obj(); assert( rna->get_strand() == LAGGING ); assert( rna->get_promoter_pos() >= pos_1 && rna->get_promoter_pos() < pos_2 ); rna->set_promoter_pos( pos_1 + pos_2 - rna->get_promoter_pos() - 1 ); rna->set_strand( LEADING ); rna_node = rna_node->get_next(); } // ... and on the former LEADING strand (becoming the LAGGING strand) rna_node = promoter_lists[LAGGING]->get_first(); i = 0; while ( rna_node != NULL ) { i++; rna = rna_node->get_obj(); assert( rna->get_strand() == LEADING ); assert( rna->get_promoter_pos() >= pos_1 && rna->get_promoter_pos() < pos_2 ); rna->set_promoter_pos( pos_1 + pos_2 - rna->get_promoter_pos() - 1); rna->set_strand( LAGGING ); rna_node = rna_node->get_next(); } } void ae_genetic_unit::extract_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* extracted_promoters ) { assert( pos_1 >= 0 && pos_1 < pos_2 && pos_2 <= _dna->get_length() ); ae_list_node* rna_node = NULL; // Find the first promoters in the interval ae_list_node* node_first = NULL; rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_1 ) { rna_node = rna_node->get_next(); } if ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { node_first = rna_node; } if ( node_first != NULL ) { // Find the last promoters in the interval ae_list_node* node_last = node_first; while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { node_last = rna_node; rna_node = rna_node->get_next(); } // Extract the promoters (remove them from the individual's list and put them in extracted_promoters) //~ print_rnas(); ae_list* tmp_list = _rna_list[LEADING]->extract_sublist( node_first, node_last ); //~ printf( "----------------------------------------------------\n" ); //~ print_rnas( tmp_list, LEADING ); //~ printf( "-------------------------==========-----------------\n" ); extracted_promoters->merge( tmp_list ); delete tmp_list; } } void ae_genetic_unit::extract_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* extracted_promoters ) { assert( pos_1 >= 0 && pos_1 < pos_2 && pos_2 <= _dna->get_length() ); ae_list_node* rna_node = NULL; // Find the first promoters in the interval (if any) ae_list_node* node_first = NULL; rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_2 ) { rna_node = rna_node->get_next(); } if ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_1 ) { node_first = rna_node; } // BREAKPOINT (contenu de extracted_promoters) if ( node_first != NULL ) { // Find the last promoters in the interval ae_list_node* node_last = NULL; while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_1 ) { node_last = rna_node; rna_node = rna_node->get_next(); } //~ // //~ printf( "_rna_list[LAGGING] (first : %p last : %p)\n", _rna_list[LAGGING]->get_first(), _rna_list[LAGGING]->get_last() ); //~ ae_list_node* anode = _rna_list[LAGGING]->get_first(); //~ while ( anode ) //~ { //~ printf( " node : %p\n", anode ); //~ anode = anode->get_next(); //~ } //~ // // Extract the promoters (remove them from the individual's list and put the in extracted_promoters) //~ printf( "tmp_list = _rna_list[LAGGING]->extract_sublist( %p, %p);\n", node_first, node_last ); ae_list* tmp_list = _rna_list[LAGGING]->extract_sublist( node_first, node_last ); //~ // //~ printf( "tmp_list (first : %p last : %p)\n", tmp_list->get_first(), tmp_list->get_last() ); //~ anode = tmp_list->get_first(); //~ while ( anode ) //~ { //~ printf( " node : %p\n", anode ); //~ anode = anode->get_next(); //~ } //~ printf( "_rna_list[LAGGING] (first : %p last : %p)\n", _rna_list[LAGGING]->get_first(), _rna_list[LAGGING]->get_last() ); //~ anode = _rna_list[LAGGING]->get_first(); //~ while ( anode ) //~ { //~ printf( " node : %p\n", anode ); //~ anode = anode->get_next(); //~ } //~ // extracted_promoters->merge( tmp_list ); delete tmp_list; } } void ae_genetic_unit::extract_leading_promoters_starting_after( int32_t pos, ae_list* extracted_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = NULL; // Find the first promoters in the interval ae_list_node* node_first = NULL; rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { rna_node = rna_node->get_next(); } node_first = rna_node; if ( node_first != NULL ) { // Extract the promoters (remove them from the individual's list and put the in extracted_promoters) ae_list* tmp_list = _rna_list[LEADING]->extract_ending_sublist( node_first ); extracted_promoters->merge( tmp_list ); delete tmp_list; } } void ae_genetic_unit::extract_leading_promoters_starting_before( int32_t pos, ae_list* extracted_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = NULL; // Find the last promoters in the interval rna_node = _rna_list[LEADING]->get_first(); // Find the last promoters in the interval ae_list_node* node_last = NULL; while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { node_last = rna_node; rna_node = rna_node->get_next(); } if ( node_last != NULL ) { // Extract the promoters (remove them from the individual's list and put the in extracted_promoters) ae_list* tmp_list = _rna_list[LEADING]->extract_starting_sublist( node_last ); extracted_promoters->merge( tmp_list ); delete tmp_list; } } void ae_genetic_unit::extract_lagging_promoters_starting_before( int32_t pos, ae_list* extracted_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = NULL; // Find the first promoters in the interval ae_list_node* node_first = NULL; rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { rna_node = rna_node->get_next(); } node_first = rna_node; if ( node_first != NULL ) { // Extract the promoters (remove them from the individual's list and put the in extracted_promoters) ae_list* tmp_list = _rna_list[LAGGING]->extract_ending_sublist( node_first ); extracted_promoters->merge( tmp_list ); delete tmp_list; } } void ae_genetic_unit::extract_lagging_promoters_starting_after( int32_t pos, ae_list* extracted_promoters ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = NULL; // Find the last promoters in the interval rna_node = _rna_list[LAGGING]->get_first(); // Find the last promoters in the interval ae_list_node* node_last = NULL; while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { node_last = rna_node; rna_node = rna_node->get_next(); } if ( node_last != NULL ) { // Extract the promoters (remove them from the individual's list and put the in extracted_promoters) ae_list* tmp_list = _rna_list[LAGGING]->extract_starting_sublist( node_last ); extracted_promoters->merge( tmp_list ); delete tmp_list; } } /*! \brief Shift all the promoters in by in a sequence of length . Every promoter in double stranded list will be shifted by , then a modulo will be applied */ /*static*/ void ae_genetic_unit::shift_promoters( ae_list** promoters_to_shift, int32_t delta_pos, int32_t seq_length ) { ae_list_node* rna_node = NULL; // -- LEADING -- rna_node = promoters_to_shift[LEADING]->get_first(); while ( rna_node != NULL ) { rna_node->get_obj()->shift_position( delta_pos, seq_length ); rna_node = rna_node->get_next(); } // -- LAGGING -- rna_node = promoters_to_shift[LAGGING]->get_first(); while ( rna_node != NULL ) { rna_node->get_obj()->shift_position( delta_pos, seq_length ); rna_node = rna_node->get_next(); } } /*! \brief Insert promoters in double stranded list into _rna_list>. The promoters in must already be at their rightful position according to and the positions of the promoters from and _rna_list> must not be interlaced i.e. no promoter in _rna_list> must have a position in [first_prom_to_insert->pos ; last_prom_to_insert->pos] */ void ae_genetic_unit::insert_promoters( ae_list** promoters_to_insert ) { ae_list_node* rna_node = NULL; ae_list_node* rna_node_to_insert = NULL; // -- LEADING -- if ( promoters_to_insert[LEADING]->get_nb_elts() > 0 ) { // Get to the right position in individual's list (first promoter after the inserted segment) int32_t pos_last_leading_to_insert = promoters_to_insert[LEADING]->get_last()->get_obj()->get_promoter_pos(); rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_last_leading_to_insert ) { rna_node = rna_node->get_next(); } // Insert the promoters in the individual's RNA list rna_node_to_insert = promoters_to_insert[LEADING]->get_first(); while ( rna_node_to_insert != NULL ) { if ( rna_node != NULL ) { _rna_list[LEADING]->add_before( rna_node_to_insert->get_obj(), rna_node ); } else { _rna_list[LEADING]->add( rna_node_to_insert->get_obj() ); } rna_node_to_insert = rna_node_to_insert->get_next(); } } // -- LAGGING -- if ( promoters_to_insert[LAGGING]->get_nb_elts() > 0 ) { // Get to the right position in individual's list (first promoter after the inserted segment) int32_t pos_last_lagging_to_insert = promoters_to_insert[LAGGING]->get_last()->get_obj()->get_promoter_pos(); rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_last_lagging_to_insert ) { rna_node = rna_node->get_next(); } // Insert the promoters in the individual's RNA list rna_node_to_insert = promoters_to_insert[LAGGING]->get_first(); while ( rna_node_to_insert != NULL ) { if ( rna_node != NULL ) { _rna_list[LAGGING]->add_before( rna_node_to_insert->get_obj(), rna_node ); } else { _rna_list[LAGGING]->add( rna_node_to_insert->get_obj() ); } rna_node_to_insert = rna_node_to_insert->get_next(); } } } /*! Insert promoters in double stranded list into _rna_list> at position The promoters in must be at their rightful position according to a stand-alone sequence (i.e. at a RELATIVE position). Their position will be updated automatically. */ void ae_genetic_unit::insert_promoters_at( ae_list** promoters_to_insert, int32_t pos ) { ae_list_node* rna_node = NULL; ae_list_node* inserted_rna_node = NULL; // -- LEADING -- if ( promoters_to_insert[LEADING]->get_nb_elts() > 0 ) { // Get to the right position in individual's list (first promoter after the inserted segment) rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { rna_node = rna_node->get_next(); } // Insert the promoters in the individual's RNA list inserted_rna_node = promoters_to_insert[LEADING]->get_first(); while ( inserted_rna_node != NULL ) { // Update promoter position inserted_rna_node->get_obj()->shift_position( pos, _dna->get_length() ); // Insert if ( rna_node != NULL ) { _rna_list[LEADING]->add_before( inserted_rna_node->get_obj(), rna_node ); } else { _rna_list[LEADING]->add( inserted_rna_node->get_obj() ); } inserted_rna_node = inserted_rna_node->get_next(); } } // -- LAGGING -- if ( promoters_to_insert[LAGGING]->get_nb_elts() > 0 ) { // Get to the right position in individual's list (first promoter after the inserted segment) rna_node = _rna_list[LAGGING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { rna_node = rna_node->get_next(); } // Insert the duplicated promoters in the individual's RNA list inserted_rna_node = promoters_to_insert[LAGGING]->get_first(); while ( inserted_rna_node != NULL ) { // Update promoter position inserted_rna_node->get_obj()->shift_position( pos, _dna->get_length() ); // Insert if ( rna_node != NULL ) { _rna_list[LAGGING]->add_before( inserted_rna_node->get_obj(), rna_node ); } else { _rna_list[LAGGING]->add( inserted_rna_node->get_obj() ); } inserted_rna_node = inserted_rna_node->get_next(); } } } /*! \brief Remove the RNAs of the LEADING strand whose starting positions lie in [pos_1 ; pos_2[ */ void ae_genetic_unit::remove_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2 ) { assert( pos_1 >= 0 && pos_1 < _dna->get_length() && pos_2 >= 0 && pos_2 <= _dna->get_length() ); if ( pos_1 > pos_2 ) { remove_leading_promoters_starting_after( pos_1 ); remove_leading_promoters_starting_before( pos_2 ); } else { ae_list_node* rna_node = _rna_list[LEADING]->get_first(); // Go to first RNA after pos_1 while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_1 ) { rna_node = rna_node->get_next(); } // Delete RNAs until we pass pos_2 (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { ae_list_node* next_node = rna_node->get_next(); //~ printf( "remove LEADING promoter at [%"PRId32", %"PRId32"]\n", rna_node->get_obj()->get_promoter_pos(), //~ ae_utils::mod( rna_node->get_obj()->get_promoter_pos() + PROM_SIZE, _dna->get_length() ) ); _rna_list[LEADING]->remove( rna_node, true, true ); rna_node = next_node; } } } /*! \brief Remove the RNAs of the LAGGING strand whose starting positions lie in [pos_1 ; pos_2[ NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::remove_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2 ) { assert( pos_1 >= 0 && pos_1 <= _dna->get_length() && pos_2 >= 0 && pos_2 <= _dna->get_length() ); if ( pos_1 == _dna->get_length() ) pos_1 = 0; if ( pos_2 == 0 ) pos_2 = _dna->get_length(); if ( pos_1 > pos_2 ) { remove_lagging_promoters_starting_after( pos_1 ); remove_lagging_promoters_starting_before( pos_2 ); } else { ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); // Go to first RNA before pos_2 while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_2 ) { rna_node = rna_node->get_next(); } // Delete RNAs until we pass pos_1 (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos_1 ) { ae_list_node* next_node = rna_node->get_next(); //~ printf( "remove LAGGING promoter at [%"PRId32", %"PRId32"]\n", rna_node->get_obj()->get_promoter_pos(), //~ ae_utils::mod( rna_node->get_obj()->get_promoter_pos() - PROM_SIZE, _dna->get_length() ) ); _rna_list[LAGGING]->remove( rna_node, true, true ); rna_node = next_node; } } } /*! \brief Remove the promoters from the LEADING strand whose starting positions are < pos */ void ae_genetic_unit::remove_leading_promoters_starting_before( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = _rna_list[LEADING]->get_first(); // Delete RNAs until we reach pos (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { ae_list_node* next_node = rna_node->get_next(); _rna_list[LEADING]->remove( rna_node, true, true ); rna_node = next_node; } } /*! \brief Remove the promoters from the LAGGING strand whose starting positions are < pos NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::remove_lagging_promoters_starting_before( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = _rna_list[LAGGING]->get_last(); // Delete RNAs until we reach pos (or we reach the beginning of the list ) ae_list_node* prev_node = NULL; while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { prev_node = rna_node->get_prev(); _rna_list[LAGGING]->remove( rna_node, true, true ); rna_node = prev_node; } } /*! \brief Remove the promoters from the LEADING strand whose starting positions are >= pos */ void ae_genetic_unit::remove_leading_promoters_starting_after( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); ae_list_node* rna_node = _rna_list[LEADING]->get_last(); // Delete RNAs until we pass pos ( or we reach the beginning of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { ae_list_node* prev_node = rna_node->get_prev(); //~ printf( "remove LEADING promoter at [%"PRId32", %"PRId32"]\n", rna_node->get_obj()->get_promoter_pos(), //~ ae_utils::mod( rna_node->get_obj()->get_promoter_pos() + PROM_SIZE, _dna->get_length() ) ); _rna_list[LEADING]->remove( rna_node, true, true ); rna_node = prev_node; } } /*! \brief Remove the promoters from the LAGGING strand whose starting positions are >= pos NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::remove_lagging_promoters_starting_after( int32_t pos ) { assert( pos < _dna->get_length() && pos >= 0 ); ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); // Delete RNAs until we pass pos (or we reach the end of the list) ae_list_node* next_node = NULL; while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { next_node = rna_node->get_next(); //~ printf( "remove LAGGING promoter at [%"PRId32", %"PRId32"]\n", rna_node->get_obj()->get_promoter_pos(), //~ ae_utils::mod( rna_node->get_obj()->get_promoter_pos() - PROM_SIZE, _dna->get_length() ) ); _rna_list[LAGGING]->remove( rna_node, true, true ); rna_node = next_node; } } /*! \brief Look for new promoters on the LEADING strand whose starting positions would lie in [pos_1 ; pos_2[ */ void ae_genetic_unit::look_for_new_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2 ) { assert( pos_1 >= 0 && pos_1 < _dna->get_length() && pos_2 >= 0 && pos_2 < _dna->get_length() ); // When pos_1 > pos_2, we will perform the search in 2 steps. // As positions 0 and _dna->get_length() are equivalent, it's preferable to // keep 0 for pos_1 and _dna->get_length() for pos_2. //~ if ( pos_2 == 0 ) pos_2 = _dna->get_length(); if ( pos_1 >= pos_2 ) { look_for_new_leading_promoters_starting_after( pos_1 ); look_for_new_leading_promoters_starting_before( pos_2 ); } else { int8_t dist; // Hamming distance of the sequence from the promoter consensus for ( int32_t i = pos_1 ; i < pos_2 ; i++ ) { if ( is_promoter( LEADING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { //~ char tmp[255]; //~ memcpy( tmp, &_dna->get_data()[i], PROM_SIZE * sizeof(char) ); //~ printf( "new promoter found on the LEADING strand at position %"PRId32" : %s\n", i, tmp ); // Look for the right place to insert the new promoter in the list ae_list_node* rna_node = _rna_list[LEADING]->get_first(); while( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < i ) { rna_node = rna_node->get_next(); } if ( rna_node == NULL ) { // Add at the end of the list #ifndef __REGUL _rna_list[LEADING]->add( new ae_rna( this, LEADING, i, dist ) ); #else _rna_list[LEADING]->add( new ae_rna_R( this, LEADING, i, dist ) ); #endif } else if ( rna_node->get_obj()->get_promoter_pos() != i ) // If not already in list { // Add before rna_node #ifndef __REGUL _rna_list[LEADING]->add_before( new ae_rna( this, LEADING, i, dist ), rna_node ); #else _rna_list[LEADING]->add_before( new ae_rna_R( this, LEADING, i, dist ), rna_node ); #endif } } } } } /*! \brief Look for new promoters on the LAGGIN strand whose starting positions would lie in [pos_1 ; pos_2[ NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::look_for_new_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2 ) { assert( pos_1 >= 0 && pos_1 < _dna->get_length() && pos_2 >= 0 && pos_2 < _dna->get_length() ); // When pos_1 > pos_2, we will perform the search in 2 steps. // As positions 0 and _dna->get_length() are equivalent, it's preferable to // keep 0 for pos_1 and _dna->get_length() for pos_2. //~ if ( pos_1 == _dna->get_length() ) pos_1 = 0; //~ if ( pos_2 == 0 ) pos_2 = _dna->get_length(); if ( pos_1 >= pos_2 ) { look_for_new_lagging_promoters_starting_after( pos_1 ); look_for_new_lagging_promoters_starting_before( pos_2 ); } else { int8_t dist; // Hamming distance of the sequence from the promoter consensus ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); for ( int32_t i = pos_2 - 1 ; i >= pos_1 ; i-- ) { if ( is_promoter( LAGGING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { assert ( i >= 0 && i < _dna->get_length() ); // Look for the right place to insert the new promoter in the list while( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() > i ) { rna_node = rna_node->get_next(); } if ( rna_node == NULL ) { // Add at the end of the list #ifndef __REGUL _rna_list[LAGGING]->add( new ae_rna( this, LAGGING, i, dist ) ); #else _rna_list[LAGGING]->add( new ae_rna_R( this, LAGGING, i, dist ) ); #endif } else if ( rna_node->get_obj()->get_promoter_pos() != i ) // If not already in list { // Add before rna_node #ifndef __REGUL _rna_list[LAGGING]->add_before( new ae_rna( this, LAGGING, i, dist ), rna_node ); #else _rna_list[LAGGING]->add_before( new ae_rna_R( this, LAGGING, i, dist ), rna_node ); #endif } } } } } /*! \brief Look for new promoters on the LEADING strand whose starting positions would be >= pos */ void ae_genetic_unit::look_for_new_leading_promoters_starting_after( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); // Hamming distance of the sequence from the promoter consensus int8_t dist; // rna list node used to find the new promoter's place in the list ae_list_node* rna_node = _rna_list[LEADING]->get_first(); for ( int32_t i = pos ; i < _dna->get_length() ; i++ ) { if ( is_promoter( LEADING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { //~ char tmp[255]; //~ memcpy( tmp, &_dna->get_data()[i], PROM_SIZE * sizeof(char) ); //~ printf( "new promoter found on the LEADING strand at position %"PRId32" : %s\n", i, tmp ); // Look for the right place to insert the new promoter in the list while( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < i ) { rna_node = rna_node->get_next(); } if ( rna_node == NULL ) { // Add at the end of the list #ifndef __REGUL _rna_list[LEADING]->add( new ae_rna( this, LEADING, i, dist ) ); #else _rna_list[LEADING]->add( new ae_rna_R( this, LEADING, i, dist ) ); #endif } else if ( rna_node->get_obj()->get_promoter_pos() != i ) // If not already in list { // Add before rna_node #ifndef __REGUL _rna_list[LEADING]->add_before( new ae_rna( this, LEADING, i, dist ), rna_node ); #else _rna_list[LEADING]->add_before( new ae_rna_R( this, LEADING, i, dist ), rna_node ); #endif } } } } /*! \brief Look for new promoters on the LAGGING strand whose starting positions would be >= pos NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::look_for_new_lagging_promoters_starting_after( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); // Hamming distance of the sequence from the promoter consensus int8_t dist; // rna list node used to find the new promoter's place in the list ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); for ( int32_t i = _dna->get_length() - 1 ; i >= pos ; i-- ) { if ( is_promoter( LAGGING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { assert ( i >= 0 && i < _dna->get_length() ); // Look for the right place to insert the new promoter in the list while( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() > i ) { rna_node = rna_node->get_next(); } if ( rna_node == NULL ) { // Add at the end of the list #ifndef __REGUL _rna_list[LAGGING]->add( new ae_rna( this, LAGGING, i, dist ) ); #else _rna_list[LAGGING]->add( new ae_rna_R( this, LAGGING, i, dist ) ); #endif } else if ( rna_node->get_obj()->get_promoter_pos() != i ) // If not already in list { // Add before rna_node #ifndef __REGUL _rna_list[LAGGING]->add_before( new ae_rna( this, LAGGING, i, dist ), rna_node ); #else _rna_list[LAGGING]->add_before( new ae_rna_R( this, LAGGING, i, dist ), rna_node ); #endif } } } } /*! \brief Look for new promoters on the LEADING strand whose starting positions would be < pos */ void ae_genetic_unit::look_for_new_leading_promoters_starting_before( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); // Hamming distance of the sequence from the promoter consensus int8_t dist; // rna list node used to find the new promoter's place in the list ae_list_node* rna_node = _rna_list[LEADING]->get_first(); for ( int32_t i = 0 ; i < pos ; i++ ) { if ( is_promoter( LEADING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { //~ char tmp[255]; //~ memcpy( tmp, &_dna->get_data()[i], PROM_SIZE * sizeof(char) ); //~ printf( "new promoter found on the LEADING strand at position %"PRId32" : %s\n", i, tmp ); // Look for the right place to insert the new promoter in the list while( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < i ) { rna_node = rna_node->get_next(); } if ( rna_node == NULL ) { // Add at the end of the list #ifndef __REGUL _rna_list[LEADING]->add( new ae_rna( this, LEADING, i, dist ) ); #else _rna_list[LEADING]->add( new ae_rna_R( this, LEADING, i, dist ) ); #endif } else if ( rna_node->get_obj()->get_promoter_pos() != i ) // If not already in list { // Add before rna_node #ifndef __REGUL _rna_list[LEADING]->add_before( new ae_rna( this, LEADING, i, dist ), rna_node ); #else _rna_list[LEADING]->add_before( new ae_rna_R( this, LEADING, i, dist ), rna_node ); #endif } } } } /*! \brief Look for new promoters on the LAGGING strand whose starting positions would be < pos NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::look_for_new_lagging_promoters_starting_before( int32_t pos ) { assert( pos >= 0 && pos < _dna->get_length() ); // Hamming distance of the sequence from the promoter consensus int8_t dist; // rna list node used to find the new promoter's place in the list ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); for ( int32_t i = pos - 1 ; i >= 0 ; i-- ) { if ( is_promoter( LAGGING, i, dist ) ) // dist takes the hamming distance of the sequence from the consensus { assert ( i >= 0 && i < _dna->get_length() ); // Look for the right place to insert the new promoter in the list while( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() > i ) { rna_node = rna_node->get_next(); } if ( rna_node == NULL ) { // Add at the end of the list #ifndef __REGUL _rna_list[LAGGING]->add( new ae_rna( this, LAGGING, i, dist ) ); #else _rna_list[LAGGING]->add( new ae_rna_R( this, LAGGING, i, dist ) ); #endif } else if ( rna_node->get_obj()->get_promoter_pos() != i ) // If not already in list { // Add before rna_node #ifndef __REGUL _rna_list[LAGGING]->add_before( new ae_rna( this, LAGGING, i, dist ), rna_node ); #else _rna_list[LAGGING]->add_before( new ae_rna_R( this, LAGGING, i, dist ), rna_node ); #endif } } } } /*! \brief Shift (by delta_post) the positions of the promoters from the LEADING strand whose starting positions are >= pos. */ void ae_genetic_unit::move_all_leading_promoters_after( int32_t pos, int32_t delta_pos ) { ae_list_node* rna_node = _rna_list[LEADING]->get_first(); // Go to first RNA after pos while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos ) { //~ printf( "don't move leading promoter at position %"PRId32"\n", rna_node->get_obj()->get_promoter_pos() ); rna_node = rna_node->get_next(); } // Update all the remaining RNAs while ( rna_node != NULL ) { //~ printf( "move leading promoter at position %"PRId32"\n", rna_node->get_obj()->get_promoter_pos() ); rna_node->get_obj()->shift_position( delta_pos, _dna->get_length() ); //~ printf( "new position : %"PRId32"\n", rna_node->get_obj()->get_promoter_pos() ); rna_node = rna_node->get_next(); } } /*! \brief Shift (by delta_post) the positions of the promoters from the LAGGING strand whose starting positions are >= pos. NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::move_all_lagging_promoters_after( int32_t pos, int32_t delta_pos ) { ae_list_node* rna_node = _rna_list[LAGGING]->get_first(); ae_rna* rna; // Update RNAs until we pass pos (or we reach the end of the list) while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() >= pos ) { rna = rna_node->get_obj(); if ( rna->get_promoter_pos() < pos ) break; rna->shift_position( delta_pos, _dna->get_length() ); rna_node = rna_node->get_next(); } } /*! \brief Copy (into new_promoter_list) the promoters from the LEADING strand whose starting positions lie in [pos_1 ; pos_2[ */ void ae_genetic_unit::copy_leading_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* new_promoter_list ) { // 1) Go to first RNA to copy ae_list_node* rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_1 ) { //~ printf( "don't move leading promoter at position %"PRId32"\n", rna_node->get_obj()->get_promoter_pos() ); rna_node = rna_node->get_next(); } // 2) Copy RNAs if ( pos_1 < pos_2 ) { // Copy from pos_1 to pos_2 while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { new_promoter_list->add( new ae_rna( this, *(rna_node->get_obj()) ) ); rna_node = rna_node->get_next(); } } else { // Copy from pos_1 to the end of the list while ( rna_node != NULL ) { new_promoter_list->add( new ae_rna( this, *(rna_node->get_obj()) ) ); rna_node = rna_node->get_next(); } // Copy from the beginning of the list to pos_2 rna_node = _rna_list[LEADING]->get_first(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { new_promoter_list->add( new ae_rna( this, *(rna_node->get_obj()) ) ); rna_node = rna_node->get_next(); } } } /*! \brief Copy (into new_promoter_list) the promoters from the LAGGING strand whose starting positions lie in [pos_1 ; pos_2[ NOTE : A lagging promoter whose starting position is pos spans [pos-PROM_SIZE+1 ; pos], not [pos-PROM_SIZE ; pos[ Assuming (PROM_SIZE == 4), the LAGGING promoter whose starting position is pos spans the cells filled with X on the following cartoon: \verbatim ------------------------------- | | | X | X | X | X | | | ------------------------------- ^ pos \endverbatim */ void ae_genetic_unit::copy_lagging_promoters_starting_between( int32_t pos_1, int32_t pos_2, ae_list* new_promoter_list ) { // Go to first RNA to copy ae_list_node* rna_node = _rna_list[LAGGING]->get_last(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_1 ) { rna_node = rna_node->get_prev(); } // Copy RNAs if ( pos_1 < pos_2 ) { // Copy from pos_1 to pos_2 while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { new_promoter_list->add_front( new ae_rna( this, *(rna_node->get_obj()) ) ); rna_node = rna_node->get_prev(); } } else { // Copy from pos_1 to the beginning of the list (we are going backwards) while ( rna_node != NULL ) { new_promoter_list->add_front( new ae_rna( this, *(rna_node->get_obj()) ) ); rna_node = rna_node->get_prev(); } // Copy from the end of the list to pos_2 (we are going backwards) rna_node = _rna_list[LAGGING]->get_last(); while ( rna_node != NULL && rna_node->get_obj()->get_promoter_pos() < pos_2 ) { new_promoter_list->add_front( new ae_rna( this, *(rna_node->get_obj()) ) ); rna_node = rna_node->get_prev(); } } } void ae_genetic_unit::save( gzFile backup_file ) { _dna->save( backup_file ); gzwrite( backup_file, &_min_gu_length, sizeof(_min_gu_length) ); gzwrite( backup_file, &_max_gu_length, sizeof(_max_gu_length) ); } int32_t ae_genetic_unit::get_nb_terminators( void ) { int32_t nb_term = 0; if ( _dna->get_length() >= TERM_SIZE ) { for ( int32_t i = 0 ; i < _dna->get_length() ; i++ ) { if ( is_terminator( LEADING, i ) ) // No need to count on both the LEADING and the LAGGING strand // as terminators are "shared" { nb_term++; } } } return nb_term; } #ifdef DEBUG void ae_genetic_unit::assert_promoters( void ) { // Check that the lists are ordered correctly assert_promoters_order(); // Make a backup of the genetic unit's lists of RNAs ae_list** old_rna_list = _rna_list; _rna_list = new ae_list*[2]; _rna_list[LEADING] = new ae_list(); _rna_list[LAGGING] = new ae_list(); locate_promoters(); // Compare lists ae_list_node* node_old = NULL; ae_list_node* node_new = NULL; ae_rna* rna_old = NULL; ae_rna* rna_new = NULL; for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { node_old = old_rna_list[strand]->get_first(); node_new = _rna_list[strand]->get_first(); while ( node_old != NULL || node_new != NULL ) { if( node_old == NULL || node_new == NULL ) { printf( "****************************** NB_ELTS problem ******************************\n" ); printf( "should be : \n" ); print_rnas( _rna_list ); printf( "is : \n" ); print_rnas( old_rna_list ); printf( "****************************************************************************\n" ); printf( " genome length : %"PRId32"\n", _dna->get_length() ); assert( node_old != NULL && node_new != NULL ); } rna_old = node_old->get_obj(); rna_new = node_new->get_obj(); if ( rna_old->get_strand() != rna_new->get_strand() ) { printf( "****************************** STRAND problem ******************************\n" ); printf( "should be : \n" ); print_rnas( _rna_list ); printf( "is : \n" ); print_rnas( old_rna_list ); printf( "****************************************************************************\n" ); printf( " %"PRId32" (%s) : %f vs %"PRId32" (%s) : %f\n", rna_old->get_promoter_pos(), rna_old->get_strand() == LEADING ? "LEADING" : "LAGGING", rna_old->get_basal_level(), rna_new->get_promoter_pos(), rna_new->get_strand() == LEADING ? "LEADING" : "LAGGING", rna_new->get_basal_level() ); printf( " genome length : %"PRId32"\n", _dna->get_length() ); assert( rna_old->get_strand() == rna_new->get_strand() ); } if ( rna_old->get_promoter_pos() != rna_new->get_promoter_pos() ) { printf( "***************************** POSITION problem *****************************\n" ); printf( "should be : \n" ); print_rnas( _rna_list ); printf( "is : \n" ); print_rnas( old_rna_list ); printf( "****************************************************************************\n" ); printf( " %"PRId32" (%s) : %f vs %"PRId32" (%s) : %f\n", rna_old->get_promoter_pos(), rna_old->get_strand() == LEADING ? "LEADING" : "LAGGING", rna_old->get_basal_level(), rna_new->get_promoter_pos(), rna_new->get_strand() == LEADING ? "LEADING" : "LAGGING", rna_new->get_basal_level() ); printf( " genome length : %"PRId32"\n", _dna->get_length() ); assert( rna_old->get_promoter_pos() == rna_new->get_promoter_pos() ); } if ( rna_old->get_basal_level() != rna_new->get_basal_level() ) { printf( "*************************** BASAL LEVEL problem ****************************\n" ); printf( "should be : \n" ); print_rnas( _rna_list ); printf( "is : \n" ); print_rnas( old_rna_list ); printf( "****************************************************************************\n" ); printf( " %"PRId32" (%s) : %f vs %"PRId32" (%s) : %f\n", rna_old->get_promoter_pos(), rna_old->get_strand() == LEADING ? "LEADING" : "LAGGING", rna_old->get_basal_level(), rna_new->get_promoter_pos(), rna_new->get_strand() == LEADING ? "LEADING" : "LAGGING", rna_new->get_basal_level() ); printf( " genome length : %"PRId32"\n", _dna->get_length() ); assert( rna_old->get_basal_level() == rna_new->get_basal_level() ); } node_old = node_old->get_next(); node_new = node_new->get_next(); } } _rna_list[LEADING]->erase( true ); _rna_list[LAGGING]->erase( true ); delete _rna_list[LEADING]; delete _rna_list[LAGGING]; delete [] _rna_list; _rna_list = old_rna_list; } void ae_genetic_unit::assert_promoters_order( void ) { ae_list_node* node1 = NULL; ae_list_node* node2 = NULL; ae_rna* rna1 = NULL; ae_rna* rna2 = NULL; for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { if ( _rna_list[strand]->get_nb_elts() >= 2 ) { node1 = _rna_list[strand]->get_first(); node2 = node1->get_next(); while ( node2 != NULL ) { rna1 = node1->get_obj(); rna2 = node2->get_obj(); if ( strand == LEADING ) { if( rna1->get_promoter_pos() >= rna2->get_promoter_pos() ) { printf( "********************** ORDER problem (LEADING) ***********************\n" ); print_rnas(); printf( "****************************************************************************\n" ); assert( rna1->get_promoter_pos() < rna2->get_promoter_pos() ); } } else { if( rna1->get_promoter_pos() <= rna2->get_promoter_pos() ) { printf( "*********************** ORDER problem (LAGGING) ***********************\n" ); print_rnas(); printf( "****************************************************************************\n" ); assert( rna1->get_promoter_pos() > rna2->get_promoter_pos() ); } } node1 = node2; node2 = node2->get_next(); } } } } #endif /*! \brief Retrieve for each base if it belongs or not to coding RNA \return Boolean table of sequence length size with for each base if it belongs or not to coding RNA */ bool* ae_genetic_unit::is_belonging_to_coding_RNA( void ) { int32_t genome_length = _dna->get_length(); bool* belongs_to_coding_RNA = new bool[genome_length]; memset( belongs_to_coding_RNA,0, genome_length ); // Parse RNA lists and mark the corresponding bases as coding (only for the coding RNAs) for ( int8_t strand = LEADING ; strand <= LAGGING ; strand++ ) { ae_list_node* rna_node = _rna_list[strand]->get_first(); ae_rna* rna = NULL; while ( rna_node != NULL ) { rna = rna_node->get_obj(); int32_t first; int32_t last; if ( strand == LEADING ) { first = rna->get_promoter_pos(); last = rna->get_last_transcribed_pos(); } else // ( strand == LAGGING ) { last = rna->get_promoter_pos(); first = rna->get_last_transcribed_pos(); } if ( ! rna->get_transcribed_proteins()->is_empty() ) // coding RNA { if ( first <= last ) { for ( int32_t i = first ; i <= last ; i++ ) { belongs_to_coding_RNA[i] = true; } } else { for ( int32_t i = first ; i < genome_length ; i++ ) { belongs_to_coding_RNA[i] = true; } for ( int32_t i = 0 ; i <= last ; i++ ) { belongs_to_coding_RNA[i] = true; } } } rna_node = rna_node->get_next(); } } return(belongs_to_coding_RNA); } /*! \brief Remove the bases that are not in coding RNA Remove the bases that are not in coding RNA and test at each loss that fitness is not changed */ void ae_genetic_unit::remove_non_coding_bases( void) { ae_environment* env = _exp_m->get_env() ; reset_expression(); locate_promoters(); _distance_to_target_computed = false; _fitness_computed = false; compute_phenotypic_contribution(); if(_exp_m->get_output_m()->get_compute_phen_contrib_by_GU()) { compute_distance_to_target(env); } compute_fitness(env); double initial_fitness = get_fitness(); int32_t genome_length = _dna->get_length(); bool* belongs_to_coding_RNA = is_belonging_to_coding_RNA(); int32_t non_coding_bases_nb = get_nb_bases_in_0_coding_RNA(); int32_t start = 0; int32_t end = 0; for ( int32_t i = genome_length-1 ; i >= 0 ; i-- ) { if ( belongs_to_coding_RNA[i] == false ) { end = i+1; while((i-1) >=0 && belongs_to_coding_RNA[(i-1)] == false ) { i--; } start = i; _dna->remove(start,end); locate_promoters(); reset_expression(); _distance_to_target_computed = false; _fitness_computed = false; compute_phenotypic_contribution(); if(_exp_m->get_output_m()->get_compute_phen_contrib_by_GU()) { compute_distance_to_target(env); } compute_fitness(env); assert(get_fitness()==initial_fitness); _non_coding_computed = false; non_coding_bases_nb = get_nb_bases_in_0_coding_RNA(); } } locate_promoters(); reset_expression(); _distance_to_target_computed = false; _fitness_computed = false; compute_phenotypic_contribution(); if(_exp_m->get_output_m()->get_compute_phen_contrib_by_GU()) { compute_distance_to_target(env); } compute_fitness(env); assert(get_fitness()==initial_fitness); _non_coding_computed = false; non_coding_bases_nb = get_nb_bases_in_0_coding_RNA(); assert(non_coding_bases_nb==0); delete [] belongs_to_coding_RNA; } /*! \brief Double the bases that are not in coding RNA Double the bases that are not in coding RNA by addition of random bases and test at each addition that fitness is not changed */ void ae_genetic_unit::double_non_coding_bases(void) { ae_environment* env = _exp_m->get_env() ; reset_expression(); locate_promoters(); _distance_to_target_computed = false; _fitness_computed = false; compute_phenotypic_contribution(); if(_exp_m->get_output_m()->get_compute_phen_contrib_by_GU()) { compute_distance_to_target(env); } compute_fitness(env); double initial_fitness = get_fitness(); int32_t genome_length = _dna->get_length(); bool* belongs_to_coding_RNA = is_belonging_to_coding_RNA(); _non_coding_computed = false; int32_t inital_non_coding_bases_nb = get_nb_bases_in_0_coding_RNA(); int32_t start = 0; int32_t end = 0; int32_t length = 0; int32_t pos = 0; char * random_portion = NULL; bool insertion_ok = false; int32_t non_coding_bases_nb_before_fitness = get_nb_bases_in_0_coding_RNA(); int32_t non_coding_bases_nb_after_fitness = get_nb_bases_in_0_coding_RNA(); int32_t non_coding_bases_nb = get_nb_bases_in_0_coding_RNA(); for ( int32_t i = genome_length-1 ; i >= 0 ; i-- ) { if ( belongs_to_coding_RNA[i] == false ) { end = i+1; while((i-1) >=0 && belongs_to_coding_RNA[(i-1)] == false ) { i--; } start = i; length = end-start; insertion_ok = false; while(not insertion_ok) { random_portion = new char [length+1]; for ( int32_t j = 0 ; j < length ; j++ ) { random_portion[j] = '0' + _indiv->get_mut_prng()->random( NB_BASE ); } random_portion[length] = 0; pos = _indiv->get_mut_prng()->random( length )+start; _dna->insert(pos, random_portion); _non_coding_computed = false; non_coding_bases_nb_before_fitness = get_nb_bases_in_0_coding_RNA(); locate_promoters(); reset_expression(); _distance_to_target_computed = false; _fitness_computed = false; compute_phenotypic_contribution(); if(_exp_m->get_output_m()->get_compute_phen_contrib_by_GU()) { compute_distance_to_target(env); } compute_fitness(env); assert(get_fitness()==initial_fitness); _non_coding_computed = false; non_coding_bases_nb_after_fitness = get_nb_bases_in_0_coding_RNA(); if (non_coding_bases_nb_before_fitness != non_coding_bases_nb_after_fitness) { _dna->remove(pos, pos + length); } else { insertion_ok = true; } } _non_coding_computed = false; delete [] random_portion; random_portion = NULL; } } locate_promoters(); reset_expression(); _distance_to_target_computed = false; _fitness_computed = false; compute_phenotypic_contribution(); if(_exp_m->get_output_m()->get_compute_phen_contrib_by_GU()) { compute_distance_to_target(env); } compute_fitness(env); assert(get_fitness()==initial_fitness); _non_coding_computed = false; non_coding_bases_nb = get_nb_bases_in_0_coding_RNA(); assert(non_coding_bases_nb == 2*inital_non_coding_bases_nb); delete [] belongs_to_coding_RNA; } // This is an auxiliary function for the method ae_genetic_unit::compute_nb_of_affected_genes. // The gene should go from 'first' to 'last' in the clockwise sense, implying that 'first' should be: // - the beginning of the promoter if the gene is on the leading strand // - or the end of the terminator if the gene is on the lagging strand. static bool breakpoint_inside_gene(int32_t pos_brkpt, int32_t first, int32_t last) { if (first < last) // most frequent case { if( (first <= pos_brkpt) && (pos_brkpt <= last)) {return true;} else {return false;} } else // special case where the RNA overlaps ori { if( (first <= pos_brkpt) || (pos_brkpt <= last) ) {return true;} else {return false;} } } // This is an auxiliary function for the method ae_genetic_unit::compute_nb_of_affected_genes. // It return true if the gene is totally included in the segment [pos1, pos2]. // The gene should go from 'first' to 'last' in the clockwise sense, implying that 'first' should be: // - the beginning of the promoter if the gene is on the leading strand // - or the end of the terminator if the gene is on the lagging strand. static bool gene_totally_in_segment(int32_t pos1, int32_t pos2, int32_t first, int32_t last) { if ( (first < last) && (pos1 <= pos2) ) { if ( ((first >= pos1) && (first <= pos2)) && ((last >= pos1) && (last <= pos2)) ) {return true; } else {return false;} } else if ( (first < last) && (pos1 > pos2) ) // mut seg in 2 pieces but not the gene { if ( (first >= pos1) || (last <= pos2) ) // the gene is either completely in [pos1, genlen-1] or completely in [0, pos2] { return true; } else return false; } else if ( (first > last) && (pos1 <= pos2) ) // gene in two pieces but not mut seg, the gene cannot be totally included { return false; } else // both mut seg and the gene are in 2 pieces { if ((first >= pos1) && (last <= pos2)) {return true;} else {return false;} } } // WARNING: This method works properly only in the case of a single genetic unit (no plasmid). // Translocations between different genetic units is not managed. void ae_genetic_unit::compute_nb_of_affected_genes(ae_mutation * mut, int & nb_genes_at_breakpoints, int & nb_genes_in_segment, int & nb_genes_in_replaced_segment) { nb_genes_at_breakpoints = 0; nb_genes_in_segment = 0; nb_genes_in_replaced_segment = 0; int32_t genlen = get_seq_length(); // length of the genetic unit, in bp int32_t pos0 = -1, pos1 = -1, pos2 = -1, pos3 = -1, mutlength = -1; int32_t pos1donor = -1, pos2donor = -1, pos3donor = -1; char * seq = NULL; int32_t first, last; bool invert = false; ae_sense sense = DIRECT; ae_mutation_type type = mut->get_mut_type(); switch(type) { case SWITCH: { mut->get_infos_point_mutation(&pos0); mutlength = 1; break; } case S_INS: { mut->get_infos_small_insertion(&pos0, &mutlength); break; } case S_DEL: { mut->get_infos_small_deletion(&pos0, &mutlength); break; } case DUPL: { mut->get_infos_duplication(&pos1, &pos2, &pos0); // pos2 is actually not included in the segment, the real end of the segment is pos2 - 1 pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case DEL: { mut->get_infos_deletion(&pos1, &pos2); pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case TRANS: { mut->get_infos_translocation(&pos1, &pos2, &pos3, &pos0, &invert); pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case INV: { mut->get_infos_inversion(&pos1, &pos2); pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case INSERT: { mut->get_infos_insertion(&pos0, &mutlength); seq = new char[mutlength+1]; mut->get_sequence_insertion(seq); // Make a temporary genetic unit and translate it to count how many genes are on the inserted segment ae_genetic_unit * tmpunit = new ae_genetic_unit( _indiv, seq, mutlength); tmpunit->do_transcription(); tmpunit->do_translation(); nb_genes_in_segment = tmpunit->get_nb_coding_RNAs(); delete tmpunit; seq = NULL; break; } case INS_HT: { mut->get_infos_ins_HT(&pos1donor, &pos2donor, &pos0, &pos3donor, &sense, &mutlength ); seq = new char[mutlength+1]; mut->get_sequence_ins_HT(seq); // Make a temporary genetic unit and translate it to count how many genes were on the exogenote ae_genetic_unit * tmpunit = new ae_genetic_unit( _indiv, seq, mutlength); tmpunit->do_transcription(); tmpunit->do_translation(); nb_genes_in_segment = tmpunit->get_nb_coding_RNAs(); // Check whether the pos3donor breakpoint killed one or several of those genes, in that case decrement nb_genes_in_segment ae_list_node* a_node = tmpunit->_rna_list[LEADING]->get_first(); ae_rna * rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; first = rna->get_promoter_pos(); last = rna->get_last_transcribed_pos(); if (breakpoint_inside_gene(pos3donor, first, last)) nb_genes_in_segment --; } a_node = tmpunit->_rna_list[LAGGING]->get_first(); rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; last = rna->get_promoter_pos(); first = rna->get_last_transcribed_pos(); if (breakpoint_inside_gene(pos3donor, first, last)) nb_genes_in_segment --; } delete tmpunit; seq = NULL; break; } case REPL_HT: { mut->get_infos_repl_HT(&pos1, &pos1donor, &pos2, &pos2donor, &sense, &mutlength ); pos2 = ae_utils::mod(pos2 - 1, genlen); seq = new char[mutlength+1]; // seq in the sequence in the donor mut->get_sequence_repl_HT(seq); // Make a temporary genetic unit and translate it to count how many genes were on the donor segment ae_genetic_unit * tmpunit = new ae_genetic_unit( _indiv, seq, mutlength); tmpunit->do_transcription(); tmpunit->do_translation(); nb_genes_in_segment = tmpunit->get_nb_coding_RNAs(); // Remove the genes that overlap ori in this temporary unit, as the transferred segment was actually linear ae_list_node* a_node = tmpunit->_rna_list[LEADING]->get_first(); ae_rna * rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; first = rna->get_promoter_pos(); last = rna->get_last_transcribed_pos(); if (first > last) nb_genes_in_segment --; } a_node = tmpunit->_rna_list[LAGGING]->get_first(); rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; first = rna->get_last_transcribed_pos(); last = rna->get_promoter_pos(); if (first > last) nb_genes_in_segment --; } delete tmpunit; seq = NULL; break; } default: { fprintf(stderr, "Error: unknown mutation type in ae_genetic_unit::compute_nb_of_affected_genes.\n"); } } ae_list_node* a_node = _rna_list[LEADING]->get_first(); ae_rna * rna = NULL; while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; first = rna->get_promoter_pos(); last = rna->get_last_transcribed_pos(); switch(type) { case SWITCH: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case S_INS: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case S_DEL: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case DUPL: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case DEL: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; // else because the gene must not be counted twice if both p1 and p2 are in the same gene break; } case TRANS: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; // beginning of the excised segment else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; // end of the excised segment else if (breakpoint_inside_gene(pos3, first, last)) nb_genes_at_breakpoints ++; // breakpoint inside the segment for the reinsertion else if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; // reinsertion point in the genetic unit break; } case INV: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; break; } case INSERT: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case INS_HT: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case REPL_HT: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_replaced_segment ++; // the whole gene sequence was replaced by the donor DNA if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; // the gene was disrupted by the breakpoint p1 else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; // the gene was disrupted by the breakpoint p2 break; } } } a_node = _rna_list[LAGGING]->get_first(); while (a_node != NULL) { rna = (ae_rna *) a_node->get_obj(); a_node = a_node->get_next(); if (rna->is_coding() == false) continue; first = rna->get_last_transcribed_pos(); last = rna->get_promoter_pos(); switch(type) { case SWITCH: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case S_INS: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case S_DEL: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case DUPL: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case DEL: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; break; } case TRANS: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; // beginning of the excised segment else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; // end of the excised segment else if (breakpoint_inside_gene(pos3, first, last)) nb_genes_at_breakpoints ++; // breakpoint inside the segment for the reinsertion else if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; // reinsertion point in the genetic unit break; } case INV: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_segment ++; if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; break; } case INSERT: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case INS_HT: { if (breakpoint_inside_gene(pos0, first, last)) nb_genes_at_breakpoints ++; break; } case REPL_HT: { if (gene_totally_in_segment(pos1, pos2, first, last)) nb_genes_in_replaced_segment ++; // the whole gene sequence was replaced by the donor DNA if (breakpoint_inside_gene(pos1, first, last)) nb_genes_at_breakpoints ++; // the gene was disrupted by the breakpoint p1 else if (breakpoint_inside_gene(pos2, first, last)) nb_genes_at_breakpoints ++; // the gene was disrupted by the breakpoint p2 break; } } } // if (type == REPL_HT) printf("%d genes in the replaced segment, %d in the donor\n", nb_genes_in_replaced_segment, nb_genes_in_segment); if (seq != NULL) delete [] seq; } // ================================================================= // Protected Methods // ================================================================= void ae_genetic_unit::init_statistical_data( void ) // TODO : integrate into compute_statistical_data { //~ _nb_promoters[LEADING] = 0; //~ _nb_promoters[LAGGING] = 0; //~ _nb_genes[LEADING] = 0; //~ _nb_genes[LAGGING] = 0; //~ _average_gene_size = 0; //~ _average_functional_gene_size = 0; //~ _nb_coding_bp = 0; //~ _clustering = 0; _nb_coding_RNAs = 0; _nb_non_coding_RNAs = 0; _overall_size_coding_RNAs = 0; _overall_size_non_coding_RNAs = 0; _nb_genes_activ = 0; _nb_genes_inhib = 0; _nb_fun_genes = 0; _nb_non_fun_genes = 0; _overall_size_fun_genes = 0; _overall_size_non_fun_genes = 0; _nb_bases_in_0_CDS = -1; _nb_bases_in_0_functional_CDS = -1; _nb_bases_in_0_non_functional_CDS = -1; _nb_bases_in_0_RNA = -1; _nb_bases_in_0_coding_RNA = -1; _nb_bases_in_0_non_coding_RNA = -1; _nb_bases_non_essential = -1; _nb_bases_non_essential_including_nf_genes = -1; _modularity = -1; _beginning_neutral_regions = NULL; _end_neutral_regions = NULL; } aevol-4.4/src/libaevol/ae_gene_tree.cpp0000644000175000017500000001766712334625707015134 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /** \class * \brief */ // ================================================================= // Libraries // ================================================================= #include #include #include // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_gene_tree # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_gene_tree::ae_gene_tree( void ) { _root = NULL; _begin_gener = 0; _end_gener = 0; _total_nb_nodes = 0; _nb_internal_nodes = 0; _nb_leaves = 0; _nb_active_leaves = 0; _creation_type = INITIALIZATION; } // Creates a tree with just a root node. ae_gene_tree::ae_gene_tree( int32_t nodeCreationDate, ae_protein * protein, ae_mutation * mut /* = NULL */ ) { _root = new ae_gene_tree_node(nodeCreationDate, protein); if (mut == NULL) _creation_type = INITIALIZATION; else if ((mut->get_mut_type() == SWITCH) || (mut->get_mut_type() == S_INS) || (mut->get_mut_type() == S_DEL)) _creation_type = LOCAL_MUTATION; else if ((mut->get_mut_type() == DUPL) || (mut->get_mut_type() == DEL) || (mut->get_mut_type() == TRANS) || (mut->get_mut_type() == INV) ) _creation_type = REARRANGEMENT; else _creation_type = TRANSFER; _begin_gener = nodeCreationDate; _end_gener = nodeCreationDate; _total_nb_nodes = 1; _nb_internal_nodes = 0; _nb_leaves = 1; if (protein != NULL) _nb_active_leaves = 1; else _nb_active_leaves = 0; } // ================================================================= // Destructors // ================================================================= ae_gene_tree::~ae_gene_tree( void ) { delete _root; } // ================================================================= // Public Methods // ================================================================= void ae_gene_tree::set_end_gener_if_active_leaves(int32_t gener) { if (_nb_active_leaves > 0) _end_gener = gener; } void ae_gene_tree::update_pointers_in_tree_leaves(ae_genetic_unit * unit) { _root->update_pointers_in_subtree_leaves(unit); } void ae_gene_tree::anticipate_mutation_effect_on_genes_in_tree_leaves(ae_mutation * mut, int32_t lengthOfGeneticUnit) { _root->anticipate_mutation_effect_on_genes_in_subtree_leaves(mut, lengthOfGeneticUnit); } void ae_gene_tree::register_actual_mutation_effect_on_genes_in_tree_leaves( ae_mutation * mut, ae_genetic_unit * unit, int32_t gener, double impact_on_metabolic_error) { _root->register_actual_mutation_effect_on_genes_in_subtree_leaves( this, mut, unit, gener, impact_on_metabolic_error); } // void ae_gene_tree::duplicate_this_gene( ae_gene_tree_node * node, int32_t duplicDate, ae_protein * newProtein ) // { // if (newProtein == node->_protein_pointer) {fprintf(stderr, "Error, duplication with the same protein\n"); exit(EXIT_FAILURE);} // // Create a new node for the "old" DNA segment // node->_left_child = new ae_gene_tree_node(duplicDate, node->_protein_pointer); // node->_left_child->_node_creation_date = duplicDate; // node->_left_child->_dna_creation_date = node->_dna_creation_date; // node->_left_child->_parent_node = node; // // Create a new node for the "new" DNA segment // node->_right_child = new ae_gene_tree_node(duplicDate, newProtein); // node->_right_child->_node_creation_date = duplicDate; // node->_right_child->_dna_creation_date = duplicDate; // node->_right_child->_parent_node = node; // // This node becomes internal, it represents an ancestral (obsolete) state of the gene // node->_protein_pointer = NULL; // for (int32_t i = 0; i < node->_nb_promoters; i++) {node->_rna_pointers[i] = NULL;} // node->_gene_loss_type = DUPLICATED; // node->_gene_loss_date = duplicDate; // // Update tree statistics // _total_nb_nodes += 2; // _nb_internal_nodes ++; // _nb_leaves ++; // - 1 + 2 (the ex-leaf becomes an internal node, 2 leaves are created) // if (newProtein != NULL) _nb_active_leaves ++; // if (duplicDate > _end_gener) _end_gener = duplicDate; // } // void ae_gene_tree::report_gene_mutation( ae_gene_tree_node * node, ae_gene_mutation * geneMut) // { // node->_mutation_list->add(geneMut); // if (geneMut->get_generation() > _end_gener) _end_gener = geneMut->get_generation(); // } // void ae_gene_tree::report_gene_loss( ae_gene_tree_node * node, int32_t geneLossDate, ae_gene_loss_type geneLossType) // { // node->_gene_loss_date = geneLossDate; // node->_gene_loss_type = geneLossType; // node->_protein_pointer = NULL; // for (int32_t i = 0; i < node->_nb_promoters; i++) {node->_rna_pointers[i] = NULL;} // if (geneLossDate > _end_gener) _end_gener = geneLossDate; // _nb_active_leaves --; // } ae_gene_tree_node * ae_gene_tree::search_in_leaves(const ae_protein * protein) { return _root->search_in_subtree_leaves(protein); } void ae_gene_tree::print_to_screen(void) { _root->print_subtree_to_screen(); printf("\n"); } void ae_gene_tree::write_to_files(const char * topologyFileName, const char * nodeAttributesFileName, int32_t end_gener) { FILE * topology_file = fopen(topologyFileName, "w"); if (topology_file == NULL) { fprintf(stderr, "Error: cannot create file %s.\n", topologyFileName); exit(EXIT_FAILURE); } FILE * node_attributes_file = fopen(nodeAttributesFileName, "w"); if (node_attributes_file == NULL) { fprintf(stderr, "Error: cannot create file %s.\n", topologyFileName); exit(EXIT_FAILURE); } _root->write_subtree_to_files(topology_file, node_attributes_file, end_gener); fprintf(topology_file, ";"); fclose(topology_file); fclose(node_attributes_file); } // f must already be open void ae_gene_tree::write_nodes_in_tabular_file(int32_t treeID, FILE * f) { _root->write_subtree_nodes_in_tabular_file(treeID, f); } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_tree.h0000644000175000017500000001670412334625707013572 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_TREE_H__ #define __AE_TREE_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_tree : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_tree( ae_exp_manager* exp_m, ae_tree_mode tree_mode, int32_t tree_step ); // To be used when we want to run a simulation. ae_tree( ae_exp_manager* exp_m, char* tree_file_name ); // To be used when we want to INSPECT a tree, // not when we want to run a simulation. // ================================================================= // Destructors // ================================================================= virtual ~ae_tree( void ); // ================================================================= // Accessors: getters // ================================================================= inline int32_t get_tree_step( void ) const; inline ae_tree_mode get_tree_mode( void ) const; // Precondition for the following 3 methods: // the tree was emptied every TREE_STEP generations ==> it contains // only the last generations since the last emptying ==> do not ask // something about an older generation int32_t get_nb_indivs( int32_t generation ) const; ae_replication_report * get_report_by_index( int32_t generation, int32_t index ) const; ae_replication_report * get_report_by_rank( int32_t generation, int32_t rank ) const; // ================================================================= // Accessors: setters // ================================================================= void set_replic_report( int32_t id, ae_replication_report* replic_report ); void set_replic_report( int32_t generation, int32_t id, ae_replication_report* replic_report ); void set_nb_indivs (int32_t nb_indivs, int32_t generation); // ================================================================= // Public Methods // ================================================================= void fill_tree_with_cur_gener( void ); void write_to_tree_file( gzFile tree_file ); inline int32_t get_LCA( int32_t num_gener, int32_t a, int32_t b, int32_t *j ); // Returns the generation of the last common ancestor of individuals number a and b // of generation num_gener and stores its index in j if provided (not NULL) // ================================================================= // Public Attributes // ================================================================= static const int32_t NO_PARENT; protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_tree( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_tree( const ae_tree &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; int32_t _tree_step; ae_tree_mode _tree_mode; int32_t* _nb_indivs; ae_replication_report*** _replics; // Two-dimensional table of ae_replication_report* // dimension 1 (lines) : generation // dimension 2 (columns) : individual // // !!!!! WARNING !!!!! // The report at line l, column c is for the // replication that created the indiv with index c of generation l+1 // light tree representation int32_t** _parent; }; // ===================================================================== // Getters' definitions // ===================================================================== inline int32_t ae_tree::get_tree_step( void ) const { return _tree_step; } inline ae_tree_mode ae_tree::get_tree_mode( void ) const { return _tree_mode; } // ===================================================================== // Setters' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== inline int32_t ae_tree::get_LCA( int32_t num_gener, int32_t a, int32_t b, int32_t* j = NULL ) // Returns the generation of the last common ancestor of individuals number a and b // of generation num_gener and stores its index in j if provided (not NULL) { switch( _tree_mode ) { case NORMAL : { // TODO break; } case LIGHT : { while ( a != b ) { a = _parent[num_gener][a]; b = _parent[num_gener][b]; num_gener = num_gener - 1; } if ( j != NULL ) { *j = a; } break; } } return num_gener; } #endif // __AE_TREE_H__ aevol-4.4/src/libaevol/ae_selection.h0000644000175000017500000002002112364050651014574 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_SELECTION_H__ #define __AE_SELECTION_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_selection : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_selection( ae_exp_manager* exp_m ); ae_selection( ae_exp_manager* exp_m, gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_selection( void ); // ================================================================= // Accessors: getters // ================================================================= inline ae_selection_scheme get_selection_scheme( void ) const; inline double get_selection_pressure( void ) const; inline double* get_prob_reprod(void) const; inline ae_jumping_mt* get_prng(void) const; // ================================================================= // Accessors: setters // ================================================================= // ----------------------------------------- Pseudo-random number generator inline void set_prng( ae_jumping_mt* prng ); // -------------------------------------------------------------- Selection inline void set_selection_scheme( ae_selection_scheme sel_scheme ); inline void set_selection_pressure( double sel_pressure ); // ================================================================= // Operators // ================================================================= // ================================================================= // Public Methods // ================================================================= void step_to_next_generation( void ); void step_to_next_generation_grid( void ); void write_setup_file( gzFile setup_file ) const; void write_setup_file( FILE* setup_file ) const; void save( gzFile& backup_file ) const; void load( gzFile& exp_setup_file, gzFile& backup_file, bool verbose ); void load( FILE*& exp_setup_file, gzFile& backup_file, bool verbose ); ae_individual* do_replication( ae_individual* parent, int32_t index, int16_t x = -1, int16_t y = -1 ); void compute_prob_reprod( void ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_selection( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_selection( const ae_selection &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= //void compute_prob_reprod( void ); void compute_local_prob_reprod( void ); //ae_individual* do_replication( ae_individual* parent, int32_t index, int16_t x = -1, int16_t y = -1 ); ae_individual* calculate_local_competition ( int16_t x, int16_t y ); // ======================================================================= // Protected Attributes // ======================================================================= ae_exp_manager* _exp_m; // ----------------------------------------- Pseudo-random number generator ae_jumping_mt* _prng; // -------------------------------------------------------------- Selection ae_selection_scheme _selection_scheme; double _selection_pressure; // --------------------------- Probability of reproduction of each organism double* _prob_reprod; }; // ===================================================================== // Getters' definitions // ===================================================================== inline ae_jumping_mt* ae_selection::get_prng(void) const { return _prng; } inline ae_selection_scheme ae_selection::get_selection_scheme( void ) const { return _selection_scheme; } inline double ae_selection::get_selection_pressure( void ) const { return _selection_pressure; } inline double* ae_selection::get_prob_reprod(void) const { if ( _prob_reprod == NULL ) { printf( "ERROR, _prob_reprod has not been computed %s:%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } return _prob_reprod; } // ===================================================================== // Setters' definitions // ===================================================================== // ----------------------------------------- Pseudo-random number generator inline void ae_selection::set_prng( ae_jumping_mt* prng ) { if (_prng != NULL) delete _prng; _prng = prng; } // -------------------------------------------------------------- Selection inline void ae_selection::set_selection_scheme( ae_selection_scheme sel_scheme ) { _selection_scheme = sel_scheme; } inline void ae_selection::set_selection_pressure( double sel_pressure ) { _selection_pressure = sel_pressure; } // ===================================================================== // Operators' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_SELECTION_H__ aevol-4.4/src/libaevol/ae_protein.cpp0000644000175000017500000004010012231437075014624 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include //############################################################################## // # // Class ae_protein # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= /** * Copy constructor. * * Copies the protein but does nothing regarding the RNAs transcribing it (creates an empty list). */ ae_protein::ae_protein( ae_genetic_unit* gen_unit, const ae_protein &model ) { _gen_unit = gen_unit; _strand = model._strand; _shine_dal_pos = model._shine_dal_pos; _first_translated_pos = model._first_translated_pos; _last_translated_pos = model._last_translated_pos; _length = model._length; _concentration = model._concentration; _is_functional = model._is_functional; _rna_list = new ae_list(); // Copy the list of amino-acids _AA_list = new ae_list(); ae_list_node* AA_node = model._AA_list->get_first(); ae_codon* AA = NULL; while ( AA_node != NULL ) { AA = AA_node->get_obj(); _AA_list->add( new ae_codon( *AA ) ); AA_node = AA_node->get_next(); } // Copy triangle parameters _mean = model._mean; _width = model._width; _height = model._height; } ae_protein::ae_protein( ae_genetic_unit* gen_unit, ae_list* codon_list, ae_strand strand, int32_t shine_dal_pos, ae_rna* rna ) { assert( shine_dal_pos >= 0 ); assert( shine_dal_pos < gen_unit->get_seq_length() ); _gen_unit = gen_unit; _strand = strand; _shine_dal_pos = shine_dal_pos; _length = codon_list->get_nb_elts(); #ifndef __REGUL // In Aevol the concentration of a new protein is set at the basal level _concentration = rna->get_basal_level(); #else // In Raevol, there is two case, depending on the heredity if ( ae_common::with_heredity ) { // With heredity the new protein has a concentration set at 0, because there are inherited proteins which allow the regulation _concentration = 0; } else { // Without heredity, we use the same concentration as in Aevol (No inherited proteins) _concentration = rna->get_basal_level(); } #endif // TODO : make this cleaner... _AA_list = codon_list; _rna_list = new ae_list(); _rna_list->add( rna ); if ( _strand == LEADING ) { _first_translated_pos = ae_utils::mod( _shine_dal_pos + (SHINE_DAL_SIZE + SHINE_START_SPACER + CODON_SIZE), _gen_unit->get_dna()->get_length() ); _last_translated_pos = ae_utils::mod( _first_translated_pos + (_length * CODON_SIZE - 1), _gen_unit->get_dna()->get_length() ); } else { _first_translated_pos = ae_utils::mod( _shine_dal_pos - (SHINE_DAL_SIZE + SHINE_START_SPACER + CODON_SIZE), _gen_unit->get_dna()->get_length() ); _last_translated_pos = ae_utils::mod( _first_translated_pos - (_length * CODON_SIZE - 1), _gen_unit->get_dna()->get_length() ); } // ============================================================================ // Folding process (compute phenotypic contribution parameters from codon list) // ============================================================================ // 1) Compute values for M, W and H // 2) Normalize M, W and H values according to number of codons of each kind // 3) Normalize M, W and H values according to the allowed ranges (defined in macros.h) // -------------------------------- // 1) Compute values for M, W and H // -------------------------------- long double M = 0.0; long double W = 0.0; long double H = 0.0; int32_t nb_m = 0; int32_t nb_w = 0; int32_t nb_h = 0; bool bin_m = false; // Initializing to false will yield a conservation of the high weight bit bool bin_w = false; // when applying the XOR operator for the Gray to standard conversion bool bin_h = false; ae_list_node* node = codon_list->get_first(); ae_codon* codon = NULL; while ( node != NULL ) { codon = node->get_obj(); switch ( codon->get_value() ) { case CODON_M0 : { // M codon found nb_m++; // Convert Gray code to "standard" binary code bin_m ^= false; // as bin_m was initialized to false, the XOR will have no effect on the high weight bit // A lower-than-the-previous-lowest weight bit was found, make a left bitwise shift //~ M <<= 1; M *= 2; // Add this nucleotide's contribution to M if ( bin_m ) M += 1; break; } case CODON_M1 : { // M codon found nb_m++; // Convert Gray code to "standard" binary code bin_m ^= true; // as bin_m was initialized to false, the XOR will have no effect on the high weight bit // A lower-than-the-previous-lowest bit was found, make a left bitwise shift //~ M <<= 1; M *= 2; // Add this nucleotide's contribution to M if ( bin_m ) M += 1; break; } case CODON_W0 : { // W codon found nb_w++; // Convert Gray code to "standard" binary code bin_w ^= false; // as bin_m was initialized to false, the XOR will have no effect on the high weight bit // A lower-than-the-previous-lowest weight bit was found, make a left bitwise shift //~ W <<= 1; W *= 2; // Add this nucleotide's contribution to W if ( bin_w ) W += 1; break; } case CODON_W1 : { // W codon found nb_w++; // Convert Gray code to "standard" binary code bin_w ^= true; // as bin_m was initialized to false, the XOR will have no effect on the high weight bit // A lower-than-the-previous-lowest weight bit was found, make a left bitwise shift //~ W <<= 1; W *= 2; // Add this nucleotide's contribution to W if ( bin_w ) W += 1; break; } case CODON_H0 : case CODON_START : // Start codon codes for the same amino-acid as H0 codon { // H codon found nb_h++; // Convert Gray code to "standard" binary code bin_h ^= false; // as bin_m was initialized to false, the XOR will have no effect on the high weight bit // A lower-than-the-previous-lowest weight bit was found, make a left bitwise shift //~ H <<= 1; H *= 2; // Add this nucleotide's contribution to H if ( bin_h ) H += 1; break; } case CODON_H1 : { // H codon found nb_h++; // Convert Gray code to "standard" binary code bin_h ^= true; // as bin_m was initialized to false, the XOR will have no effect on the high weight bit // A lower-than-the-previous-lowest weight bit was found, make a left bitwise shift //~ H <<= 1; H *= 2; // Add this nucleotide's contribution to H if ( bin_h ) H += 1; break; } } node = node->get_next(); } // ---------------------------------------------------------------------------------- // 2) Normalize M, W and H values in [0;1] according to number of codons of each kind // ---------------------------------------------------------------------------------- if ( nb_m != 0 ) _mean = M / (pow(2, nb_m) - 1); else _mean = 0.5; if ( nb_w != 0 ) _width = W / (pow(2, nb_w) - 1); else _width = 0.0; if ( nb_h != 0 ) _height = H / (pow(2, nb_h) - 1); else _height = 0.5; assert( _mean >= 0.0 && _mean <= 1.0 ); assert( _width >= 0.0 && _width <= 1.0 ); assert( _height >= 0.0 && _height <= 1.0 ); // ------------------------------------------------------------------------------------ // 3) Normalize M, W and H values according to the allowed ranges (defined in macros.h) // ------------------------------------------------------------------------------------ // x_min <= M <= x_max // w_min <= W <= w_max // h_min <= H <= h_max _mean = (X_MAX - X_MIN) * _mean + X_MIN; _width = (get_indiv()->get_w_max() - W_MIN) * _width + W_MIN; _height = (H_MAX - H_MIN) * _height + H_MIN; if ( nb_m == 0 || nb_w == 0 || nb_h == 0 || _width == 0.0 || _height == 0.0 ) { _is_functional = false; } else { _is_functional = true; } assert( _mean >= X_MIN && _mean <= X_MAX ); assert( _width >= W_MIN && _width <= get_indiv()->get_w_max() ); assert( _height >= H_MIN && _height <= H_MAX ); } /* ae_protein::ae_protein( ae_protein* parent ) { _gen_unit = parent->_gen_unit; _strand = parent->_strand; _shine_dal_pos = parent->_shine_dal_pos; _first_translated_pos = parent->_first_translated_pos; _last_translated_pos = parent->_last_translated_pos; _length = parent->_length; _concentration = parent->_concentration; _mean = parent->_mean; _width = parent->_width; _height = parent->_height; } */ ae_protein::ae_protein( gzFile backup_file ) { _gen_unit = NULL; int8_t tmp_strand; gzread( backup_file, &tmp_strand, sizeof(tmp_strand) ); _strand = (ae_strand) tmp_strand; gzread( backup_file, &_shine_dal_pos, sizeof(_shine_dal_pos) ); gzread( backup_file, &_first_translated_pos, sizeof(_first_translated_pos) ); gzread( backup_file, &_last_translated_pos, sizeof(_last_translated_pos) ); gzread( backup_file, &_length, sizeof(_length) ); gzread( backup_file, &_concentration, sizeof(_concentration) ); gzread( backup_file, &_is_functional, sizeof(_is_functional) ); gzread( backup_file, &_mean, sizeof(_mean) ); gzread( backup_file, &_width, sizeof(_width) ); gzread( backup_file, &_height, sizeof(_height) ); _rna_list = new ae_list(); // Retreive the AA _AA_list = new ae_list(); int16_t nb_AA = 0; gzread( backup_file, &nb_AA, sizeof(nb_AA) ); for ( int16_t i = 0 ; i < nb_AA ; i++ ) { _AA_list->add( new ae_codon( backup_file ) ); } } // ================================================================= // Destructors // ================================================================= ae_protein::~ae_protein( void ) { _rna_list->erase( false ); delete _rna_list; _AA_list->erase( true ); delete _AA_list; } // ================================================================= // Public Methods // ================================================================= int32_t ae_protein::get_last_STOP_base_pos( void ) const { if ( _strand == LEADING ) { return ae_utils::mod( _last_translated_pos + 3, _gen_unit->get_dna()->get_length() ); } else { return ae_utils::mod( _last_translated_pos - 3, _gen_unit->get_dna()->get_length() ); } } void ae_protein::add_RNA( ae_rna* rna ) { _rna_list->add( rna ); _concentration += rna->get_basal_level(); } char* ae_protein::get_AA_sequence( void ) const { char* seq = new char[3*_length]; // + 1 (for the '\0') - 1 (_length - 1 spaces) ae_list_node* codon_node = _AA_list->get_first(); int32_t i = 0; while ( codon_node != NULL ) { ae_codon* codon = codon_node->get_obj(); if ( i != 0 ) seq[i++] = ' '; switch ( codon->get_value() ) { case CODON_START : { seq[i++] = 'S'; seq[i++] = 'T'; break; } case CODON_M0 : { seq[i++] = 'M'; seq[i++] = '0'; break; } case CODON_M1 : { seq[i++] = 'M'; seq[i++] = '1'; break; } case CODON_W0 : { seq[i++] = 'W'; seq[i++] = '0'; break; } case CODON_W1 : { seq[i++] = 'W'; seq[i++] = '1'; break; } case CODON_H0 : { seq[i++] = 'H'; seq[i++] = '0'; break; } case CODON_H1 : { seq[i++] = 'H'; seq[i++] = '1'; break; } } codon_node = codon_node->get_next(); } seq[3*_length-1] = '\0'; return seq; } void ae_protein::save( gzFile backup_file ) { // The rna_list is not write because there is no need to, it is an empty list. int8_t tmp_strand = _strand; gzwrite( backup_file, &tmp_strand, sizeof(tmp_strand) ); gzwrite( backup_file, &_shine_dal_pos, sizeof(_shine_dal_pos) ); gzwrite( backup_file, &_first_translated_pos, sizeof(_first_translated_pos) ); gzwrite( backup_file, &_last_translated_pos, sizeof(_last_translated_pos) ); gzwrite( backup_file, &_length, sizeof(_length) ); gzwrite( backup_file, &_concentration, sizeof(_concentration) ); gzwrite( backup_file, &_is_functional, sizeof(_is_functional) ); gzwrite( backup_file, &_mean, sizeof(_mean) ); gzwrite( backup_file, &_width, sizeof(_width) ); gzwrite( backup_file, &_height, sizeof(_height) ); // Write the Acide Amino in the backup file int16_t nb_AA = _AA_list->get_nb_elts(); gzwrite( backup_file, &nb_AA, sizeof(nb_AA) ); ae_list_node* AA_node = _AA_list->get_first(); ae_codon* AA; for ( int16_t i = 0 ; i < nb_AA ; i++ ) { AA = AA_node->get_obj(); AA->save( backup_file ); AA_node = AA_node->get_next(); } } // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Non inline accessors // ================================================================= ae_individual* ae_protein::get_indiv( void ) const { return _gen_unit->get_indiv(); } aevol-4.4/src/libaevol/ae_fuzzy_set.h0000644000175000017500000001654212231437075014670 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** /** \class * \brief This class provides management tools for "fuzzy sets" * abscissa are bound between MIN_X and MAX_X (defined elsewhere) * A "fuzzy set" should always have at least two points of abscissa * MIN_X and MAX_X */ #ifndef __AE_FUZZY_SET_H__ #define __AE_FUZZY_SET_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include #include // ================================================================= // Class declarations // ================================================================= class exp_manager; class ae_fuzzy_set : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_fuzzy_set( void ); ae_fuzzy_set( const ae_fuzzy_set &model ); ae_fuzzy_set( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_fuzzy_set( void ); // ================================================================= // Accessors // ================================================================= inline ae_list* get_points( void ); // ================================================================= // Public Methods // ================================================================= inline void initialize( void ); void simplify( void ); void print_points( void ) const; void add_triangle( double mean, double width, double height ); void add( ae_fuzzy_set* to_add ); void sub( ae_fuzzy_set* to_sub ); double get_geometric_area( void ) const; double get_geometric_area( double start_segment, double end_segment ) const; inline double get_y( double x ) const; inline double get_x( double y, ae_point_2d* left_point, ae_point_2d* right_point ) const; inline ae_list_node* create_interpolated_point( double x ); void add_upper_bound( double upper_bound ); void add_lower_bound( double lower_bound ); bool is_identical_to( const ae_fuzzy_set * other, double tolerance) const; void save( gzFile backup_file ) const; void load( gzFile backup_file ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= /* ae_fuzzy_set( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; */ /* ae_fuzzy_set( const ae_fuzzy_set &model ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; */ // ================================================================= // Protected Methods // ================================================================= void _assert_order( void ); // ================================================================= // Protected Attributes // ================================================================= exp_manager* _exp_m; ae_list* _points; private : // WARNING : The 2 following functions are private because they are dangerous. // They are optimized versions of their omonyms, beginning their search at the given list entry. // The following conditions are MANDATORY : // list_entry must be a node of the point list (_points) // the corresponding point's abscissa must be <= x double get_y( double x, ae_list_node* list_entry ) const; ae_list_node* create_interpolated_point( double x, ae_list_node* list_entry ); }; // ===================================================================== // Accessors definitions // ===================================================================== ae_list* ae_fuzzy_set::get_points( void ) { return _points; } // ===================================================================== // Inline functions' definition // ===================================================================== void ae_fuzzy_set::initialize( void ) { _points->erase( true ); _points->add( new ae_point_2d( X_MIN, 0.0 ) ); _points->add( new ae_point_2d( X_MAX, 0.0 ) ); } double ae_fuzzy_set::get_y( double x ) const { return get_y( x, _points->get_first() ); } double ae_fuzzy_set::get_x( double y, ae_point_2d* left_point, ae_point_2d* right_point ) const { assert( left_point != NULL ); assert( right_point != NULL ); assert( left_point->y != right_point->y ); assert( ( y >= right_point->y && y <= left_point->y ) || ( y >= left_point->y && y <= right_point->y ) ); double tmp = left_point->x + (right_point->x - left_point->x) * (y - left_point->y) / (right_point->y - left_point->y); if ( tmp < left_point->x ) return left_point->x; else if ( tmp > right_point->x ) return right_point->x; else return tmp; } ae_list_node* ae_fuzzy_set::create_interpolated_point( double x ) { return create_interpolated_point( x, _points->get_first() ); } #endif // __AE_FUZZY_SET_H__ aevol-4.4/src/libaevol/ae_grid_cell.h0000644000175000017500000001471412231437075014551 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_GRID_CELL_H__ #define __AE_GRID_CELL_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_grid_cell : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_grid_cell( int16_t x, int16_t y, ae_individual* indiv ); ae_grid_cell( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_grid_cell( void ); // ================================================================= // Accessors: getters // ================================================================= inline int16_t get_x( void ) const; inline int16_t get_y( void ) const; inline double get_compound_amount( void ) const; inline ae_individual* get_individual( void ) const; inline double get_secreted_amount( void ) const; inline double get_metabolic_fitness( void ) const; inline double get_total_fitness( void ) const; // ================================================================= // Accessors: setters // ================================================================= inline void set_compound_amount( double compound_amount ); inline void set_individual( ae_individual * indiv ); // ================================================================= // Public Methods // ================================================================= void save( gzFile backup_file ) const; // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_grid_cell( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; //~ ae_grid_cell( const ae_grid_cell &model ) //~ { //~ printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); //~ exit( EXIT_FAILURE ); //~ }; // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= // Position on the grid int16_t _x; int16_t _y; // Amount of secreted compound currently present in the grid cell double _compound_amount; // pointer to the individual in this cell ae_individual * _individual; }; // ===================================================================== // Getters' definitions // ===================================================================== inline int16_t ae_grid_cell::get_x( void ) const { return _x; } inline int16_t ae_grid_cell::get_y( void ) const { return _y; } inline double ae_grid_cell::get_compound_amount( void ) const { return _compound_amount; } inline ae_individual* ae_grid_cell::get_individual( void ) const { return _individual; } inline double ae_grid_cell::get_secreted_amount( void ) const { return _individual->get_fitness_by_feature( SECRETION ); } inline double ae_grid_cell::get_metabolic_fitness( void ) const { return _individual->get_fitness_by_feature( METABOLISM ); } inline double ae_grid_cell::get_total_fitness( void ) const { return _individual->get_fitness(); } // ===================================================================== // Setters' definitions // ===================================================================== inline void ae_grid_cell::set_compound_amount(double compound_amount) { _compound_amount = compound_amount; } inline void ae_grid_cell::set_individual( ae_individual * indiv ) { _individual = indiv; if ( _individual->get_grid_cell() != this ) { _individual->set_grid_cell( this ); } } // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_GRID_CELL_H__ aevol-4.4/src/libaevol/ae_fuzzy_set.cpp0000644000175000017500000007215712231437075015227 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include //############################################################################## // # // Class ae_fuzzy_set # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_fuzzy_set::ae_fuzzy_set( void ) { _points = new ae_list(); initialize(); } ae_fuzzy_set::ae_fuzzy_set( const ae_fuzzy_set &model ) { _points = new ae_list(); ae_list_node* model_point_parser = model._points->get_first(); ae_point_2d* model_point; while ( model_point_parser != NULL ) { model_point = model_point_parser->get_obj(); _points->add( new ae_point_2d( *model_point ) ); model_point_parser = model_point_parser->get_next(); } } ae_fuzzy_set::ae_fuzzy_set( gzFile backup_file ) { _points = new ae_list(); load( backup_file ); } // ================================================================= // Destructors // ================================================================= ae_fuzzy_set::~ae_fuzzy_set( void ) { if ( _points != NULL ) { _points->erase( true ); delete _points; } } // ================================================================= // Public Methods // ================================================================= void ae_fuzzy_set::simplify( void ) { // Removes useless points like A or B: // // ^ B // | +--+-----+ // | | \ --- // | A+ \ / // | | \ / // |---+------------+-------+-----> // printf("initial nb of points %d\n",_points.get_count()); ae_list_node* node = _points->get_first(); ae_list_node* next_node = NULL; ae_list_node* other_node = NULL; ae_point_2d* pt = NULL; ae_point_2d* next_pt = NULL; ae_point_2d* other_pt = NULL; double x, y, next_x, next_y, other_x, other_y; while ( node != NULL ) { pt = node->get_obj(); x = pt->x; y = pt->y; next_node = node->get_next(); if ( next_node != NULL ) { next_pt = next_node->get_obj(); next_x = next_pt->x; next_y = next_pt->y; if ( next_x == x ) { // discontinuity on x // is the next point also on the same x ? other_node = next_node->get_next(); while ( other_node != NULL ) { other_pt = other_node->get_obj(); other_x = other_pt->x; other_y = other_pt->y; if ( other_x == x ) { _points->remove( next_node, true, true ); next_node = other_node; } else { break; } other_node = other_node->get_next(); } } } node = next_node; } node = _points->get_first(); next_node = NULL; other_node = NULL; pt = NULL; next_pt = NULL; other_pt = NULL; while ( node != NULL ) { pt = node->get_obj(); x = pt->x; y = pt->y; next_node = node->get_next(); if ( next_node != NULL ) { next_pt = next_node->get_obj(); next_x = next_pt->x; next_y = next_pt->y; if ( next_y == y ) { // plateau on y // is the next point also on the same y ? other_node = next_node->get_next(); while ( other_node != NULL ) { other_pt = other_node->get_obj(); other_x = other_pt->x; other_y = other_pt->y; if ( other_y == y ) { _points->remove( next_node, true, true ); next_node = other_node; next_pt = next_node->get_obj(); } else break; other_node = other_node->get_next(); } } } node = next_node; } #ifdef DEBUG _assert_order(); #endif } void ae_fuzzy_set::print_points( void ) const { ae_list_node* point_node = _points->get_first(); ae_point_2d* point; while ( point_node != NULL ) { point = point_node->get_obj(); printf( " (%f, %f)\n", point->x, point->y ); point_node = point_node->get_next(); } } void ae_fuzzy_set::add_triangle( double mean, double width, double height ) { assert( X_MIN <= mean && mean <= X_MAX ); assert( W_MIN <= width ); // the maximum width depends on each individual // assert( MIN_H <= height && height <= MAX_H ); Not necessarily because the concentration can be > 1 if ( fabs(width) < 1e-15 || fabs(height) < 1e-15 ) return; // Compute triangle points' coordinates double x0 = mean - width; double x1 = mean; double x2 = mean + width; //~ double y0 = 0.0; double y1 = height; //~ double y2 = 0.0; // We will need at least a point at abscissa x0, x1 and x2, // Create them if they don't exist or update them if they do. ae_list_node* node_0 = NULL; ae_list_node* node_1 = NULL; ae_list_node* node_2 = NULL; if ( x0 >= X_MIN ) node_0 = create_interpolated_point( x0 ); node_1 = create_interpolated_point( x1, node_0 ); if ( x2 <= X_MAX ) node_2 = create_interpolated_point( x2, node_1 ); // Update all the points in the list having their abscisse in ]x0;x2[ ae_list_node* point_node; ae_point_2d* point; if ( node_0 != NULL ) point_node = node_0->get_next(); else point_node = _points->get_first(); while ( point_node != node_2 ) { point = point_node->get_obj(); if ( point_node == node_1 ) { point->y += y1; } else { if ( point->x < x1 ) { point->y += y1 * (point->x - x0) / (x1 - x0); } else { point->y += y1 * (x2 - point->x) / (x2 - x1); } } point_node = point_node->get_next(); } #ifdef DEBUG _assert_order(); #endif } void ae_fuzzy_set::add( ae_fuzzy_set* to_add ) { // Add interpolated points (one point is needed for each abscissa present in either of the two point lists) ae_list_node* point_node = _points->get_first(); ae_list_node* point_to_add_node = to_add->get_points()->get_first(); ae_point_2d* point; ae_point_2d* point_to_add; while ( point_to_add_node != NULL ) { point_to_add = point_to_add_node->get_obj(); point_node = create_interpolated_point( point_to_add->x, point_node ); point_to_add_node = point_to_add_node->get_next(); } // Update each point's ordinate point_node = _points->get_first(); while ( point_node != NULL ) { point = point_node->get_obj(); point->y += to_add->get_y( point->x ); // It is possible to gain some execution time here // by parsing to_add's point list and using the // get_y( double x, ae_list_node* list_entry ) function // instead of get_y( double x ) point_node = point_node->get_next(); } #ifdef DEBUG _assert_order(); #endif } void ae_fuzzy_set::sub( ae_fuzzy_set* to_sub ) { // 1. Remove multiple discontinuities. simplify(); to_sub->simplify(); // 2. Add. ae_list_node* bn = _points->get_first(); ae_list_node* rn = (to_sub->_points)->get_first(); ae_list_node* next_bn = NULL; ae_list_node* next_rn = NULL; ae_point_2d* bpt = NULL; ae_point_2d* rpt = NULL; ae_point_2d* next_bpt = NULL; ae_point_2d* next_rpt = NULL; ae_point_2d* new_pt = NULL; double xb, yb, xr, yr, next_xb, next_yb, next_xr, next_yr; double yb_interpol, yr_interpol; bool red_discont = false; bool black_discont = false; ae_list* result = new ae_list(); while ( bn != NULL || rn != NULL ) // there are more points to deal with { // get data for the black function if ( bn != NULL ) { black_discont = false; bpt = bn->get_obj(); xb = bpt->x; yb = bpt->y; next_bn = bn->get_next(); if ( next_bn != NULL ) { next_bpt = next_bn->get_obj(); next_xb = next_bpt->x; next_yb = next_bpt->y; if ( next_xb == xb ) { black_discont = true; } } } else { // no more black point, do as if the black function were 0: // simply copy the remaining red points (if any) in the result // xb and yb have the same values as those of the last black point yr_interpol = to_sub->get_y( xb ); if ( rn != NULL && yb != 0 ) { new_pt = new ae_point_2d( xb, -yr_interpol ); assert( new_pt ); result->add( new_pt ); } while ( rn != NULL ) { rpt = rn->get_obj(); xr = rpt->x; yr = rpt->y; new_pt = new ae_point_2d( xr, -yr ); assert( new_pt ); result->add( new_pt ); rn = rn->get_next(); } break; } // get data for the red function if ( rn != NULL ) { red_discont = false; rpt = rn->get_obj(); xr = rpt->x; yr = rpt->y; next_rn = rn->get_next(); if ( next_rn != NULL ) { next_rpt = next_rn->get_obj(); next_xr = next_rpt->x; next_yr = next_rpt->y; if ( next_xr == xr ) { red_discont = true; } } } else { // no more red point, do as if the red function were 0: // simply copy the (eventual) remaining black points in the result // xr and yr have the same values as those of the last red point // printf("no more red point\n"); yb_interpol = get_y( xr ); if ( bn != NULL && yr != 0 ) { new_pt = new ae_point_2d( xr, yb_interpol ); assert( new_pt ); result->add( new_pt ); } while ( bn != NULL ) { bpt = bn->get_obj(); xb = bpt->x; yb = bpt->y; new_pt = new ae_point_2d( xb, yb ); assert( new_pt ); result->add( new_pt ); bn = bn->get_next(); } break; } // compare xb and xr if ( xb == xr ) { // ----------------- case 1 : xb == xr ----------------------- // there will be at at least one point P on x == xb == x_c if ( ! red_discont && ! black_discont ) { // case 1a : no discontinuity // => P(x, yb + yr) new_pt = new ae_point_2d( xb, yb - yr ); assert( new_pt ); result->add( new_pt ); bn = next_bn; if ( bn != NULL ) next_bn = bn->get_next(); rn = next_rn; if ( rn != NULL ) next_rn = rn->get_next(); } else { if ( black_discont && ! red_discont ) { // case 1b : discontinuity in the black function only // => P-(x, yb- + yr) and P+(x, yb+ + yr) // P+ is computed using the following black point new_pt = new ae_point_2d( xb, yb - yr ); assert( new_pt ); result->add( new_pt ); new_pt = new ae_point_2d( xb, next_yb - yr ); assert( new_pt ); result->add( new_pt ); if ( next_bn != NULL ) bn = next_bn->get_next(); // jump over the next black point if ( bn != NULL ) next_bn = bn->get_next(); rn = next_rn; if ( rn != NULL ) next_rn = rn->get_next(); } else { if ( ! black_discont && red_discont ) { // case 1c : discontinuity in the red function only // => P-(x, yb + yr-) and P+(x, yb + yr+) // P+ is computed using the following red point new_pt = new ae_point_2d( xb, yb - yr ); assert( new_pt ); result->add( new_pt ); new_pt = new ae_point_2d( xb, yb - next_yr ); assert( new_pt ); result->add( new_pt ); bn = next_bn; if ( bn != NULL ) next_bn = bn->get_next(); if ( next_rn != NULL ) rn = next_rn->get_next(); // jump over the next red point if ( rn != NULL ) next_rn = rn->get_next(); } else { // case 1d : discontinuity in both functions // => P-(x, yb- + yr-) and P+(x, yb+ + yr+) // P+ is computed using both the following red and black points new_pt = new ae_point_2d( xb, yb - yr ); assert( new_pt ); result->add( new_pt ); new_pt = new ae_point_2d( xb, next_yb - next_yr ); assert( new_pt ); result->add( new_pt ); if ( next_bn != NULL ) bn = next_bn->get_next(); // jump over the next black point if ( bn != NULL ) next_bn = bn->get_next(); if ( next_rn != NULL ) rn = next_rn->get_next(); // jump over the next red point if ( rn != NULL ) next_rn = rn->get_next(); } } } } else { // xb is the === zone: // // ==============|---|---|================ // xr-eps xr xr+eps if( xb < xr ) { // ----------------- case 2 : xb < xr ----------------------- // xb is the === zone: // // ==============|---|---|----------------- // xr-eps xr xr+eps // // there will be at at least one point P on x == xb yr_interpol = to_sub->get_y( xb ); if ( ! black_discont ) { // case 2a : no discontinuity // => P(xb, yb + red(xb)) new_pt = new ae_point_2d( xb, yb - yr_interpol ); assert( new_pt ); result->add( new_pt ); bn = next_bn; if ( bn != NULL ) next_bn = bn->get_next(); } else { // case 2b : discontinuity on xb in the black function // => P-(xb, yb- + red(xb)) and P+(xb, yb+ + red(xb)) new_pt = new ae_point_2d( xb, yb - yr_interpol ); assert( new_pt ); result->add( new_pt ); new_pt = new ae_point_2d( xb, next_yb - yr_interpol ); assert( new_pt ); result->add( new_pt ); if ( next_bn != NULL ) bn = next_bn->get_next(); // jump over the next bn if ( bn != NULL ) next_bn = bn->get_next(); } // can there be a discontinuity on xr ? yes, but we will deal // with it later, when min{xb,xr} will be xr // bn goes one step further and rn doesn't move // if there is a discontinuity on xb, the same thing will // happen with the following black point } else { // ----------------- case 3 : xb > xr ----------------------- // xb is the === zone: // // --------------|---|---|=============== // xr-eps xr xr+eps // // there will be at at least one point P on x == xr yb_interpol = get_y( xr ); if ( ! red_discont ) { // case 3a : no discontinuity // => P(xr, yr + black(xr)) new_pt = new ae_point_2d( xr, yb_interpol - yr ); assert( new_pt ); result->add( new_pt ); rn = next_rn; if ( rn != NULL ) next_rn = rn->get_next(); } else { // case 2b : discontinuity on xr // => P-(xr, yr- + black(xr)) and P+(xr, yr+ + black(xr)) new_pt = new ae_point_2d( xr, yb_interpol - yr ); assert( new_pt ); result->add( new_pt ); new_pt = new ae_point_2d( xr, yb_interpol - next_yr ); assert( new_pt ); result->add( new_pt ); if ( next_rn != NULL ) rn = next_rn->get_next(); // jump over next red point if ( rn != NULL ) next_rn = rn->get_next(); } // store xr, rn goes one step further and bn doesn't move // if there is a discontinuity on xr, the same thing will // happen with the following red point } } } _points->erase( true ); delete _points; _points = result; #ifdef DEBUG _assert_order(); #endif } double ae_fuzzy_set::get_geometric_area( void ) const { double area = 0; double tmp, tmp2; ae_point_2d* point = _points->get_first()->get_obj(); ae_list_node* next_point_node = _points->get_first()->get_next(); ae_point_2d* next_point = NULL; while ( next_point_node != NULL ) { next_point = next_point_node->get_obj(); if ( point->x != next_point->x ) { if ( (point->y > 0 && next_point->y < 0) || (point->y < 0 && next_point->y > 0) ) { // The segment [point, next_point] crosses the abscissa axis => We will compute the area in 2 parts ae_point_2d* pt_zero = new ae_point_2d( get_x( 0.0, point, next_point ), 0.0 ); tmp = (point->y + pt_zero->y) * (pt_zero->x - point->x) / 2.0; // Negative if y1 is negative tmp2 = (pt_zero->y + next_point->y) * (next_point->x - pt_zero->x) / 2.0; // Negative if y2 is negative delete pt_zero; area += ( tmp >= 0 )? tmp : -tmp; area += ( tmp2 >= 0 )? tmp2 : -tmp2; } else { // The segment is entirely above or underneath the abscissa axis tmp = (point->y + next_point->y) * (next_point->x - point->x) / 2.0; area += ( tmp >= 0 )? tmp : -tmp; } } point = next_point; next_point_node = next_point_node->get_next(); } return area; } double ae_fuzzy_set::get_geometric_area( double start_segment, double end_segment ) const { // Fuzzy set first (resp last) point must be at x = X_MIN (resp x = X_MAX) assert( _points->get_first() != _points->get_last() ); assert( _points->get_first()->get_obj()->x == X_MIN ); assert( _points->get_last()->get_obj()->x == X_MAX ); // We must have ( X_MIN <= start_segment < end_segment <= X_MAX ) assert( start_segment >= X_MIN && start_segment < end_segment && end_segment <= X_MAX ); double area = 0; double tmp, tmp2; ae_list_node* point_node = _points->get_first(); ae_list_node* next_point_node = point_node->get_next(); ae_point_2d* point = point_node->get_obj(); ae_point_2d* next_point = NULL; while ( next_point_node != NULL ) { next_point = next_point_node->get_obj(); // If there are no points at x = start_segment and x = end_segment, we must interpolate them if ( point->x < start_segment && next_point->x > start_segment ) { next_point = new ae_point_2d( start_segment, get_y( start_segment, point_node ) ); next_point_node = _points->add_after( next_point, point_node ); continue; } if ( point->x < end_segment && next_point->x > end_segment ) { next_point = new ae_point_2d( end_segment, get_y( end_segment, point_node ) ); next_point_node = _points->add_after( next_point, point_node ); continue; } // If we are within the segment, compute the area if ( point->x >= start_segment && next_point->x <= end_segment ) { if ( point->x != next_point->x ) { if ( (point->y > 0 && next_point->y < 0) || (point->y < 0 && next_point->y > 0) ) { // The segment [point, next_point] crosses the abscissa axis => We will compute the area in 2 parts ae_point_2d* pt_zero = new ae_point_2d( get_x( 0.0, point, next_point ), 0.0 ); tmp = (point->y + pt_zero->y) * (pt_zero->x - point->x) / 2.0; // Negative if y1 is negative tmp2 = (pt_zero->y + next_point->y) * (next_point->x - pt_zero->x) / 2.0; // Negative if y2 is negative delete pt_zero; area += ( tmp >= 0 )? tmp : -tmp; area += ( tmp2 >= 0 )? tmp2 : -tmp2; } else { // The segment is entirely above or underneath the abscissa axis tmp = (point->y + next_point->y) * (next_point->x - point->x) / 2.0; area += ( tmp >= 0 )? tmp : -tmp; } } } point = next_point; point_node = next_point_node; next_point_node = next_point_node->get_next(); } return area; } void ae_fuzzy_set::add_upper_bound( double upper_bound ) { ae_list_node* point_node = _points->get_first(); ae_point_2d* point; ae_list_node* prev_node; ae_list_node* next_node; ae_point_2d* prev_point; ae_point_2d* next_point; while ( point_node != NULL ) { point = point_node->get_obj(); if ( point->y > upper_bound ) { prev_node = point_node->get_prev(); next_node = point_node->get_next(); if ( prev_node != NULL ) { prev_point = prev_node->get_obj(); if ( prev_point->y < upper_bound ) // In fact it can only be < or == { // Create a point at the intersection of the segment and the ceiling defined by the upper bound _points->add_after( new ae_point_2d( get_x( upper_bound, prev_point, point ), upper_bound ), prev_node ); } } if ( next_node != NULL ) { next_point = next_node->get_obj(); if ( next_point->y < upper_bound ) { // Create a point at the intersection of the segment and the ceiling defined by the upper bound _points->add_after( new ae_point_2d( get_x( upper_bound, point, next_point ), upper_bound ), point_node ); } } // Lower current point down to upper_bound point->y = upper_bound; } point_node = point_node->get_next(); } #ifdef DEBUG _assert_order(); #endif } void ae_fuzzy_set::add_lower_bound( double lower_bound ) { ae_list_node* point_node = _points->get_first(); ae_point_2d* point; ae_list_node* prev_node; ae_list_node* next_node; ae_point_2d* prev_point; ae_point_2d* next_point; while ( point_node != NULL ) { point = point_node->get_obj(); if ( point->y < lower_bound ) { prev_node = point_node->get_prev(); next_node = point_node->get_next(); if ( prev_node != NULL ) { prev_point = prev_node->get_obj(); if ( prev_point->y > lower_bound ) // In fact it can only be > or == { // Create a point at the intersection of the segment and the floor defined by the lower bound _points->add_after( new ae_point_2d( get_x( lower_bound, prev_point, point ), lower_bound ), prev_node ); #ifdef DEBUG _assert_order(); #endif } // else nothing to do } if ( next_node != NULL ) { next_point = next_node->get_obj(); if ( next_point->y > lower_bound ) { // Create a point at the intersection of the segment and the floor defined by the lower bound _points->add_after( new ae_point_2d( get_x( lower_bound, point, next_point ), lower_bound ), point_node ); #ifdef DEBUG _assert_order(); #endif } // else nothing to do } // Raise current point up to lower_bound point->y = lower_bound; } point_node = point_node->get_next(); } #ifdef DEBUG _assert_order(); #endif } bool ae_fuzzy_set::is_identical_to( const ae_fuzzy_set * other, double tolerance ) const { if ( _points->get_nb_elts() != other->_points->get_nb_elts()) { return false; } ae_list_node* point_node = _points->get_first(); ae_point_2d* point = NULL; ae_list_node* other_node = other->_points->get_first(); ae_point_2d* other_point = NULL; bool ok = true; while ( ok && (point_node != NULL) ) { point = point_node->get_obj(); other_point = other_node->get_obj(); if (fabs(point->x - other_point->x)> tolerance*(fabs(point->x) + fabs(other_point->x)) || fabs(point->y - other_point->y)>tolerance*(fabs(point->y) + fabs(other_point->y))) {ok = false;} point_node = point_node->get_next(); other_node = other_node->get_next(); } return ok; } void ae_fuzzy_set::save( gzFile backup_file ) const { int16_t nb_points = (_points == NULL) ? 0 : _points->get_nb_elts(); gzwrite( backup_file, &nb_points, sizeof(nb_points) ); if ( _points != NULL ) { ae_list_node* point_node = _points->get_first(); ae_point_2d* point; for ( int16_t i = 0 ; i < nb_points ; i++ ) { point = point_node->get_obj(); point->save( backup_file ); point_node = point_node->get_next(); } } } void ae_fuzzy_set::load( gzFile backup_file ) { int16_t nb_points; gzread( backup_file, &nb_points, sizeof(nb_points) ); if ( nb_points > 0 ) _points = new ae_list(); for ( int16_t i = 0 ; i < nb_points ; i++ ) { _points->add( new ae_point_2d( backup_file ) ); } } // ================================================================= // Protected Methods // ================================================================= double ae_fuzzy_set::get_y( double x, ae_list_node* list_entry ) const { if ( list_entry == NULL ) list_entry = _points->get_first(); assert( x >= X_MIN && x <= X_MAX ); assert( list_entry != NULL ); assert( list_entry->get_obj()->x <= x ); assert( _points->get_nb_elts() >= 2 ); // Look for the first point of the list having point->x >= x ae_list_node* point_node = list_entry; ae_point_2d* point = point_node->get_obj(); while ( point->x < x ) { point_node = point_node->get_next(); point = point_node->get_obj(); } // If a point with abscissa x exists, return it's y, otherwise compute the needed y by interpolation // from the 2 flanking points if ( point->x == x ) return point->y; else { ae_point_2d* prev_point = point_node->get_prev()->get_obj(); return prev_point->y + (point->y - prev_point->y) * (x - prev_point->x) / (point->x - prev_point->x); } } ae_list_node* ae_fuzzy_set::create_interpolated_point( double x, ae_list_node* list_entry ) { if ( list_entry == NULL ) list_entry = _points->get_first(); assert( x >= X_MIN && x <= X_MAX ); assert( list_entry->get_obj()->x <= x ); assert( _points->get_nb_elts() >= 2 ); // Look for the first point of the list having point->x >= x ae_list_node* point_node = list_entry; ae_point_2d* point = point_node->get_obj(); while ( point->x < x ) { point_node = point_node->get_next(); point = point_node->get_obj(); } if ( point->x == x ) { // The point already exists, nothing to do return point_node; } else { point_node = _points->add_before( new ae_point_2d( x, get_y( x ) ), point_node ); return point_node; } #ifdef DEBUG _assert_order(); #endif } void ae_fuzzy_set::_assert_order( void ) { assert( (_points->get_first()->get_obj())->x == X_MIN ); assert( (_points->get_last()->get_obj())->x == X_MAX ); ae_list_node* point_node = _points->get_first(); ae_list_node* next_point_node = point_node->get_next(); ae_point_2d* point; ae_point_2d* next_point; while ( next_point_node != NULL ) { point = point_node->get_obj(); next_point = next_point_node->get_obj(); assert( point->x <= next_point->x ); point_node = point_node->get_next(); next_point_node = next_point_node->get_next(); } } aevol-4.4/src/libaevol/ae_mutation.cpp0000644000175000017500000006531112364441727015025 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include //############################################################################## // # // Class ae_mutation # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_mutation::ae_mutation( void ) { _pos = NULL; _length = NULL; _seq = NULL; _align_score = NULL; } ae_mutation::ae_mutation( const ae_mutation &model ) { _pos = NULL; _length = NULL; _seq = NULL; _align_score = NULL; _mut_type = model._mut_type; switch( _mut_type ) { case SWITCH : { _pos = new int32_t( *(model._pos) ); break; } case S_INS : { _pos = new int32_t( *(model._pos) ); _length = new int32_t( *(model._length) ); _seq = new char[_length[0] + 1]; strncpy(_seq, model._seq, _length[0]); _seq[_length[0]] = '\0'; break; } case S_DEL: { _pos = new int32_t( *(model._pos) ); _length = new int32_t( *(model._length) ); break; } case DUPL: { _pos = new int32_t[3]; _pos[0] = model._pos[0]; _pos[1] = model._pos[1]; _pos[2] = model._pos[2]; _length = new int32_t( *(model._length) ); _align_score = new int16_t( *(model._align_score) ); break; } case DEL: { _pos = new int32_t[2]; _pos[0] = model._pos[0]; _pos[1] = model._pos[1]; _length = new int32_t( *(model._length) ); _align_score = new int16_t( *(model._align_score) ); break; } case TRANS: { _pos = new int32_t[4]; _pos[0] = model._pos[0]; _pos[1] = model._pos[1]; _pos[2] = model._pos[2]; _pos[3] = model._pos[3]; _invert = model._invert; _length = new int32_t( *(model._length) ); _align_score = new int16_t[2]; _align_score[0] = model._align_score[0]; _align_score[1] = model._align_score[1]; break; } case INV: { _pos = new int32_t[2]; _pos[0] = model._pos[0]; _pos[1] = model._pos[1]; _length = new int32_t( *(model._length) ); _align_score = new int16_t( *(model._align_score) ); break; } case INSERT: { _pos = new int32_t( *(model._pos) ); _length = new int32_t( *(model._length) ); _seq = new char[_length[0] + 1]; strncpy(_seq, model._seq, _length[0]); _seq[_length[0]] = '\0'; break; } case INS_HT: { _pos = new int32_t[4]; _pos[0] = model._pos[0]; _pos[1] = model._pos[1]; _pos[2] = model._pos[2]; _pos[3] = model._pos[3]; _length = new int32_t( *(model._length) ); _seq = new char[_length[0] + 1]; strncpy(_seq, model._seq, _length[0]); _seq[_length[0]] = '\0'; _align_score = new int16_t[2]; _align_score[0] = model._align_score[0]; _align_score[1] = model._align_score[1]; _donor_id = model._donor_id; _sense = model._sense; break; } case REPL_HT: { _pos = new int32_t[4]; _pos[0] = model._pos[0]; _pos[1] = model._pos[1]; _pos[2] = model._pos[2]; _pos[3] = model._pos[3]; _length = new int32_t[2]; _length[0] = model._length[0]; _length[1] = model._length[1]; _seq = new char[_length[1] + 1]; strncpy(_seq, model._seq, _length[1]); _seq[_length[1]] = '\0'; _align_score = new int16_t[2]; _align_score[0] = model._align_score[0]; _align_score[1] = model._align_score[1]; _donor_id = model._donor_id; _sense = model._sense; break; } default : { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", model._mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } } ae_mutation::ae_mutation( gzFile backup_file ) { _pos = NULL; _length = NULL; _seq = NULL; _align_score = NULL; int8_t tmp_mut_type; gzread( backup_file, &tmp_mut_type, sizeof(tmp_mut_type) ); _mut_type = (ae_mutation_type) tmp_mut_type; //~ printf("mut type %d\n", _mut_type); switch ( _mut_type ) { case SWITCH : { _pos = new int32_t; gzread( backup_file, _pos, sizeof(*_pos) ); break; } case S_INS : { _pos = new int32_t; gzread( backup_file, _pos, sizeof(*_pos) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _seq = new char[_length[0] + 1]; gzread( backup_file, _seq, _length[0] * sizeof(_seq[0]) ); _seq[_length[0]] = '\0'; break; } case S_DEL : { _pos = new int32_t; gzread( backup_file, _pos, sizeof(*_pos) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); break; } case DUPL : { _pos = new int32_t[3]; gzread( backup_file, _pos, 3 * sizeof(_pos[0]) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _align_score = new int16_t; gzread( backup_file, _align_score, sizeof(*_align_score) ); break; } case DEL : { _pos = new int32_t[2]; gzread( backup_file, _pos, 2 * sizeof(_pos[0]) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _align_score = new int16_t; gzread( backup_file, _align_score, sizeof(*_align_score) ); break; } case TRANS : { _pos = new int32_t[4]; gzread( backup_file, _pos, 4 * sizeof(_pos[0]) ); int8_t tmp_invert; gzread( backup_file, &tmp_invert, sizeof(tmp_invert) ); _invert = (tmp_invert != 0); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _align_score = new int16_t[2]; gzread( backup_file, _align_score, 2 * sizeof(_align_score[0]) ); break; } case INV : { _pos = new int32_t[2]; gzread( backup_file, _pos, 2 * sizeof(_pos[0]) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _align_score = new int16_t; gzread( backup_file, _align_score, sizeof(*_align_score) ); break; } case INSERT: { _pos = new int32_t; gzread( backup_file, _pos, sizeof(*_pos) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _seq = new char[_length[0] + 1]; gzread( backup_file, _seq, _length[0] * sizeof(_seq[0]) ); _seq[_length[0]] = '\0'; } case INS_HT: { _pos = new int32_t[4]; gzread( backup_file, _pos, 4 * sizeof(_pos[0]) ); _length = new int32_t; gzread( backup_file, _length, sizeof(*_length) ); _seq = new char[_length[0] + 1]; gzread( backup_file, _seq, _length[0] * sizeof(_seq[0]) ); _seq[_length[0]] = '\0'; _align_score = new int16_t[2]; gzread( backup_file, _align_score, 2 * sizeof(_align_score[0]) ); gzread( backup_file, &_donor_id, sizeof(_donor_id) ); gzread( backup_file, &_sense, sizeof(_sense) ); break; } case REPL_HT: { _pos = new int32_t[4]; gzread( backup_file, _pos, 4 * sizeof(_pos[0]) ); _length = new int32_t[2]; gzread( backup_file, _length, 2 *sizeof(_length[0]) ); _seq = new char[_length[1] + 1]; gzread( backup_file, _seq, _length[1] * sizeof(_seq[0]) ); _seq[_length[1]] = '\0'; _align_score = new int16_t[2]; gzread( backup_file, _align_score, 2 * sizeof(_align_score[0]) ); gzread( backup_file, &_donor_id, sizeof(_donor_id) ); gzread( backup_file, &_sense, sizeof(_sense) ); break; } default : { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } } // ================================================================= // Destructors // ================================================================= ae_mutation::~ae_mutation( void ) { switch ( _mut_type ) { case SWITCH : delete _pos; delete _length; break; case S_INS : delete _pos; delete _length; delete [] _seq; break; case S_DEL : delete _pos; delete _length; break; case DUPL : delete [] _pos; delete _length; delete _align_score; break; case DEL : delete [] _pos; delete _length; delete _align_score; break; case TRANS : delete [] _pos; delete _length; delete [] _align_score; break; case INV : delete [] _pos; delete _length; delete _align_score; break; case INSERT : delete _pos; delete _length; delete [] _seq; break; case INS_HT: delete [] _pos; delete _length; delete [] _align_score; delete [] _seq; break; case REPL_HT: delete [] _pos; delete [] _length; delete [] _align_score; delete [] _seq; break; default : fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } // ================================================================= // Public Methods // ================================================================= void ae_mutation::report_point_mutation( int32_t pos ) { //~ printf( "report point mutation at %ld\n", pos ); _mut_type = SWITCH; _pos = new int32_t( pos ); _length = new int32_t(1); } void ae_mutation::report_small_insertion( int32_t pos, int32_t length, const char* seq ) { //~ printf( "report small insertion of %s (%ld) at %ld\n", seq, length, pos ); _mut_type = S_INS; _pos = new int32_t( pos ); _length = new int32_t(length); _seq = new char[length + 1]; strncpy(_seq, seq, length); _seq[length] = '\0'; } void ae_mutation::report_small_deletion( int32_t pos, int32_t length ) { //~ printf( "report small deletion of %ld at %ld\n", length, pos ); _mut_type = S_DEL; _pos = new int32_t( pos ); _length = new int32_t(length); } void ae_mutation::report_duplication( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t length, int16_t align_score ) { //~ printf( "report duplication of [%ld, %ld] to %ld\n", pos_1, pos_2, pos_3 ); _mut_type = DUPL; _pos = new int32_t[3]; _pos[0] = pos_1; _pos[1] = pos_2; _pos[2] = pos_3; _length = new int32_t(length); _align_score = new int16_t( align_score ); } void ae_mutation::report_deletion( int32_t pos_1, int32_t pos_2, int32_t length, int16_t align_score ) { //~ printf( "report deletion of [%ld, %ld]\n", pos_1, pos_2 ); _mut_type = DEL; _pos = new int32_t[2]; _pos[0] = pos_1; _pos[1] = pos_2; _length = new int32_t(length); _align_score = new int16_t( align_score ); } void ae_mutation::report_translocation( int32_t pos_1, int32_t pos_2, int32_t pos_3, int32_t pos_4, int32_t length, bool invert, int16_t align_score_1, int16_t align_score_2 ) { //~ printf( "report translocation of [%ld, %ld] to %ld through %ld (%s)\n", pos_1, pos_2, pos_3, pos_4, invert?"invert":"plain" ); _mut_type = TRANS; _pos = new int32_t[4]; _pos[0] = pos_1; _pos[1] = pos_2; _pos[2] = pos_3; _pos[3] = pos_4; _invert = invert; _length = new int32_t(length); _align_score = new int16_t[2]; _align_score[0] = align_score_1; _align_score[1] = align_score_2; } void ae_mutation::report_inversion( int32_t pos_1, int32_t pos_2, int32_t length, int16_t align_score ) { //~ printf( "report inversion of [%ld, %ld]\n", pos_1, pos_2 ); _mut_type = INV; _pos = new int32_t[2]; _pos[0] = pos_1; _pos[1] = pos_2; _length = new int32_t(length); _align_score = new int16_t( align_score ); } void ae_mutation::report_insertion( int32_t pos, int32_t length, const char* seq ) { //~ printf( "report insertion of %s (%ld) at %ld\n", seq, length, pos ); _mut_type = INSERT; _pos = new int32_t( pos ); _length = new int32_t(length); _seq = new char[length + 1]; strncpy(_seq, seq, length); _seq[length] = '\0'; } void ae_mutation::report_ins_HT(int32_t alignment_1_donor_pos_1, int32_t alignment_1_donor_pos_2, int32_t alignment_2_ind_pos, int32_t alignment_2_donor_pos, int32_t length, int16_t alignment_1_score, int16_t alignment_2_score, int32_t donor_id, ae_sense sense, const char* donor_seq) { _mut_type = INS_HT; _pos = new int32_t[4]; _pos[0] = alignment_1_donor_pos_1; //donor _pos[1] = alignment_1_donor_pos_2; //donor _pos[2] = alignment_2_ind_pos; //exogenote // NOTE: wrong comment? I think it's receiver _pos[3] = alignment_2_donor_pos; //receiver // NOTE: wrong comment? I think it's exogenote _length = new int32_t( length ); _seq = new char[length + 1]; strncpy(_seq, donor_seq, length); _seq[length] = '\0'; _align_score = new int16_t[2]; _align_score[0] = alignment_1_score; _align_score[1] = alignment_2_score; _donor_id = donor_id; _sense = sense; } void ae_mutation::report_repl_HT(int32_t alignment_1_ind_pos, int32_t alignment_1_donor_pos, int32_t alignment_2_ind_pos, int32_t alignment_2_donor_pos, int32_t repl_seq_length, int32_t donor_seq_length, int16_t alignment_1_score, int16_t alignment_2_score, int32_t donor_id, ae_sense sense, const char* donor_seq) { _mut_type = REPL_HT; _pos = new int32_t[4]; _pos[0] = alignment_1_ind_pos; //receiver _pos[1] = alignment_1_donor_pos; //donor _pos[2] = alignment_2_ind_pos; //receiver _pos[3] = alignment_2_donor_pos; //donor _length = new int32_t[2]; _length[0] = repl_seq_length; _length[1] = donor_seq_length; _seq = new char[donor_seq_length + 1]; strncpy(_seq, donor_seq, donor_seq_length); _seq[donor_seq_length] = '\0'; _align_score = new int16_t[2]; _align_score[0] = alignment_1_score; _align_score[1] = alignment_2_score; _donor_id = donor_id; _sense = sense; } void ae_mutation::save( gzFile backup_file ) // Usually is the tree file (?) { int8_t tmp_mut_type = _mut_type; gzwrite( backup_file, &tmp_mut_type, sizeof(tmp_mut_type) ); switch ( _mut_type ) { case SWITCH : { gzwrite( backup_file, _pos, sizeof(*_pos) ); break; } case S_INS : { gzwrite( backup_file, _pos, sizeof(*_pos) ); gzwrite( backup_file, _length, sizeof(*_length) ); gzwrite( backup_file, _seq, _length[0] * sizeof(_seq[0]) ); break; } case S_DEL : { gzwrite( backup_file, _pos, sizeof(*_pos) ); gzwrite( backup_file, _length, sizeof(*_length) ); break; } case DUPL : { gzwrite( backup_file, _pos, 3 * sizeof(_pos[0]) ); gzwrite( backup_file, _length, sizeof(*_length) ); gzwrite( backup_file, _align_score, sizeof(*_align_score) ); break; } case DEL : { gzwrite( backup_file, _pos, 2 * sizeof(_pos[0]) ); gzwrite( backup_file, _length, sizeof(*_length) ); gzwrite( backup_file, _align_score, sizeof(*_align_score) ); break; } case TRANS : { gzwrite( backup_file, _pos, 4 * sizeof(_pos[0]) ); int8_t tmp_invert = _invert? 1 : 0; gzwrite( backup_file, &tmp_invert, sizeof(tmp_invert) ); gzwrite( backup_file, _length, sizeof(*_length) ); gzwrite( backup_file, _align_score, 2 * sizeof(_align_score[0]) ); break; } case INV : { gzwrite( backup_file, _pos, 2 * sizeof(_pos[0]) ); gzwrite( backup_file, _length, sizeof(*_length) ); gzwrite( backup_file, _align_score, sizeof(*_align_score) ); break; } case INS_HT: { gzwrite( backup_file, _pos, 4 * sizeof(_pos[0]) ); gzwrite( backup_file, _length, sizeof(*_length) ); gzwrite( backup_file, _seq, _length[0] * sizeof(_seq[0]) ); gzwrite( backup_file, _align_score, 2 * sizeof(_align_score[0]) ); gzwrite( backup_file, &_donor_id, sizeof(_donor_id) ); gzwrite( backup_file, &_sense, sizeof(_sense) ); break; } case REPL_HT: { gzwrite( backup_file, _pos, 4 * sizeof(_pos[0]) ); gzwrite( backup_file, _length, 2 *sizeof(_length[0]) ); gzwrite( backup_file, _seq, _length[1] * sizeof(_seq[0]) ); gzwrite( backup_file, _align_score, 2 * sizeof(_align_score[0]) ); gzwrite( backup_file, &_donor_id, sizeof(_donor_id) ); gzwrite( backup_file, &_sense, sizeof(_sense) ); break; } default : { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } } void ae_mutation::get_generic_description_string( char * str ) { switch ( _mut_type ) { case SWITCH : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], -1, -1, -1, (int8_t) -1, (int16_t) -1, (int16_t) -1, (int32_t) -1, (int32_t) -1 ); break; } case S_INS : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], -1, -1, -1, (int8_t) -1, (int16_t) -1, (int16_t) -1, _length[0], (int32_t) -1 ); break; } case S_DEL : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], -1, -1, -1, (int8_t) -1, (int16_t) -1, (int16_t) -1, _length[0], (int32_t) -1 ); break; } case DUPL : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], _pos[1], _pos[2], -1, (int8_t) -1, *_align_score, (int16_t) -1, _length[0], (int32_t) -1 ); break; } case DEL : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], _pos[1], -1, -1, (int8_t) -1, *_align_score, (int16_t) -1, _length[0], (int32_t) -1 ); break; } case TRANS : { int8_t tmp_invert = _invert? 1 : 0; sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], _pos[1], _pos[2], _pos[3], tmp_invert, _align_score[0], _align_score[1], _length[0], (int32_t) -1 ); break; } case INV : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], _pos[1], -1, -1, (int8_t) -1, *_align_score, (int16_t) -1, _length[0], (int32_t) -1 ); break; } case INSERT : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], (int32_t)-1, (int32_t)-1, (int32_t)-1, (int8_t) -1, (int16_t) -1, (int16_t) -1, _length[0], (int32_t) -1 ); break; } case INS_HT : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32"", \ (int8_t) _mut_type, _pos[0], _pos[1], _pos[2], _pos[3], (int8_t) _sense, _align_score[0], _align_score[1], _length[0], (int32_t) -1 ); break; } case REPL_HT : { sprintf( str, "%"PRId8" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId8" %"PRId16" %"PRId16" %"PRId32" %"PRId32" ", \ (int8_t) _mut_type, _pos[0], _pos[1], _pos[2], _pos[3], (int8_t) _sense, _align_score[0], _align_score[1], _length[1], _length[0] ); break; } default : { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } } /* DEPRECATED, use get_length instead */ int32_t ae_mutation::segment_length( int32_t gen_unit_len ) { int32_t res = 0; switch ( _mut_type ) { case SWITCH : { res = 1; break; } case S_INS : { res = _length[0]; break; } case S_DEL : { res = _length[0]; break; } case DUPL : { // pos 0 = begin_seg; // pos 1 = end_seg; // pos 2 = insertion_point; if (_pos[0] <= _pos[1]) res = _pos[1] - _pos[0]; else res = gen_unit_len - _pos[0] + _pos[1]; break; } case DEL : { // pos 0 = begin_seg; // pos 1 = end_seg; if (_pos[0] <= _pos[1]) res = _pos[1] - _pos[0]; else res = gen_unit_len - _pos[0] + _pos[1]; break; } case TRANS : { // pos 0 = begin_seg; // pos 1 = end_seg; // pos 2 = cutting_point_in_translocated_segment (1st reinserted bp) // pos 3 = reinsertion_point_in_chromosome; if (_pos[0] <= _pos[1]) res = _pos[1] - _pos[0]; else res = gen_unit_len - _pos[0] + _pos[1]; break; } case INV : { // pos 0 = begin_seg; // pos 1 = end_seg; if (_pos[0] <= _pos[1]) res = _pos[1] - _pos[0]; else res = gen_unit_len - _pos[0] + _pos[1]; break; } case INS_HT : { break; } case REPL_HT : { break; } default : { fprintf( stderr, "ERROR, invalid mutation type \"%d\" in file %s:%d.\n", _mut_type, __FILE__, __LINE__ ); exit( EXIT_FAILURE ); break; } } return res; } void ae_mutation::get_infos_point_mutation( int32_t* pos ) { assert( _mut_type == SWITCH ); *pos = _pos[0]; } void ae_mutation::get_infos_small_insertion( int32_t* pos, int32_t* length ) { assert( _mut_type == S_INS ); *pos = *_pos; *length = _length[0]; } // seq must be a char array, large enough to contain _length+1 characters void ae_mutation::get_sequence_small_insertion( char* seq ) { assert( _mut_type == S_INS ); strncpy( seq, _seq, _length[0]); seq[_length[0]] = '\0'; } void ae_mutation::get_infos_small_deletion( int32_t* pos, int32_t* length ) { assert( _mut_type == S_DEL ); *pos = _pos[0]; *length = _length[0]; } void ae_mutation::get_infos_duplication( int32_t* pos1, int32_t* pos2, int32_t* pos3, int16_t* align_score ) { assert( _mut_type == DUPL ); *pos1 = _pos[0]; *pos2 = _pos[1]; *pos3 = _pos[2]; if ( align_score != NULL ) { *align_score = *_align_score; } } void ae_mutation::get_infos_deletion( int32_t* pos1, int32_t* pos2, int16_t* align_score ) { assert( _mut_type == DEL ); *pos1 = _pos[0]; *pos2 = _pos[1]; if ( align_score != NULL ) { *align_score = *_align_score; } } void ae_mutation::get_infos_translocation( int32_t* pos1, int32_t* pos2, int32_t* pos3, int32_t* pos4, bool* invert, int16_t* align_score_1, int16_t* align_score_2 ) { assert( _mut_type == TRANS ); *pos1 = _pos[0]; *pos2 = _pos[1]; *pos3 = _pos[2]; *pos4 = _pos[3]; *invert = _invert; if ( align_score_1 != NULL && align_score_2 != NULL ) { *align_score_1 = _align_score[0]; *align_score_2 = _align_score[1]; } } void ae_mutation::get_infos_inversion( int32_t* pos1, int32_t* pos2, int16_t* align_score ) { assert( _mut_type == INV ); *pos1 = _pos[0]; *pos2 = _pos[1]; if ( align_score != NULL ) { *align_score = *_align_score; } } void ae_mutation::get_infos_insertion( int32_t* pos, int32_t* length ) { assert( _mut_type == INSERT ); *pos = _pos[0]; *length = _length[0]; } void ae_mutation::get_sequence_insertion( char* seq ) { assert( _mut_type == INSERT ); strncpy( seq, _seq, _length[0]); seq[_length[0]] = '\0'; } void ae_mutation::get_infos_ins_HT( int32_t* pos1, int32_t* pos2, int32_t* pos3, int32_t* pos4, ae_sense* sense, int32_t* length ) { assert( _mut_type == INS_HT ); *pos1 = _pos[0]; *pos2 = _pos[1]; *pos3 = _pos[2]; *pos4 = _pos[3]; *sense = _sense; *length = _length[0]; } void ae_mutation::get_sequence_ins_HT( char* seq ) { assert( _mut_type == INS_HT ); strncpy( seq, _seq, _length[0]); seq[_length[0]] = '\0'; } void ae_mutation::get_infos_repl_HT( int32_t* pos1, int32_t* pos2, int32_t* pos3, int32_t* pos4, ae_sense* sense, int32_t* length ) { assert( _mut_type == REPL_HT ); *pos1 = _pos[0]; *pos2 = _pos[1]; *pos3 = _pos[2]; *pos4 = _pos[3]; *sense = _sense; *length = _length[1]; } void ae_mutation::get_sequence_repl_HT( char* seq ) { assert( _mut_type == REPL_HT ); strncpy( seq, _seq, _length[1]); seq[_length[1]] = '\0'; } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_exp_manager_X11.cpp0000644000175000017500000006321512322771742016102 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include #include // XCheckMaskEvent() doesn't get ClientMessage Events so use XCheckIfEvent() // with this Predicate function as a work-around ( ClientMessage events // are needed in order to catch "WM_DELETE_WINDOW") static Bool AlwaysTruePredicate ( Display*, XEvent*, char* ) { return True; } //############################################################################## // # // Class ae_exp_manager_X11 # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= #define NB_WIN INT32_C(7) // Number of windows that can be showed => CDS, RNA, phenotype, ... // ================================================================= // Constructors // ================================================================= ae_exp_manager_X11::ae_exp_manager_X11( void ) : ae_exp_manager() { // Basic initializations _win = NULL; _win_size = NULL; _win_pos = NULL; _win_name = NULL; _display_on = false; _handle_display_on_off = false; // Initialize XLib stuff _display = XOpenDisplay( NULL ); _screen = XDefaultScreen( _display ); _atoms = new Atom[2]; _atoms[0] = XInternAtom( _display, "WM_DELETE_WINDOW", False ); _atoms[1] = XInternAtom( _display, "WM_PROTOCOLS", False ); set_codes(); } //ae_exp_manager_X11::ae_exp_manager_X11( ae_param_overloader* param_overloader /* = NULL */ ) : ae_exp_manager( param_overloader ) /*{ initialize(); }*/ //ae_exp_manager_X11::ae_exp_manager_X11( char* backup_file_name, bool to_be_run /* = true */, ae_param_overloader* param_overloader /* = NULL */ ) : /* ae_exp_manager( backup_file_name, to_be_run, param_overloader ) { initialize(); }*/ // ================================================================= // Destructors // ================================================================= ae_exp_manager_X11::~ae_exp_manager_X11( void ) { delete [] _key_codes; delete [] _atoms; for ( int8_t i = 0 ; i < NB_WIN ; i++ ) { if ( _win != NULL ) { if ( _win[i] != NULL ) delete _win[i]; } if ( _win_size != NULL ) { if ( _win_size[i] != NULL ) delete [] _win_size[i]; } if ( _win_pos != NULL ) { if ( _win_pos[i] != NULL ) delete [] _win_pos[i]; } } if ( _win != NULL ) delete [] _win; XCloseDisplay( _display ); if ( _win_name != NULL ) delete [] _win_name; if ( _win_size != NULL ) delete [] _win_size; if ( _win_pos != NULL ) delete [] _win_pos; } // ================================================================= // Public Methods // ================================================================= bool ae_exp_manager_X11::quit_signal_received( void ) { return _quit_signal_received; } void ae_exp_manager_X11::display( void ) { // --------------------- // 1) Handle user events // --------------------- if ( _display_on ) handle_events(); // -------------------------------------------------- // 2) Handle signal that toggle the display on or off // -------------------------------------------------- if ( _handle_display_on_off ) { _handle_display_on_off = false; if ( _display_on ) // Display was "on", close all windows (after saving their current size and position) { for ( int8_t num_win = 0 ; num_win < NB_WIN ; num_win++ ) { if ( _win[num_win] != NULL ) { // 1) Save current window position and size Window aWindow; // Unused int x_return, y_return; int dest_x_return, dest_y_return; unsigned int border_width_return, depth_return; // Unused XGetGeometry( _display, _win[num_win]->get_window(), &aWindow, &x_return, &y_return, &_win_size[num_win][0], &_win_size[num_win][1], &border_width_return, &depth_return ); XTranslateCoordinates( _display, _win[num_win]->get_window(), DefaultRootWindow(_display), 0, 0, &dest_x_return, &dest_y_return, &aWindow ); _win_pos[num_win][0] = dest_x_return - x_return; _win_pos[num_win][1] = dest_y_return - y_return; // 2) Delete window delete _win[num_win]; _win[num_win] = NULL; } } XFlush( _display ); delete _win; _win = NULL; _display_on = false; } else // Display was "off", open windows { _show_window |= 1; _new_show_window = _show_window; // If it's the first time the display is switched on, initialize it. if ( _win == NULL ) initialize(); for ( int8_t i = 0 ; i < NB_WIN ; i++ ) { if ( get_show_window(i) ) { _win[i] = new ae_X11_window( _display, _screen, _atoms, _win_pos[i][0], _win_pos[i][1], _win_size[i][0], _win_size[i][1], _win_name[i] ); } } _display_on = true; } } // ---------- // 3) Display // ---------- if ( _display_on ) { for ( int8_t i = 0 ; i < NB_WIN ; i++ ) { if ( get_show_window( i ) ) { if ( get_new_show_window( i ) ) { draw_window( i ); } else { refresh_window( i ); } } } // Refresh all windows XFlush( _display ); } } void ae_exp_manager_X11::handle_events( void ) { XEvent event; int8_t win_number; // XCheckMaskEvent() doesn't get ClientMessage Events so use XCheckIfEvent() // with the custom AlwaysTruePredicate function as a work-around (ClientMessage // events are needed in order to catch "WM_DELETE_WINDOW") int iCurrEvent = 0; int iIgnoreNoise = 0; while( XCheckIfEvent( _display, &event, AlwaysTruePredicate, 0) ) { iCurrEvent ++; win_number = identify_window( event.xany.window ); if( win_number == -1) continue; // We discard this event because it occurred on a destroyed window // (e.g. the user pressed F3 and then moved or resized the window, // before the window was destroyed) switch( event.type ) { case ConfigureNotify : { _win[win_number]->resize( event.xconfigure.width, event.xconfigure.height ); //~ _win[win_number]->repos( event.xconfigure.x, event.xconfigure.y ); // Mark window as having to be entirely redrawn _new_show_window |= 1 << win_number; break; } case MapNotify : { draw_window( win_number ); break; } case Expose: { if( iCurrEvent > iIgnoreNoise ) { draw_window( win_number ); iIgnoreNoise = iCurrEvent + XQLength( _display ); } break; } case ClientMessage : { if ( ((Atom) event.xclient.data.l[0]) == _atoms[0] ) // The user closed the window by clicking on the cross { // 1) Save current window position and size Window aWindow; // Unused int x_return, y_return; int dest_x_return, dest_y_return; unsigned int border_width_return, depth_return; // Unused XGetGeometry( _display, _win[win_number]->get_window(), &aWindow, &x_return, &y_return, &_win_size[win_number][0], &_win_size[win_number][1], &border_width_return, &depth_return ); XTranslateCoordinates( _display, _win[win_number]->get_window(), DefaultRootWindow(_display), 0, 0, &dest_x_return, &dest_y_return, &aWindow ); _win_pos[win_number][0] = dest_x_return - x_return; _win_pos[win_number][1] = dest_y_return - y_return; // 2) Delete window and mark as "not to be shown" delete _win[win_number]; _win[win_number] = NULL; _show_window &= ~(1 << win_number); // 3) If it was the main that was closed, turn display off. if ( win_number == 0 ) { _handle_display_on_off = true; } } break; } case KeyPress : { // Not sure a switch would work on any platform => use ifs instead if ( event.xkey.keycode == _key_codes[KEY_F1] || event.xkey.keycode == _key_codes[KEY_F2] || event.xkey.keycode == _key_codes[KEY_F3] || event.xkey.keycode == _key_codes[KEY_F4] || event.xkey.keycode == _key_codes[KEY_F5] || event.xkey.keycode == _key_codes[KEY_F6] ) { int8_t num_win; // Not sure a switch would work on any platform => use ifs instead if ( event.xkey.keycode == _key_codes[KEY_F1] ) num_win = 1; else if ( event.xkey.keycode == _key_codes[KEY_F2] ) num_win = 2; else if ( event.xkey.keycode == _key_codes[KEY_F3] ) num_win = 3; else if ( event.xkey.keycode == _key_codes[KEY_F4] ) num_win = 4; else if ( event.xkey.keycode == _key_codes[KEY_F5] ) num_win = 5; else num_win = 6; // case where ( event.xkey.keycode == _key_codes[KEY_F6] ) if ( get_show_window( num_win ) ) { // 1) Save current window position and size Window aWindow; // Unused int x_return, y_return; int dest_x_return, dest_y_return; unsigned int border_width_return, depth_return; // Unused XGetGeometry( _display, _win[num_win]->get_window(), &aWindow, &x_return, &y_return, &_win_size[num_win][0], &_win_size[num_win][1], &border_width_return, &depth_return ); XTranslateCoordinates( _display, _win[num_win]->get_window(), DefaultRootWindow(_display), 0, 0, &dest_x_return, &dest_y_return, &aWindow ); _win_pos[num_win][0] = dest_x_return - x_return; _win_pos[num_win][1] = dest_y_return - y_return; // 2) Delete window and mark as "not to be shown" delete _win[num_win]; _win[num_win] = NULL; _show_window &= ~(1 << num_win); } else { _win[num_win] = new ae_X11_window( _display, _screen, _atoms, _win_pos[num_win][0], _win_pos[num_win][1], _win_size[num_win][0], _win_size[num_win][1], _win_name[num_win] ); _new_show_window |= 1 << num_win; _show_window |= _new_show_window; draw_window( num_win ); } } else if ( event.xkey.keycode == _key_codes[KEY_P] ) { printf(" P A U S E D \n"); bool pause_key = false; while ( ! pause_key ) { if ( XCheckIfEvent( _display, &event, AlwaysTruePredicate, 0) ) { if ( event.xkey.keycode == _key_codes[KEY_P] ) { pause_key = true; } } } } else if ( (event.xkey.state & ControlMask) && (event.xkey.keycode == _key_codes[KEY_Q])) { printf(" Q U I T R E Q U E S T E D\n"); _quit_signal_received = true; // We do not exit here, because it is cleaner to let the main program // interpret the signal and call the destructor of the simulation. // This ensures that the connection to the X server will be closed // in a clean way, which is much better if we want to run other // X applications afterwards! } break; } default : { // printf("event not handled \n"); break; } } } } void ae_exp_manager_X11::toggle_display_on_off( void ) { // Mark action to be done _handle_display_on_off = true; } // ================================================================= // Protected Methods // ================================================================= void ae_exp_manager_X11::initialize( bool with_grid /*= false*/, bool with_plasmids /*= false*/ ) { // Initialize window structures _win = new ae_X11_window* [NB_WIN]; _win_size = new unsigned int* [NB_WIN]; _win_pos = new int* [NB_WIN]; for ( int8_t i = 0 ; i < NB_WIN ; i++ ) { _win[i] = NULL; // Default values _win_size[i] = new unsigned int[2]; _win_size[i][0] = 300; _win_size[i][1] = 300; _win_pos[i] = new int[2]; _win_pos[i][0] = 0; _win_pos[i][1] = 0; } // Set phenotype window width _win_size[1][0] = 600; // Set CDS and RNA window width if ( with_plasmids ) { _win_size[2][0] = 600; _win_size[3][0] = 600; } // Set initial positions if screen is large enough if ( with_plasmids && with_grid ) { //if ( XDisplayWidth( _display, _screen ) >= 900 && XDisplayHeight( _display, _screen ) >= 650 ) { _win_pos[0][0] = 0; _win_pos[0][1] = 0; _win_pos[1][0] = 300; _win_pos[1][1] = 0; _win_pos[2][0] = 0; _win_pos[2][1] = 350; _win_pos[3][0] = 0; _win_pos[3][1] = 700; } } else if ( with_plasmids ) { //if ( XDisplayWidth( _display, _screen ) >= 900 && XDisplayHeight( _display, _screen ) >= 650 ) { _win_pos[0][0] = 0; _win_pos[0][1] = 0; _win_pos[1][0] = 300; _win_pos[1][1] = 0; _win_pos[2][0] = 0; _win_pos[2][1] = 350; _win_pos[3][0] = 0; _win_pos[3][1] = 700; } } else if ( with_grid ) { //if ( XDisplayWidth( _display, _screen ) >= 900 && XDisplayHeight( _display, _screen ) >= 650 ) { _win_pos[0][0] = 0; _win_pos[0][1] = 0; _win_pos[1][0] = 300; _win_pos[1][1] = 0; _win_pos[2][0] = 0; _win_pos[2][1] = 350; _win_pos[3][0] = 300; _win_pos[3][1] = 350; } } else // ( ! with_plasmids && ! with_grid ) { //if ( XDisplayWidth( _display, _screen ) >= 900 && XDisplayHeight( _display, _screen ) >= 650 ) { _win_pos[0][0] = 0; _win_pos[0][1] = 0; _win_pos[1][0] = 300; _win_pos[1][1] = 0; _win_pos[2][0] = 0; _win_pos[2][1] = 350; _win_pos[3][0] = 300; _win_pos[3][1] = 350; } } // Visible windows at the beginning of the run if ( with_grid ) { _show_window = 0x007F; // hex for bin 1111111 => show first 7 windows } else { _show_window = 0x000F; // hex for bin 1111 => show first 4 windows } _new_show_window = _show_window; _win_name = new char*[NB_WIN]; if ( with_grid ) _win_name[0] = (char*) "Population grid"; else _win_name[0] = (char*) "Population"; _win_name[1] = (char*) "Phenotypic profile"; _win_name[2] = (char*) "Genes"; _win_name[3] = (char*) "RNAs"; _win_name[4] = (char*) "Secreted compound present"; _win_name[5] = (char*) "Metabolic fitness"; _win_name[6] = (char*) "Current secretion"; } int8_t ae_exp_manager_X11::identify_window( Window winID ) { for ( int8_t i = 0 ; i < NB_WIN ; i++ ) { if ( _win[i] != NULL ) { if ( _win[i]->get_window() == winID ) return i; } } return -1; } void ae_exp_manager_X11::draw_window( int8_t win_number ) { if ( _win[win_number] == NULL) { fprintf(stderr, "Error: cannot draw this window, it doesn't exist.\n"); return; } ae_X11_window* cur_win = _win[win_number]; switch ( win_number ) { case 0: { break; } case 1: { cur_win->blacken(); // Display colour bar char* color; for ( int16_t i = 0 ; i < cur_win->get_width() ; i++ ) { color = ae_X11_window::get_color( ((double)i / cur_win->get_width()) * (X_MAX - X_MIN) ); //~ cur_win->draw_line( i, 0, i, cur_win->get_height() / 20, color ); cur_win->draw_line( i, cur_win->get_height() * 19 / 20, i, cur_win->get_height(), color ); delete [] color; } break; } case 2: { break; } case 3: { break; } // Amount of secreted compound present at each grid location case 4: { break; } // Metabolic fitness grid case 5: { break; } // Current secretion (how much is secreted by each organism) case 6: { break; } } refresh_window( win_number ); _new_show_window &= ~(1 << win_number); XFlush(_display); } void ae_exp_manager_X11::refresh_window( int8_t win_number ) { if ( _win[win_number] == NULL) { fprintf(stderr, "Error: cannot draw this window, it doesn't exist.\n"); return; } ae_X11_window* cur_win = _win[win_number]; switch ( win_number ) { // Main window (population) case 0 : { cur_win->blacken(); if ( is_spatially_structured() ) { double** grid = get_spatial_structure()->get_total_fitness_grid(); ((ae_population_X11*)_pop)->display_grid( cur_win, grid ); // Has been allocated in ae_spatial_structure::get_total_fitness_grid() for ( int16_t x = 0 ; x < get_grid_width() ; x++ ) { delete [] grid[x]; } delete [] grid; } else { ((ae_population_X11*)_pop)->display( cur_win ); } break; } // Display phenotypes and environment case 1 : { // Blacken all the window except the colour bar cur_win->fill_rectangle( 0, 0, cur_win->get_width(), cur_win->get_height() * 19 / 20, BLACK ); // Mark all the non-metabolic segments (paint them in grey) if ( get_env()->get_nb_segments() > 1 ) { ae_env_segment** segments = get_env()->get_segments(); for ( int16_t i = 0 ; i < get_env()->get_nb_segments() ; i++ ) { if ( segments[i]->feature != METABOLISM ) { if ( segments[i]->feature == NEUTRAL ) { cur_win->fill_rectangle( cur_win->get_width() * segments[i]->start / (X_MAX-X_MIN), 0.0, cur_win->get_width() * (segments[i]->stop - segments[i]->start) / (X_MAX-X_MIN), cur_win->get_height() * 19 / 20, DARKER_GREY ); } else { cur_win->fill_rectangle( cur_win->get_width() * segments[i]->start / (X_MAX-X_MIN), 0.0, cur_win->get_width() * (segments[i]->stop - segments[i]->start) / (X_MAX-X_MIN), cur_win->get_height() * 19 / 20, GREY ); } } } } // Display all the phenotypes (blue) ae_list_node* indiv_node = _pop->get_indivs()->get_first(); ae_individual* indiv; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); indiv->get_phenotype()->display( cur_win, BLUE ); if ( indiv->get_allow_plasmids() ) { ((ae_fuzzy_set_X11*)indiv->get_genetic_unit( 0 )->get_phenotypic_contribution())->display( cur_win, YELLOW ); ((ae_fuzzy_set_X11*)indiv->get_genetic_unit( 1 )->get_phenotypic_contribution())->display( cur_win, GREEN ); } indiv_node = indiv_node->get_next(); } // Display best indiv's phenotype (white) get_best_indiv()->get_phenotype()->display( cur_win, WHITE, true ); // Display environment (red) get_env()->display( cur_win, RED, false, true ); } break; // Display genes case 2 : { cur_win->blacken(); ae_individual_X11* indiv = dynamic_cast( get_best_indiv() ); indiv->display_cdss( cur_win ); } break; // Display RNAs case 3 : { cur_win->blacken(); ae_individual_X11* indiv = dynamic_cast( get_best_indiv() ); indiv->display_rnas( cur_win ); } break; // Display the amount of secreted compound present at each location case 4 : { cur_win->blacken(); if ( is_spatially_structured() ) { ((ae_population_X11*)_pop)->display_grid( cur_win, get_spatial_structure()->get_secretion_present_grid()); } } break; // Display the metabolic fitness grid case 5 : { cur_win->blacken(); ((ae_population_X11*)_pop)->display_grid( cur_win, get_spatial_structure()->get_metabolic_fitness_grid()); } break; // display current secretion (how much is secreted by each organism) case 6: { cur_win->blacken(); ((ae_population_X11*)_pop)->display_grid( cur_win, get_spatial_structure()->get_secreted_amount_grid()); } break; } XFlush( _display ); } void ae_exp_manager_X11::set_codes( void ) { _key_codes = new KeyCode[50]; assert( _key_codes ); _key_codes[KEY_ESCAPE] = XKeysymToKeycode( _display, XK_Escape ); _key_codes[KEY_F1] = XKeysymToKeycode( _display, XK_F1 ); _key_codes[KEY_F2] = XKeysymToKeycode( _display, XK_F2 ); _key_codes[KEY_F3] = XKeysymToKeycode( _display, XK_F3 ); _key_codes[KEY_F4] = XKeysymToKeycode( _display, XK_F4 ); _key_codes[KEY_F5] = XKeysymToKeycode( _display, XK_F5 ); _key_codes[KEY_F6] = XKeysymToKeycode( _display, XK_F6 ); _key_codes[KEY_F7] = XKeysymToKeycode( _display, XK_F7 ); _key_codes[KEY_F8] = XKeysymToKeycode( _display, XK_F8 ); _key_codes[KEY_F9] = XKeysymToKeycode( _display, XK_F9 ); _key_codes[KEY_F10] = XKeysymToKeycode( _display, XK_F10 ); _key_codes[KEY_F11] = XKeysymToKeycode( _display, XK_F11 ); _key_codes[KEY_F12] = XKeysymToKeycode( _display, XK_F12 ); _key_codes[KEY_A] = XKeysymToKeycode( _display, XK_A ); _key_codes[KEY_Q] = XKeysymToKeycode( _display, XK_Q ); _key_codes[KEY_W] = XKeysymToKeycode( _display, XK_W ); _key_codes[KEY_Z] = XKeysymToKeycode( _display, XK_Z ); _key_codes[KEY_S] = XKeysymToKeycode( _display, XK_S ); _key_codes[KEY_X] = XKeysymToKeycode( _display, XK_X ); _key_codes[KEY_E] = XKeysymToKeycode( _display, XK_E ); _key_codes[KEY_D] = XKeysymToKeycode( _display, XK_D ); _key_codes[KEY_C] = XKeysymToKeycode( _display, XK_C ); _key_codes[KEY_R] = XKeysymToKeycode( _display, XK_R ); _key_codes[KEY_F] = XKeysymToKeycode( _display, XK_F ); _key_codes[KEY_V] = XKeysymToKeycode( _display, XK_V ); _key_codes[KEY_T] = XKeysymToKeycode( _display, XK_T ); _key_codes[KEY_G] = XKeysymToKeycode( _display, XK_G ); _key_codes[KEY_B] = XKeysymToKeycode( _display, XK_B ); _key_codes[KEY_Y] = XKeysymToKeycode( _display, XK_Y ); _key_codes[KEY_H] = XKeysymToKeycode( _display, XK_H ); _key_codes[KEY_N] = XKeysymToKeycode( _display, XK_N ); _key_codes[KEY_U] = XKeysymToKeycode( _display, XK_U ); _key_codes[KEY_J] = XKeysymToKeycode( _display, XK_J ); _key_codes[KEY_I] = XKeysymToKeycode( _display, XK_I ); _key_codes[KEY_K] = XKeysymToKeycode( _display, XK_K ); _key_codes[KEY_O] = XKeysymToKeycode( _display, XK_O ); _key_codes[KEY_L] = XKeysymToKeycode( _display, XK_L ); _key_codes[KEY_P] = XKeysymToKeycode( _display, XK_P ); _key_codes[KEY_M] = XKeysymToKeycode( _display, XK_M ); _key_codes[KEY_1] = XKeysymToKeycode( _display, XK_1 ); _key_codes[KEY_2] = XKeysymToKeycode( _display, XK_2 ); _key_codes[KEY_3] = XKeysymToKeycode( _display, XK_3 ); _key_codes[KEY_4] = XKeysymToKeycode( _display, XK_4 ); _key_codes[KEY_5] = XKeysymToKeycode( _display, XK_5 ); _key_codes[KEY_6] = XKeysymToKeycode( _display, XK_6 ); _key_codes[KEY_7] = XKeysymToKeycode( _display, XK_7 ); _key_codes[KEY_8] = XKeysymToKeycode( _display, XK_8 ); _key_codes[KEY_9] = XKeysymToKeycode( _display, XK_9 ); } aevol-4.4/src/libaevol/ae_spatial_structure.h0000644000175000017500000002303412364050651016373 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_SPATIAL_STRUCTURE_H__ #define __AE_SPATIAL_STRUCTURE_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_spatial_structure : public ae_object { public : // ================================================================= // Constructors // ================================================================= ae_spatial_structure( void ); ae_spatial_structure( gzFile backup_file ); // ================================================================= // Destructors // ================================================================= virtual ~ae_spatial_structure( void ); // ================================================================= // Accessors: getters // ================================================================= inline ae_jumping_mt * get_prng( void ) const; inline int16_t get_grid_width( void ) const; inline int16_t get_grid_height( void ) const; inline int32_t get_migration_number( void ) const; inline ae_grid_cell*** get_pop_grid( void ) const; inline ae_grid_cell* get_grid_cell( int16_t x, int16_t y ) const; inline ae_individual* get_indiv_at( int16_t x, int16_t y ) const; inline double** get_secretion_present_grid( void ) const; inline double** get_secreted_amount_grid( void ) const; inline double** get_metabolic_fitness_grid( void ) const; inline double** get_total_fitness_grid( void ) const; // ================================================================= // Accessors: setters // ================================================================= inline void set_grid_size( int16_t grid_x, int16_t grid_y ); inline void set_migration_number( int32_t migration_number ); inline void set_prng( ae_jumping_mt* prng ); inline void set_secretion_degradation_prop( double degradation_prop ); inline void set_secretion_diffusion_prop( double diffusion_prop ); // ================================================================= // Operators // ================================================================= // ================================================================= // Public Methods // ================================================================= void update_secretion_grid( void ); void do_random_migrations ( void ); void save( gzFile backup_file ) const; // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= /*ae_spatial_structure( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; ae_spatial_structure( const ae_spatial_structure &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_jumping_mt* _prng; int16_t _grid_width; int16_t _grid_height; ae_grid_cell*** _pop_grid; int32_t _migration_number; double _secretion_diffusion_prop; double _secretion_degradation_prop; }; // ===================================================================== // Getters' definitions // ===================================================================== inline ae_jumping_mt * ae_spatial_structure::get_prng( void ) const { return _prng; } inline int16_t ae_spatial_structure::get_grid_width( void ) const { return _grid_width; } inline int16_t ae_spatial_structure::get_grid_height( void ) const { return _grid_height; } inline int32_t ae_spatial_structure::get_migration_number( void ) const { return _migration_number; } inline ae_grid_cell*** ae_spatial_structure::get_pop_grid( void ) const { return _pop_grid; } inline ae_grid_cell* ae_spatial_structure::get_grid_cell( int16_t x, int16_t y ) const { return _pop_grid[x][y]; } inline ae_individual* ae_spatial_structure::get_indiv_at( int16_t x, int16_t y ) const { return _pop_grid[x][y]->get_individual(); } inline double** ae_spatial_structure::get_secretion_present_grid( void ) const { double** ret = new double*[_grid_width]; for ( int16_t x = 0; x < _grid_width ; x++ ) { ret[x] = new double[_grid_height]; for ( int16_t y = 0; y < _grid_height ; y++ ) { ret[x][y] = _pop_grid[x][y]->get_compound_amount(); } } return ret; } inline double** ae_spatial_structure::get_secreted_amount_grid( void ) const { double** ret = new double*[_grid_width]; for ( int16_t x = 0 ; x < _grid_width ; x++ ) { ret[x] = new double[_grid_height]; for ( int16_t y = 0; y < _grid_height ; y++ ) { ret[x][y] = _pop_grid[x][y]->get_secreted_amount(); } } return ret; } inline double** ae_spatial_structure::get_metabolic_fitness_grid( void ) const { double** ret = new double*[_grid_width]; for ( int16_t x = 0 ; x < _grid_width ; x++ ) { ret[x] = new double[_grid_height]; for ( int16_t y = 0; y < _grid_height ; y++ ) { ret[x][y] = _pop_grid[x][y]->get_metabolic_fitness(); } } return ret; } inline double** ae_spatial_structure::get_total_fitness_grid( void ) const { double** ret = new double*[_grid_width]; for ( int16_t x = 0 ; x < _grid_width ; x++ ) { ret[x] = new double[_grid_height]; for ( int16_t y = 0; y < _grid_height ; y++ ) { ret[x][y] = _pop_grid[x][y]->get_total_fitness(); } } return ret; } // ===================================================================== // Setters' definitions // ===================================================================== inline void ae_spatial_structure::set_prng( ae_jumping_mt* prng ) { if (_prng != NULL) delete _prng; _prng = prng; } inline void ae_spatial_structure::set_grid_size( int16_t grid_width, int16_t grid_height ) { _grid_width = grid_width; _grid_height = grid_height; _pop_grid = new ae_grid_cell** [_grid_width]; for ( int16_t x = 0 ; x < _grid_width ; x++ ) { _pop_grid[x] = new ae_grid_cell* [_grid_height]; for ( int16_t y = 0 ; y < _grid_height ; y++ ) { _pop_grid[x][y] = new ae_grid_cell( x, y, NULL ); } } } inline void ae_spatial_structure::set_migration_number( int32_t migration_number ) { _migration_number = migration_number; } inline void ae_spatial_structure::set_secretion_degradation_prop( double degradation_prop ) { _secretion_degradation_prop=degradation_prop; } inline void ae_spatial_structure::set_secretion_diffusion_prop( double diffusion_prop ) { _secretion_diffusion_prop=diffusion_prop; } // ===================================================================== // Operators' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_SPATIAL_STRUCTURE_H__ aevol-4.4/src/libaevol/Makefile.am0000644000175000017500000000610712365452043014040 00000000000000############################################ # Variables # ############################################ AM_CPPFLAGS = $(AEVOLCPPFLAGS) AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) if WITH_CPPUNIT SUBDIRS = SFMT-src-1.4 . tests else # WITHOUT_CPPUNIT SUBDIRS = SFMT-src-1.4 . endif ######################## # Set library to build # ######################## noinst_LIBRARIES = libaevol.a ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS common_headers = ae_align.h ae_codon.h ae_dna.h ae_dump.h ae_enums.h ae_environment.h ae_env_segment.h ae_exp_manager.h ae_exp_setup.h ae_fuzzy_set.h ae_gaussian.h ae_genetic_unit.h ae_grid_cell.h ae_individual.h ae_list.h ae_logs.h ae_macros.h ae_mutation.h ae_object.h ae_output_manager.h ae_params_mut.h ae_phenotype.h ae_population.h ae_point_1d.h ae_point_2d.h ae_protein.h ae_jumping_mt.h ae_jump_poly.h ae_replication_report.h ae_dna_replic_report.h ae_rna.h ae_stats.h ae_stat_record.h ae_string.h ae_tree.h ae_utils.h ae_vis_a_vis.h ae_selection.h ae_spatial_structure.h ae_gene_tree.h ae_gene_tree_node.h ae_gene_mutation.h common_headers += param_loader.h f_line.h common_sources = ae_align.cpp ae_codon.cpp ae_dna.cpp ae_dump.cpp ae_environment.cpp ae_exp_manager.cpp ae_exp_setup.cpp ae_fuzzy_set.cpp ae_genetic_unit.cpp ae_grid_cell.cpp ae_individual.cpp ae_logs.cpp ae_mutation.cpp ae_output_manager.cpp ae_params_mut.cpp ae_phenotype.cpp ae_population.cpp ae_protein.cpp ae_jumping_mt.cpp ae_replication_report.cpp ae_dna_replic_report.cpp ae_rna.cpp ae_stats.cpp ae_stat_record.cpp ae_string.cpp ae_tree.cpp ae_vis_a_vis.cpp ae_selection.cpp ae_spatial_structure.cpp ae_gene_tree.cpp ae_gene_tree_node.cpp ae_gene_mutation.cpp common_sources += param_loader.cpp f_line.cpp X11_headers = ae_fuzzy_set_X11.h ae_individual_X11.h ae_population_X11.h ae_exp_manager_X11.h ae_X11_window.h X11_sources = ae_fuzzy_set_X11.cpp ae_individual_X11.cpp ae_population_X11.cpp ae_exp_manager_X11.cpp ae_X11_window.cpp # The target_CPPFLAGS for each target may look useless, it is here to force automake to create # prefixed object files so that we don't use an object file built for another set of macrodefinitions # e.g. We don't want to use an object file created with NO_X when building the X11 lib libaevol_a_CPPFLAGS = $(AM_CPPFLAGS) if WITH_X #libaevol_a_HEADERS = $(common_headers) $(X11_headers) libaevol_a_SOURCES = $(common_sources) $(X11_sources) libaevol_a_SOURCES += $(common_headers) $(X11_headers) else # WITHOUT_X #libaevol_a_HEADERS = $(common_headers) libaevol_a_SOURCES = $(common_sources) libaevol_a_SOURCES += $(common_headers) endif # X aevol-4.4/src/libaevol/ae_individual_X11.cpp0000644000175000017500000007760312364240744015751 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include //############################################################################## // # // Class ae_individual_X11 # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= ae_individual_X11::ae_individual_X11( ae_exp_manager* exp_m, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng, ae_params_mut* param_mut, double w_max, int32_t min_genome_length, int32_t max_genome_length, bool allow_plasmids, int32_t id, char* strain_name, int32_t age ) : ae_individual( exp_m, mut_prng, stoch_prng, param_mut, w_max, min_genome_length, max_genome_length, allow_plasmids, id, strain_name, age ) { init_occupied_sectors(); } ae_individual_X11::ae_individual_X11( ae_exp_manager* exp_manager, gzFile backup_file ) : ae_individual( exp_manager, backup_file ) { init_occupied_sectors(); } ae_individual_X11::ae_individual_X11( const ae_individual_X11 &model, bool replication_report_copy ) : ae_individual( model, replication_report_copy ) { init_occupied_sectors(); } ae_individual_X11::ae_individual_X11( ae_individual_X11* const parent, int32_t id, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng ) : ae_individual( parent, id, mut_prng, stoch_prng ) { init_occupied_sectors(); } /*ae_individual_X11::ae_individual_X11( char* genome, int32_t genome_size ) : ae_individual( genome, genome_size ) { init_occupied_sectors(); }*/ // ================================================================= // Destructors // ================================================================= ae_individual_X11::~ae_individual_X11( void ) { for ( int16_t layer = 0 ; layer < _outmost_layer ; layer++ ) { delete [] _occupied_sectors[LEADING][layer]; delete [] _occupied_sectors[LAGGING][layer]; } } // ================================================================= // Public Methods // ================================================================= void ae_individual_X11::display( void ) { } void ae_individual_X11::display_cdss( ae_X11_window* win ) { // Retreive the genetic unit corresponding to the main chromosome ae_genetic_unit* gen_unit = get_genetic_unit(0); int32_t genome_length = gen_unit->get_dna()->get_length(); // Display the number of CDSs char display_string[40]; sprintf( display_string, "Main chromosome size : %"PRId32"bp", genome_length ); win->draw_string( 15, 25, display_string ); sprintf( display_string, "Leading : %"PRId32" CDSs", gen_unit->get_protein_list()[LEADING]->get_nb_elts() ); win->draw_string( 15, 40, display_string ); sprintf( display_string, "Lagging : %"PRId32" CDSs", gen_unit->get_protein_list()[LAGGING]->get_nb_elts() ); win->draw_string( 15, 55, display_string ); // Compute display diameter according to genome length and window size int16_t canvas_width; if ( _allow_plasmids ) canvas_width = win->get_width() / 2; else canvas_width = win->get_width(); int16_t canvas_height = win->get_height(); int16_t canvas_size = ae_utils::min( canvas_width, canvas_width ); int16_t diam = round( canvas_size * log( (double)genome_length ) / 16 ); // Prevent diameter from getting greater than 2/3 of the window size if ( diam > 2 * canvas_size / 3 ) { diam = 2 * canvas_size / 3; } // Compute coordinates of the upper-left corner of the containing square int16_t pos_x = (canvas_width - diam) / 2; int16_t pos_y = (canvas_height - diam) / 2; // Draw main circle win->draw_circle( pos_x, pos_y, diam ); // Sector occupation management reset_sectors(); // --------------- // Draw each CDS // --------------- ae_list_node* cds_node = NULL; ae_protein* cds = NULL; // NB : As we want OriC to be at the "top" of the circle and the orientation // to be clockwise, the drawing angle (theta) will be given as // (90 - alpha), alpha being the "classical" trigonometric angle int16_t alpha_first, alpha_last; // Angles of first and last transcribed bases from OriC (degrees) int16_t theta_first, theta_last; // Transposed angles on the trigonometric circle (degrees) int16_t nb_sect; // Same as above with precision = 1/64 degree int16_t alpha_first_64, alpha_last_64; int16_t theta_first_64, theta_last_64; int16_t nb_sect_64; // ---------------- // LEADING strand // ---------------- cds_node = gen_unit->get_protein_list()[LEADING]->get_first(); while ( cds_node != NULL ) { cds = cds_node->get_obj(); // Alpha : angles from OriC (in degrees) // Theta : angles on the trigonometric circle (in degrees) // nb_sect : "length" in degrees of the arc to be drawn alpha_first = (int16_t) round( 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last = (int16_t) round( 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_last - alpha_first + 1, 360 ); // These are the same as above but with a higher precision (1/64 degrees) alpha_first_64 = (int16_t) round(64 * 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last_64 = (int16_t) round(64 * 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first_64 = ae_utils::mod( 64 * 90 - alpha_first_64, 64 * 360 ); theta_last_64 = ae_utils::mod( 64 * 90 - alpha_last_64, 64 * 360 ); nb_sect_64 = ae_utils::mod( alpha_last_64 - alpha_first_64 + 1, 64 * 360 ); // Look for the inmost layer that has all the sectors between // theta_first and theta_last free int16_t layer = 0; bool sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { if ( _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( layer >= _outmost_layer ) { add_layer(); break; // An added layer is necessarily free, no need to look further } } } // Mark sectors to be drawn as occupied for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-rho, 360)] = true; } // Mark flanking sectors as occupied _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first+1, 360)] = true; _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-nb_sect, 360)] = true; // Draw const int8_t cds_layer_spacing = 5; // TODO : param? layer++; // index starting at 0 but needed to start at 1 int16_t diam2 = diam + (layer * 2 * cds_layer_spacing); pos_x = (int16_t) round( (double)(canvas_width - diam2 ) / 2.0 ); pos_y = (int16_t) round( (double)(canvas_height - diam2 ) / 2.0 ); char* color = ae_X11_window::get_color( cds->get_mean() ); win->draw_arc_64( pos_x, pos_y, diam2, theta_first_64 - nb_sect_64, nb_sect_64, color ); delete [] color; cds_node = cds_node->get_next(); } // ---------------- // LAGGING strand // ---------------- cds_node = gen_unit->get_protein_list()[LAGGING]->get_first(); while ( cds_node != NULL ) { cds = cds_node->get_obj(); // Alpha : angles from OriC (in degrees) // Theta : angles on the trigonometric circle (in degrees) // nb_sect : "length" in degrees of the arc to be drawn alpha_first = (int16_t) round( 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last = (int16_t) round( 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_first - alpha_last + 1, 360 ); // These are the same as above but with a higher precision (1/64 degrees) alpha_first_64 = (int16_t) round(64 * 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last_64 = (int16_t) round(64 * 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first_64 = ae_utils::mod( 64 * 90 - alpha_first_64, 64 * 360 ); theta_last_64 = ae_utils::mod( 64 * 90 - alpha_last_64, 64 * 360 ); nb_sect_64 = ae_utils::mod( alpha_first_64 - alpha_last_64 + 1, 64 * 360 ); // Look for the inmost layer that has all the sectors between // theta_first and theta_last free int16_t layer = 0; bool sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { if ( _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( layer >= _outmost_layer ) { add_layer(); break; // An added layer is necessarily free, no need to look further } } } // Mark sectors to be drawn as occupied for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+rho, 360)] = true; } // Mark flanking sectors as occupied _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first-1, 360)] = true; _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+nb_sect, 360)] = true; // Draw const int8_t cds_layer_spacing = 5; // TODO : param? layer++; // index starting at 0 but needed to start at 1 int16_t diam2 = diam - (layer * 2 * cds_layer_spacing); pos_x = (int16_t) round( (double)(canvas_width - diam2 ) / 2.0 ); pos_y = (int16_t) round( (double)(canvas_height - diam2 ) / 2.0 ); char* color = ae_X11_window::get_color( cds->get_mean() ); win->draw_arc_64( pos_x, pos_y, diam2, theta_first_64, nb_sect_64, color ); delete [] color; cds_node = cds_node->get_next(); } // --------------------------------------------------------------------------This is temporary, it is a big copy-paste of what's above. if ( _allow_plasmids ) { // Retreive the genetic unit corresponding to the plasmid ae_genetic_unit* gen_unit = get_genetic_unit(1); if ( gen_unit == NULL ) return; int32_t genome_length = gen_unit->get_dna()->get_length(); // Compute display diameter according to genome length and window size int16_t canvas_width; int16_t canvas_height; int16_t canvas_size ; if ( _allow_plasmids ) { canvas_width = win->get_width() / 2; canvas_size = canvas_width; } else { canvas_width = win->get_width(); canvas_size = ae_utils::min( canvas_width, canvas_width ); } canvas_height = win->get_height(); int16_t diam = round( canvas_size * log( (double)genome_length ) / 16 ); // Prevent diameter from getting greater than 2/3 of the window size if ( diam > 2 * canvas_size / 3 ) { diam = 2 * canvas_size / 3; } // Compute coordinates of the upper-left corner of the containing square int16_t pos_x = canvas_width + (canvas_width - diam) / 2; int16_t pos_y = (canvas_height - diam) / 2; // Draw main circle win->draw_circle( pos_x, pos_y, diam ); // Sector occupation management reset_sectors(); // --------------- // Draw each CDS // --------------- ae_list_node* cds_node = NULL; ae_protein* cds = NULL; // NB : As we want OriC to be at the "top" of the circle and the orientation // to be clockwise, the drawing angle (theta) will be given as // (90 - alpha), alpha being the "classical" trigonometric angle int16_t alpha_first, alpha_last; // Angles of first and last transcribed bases from OriC (degrees) int16_t theta_first, theta_last; // Transposed angles on the trigonometric circle (degrees) int16_t nb_sect; // Same as above with precision = 1/64 degree int16_t alpha_first_64, alpha_last_64; int16_t theta_first_64, theta_last_64; int16_t nb_sect_64; // ---------------- // LEADING strand // ---------------- cds_node = gen_unit->get_protein_list()[LEADING]->get_first(); while ( cds_node != NULL ) { cds = cds_node->get_obj(); // Alpha : angles from OriC (in degrees) // Theta : angles on the trigonometric circle (in degrees) // nb_sect : "length" in degrees of the arc to be drawn alpha_first = (int16_t) round( 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last = (int16_t) round( 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_last - alpha_first + 1, 360 ); // These are the same as above but with a higher precision (1/64 degrees) alpha_first_64 = (int16_t) round(64 * 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last_64 = (int16_t) round(64 * 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first_64 = ae_utils::mod( 64 * 90 - alpha_first_64, 64 * 360 ); theta_last_64 = ae_utils::mod( 64 * 90 - alpha_last_64, 64 * 360 ); nb_sect_64 = ae_utils::mod( alpha_last_64 - alpha_first_64 + 1, 64 * 360 ); // Look for the inmost layer that has all the sectors between // theta_first and theta_last free int16_t layer = 0; bool sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { if ( _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( layer >= _outmost_layer ) { add_layer(); break; // An added layer is necessarily free, no need to look further } } } // Mark sectors to be drawn as occupied for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-rho, 360)] = true; } // Mark flanking sectors as occupied _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first+1, 360)] = true; _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-nb_sect, 360)] = true; // Draw const int8_t cds_layer_spacing = 5; // TODO : param? layer++; // index starting at 0 but needed to start at 1 int16_t diam2 = diam + (layer * 2 * cds_layer_spacing); pos_x = canvas_width + (int16_t) round( (double)(canvas_width - diam2 ) / 2.0 ); pos_y = (int16_t) round( (double)(canvas_height - diam2 ) / 2.0 ); char* color = ae_X11_window::get_color( cds->get_mean() ); win->draw_arc_64( pos_x, pos_y, diam2, theta_first_64 - nb_sect_64, nb_sect_64, color ); delete [] color; cds_node = cds_node->get_next(); } // ---------------- // LAGGING strand // ---------------- cds_node = gen_unit->get_protein_list()[LAGGING]->get_first(); while ( cds_node != NULL ) { cds = cds_node->get_obj(); // Alpha : angles from OriC (in degrees) // Theta : angles on the trigonometric circle (in degrees) // nb_sect : "length" in degrees of the arc to be drawn alpha_first = (int16_t) round( 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last = (int16_t) round( 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_first - alpha_last + 1, 360 ); // These are the same as above but with a higher precision (1/64 degrees) alpha_first_64 = (int16_t) round(64 * 360 * ((double)cds->get_first_translated_pos() / (double)genome_length )); alpha_last_64 = (int16_t) round(64 * 360 * ((double)cds->get_last_translated_pos() / (double)genome_length )); theta_first_64 = ae_utils::mod( 64 * 90 - alpha_first_64, 64 * 360 ); theta_last_64 = ae_utils::mod( 64 * 90 - alpha_last_64, 64 * 360 ); nb_sect_64 = ae_utils::mod( alpha_first_64 - alpha_last_64 + 1, 64 * 360 ); // Look for the inmost layer that has all the sectors between // theta_first and theta_last free int16_t layer = 0; bool sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { if ( _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( layer >= _outmost_layer ) { add_layer(); break; // An added layer is necessarily free, no need to look further } } } // Mark sectors to be drawn as occupied for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+rho, 360)] = true; } // Mark flanking sectors as occupied _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first-1, 360)] = true; _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+nb_sect, 360)] = true; // Draw const int8_t cds_layer_spacing = 5; // TODO : param? layer++; // index starting at 0 but needed to start at 1 int16_t diam2 = diam - (layer * 2 * cds_layer_spacing); pos_x = canvas_width + (int16_t) round( (double)(canvas_width - diam2 ) / 2.0 ); pos_y = (int16_t) round( (double)(canvas_height - diam2 ) / 2.0 ); char* color = ae_X11_window::get_color( cds->get_mean() ); win->draw_arc_64( pos_x, pos_y, diam2, theta_first_64, nb_sect_64, color ); delete [] color; cds_node = cds_node->get_next(); } } } void ae_individual_X11::display_rnas( ae_X11_window* win ) { // Retreive the genetic unit corresponding to the main chromosome ae_genetic_unit* gen_unit = _genetic_unit_list->get_first()->get_obj(); int32_t genome_length = gen_unit->get_dna()->get_length(); // Display the number of RNAs char nb_rna[40]; sprintf( nb_rna, "Leading : %"PRId32" RNAs", gen_unit->get_rna_list()[LEADING]->get_nb_elts() ); win->draw_string( 15, 15, nb_rna ); sprintf( nb_rna, "Lagging : %"PRId32" RNAs", gen_unit->get_rna_list()[LAGGING]->get_nb_elts() ); win->draw_string( 15, 30, nb_rna ); // Compute display diameter according to genome length and window size int16_t win_size = ae_utils::min( win->get_width(), win->get_height() ); int16_t diam = round( win_size * log( (double)genome_length ) / 16 ); // Prevent diameter from getting greater than 2/3 of the window size if ( diam > 2 * win_size / 3 ) { diam = 2 * win_size / 3; } // Compute coordinates of the upper-left corner of the containing square int16_t pos_x = (win->get_width() - diam) / 2; int16_t pos_y = (win->get_height() - diam) / 2; // Draw main circle win->draw_circle( pos_x, pos_y, diam ); // Sector occupation management reset_sectors(); // --------------- // Draw each RNA // --------------- ae_list_node* rna_node = NULL; ae_rna* rna = NULL; // NB : As we want OriC to be at the "top" of the circle and the orientation // to be clockwise, the drawing angle (theta) will be given as // (90 - alpha), alpha being the "classical" trigonometric angle int16_t alpha_first, alpha_last; // Angles of first and last transcribed bases from OriC (degrees) int16_t theta_first, theta_last; // Transposed angles on the trigonometric circle (degrees) int16_t nb_sect; // Same as above with precision = 1/64 degree int16_t alpha_first_64, alpha_last_64; int16_t theta_first_64, theta_last_64; int16_t nb_sect_64; // ---------------- // LEADING strand // ---------------- rna_node = gen_unit->get_rna_list()[LEADING]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); // Alpha : angles from OriC (in degrees) // Theta : angles on the trigonometric circle (in degrees) // nb_sect : "length" in degrees of the arc to be drawn alpha_first = (int16_t) round( 360 * ((double)rna->get_first_transcribed_pos() / (double)genome_length )); alpha_last = (int16_t) round( 360 * ((double)rna->get_last_transcribed_pos() / (double)genome_length )); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_last - alpha_first + 1, 360 ); // These are the same as above but with a higher precision (1/64 degrees) alpha_first_64 = (int16_t) round(64 * 360 * ((double)rna->get_first_transcribed_pos() / (double)genome_length )); alpha_last_64 = (int16_t) round(64 * 360 * ((double)rna->get_last_transcribed_pos() / (double)genome_length )); theta_first_64 = ae_utils::mod( 64 * 90 - alpha_first_64, 64 * 360 ); theta_last_64 = ae_utils::mod( 64 * 90 - alpha_last_64, 64 * 360 ); nb_sect_64 = ae_utils::mod( alpha_last_64 - alpha_first_64 + 1, 64 * 360 ); //~ printf( " LEADING RNA %"PRId32" => %"PRId32" :: %"PRId16" %"PRId16"\n", rna->get_first_transcribed_pos(), rna->get_last_transcribed_pos(), theta_first, theta_last ); // Look for the inmost layer that has all the sectors between // theta_first and theta_last free int16_t layer = 0; bool sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { if ( _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( layer >= _outmost_layer ) { add_layer(); break; // An added layer is necessarily free, no need to look further } } } // Mark sectors to be drawn as occupied for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-rho, 360)] = true; } // Mark flanking sectors as occupied _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first+1, 360)] = true; _occupied_sectors[LEADING][layer][ae_utils::mod(theta_first-nb_sect, 360)] = true; // Determine drawing color char* color; if ( rna->is_coding() ) { color = ae_X11_window::get_color( rna->get_basal_level() ); } else { color = new char[8]; strcpy( color, "#FFFFFF" ); } // Draw arrow body const int8_t rna_layer_spacing = 5; // TODO : param? layer++; // index starting at 0 but needed to start at 1 int16_t diam2 = diam + (layer * 2 * rna_layer_spacing); pos_x = (int16_t) round( (double)(win->get_width() - diam2 ) / 2.0 ); pos_y = (int16_t) round( (double)(win->get_height() - diam2 ) / 2.0 ); win->draw_arc_64( pos_x, pos_y, diam2, theta_first_64 - nb_sect_64, nb_sect_64, color ); // Draw arrow head int8_t arrow_thick = 6; // Must be an even value pos_x = (win->get_width() / 2.0) + (cos((theta_first_64 - nb_sect_64)/(64*180.0)*M_PI) * diam2 / 2.0) - (arrow_thick / 2.0); pos_y = (win->get_height() / 2.0) - (sin((theta_first_64 - nb_sect_64)/(64*180.0)*M_PI) * diam2 / 2.0) - (arrow_thick / 2.0); win->fill_arc( pos_x, pos_y, arrow_thick, ae_utils::mod(180+theta_last, 360), 180, color ); delete [] color; rna_node = rna_node->get_next(); } // ---------------- // LAGGING strand // ---------------- rna_node = gen_unit->get_rna_list()[LAGGING]->get_first(); while ( rna_node != NULL ) { rna = rna_node->get_obj(); // Alpha : angles from OriC (in degrees) // Theta : angles on the trigonometric circle (in degrees) // nb_sect : "length" in degrees of the arc to be drawn alpha_first = (int16_t) round( 360 * ((double)rna->get_first_transcribed_pos() / (double)genome_length )); alpha_last = (int16_t) round( 360 * ((double)rna->get_last_transcribed_pos() / (double)genome_length )); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_first - alpha_last + 1, 360 ); // These are the same as above but with a higher precision (1/64 degrees) alpha_first_64 = (int16_t) round(64 * 360 * ((double)rna->get_first_transcribed_pos() / (double)genome_length )); alpha_last_64 = (int16_t) round(64 * 360 * ((double)rna->get_last_transcribed_pos() / (double)genome_length )); theta_first_64 = ae_utils::mod( 64 * 90 - alpha_first_64, 64 * 360 ); theta_last_64 = ae_utils::mod( 64 * 90 - alpha_last_64, 64 * 360 ); nb_sect_64 = ae_utils::mod( alpha_first_64 - alpha_last_64 + 1, 64 * 360 ); //~ printf( " LAGGING RNA %"PRId32" => %"PRId32" :: %"PRId16" %"PRId16"\n", rna->get_first_transcribed_pos(), rna->get_last_transcribed_pos(), theta_first, theta_last ); // Look for the inmost layer that has all the sectors between // theta_first and theta_last free int16_t layer = 0; bool sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { if ( _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( layer >= _outmost_layer ) { add_layer(); break; // An added layer is necessarily free, no need to look further } } } // Mark sectors to be drawn as occupied for ( int16_t rho = 0 ; rho < nb_sect ; rho++ ) { _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+rho, 360)] = true; } // Mark flanking sectors as occupied _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first-1, 360)] = true; _occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first+nb_sect, 360)] = true; // Determine drawing color char* color; if ( rna->is_coding() ) { color = ae_X11_window::get_color( rna->get_basal_level() ); } else { color = new char[8]; strcpy( color, "#FFFFFF" ); } // Draw arrow body const int8_t rna_layer_spacing = 5; // TODO : param? layer++; // index starting at 0 but needed to start at 1 int16_t diam2 = diam - (layer * 2 * rna_layer_spacing); pos_x = (int16_t) round( (double)(win->get_width() - diam2 ) / 2.0 ); pos_y = (int16_t) round( (double)(win->get_height() - diam2 ) / 2.0 ); win->draw_arc_64( pos_x, pos_y, diam2, theta_first_64, nb_sect_64, color ); // Draw arrow head int8_t arrow_thick = 6; // Must be an even value pos_x = (win->get_width() / 2.0) + (cos((theta_last_64+1)/(64*180.0)*M_PI) * diam2 / 2.0) - (arrow_thick / 2.0); pos_y = (win->get_height() / 2.0) - (sin((theta_last_64+1)/(64*180.0)*M_PI) * diam2 / 2.0) - (arrow_thick / 2.0); win->fill_arc( pos_x, pos_y, arrow_thick, theta_last, 180, color ); delete [] color; rna_node = rna_node->get_next(); } } // ================================================================= // Protected Methods // ================================================================= void ae_individual_X11::add_layer( void ) { _occupied_sectors[LEADING][_outmost_layer] = new bool[360]; _occupied_sectors[LAGGING][_outmost_layer] = new bool[360]; for ( int16_t angle = 0 ; angle < 360 ; angle++ ) { _occupied_sectors[LEADING][_outmost_layer][angle] = false; _occupied_sectors[LAGGING][_outmost_layer][angle] = false; } _outmost_layer++; } void ae_individual_X11::init_occupied_sectors( void ) { _outmost_layer = 1; for ( int16_t layer = 0 ; layer < _outmost_layer ; layer++ ) { _occupied_sectors[LEADING][layer] = new bool[360]; _occupied_sectors[LAGGING][layer] = new bool[360]; } } void ae_individual_X11::reset_sectors( void ) { for ( int16_t layer = 0 ; layer < _outmost_layer ; layer++ ) { for ( int16_t angle = 0 ; angle < 360 ; angle++ ) { _occupied_sectors[LEADING][layer][angle] = false; _occupied_sectors[LAGGING][layer][angle] = false; } } } aevol-4.4/src/libaevol/ae_stat_record.h0000644000175000017500000001746012231437075015137 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** #ifndef __AE_STAT_RECORD_H__ #define __AE_STAT_RECORD_H__ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Class declarations // ================================================================= class ae_exp_manager; class ae_stats; class ae_individual; class ae_population; enum indiv_or_pop { INDIV = 0, POP = 1, STDEVS = 2, SKEWNESS = 3, NB_INDIV_OR_POP = 4 }; enum chrom_or_gen_unit { ALL_GU = 0, CHROM = 1, PLASMIDS = 2, NB_CHROM_OR_GU = 3 }; enum best_or_glob { BEST = 0, GLOB = 1, SDEV = 2, SKEW = 3, NB_BEST_OR_GLOB = 4 }; enum stats_type { FITNESS_STATS = 0, MUTATION_STATS = 1, GENES_STATS = 2, BP_STATS = 3, REAR_STATS = 4, NB_STATS_TYPES = 5 }; class ae_stat_record : public ae_object { friend class ae_stats; public : // ================================================================= // Constructors // ================================================================= ae_stat_record( ae_exp_manager* exp_m ); ae_stat_record( const ae_stat_record &model ); ae_stat_record( ae_exp_manager* exp_m, ae_individual const * indiv, chrom_or_gen_unit chrom_or_gu = CHROM, bool compute_non_coding = true, int32_t num_gener = -1 ); ae_stat_record( ae_exp_manager* exp_m, ae_population const * pop, chrom_or_gen_unit chrom_or_gu = CHROM ); ae_stat_record( ae_exp_manager* exp_m, ae_population const * pop, ae_stat_record const * means, chrom_or_gen_unit chrom_or_gu = CHROM ); ae_stat_record( ae_exp_manager* exp_m, ae_population const * pop, ae_stat_record const * means, ae_stat_record const * stdevs, chrom_or_gen_unit chrom_or_gu = CHROM ); // ================================================================= // Destructors // ================================================================= virtual ~ae_stat_record( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= void initialize_data( void ); void write_to_file( FILE* stat_file, stats_type stat_type_to_print ) const; void divide( double divisor ); void divide_record( ae_stat_record const * means, double power ); void add( ae_stat_record* to_add, int32_t index ); void substract_power( ae_stat_record const * means, ae_stat_record const * to_substract, double power ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_stat_record( void ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; /*ae_stat_record( const ae_stat_record &model ) { printf( "%s:%d: error: call to forbidden constructor.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); };*/ // ================================================================= // Protected Methods // ================================================================= // ================================================================= // Protected Attributes // ================================================================= ae_exp_manager* _exp_m; // NB : All the attributes are doubles because they will be used to // compute averages over the population. indiv_or_pop _record_type; double _num_gener; double _pop_size; double _fitness; double _metabolic_error; double _parent_metabolic_error; double _metabolic_fitness; double _secretion_error; double _parent_secretion_error; double _secretion_fitness; double _compound_amount; double _amount_of_dna; double _nb_coding_rnas; double _nb_non_coding_rnas; double _av_size_coding_rnas; // NOT including promoter but including terminator double _av_size_non_coding_rnas; // NOT including promoter but including terminator double _nb_functional_genes; double _nb_non_functional_genes; double _av_size_functional_gene; // NOT including START and STOP codons double _av_size_non_functional_gene; // NOT including START and STOP codons double _nb_mut; double _nb_rear; double _nb_switch; double _nb_indels; double _nb_dupl; double _nb_del; double _nb_trans; double _nb_inv; double _dupl_rate; double _del_rate; double _trans_rate; double _inv_rate; double _mean_align_score; double _nb_bases_in_0_CDS; double _nb_bases_in_0_functional_CDS; double _nb_bases_in_0_non_functional_CDS; double _nb_bases_in_0_RNA; double _nb_bases_in_0_coding_RNA; double _nb_bases_in_0_non_coding_RNA; double _nb_bases_non_essential; double _nb_bases_non_essential_including_nf_genes; #ifdef __REGUL double _nb_influences; double _nb_enhancing_influences; double _nb_operating_influences; double _av_value_influences; double _av_value_enhancing_influences; double _av_value_operating_influences; #endif }; // ===================================================================== // Accessors' definitions // ===================================================================== // ===================================================================== // Inline functions' definition // ===================================================================== #endif // __AE_STAT_RECORD_H__ aevol-4.4/src/libaevol/ae_gene_tree_node.cpp0000644000175000017500000016750112364050651016123 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /** \class * \brief */ // ================================================================= // Libraries // ================================================================= #include // ================================================================= // Project Files // ================================================================= #include #include #include //############################################################################## // # // Class ae_gene_tree_node # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= int32_t ae_gene_tree_node::_nextID = 0; // To search for a protein with a specific Shine-Dalgarno position and strand in an ae_list of proteins // This one has to be a plain int, to comply with the definition of bsearch() static int compare_protein_position( const void * searchedProteinPos, const void * candidateProteinInList ) { if ( *((int32_t *)searchedProteinPos) == ((ae_protein * )candidateProteinInList)->get_shine_dal_pos() ) return 0; else return 1; } // ================================================================= // Constructors // ================================================================= ae_gene_tree_node::ae_gene_tree_node( int32_t nodeCreationDate, ae_protein * protein) { _ID = ae_gene_tree_node::_nextID; ae_gene_tree_node::_nextID ++; _dna_creation_date = nodeCreationDate; _node_creation_date = nodeCreationDate; _gene_loss_date = -1; _gene_loss_type = NOT_LOST_YET; _protein_pointer = protein; _shine_dal_position = protein->get_shine_dal_pos(); _strand = protein->get_strand(); _nb_promoters = protein->get_rna_list()->get_nb_elts(); //printf("%d promoters at positions", _nb_promoters); // debug _promoter_positions = new int32_t[_nb_promoters]; _rna_pointers = new ae_rna*[_nb_promoters]; ae_list_node * rnanode = protein->get_rna_list()->get_first(); ae_rna* rna = NULL; int32_t i = 0; while (rnanode != NULL) { rna = rnanode->get_obj(); _rna_pointers[i] = rna; _promoter_positions[i] = rna->get_promoter_pos(); // printf(" %d, ", _promoter_positions[i] ); // debug rnanode = rnanode->get_next(); i++; } // printf(" \n "); //debug _mutation_list = new ae_list(); _left_child = NULL; _right_child = NULL; _parent_node = NULL; _cds_possibly_modified = false; _proms_possibly_modified = false; _gene_possibly_duplicated = false; _cds_completely_deleted = false; _putative_position_for_the_duplicate = -1; } // ================================================================= // Destructors // ================================================================= ae_gene_tree_node::~ae_gene_tree_node( void ) { if (_left_child != NULL) delete _left_child; if (_right_child != NULL) delete _right_child; if (_promoter_positions != NULL) delete [] _promoter_positions; if (_rna_pointers != NULL) delete [] _rna_pointers; _mutation_list->erase(true); delete _mutation_list; } // ================================================================= // Public Methods // ================================================================= ae_gene_tree_node * ae_gene_tree_node::search_in_subtree_leaves(const ae_protein * protein) { ae_gene_tree_node *result_left = NULL, *result_right = NULL; if ((_left_child == NULL) && (_right_child == NULL)) // I am a leaf { if (_protein_pointer == protein) return this; else return NULL; } else // I am an internal node { if (_left_child != NULL) result_left = _left_child->search_in_subtree_leaves(protein); if (_right_child != NULL) result_right = _right_child->search_in_subtree_leaves(protein); if ((result_left == NULL) && (result_right == NULL)) return NULL; else if ((result_left == NULL) && (result_right != NULL)) return result_right; else if ((result_left != NULL) && (result_right == NULL)) return result_left; else { fprintf(stderr, "Error, the protein %p should not be found twice in the tree.\n", protein); // get the _root address to print the whole tree to screen ae_gene_tree_node * n = _parent_node, *root = this; while (n!=NULL) {root = n; n = n->_parent_node; } // here, n==NULL and root points on the root of the tree root->print_subtree_to_screen(); exit(EXIT_FAILURE); } } } void ae_gene_tree_node::print_subtree_to_screen(void) { // Postorder tree traversal /* Left subtree */ if (_left_child != NULL) _left_child->print_subtree_to_screen(); /* Right subtree */ if (_right_child != NULL) _right_child->print_subtree_to_screen(); /* Current tree node */ printf("Node ID: %"PRId32"\n", _ID); if (_parent_node != NULL) printf("Parent ID: %"PRId32"\n", _parent_node->_ID); else printf("Parent ID: none\n"); if (_left_child != NULL) printf("Left child ID: %"PRId32"\n", _left_child->_ID); else printf("Left child ID: none\n"); if (_right_child != NULL) printf("Right child ID: %"PRId32"\n", _right_child->_ID); else printf("Right child ID: none\n"); printf("Node creation date: %"PRId32"\n", _node_creation_date); printf("DNA creation date: %"PRId32"\n", _dna_creation_date); switch(_gene_loss_type) { case NOT_LOST_YET: printf("Node status: NOT_LOST_YET\n"); break; case LOST_BY_LOCAL_MUTATION: printf("Gene loss type: LOST_BY_LOCAL_MUTATION\n"); printf("Gene loss date: %"PRId32"\n", _gene_loss_date); break; case DELETED : printf("Gene loss type: DELETED\n"); printf("Gene loss date: %"PRId32"\n", _gene_loss_date); break; case BROKEN_BY_REAR: printf("Gene loss type: BROKEN_BY_REAR\n"); printf("Gene loss date: %"PRId32"\n", _gene_loss_date); break; case DUPLICATED: printf("Node status: DUPLICATED\n"); printf("Duplication date: %"PRId32"\n", _gene_loss_date);break; default: break; } printf("Protein pointer: %p, Shine-Dalgarno position: %"PRId32"\n", _protein_pointer, _shine_dal_position); if( _strand == LEADING) printf("Strand: LEADING\n"); else printf("Strand: LAGGING\n"); for(int32_t i = 0; i < _nb_promoters; i++) { printf("Promoter at %"PRId32", rna pointer %p\n", _promoter_positions[i], _rna_pointers[i]); } printf("Number of mutations: %"PRId32"\n", _mutation_list->get_nb_elts()); ae_list_node * mnode = _mutation_list->get_first(); ae_gene_mutation * mut = NULL; char str[128]; while(mnode != NULL) { mut = (ae_gene_mutation *) mnode->get_obj(); mut->get_description_string_for_gene_mut(str); printf(" %s\n", str); mnode = mnode->get_next(); } printf("\n\n"); } void ae_gene_tree_node::write_subtree_to_files(FILE * topologyFile, FILE * nodeAttributesFile, int32_t end_gener) { // Newick format for the topology file (postorder tree traversal with parentheses and branch lengths) if ((_left_child != NULL) || (_right_child != NULL)) { fprintf(topologyFile, "("); /* Left subtree */ if (_left_child != NULL) _left_child->write_subtree_to_files(topologyFile, nodeAttributesFile, end_gener); fprintf(topologyFile, ", "); /* Right subtree */ if (_right_child != NULL) _right_child->write_subtree_to_files(topologyFile, nodeAttributesFile, end_gener); fprintf(topologyFile, ")"); } /* Current tree node */ fprintf(topologyFile, "%"PRId32"", _ID); if (_gene_loss_type == NOT_LOST_YET) fprintf(topologyFile, ":%"PRId32"", end_gener - _node_creation_date); else fprintf(topologyFile, ":%"PRId32"", _gene_loss_date - _node_creation_date); fprintf(nodeAttributesFile, "Node ID: %"PRId32"\n", _ID); if (_parent_node != NULL) fprintf(nodeAttributesFile, "Parent ID: %"PRId32"\n", _parent_node->_ID); else fprintf(nodeAttributesFile, "Parent ID: none\n"); if (_left_child != NULL) fprintf(nodeAttributesFile, "Left child ID: %"PRId32"\n", _left_child->_ID); else fprintf(nodeAttributesFile, "Left child ID: none\n"); if (_right_child != NULL) fprintf(nodeAttributesFile, "Right child ID: %"PRId32"\n", _right_child->_ID); else fprintf(nodeAttributesFile, "Right child ID: none\n"); fprintf(nodeAttributesFile, "Node creation date: %"PRId32"\n", _node_creation_date); fprintf(nodeAttributesFile, "DNA creation date: %"PRId32"\n", _dna_creation_date); switch(_gene_loss_type) { case NOT_LOST_YET: fprintf(nodeAttributesFile, "Node status: NOT_LOST_YET\n"); break; case LOST_BY_LOCAL_MUTATION: fprintf(nodeAttributesFile, "Gene loss type: LOST_BY_LOCAL_MUTATION\n"); fprintf(nodeAttributesFile, "Gene loss date: %"PRId32"\n", _gene_loss_date); break; case DELETED : fprintf(nodeAttributesFile, "Gene loss type: DELETED\n"); fprintf(nodeAttributesFile, "Gene loss date: %"PRId32"\n", _gene_loss_date); break; case BROKEN_BY_REAR: fprintf(nodeAttributesFile, "Gene loss type: BROKEN_BY_REAR\n"); fprintf(nodeAttributesFile, "Gene loss date: %"PRId32"\n", _gene_loss_date); break; case DUPLICATED: fprintf(nodeAttributesFile, "Node status: DUPLICATED\n"); fprintf(nodeAttributesFile, "Duplication date: %"PRId32"\n", _gene_loss_date); break; default: break; } if( _strand == LEADING) fprintf(nodeAttributesFile, "Strand: LEADING\n"); else fprintf(nodeAttributesFile, "Strand: LAGGING\n"); fprintf(nodeAttributesFile, "Shine-Dalgarno position: %"PRId32"\n", _shine_dal_position); for (int32_t i= 0; i < _nb_promoters; i++) { fprintf(nodeAttributesFile, "Position of promoter %"PRId32": %"PRId32"\n", i+1, _promoter_positions[i]); } fprintf(nodeAttributesFile, "Number of mutations: %"PRId32"\n", _mutation_list->get_nb_elts()); ae_list_node * mnode = _mutation_list->get_first(); ae_gene_mutation * mut = NULL; char str[128]; while(mnode != NULL) { mut = mnode->get_obj(); mut->get_description_string_for_gene_mut(str); fprintf(nodeAttributesFile, " %s", str); fprintf(nodeAttributesFile, "\n"); mnode = mnode->get_next(); } if (_gene_loss_type == NOT_LOST_YET) { assert( _protein_pointer != NULL ); fprintf(nodeAttributesFile, " Shine-Dalgarno pos:%"PRId32", Stop pos: %"PRId32", M: %.8f, W: %.8f, H: %.8f, nb promoters: %"PRId32", conc: %.8f \n", \ _protein_pointer->get_shine_dal_pos(), _protein_pointer->get_last_STOP_base_pos(), \ _protein_pointer->get_mean(), _protein_pointer->get_width(), _protein_pointer->get_height(), \ _protein_pointer->get_rna_list()->get_nb_elts(), _protein_pointer->get_concentration() ); } fprintf(nodeAttributesFile, "\n\n"); } // all attributes on a single line void ae_gene_tree_node::write_subtree_nodes_in_tabular_file(int32_t treeID, FILE * f) { /* Left subtree */ if (_left_child != NULL) _left_child->write_subtree_nodes_in_tabular_file(treeID, f); /* Right subtree */ if (_right_child != NULL) _right_child->write_subtree_nodes_in_tabular_file(treeID, f); fprintf(f, "%"PRId32" ", treeID); fprintf(f, "%"PRId32" ", _ID); if (_parent_node != NULL) fprintf(f, "%"PRId32" ", _parent_node->_ID); else fprintf(f, "-1 "); if (_left_child != NULL) fprintf(f, "%"PRId32" ", _left_child->_ID); else fprintf(f, "-1 "); if (_right_child != NULL) fprintf(f, "%"PRId32" ", _right_child->_ID); else fprintf(f, "-1 "); fprintf(f, "%"PRId32" ", _node_creation_date); fprintf(f, "%"PRId32" ", _dna_creation_date); switch(_gene_loss_type) { case NOT_LOST_YET: fprintf(f, "NOT_LOST_YET "); break; case LOST_BY_LOCAL_MUTATION: fprintf(f, "LOST_BY_LOCAL_MUTATION "); break; case DELETED : fprintf(f, "DELETED "); break; case BROKEN_BY_REAR: fprintf(f, "BROKEN_BY_REAR "); break; case DUPLICATED: fprintf(f, "DUPLICATED "); break; default: break; } fprintf(f, "%"PRId32" ", _gene_loss_date); if (_strand == LEADING) fprintf(f, "LEADING "); else fprintf(f, "LAGGING "); fprintf(f, "%"PRId32" ", _shine_dal_position); fprintf(f, "%"PRId32" ", _nb_promoters); if (_gene_loss_type == NOT_LOST_YET) { assert( _protein_pointer != NULL ); fprintf(f, "%.8f %.8f %.8f %.8f ", \ _protein_pointer->get_mean(), _protein_pointer->get_width(), _protein_pointer->get_height(), \ _protein_pointer->get_concentration() ); } else {fprintf(f, "-1 -1 -1 -1 ");} fprintf(f, "%"PRId32" ", _mutation_list->get_nb_elts()); int32_t nb_localmut_upstream_neutral = 0, nb_localmut_upstream_benef = 0, nb_localmut_upstream_delet = 0; int32_t nb_rear_upstream_neutral = 0, nb_rear_upstream_benef = 0, nb_rear_upstream_delet = 0; int32_t nb_localmut_cds_neutral = 0, nb_localmut_cds_benef = 0, nb_localmut_cds_delet = 0; int32_t nb_rear_cds_neutral = 0, nb_rear_cds_benef = 0, nb_rear_cds_delet = 0; ae_list_node * mnode = _mutation_list->get_first(); ae_gene_mutation * mut = NULL; if ((_gene_loss_type == DELETED) || (_gene_loss_type == LOST_BY_LOCAL_MUTATION) || (_gene_loss_type == BROKEN_BY_REAR)) { // do not count the last event, it was disruptive while(mnode->get_next() != NULL) // TO DO protect against seg fault if no mutation in the list (should not happen if the gene was disrupted however) { mut = mnode->get_obj(); if ((mut->type_of_event() == 0) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_localmut_upstream_neutral ++;} else if ((mut->type_of_event() == 0) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_localmut_upstream_benef ++;} else if ((mut->type_of_event() == 0) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_localmut_upstream_delet ++;} else if ((mut->type_of_event() == 0) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_localmut_cds_neutral ++;} else if ((mut->type_of_event() == 0) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_localmut_cds_benef ++;} else if ((mut->type_of_event() == 0) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_localmut_cds_delet ++;} else if ((mut->type_of_event() == 1) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_rear_upstream_neutral ++;} else if ((mut->type_of_event() == 1) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_rear_upstream_benef ++;} else if ((mut->type_of_event() == 1) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_rear_upstream_delet ++;} else if ((mut->type_of_event() == 1) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_rear_cds_neutral ++;} else if ((mut->type_of_event() == 1) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_rear_cds_benef ++;} else if ((mut->type_of_event() == 1) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_rear_cds_delet ++;} mnode = mnode->get_next(); } } else { while(mnode != NULL) { mut = mnode->get_obj(); if ((mut->type_of_event() == 0) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_localmut_upstream_neutral ++;} else if ((mut->type_of_event() == 0) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_localmut_upstream_benef ++;} else if ((mut->type_of_event() == 0) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_localmut_upstream_delet ++;} else if ((mut->type_of_event() == 0) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_localmut_cds_neutral ++;} else if ((mut->type_of_event() == 0) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_localmut_cds_benef ++;} else if ((mut->type_of_event() == 0) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_localmut_cds_delet ++;} else if ((mut->type_of_event() == 1) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_rear_upstream_neutral ++;} else if ((mut->type_of_event() == 1) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_rear_upstream_benef ++;} else if ((mut->type_of_event() == 1) && (mut->get_region() == UPSTREAM) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_rear_upstream_delet ++;} else if ((mut->type_of_event() == 1) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() == 0.0)) {nb_rear_cds_neutral ++;} else if ((mut->type_of_event() == 1) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() < 0.0)) {nb_rear_cds_benef ++;} else if ((mut->type_of_event() == 1) && ((mut->get_region() == CDS) || (mut->get_region() == BOTH)) && (mut->get_impact_on_metabolic_error() > 0.0)) {nb_rear_cds_delet ++;} mnode = mnode->get_next(); } } fprintf(f, "%"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" ", \ nb_localmut_upstream_neutral, nb_localmut_upstream_benef, nb_localmut_upstream_delet, \ nb_localmut_cds_neutral, nb_localmut_cds_benef, nb_localmut_cds_delet, \ nb_rear_upstream_neutral, nb_rear_upstream_benef, nb_rear_upstream_delet, \ nb_rear_cds_neutral, nb_rear_cds_benef, nb_rear_cds_delet); fprintf(f, "\n"); } // This is an auxiliary function for the method anticipate_mutation_effect_on_genes_in_subtree. // The segment should go from 'first' to 'last' (included) in the clockwise sense. // 'first' and 'last' should not be equal. static bool breakpoint_inside_segment(int32_t pos_brkpt, int32_t first, int32_t last) { if (first < last) // most frequent case { if( (first <= pos_brkpt) && (pos_brkpt <= last)) {return true;} else {return false;} } else // special case where the segment overlaps ori { if( (first <= pos_brkpt) || (pos_brkpt <= last) ) {return true;} else {return false;} } } // This is an auxiliary function for the method anticipate_mutation_effect_on_genes_in_subtree. // It return true if the subsegment [first, last] is totally included in the segment [pos1, pos2]. // The subsegment should go from 'first' to 'last' in the clockwise sense and the segment should // go from 'pos1' to 'pos2' in the clockwise sense. static bool subsegment_totally_in_segment(int32_t pos1, int32_t pos2, int32_t first, int32_t last) { if ( (first < last) && (pos1 <= pos2) ) { if ( ((first >= pos1) && (first <= pos2)) && ((last >= pos1) && (last <= pos2)) ) {return true; } else {return false;} } else if ( (first < last) && (pos1 > pos2) ) // mut seg in 2 pieces but not the gene { if ( (first >= pos1) || (last <= pos2) ) // the gene is either completely in [pos1, genlen-1] or completely in [0, pos2] { return true; } else return false; } else if ( (first > last) && (pos1 <= pos2) ) // gene in two pieces but not mut seg, the gene cannot be totally included { return false; } else // both mut seg and the gene are in 2 pieces { if ((first >= pos1) && (last <= pos2)) {return true;} else {return false;} } } void ae_gene_tree_node::update_pointers_in_subtree_leaves(ae_genetic_unit * unit) { if ((_left_child != NULL) || (_right_child != NULL)) // I am a internal node { if (_left_child != NULL) _left_child->update_pointers_in_subtree_leaves(unit); if (_right_child != NULL) _right_child->update_pointers_in_subtree_leaves(unit); } else // no child => I am a leaf => there is work to do for me ! { if (_gene_loss_type != NOT_LOST_YET) { // inactive leaf return; } ae_list_node * protnode = NULL; ae_list_node * rnanode = NULL; ae_rna * rna = NULL; bool found = false; int32_t i = 0; if (_strand == LEADING) {protnode = (unit->get_protein_list()[LEADING])->bsearch(&_shine_dal_position, compare_protein_position); found = (protnode != NULL);} else {protnode = (unit->get_protein_list()[LAGGING])->bsearch(&_shine_dal_position, compare_protein_position); found = (protnode != NULL); } if (found) { /* The strand and shine dal position are correct */ /* Update the protein and rna pointers and positions */ _protein_pointer = protnode->get_obj(); _nb_promoters = _protein_pointer->get_rna_list()->get_nb_elts(); if (_promoter_positions != NULL) delete [] _promoter_positions; if (_rna_pointers != NULL) delete [] _rna_pointers; _promoter_positions = new int32_t[_nb_promoters]; _rna_pointers = new ae_rna*[_nb_promoters]; rnanode = _protein_pointer->get_rna_list()->get_first(); rna = NULL; i = 0; while (rnanode != NULL) { rna = rnanode->get_obj(); _rna_pointers[i] = rna; _promoter_positions[i] = rna->get_promoter_pos(); rnanode = rnanode->get_next(); i++; } } else { fprintf(stderr, "Error: cannot find a protein that should be there.\n"); exit(EXIT_FAILURE); } } } void ae_gene_tree_node::anticipate_mutation_effect_on_genes_in_subtree_leaves(ae_mutation * mut, int32_t lengthOfGeneticUnit) { if ((_left_child != NULL) || (_right_child != NULL)) // I am a internal node { if (_left_child != NULL) _left_child->anticipate_mutation_effect_on_genes_in_subtree_leaves(mut, lengthOfGeneticUnit); if (_right_child != NULL) _right_child->anticipate_mutation_effect_on_genes_in_subtree_leaves(mut, lengthOfGeneticUnit); } else // no child => I am a leaf => there is work to do for me ! { if (_gene_loss_type != NOT_LOST_YET) { // inactive leaf return; } int32_t genlen = lengthOfGeneticUnit; // in bp int32_t pos0 = -1, pos1 = -1, pos2 = -1, pos2bis = -1, pos3 = -1, mutlength = -1; // int32_t pos1donor = -1, pos2donor = -1, pos3donor = -1; ae_sense sense = DIRECT; // related to transfer (TO DO) bool invert = false; ae_mutation_type type = mut->get_mut_type(); switch(type) { case SWITCH: { mut->get_infos_point_mutation(&pos0); mutlength = 1; break; } case S_INS: { mut->get_infos_small_insertion(&pos0, &mutlength); break; } case S_DEL: { mut->get_infos_small_deletion(&pos0, &mutlength); break; } case DUPL: { mut->get_infos_duplication(&pos1, &pos2, &pos0); // pos2 is actually not included in the segment, the real end of the segment is pos2 - 1 pos2bis = pos2; pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case DEL: { mut->get_infos_deletion(&pos1, &pos2); pos2bis = pos2; pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case TRANS: { mut->get_infos_translocation(&pos1, &pos2, &pos3, &pos0, &invert); // TO DO: check whether the 4 positions are also in absolute coordinates when rearrangements with alignments pos2bis = pos2; pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case INV: { mut->get_infos_inversion(&pos1, &pos2); pos2bis = pos2; pos2 = ae_utils::mod(pos2 - 1, genlen); mutlength = mut->get_length(); break; } case INSERT: { // TO DO break; } case INS_HT: { // TO DO break; } case REPL_HT: { // TO DO break; } default: { fprintf(stderr, "Error: unknown mutation type in ae_gene_tree_node::anticipate_mutation_effect_on_genes_in_subtree.\n"); } } int32_t first_cds, last_cds; int32_t first_upstream, last_upstream; // "upstream region" is the segment between the furthest promoter and the Shine-Dalgarno sequence int32_t nbprom = _protein_pointer->get_rna_list()->get_nb_elts(); assert(nbprom != 0); assert(nbprom == _nb_promoters); int32_t position_furthest_prom = -1, currentprompos = -1; ae_list_node * rnanode = NULL; ae_rna* rna = NULL; int32_t i = 0; if (_protein_pointer->get_strand() == LEADING) { first_cds = _protein_pointer->get_shine_dal_pos(); last_cds = _protein_pointer->get_last_STOP_base_pos( ); rnanode = _protein_pointer->get_rna_list()->get_first(); while (rnanode != NULL) { rna = rnanode->get_obj(); currentprompos = rna->get_promoter_pos(); if (currentprompos > first_cds) currentprompos = currentprompos - genlen; // negative value for promoters on the other side of ori if ((position_furthest_prom == -1) || (position_furthest_prom < currentprompos)) // we need the smallest promoter position { position_furthest_prom = rna->get_promoter_pos(); } rnanode = rnanode->get_next(); i++; } position_furthest_prom = ae_utils::mod(position_furthest_prom, genlen); // restore a positive value if necessary first_upstream = position_furthest_prom; last_upstream = ae_utils::mod(first_cds - 1, genlen); } else { first_cds = _protein_pointer->get_last_STOP_base_pos( ); last_cds = _protein_pointer->get_shine_dal_pos(); rnanode = _protein_pointer->get_rna_list()->get_first(); while (rnanode != NULL) { rna = rnanode->get_obj(); currentprompos = rna->get_promoter_pos(); if (currentprompos < last_cds) currentprompos = currentprompos + genlen; // value larger than genlen for promoters on the other side of ori if ((position_furthest_prom == -1) || (position_furthest_prom > currentprompos)) // we need the largest promoter position { position_furthest_prom = rna->get_promoter_pos(); } rnanode = rnanode->get_next(); i++; } position_furthest_prom = ae_utils::mod(position_furthest_prom, genlen); // restore a value < genlen if necessary first_upstream = ae_utils::mod(last_cds - 1, genlen); last_upstream = position_furthest_prom; } switch(type) { case SWITCH: { if (breakpoint_inside_segment(pos0, first_cds, last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos0, first_upstream, last_upstream)) _proms_possibly_modified = true; break; } case S_INS: { if (breakpoint_inside_segment(pos0, first_cds, last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos0, first_upstream, last_upstream)) _proms_possibly_modified = true; if (_shine_dal_position >= pos0) _shine_dal_position = ae_utils::mod(_shine_dal_position + mutlength, genlen + mutlength); for (i = 0; i <_nb_promoters; i++) { if (_promoter_positions[i] >= pos0){ _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + mutlength, genlen + mutlength);} } break; } case S_DEL: { // If the Shine-Dalgarno position is in the small deleted segment, mark the cds as deleted // (our gene tracking is based on the tracking of the Shine-Dalgarno position, // and we cannot predict the position of a bp that was deleted: we lose track of the gene) if (mutlength == 1) { if (_protein_pointer->get_shine_dal_pos() == pos0) _cds_completely_deleted = true; } else // mutlength > 1 { if (breakpoint_inside_segment(_protein_pointer->get_shine_dal_pos(), pos0, ae_utils::mod(pos0 + mutlength - 1, genlen))) _cds_completely_deleted = true; } if (!(_cds_completely_deleted)) { if (breakpoint_inside_segment(pos0, ae_utils::mod(first_cds - mutlength, genlen), last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos0, ae_utils::mod(first_upstream - mutlength, genlen), last_upstream)) _proms_possibly_modified = true; if ( pos0 + mutlength <= genlen ) // the deletion does not contain the replication origin { if (_shine_dal_position >= pos0) _shine_dal_position = ae_utils::mod(_shine_dal_position - mutlength, genlen - mutlength); for (i = 0; i <_nb_promoters; i++) { if (_promoter_positions[i] >= pos0){ _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - mutlength, genlen - mutlength);} } } else // the deletion contains the replication origin { int32_t nb_del_after_ori = mutlength - genlen + pos0; if (_shine_dal_position >= 0) _shine_dal_position = ae_utils::mod(_shine_dal_position - nb_del_after_ori, genlen - mutlength); for (i = 0; i <_nb_promoters; i++) { if (_promoter_positions[i] >= 0){ _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - nb_del_after_ori, genlen - mutlength);} } } } break; } case DUPL: { if (subsegment_totally_in_segment(pos1, pos2, first_cds, last_cds)) { _gene_possibly_duplicated = true; _putative_position_for_the_duplicate = ae_utils::mod(ae_utils::mod(_shine_dal_position - pos1, genlen) + pos0, genlen + mutlength); } if (breakpoint_inside_segment(pos0, first_cds, last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos0, first_upstream, last_upstream)) _proms_possibly_modified = true; if (_shine_dal_position >= pos0) _shine_dal_position = ae_utils::mod(_shine_dal_position + mutlength, genlen + mutlength); for (i = 0; i <_nb_promoters; i++) { if (_promoter_positions[i] >= pos0){ _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + mutlength, genlen + mutlength);} } break; } case DEL: { // If the Shine-Dalgarno is in the deleted segment, mark the cds as deleted // (our gene tracking is based on the tracking of the Shine-Dalgarno position, // and we cannot predict the position of a bp that was deleted: we lose track of the gene) if (mutlength == 1) { if (_protein_pointer->get_shine_dal_pos() == pos1) _cds_completely_deleted = true; } else // mutlength > 1 { if (breakpoint_inside_segment(_protein_pointer->get_shine_dal_pos(), pos1, pos2)) _cds_completely_deleted = true; } if (!(_cds_completely_deleted)) { if (breakpoint_inside_segment(pos1, first_cds, last_cds) || breakpoint_inside_segment(pos2, first_cds, last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos1, first_upstream, last_upstream) || breakpoint_inside_segment(pos2, first_upstream, last_upstream)) _proms_possibly_modified = true; if ( pos1 < pos2bis ) // the deletion does not contain the replication origin { if (_shine_dal_position >= pos1) _shine_dal_position = ae_utils::mod(_shine_dal_position - mutlength, genlen - mutlength); for (i = 0; i <_nb_promoters; i++) { if (_promoter_positions[i] >= pos1){ _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - mutlength, genlen - mutlength);} } } else // the deletion contains the replication origin { if (_shine_dal_position >= 0) _shine_dal_position = ae_utils::mod(_shine_dal_position - pos2bis, genlen - mutlength); for (i = 0; i <_nb_promoters; i++) { if (_promoter_positions[i] >= 0){ _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - pos2bis, genlen - mutlength);} } } } break; } case TRANS: { if (breakpoint_inside_segment(pos1, first_cds, last_cds)) _cds_possibly_modified = true; // beginning of the excised segment if (breakpoint_inside_segment(pos2, first_cds, last_cds)) _cds_possibly_modified = true; // end of the excised segment if (breakpoint_inside_segment(pos3, first_cds, last_cds)) _cds_possibly_modified = true; // breakpoint inside the segment for the reinsertion if (breakpoint_inside_segment(pos0, first_cds, last_cds)) _cds_possibly_modified = true; // reinsertion point in the genetic unit if (breakpoint_inside_segment(pos1, first_upstream, last_upstream)) _proms_possibly_modified = true; // beginning of the excised segment if (breakpoint_inside_segment(pos2, first_upstream, last_upstream)) _proms_possibly_modified = true; // end of the excised segment if (breakpoint_inside_segment(pos3, first_upstream, last_upstream)) _proms_possibly_modified = true; // breakpoint inside the segment for the reinsertion if (breakpoint_inside_segment(pos0, first_upstream, last_upstream)) _proms_possibly_modified = true; // reinsertion point in the genetic unit int32_t pos_min = ae_utils::min( pos1, ae_utils::min( pos2bis, ae_utils::min( pos3, pos0 ) ) ); int32_t pos_B, pos_C, pos_D, pos_E; int32_t len_B, len_C, len_D; if ( ! invert ) { if ( pos_min == pos1 ) { pos_B = pos1; pos_C = pos3; pos_D = pos2bis; pos_E = pos0; } else if ( pos_min == pos2bis ) { pos_B = pos2bis; pos_C = pos0; pos_D = pos1; pos_E = pos3; } else if ( pos_min == pos3 ) { pos_B = pos3; pos_C = pos2bis; pos_D = pos0; pos_E = pos1; } else { pos_B = pos0; pos_C = pos1; pos_D = pos3; pos_E = pos2bis; } // if ( pos_min == pos0 ) len_B = pos_C - pos_B; len_C = pos_D - pos_C; len_D = pos_E - pos_D; if ((_shine_dal_position >= pos_B) && (_shine_dal_position < pos_C)) _shine_dal_position = ae_utils::mod(_shine_dal_position + len_D + len_C, genlen); else if ((_shine_dal_position >= pos_C) && (_shine_dal_position < pos_D)) _shine_dal_position = ae_utils::mod(_shine_dal_position + len_D - len_B, genlen); else if ((_shine_dal_position >= pos_D) && (_shine_dal_position < pos_E)) _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B - len_C, genlen); for (i = 0; i <_nb_promoters; i++) { if ((_promoter_positions[i] >= pos_B) && (_promoter_positions[i] < pos_C)) _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_D + len_C, genlen); else if ((_promoter_positions[i] >= pos_C) && (_promoter_positions[i] < pos_D)) _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_D - len_B, genlen); else if ((_promoter_positions[i] >= pos_D) && (_promoter_positions[i] < pos_E)) _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B - len_C, genlen); } } else // invert { if ( pos_min == pos1 ) { pos_B = pos1; pos_C = pos3; pos_D = pos2bis; pos_E = pos0; len_B = pos_C - pos_B; len_C = pos_D - pos_C; len_D = pos_E - pos_D; if ((_shine_dal_position >= pos_B) && (_shine_dal_position < pos_C)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_B + pos_C - _shine_dal_position -1 ; _shine_dal_position = ae_utils::mod(_shine_dal_position + len_D, genlen); } else if ((_shine_dal_position >= pos_C) && (_shine_dal_position < pos_D)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_C + pos_D - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position + len_D, genlen); } else if ((_shine_dal_position >= pos_D) && (_shine_dal_position < pos_E)) { _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B - len_C, genlen); } for (i = 0; i <_nb_promoters; i++) { if ((_promoter_positions[i] >= pos_B) && (_promoter_positions[i] < pos_C)) { _promoter_positions[i] = pos_B + pos_C - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_D, genlen); } else if ((_promoter_positions[i] >= pos_C) && (_promoter_positions[i] < pos_D)) { _promoter_positions[i] = pos_C + pos_D - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_D, genlen); } else if ((_promoter_positions[i] >= pos_D) && (_promoter_positions[i] < pos_E)) { _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B - len_C, genlen); } } } else if ( pos_min == pos2bis ) { pos_B = pos2bis; pos_C = pos0; pos_D = pos1; pos_E = pos3; len_B = pos_C - pos_B; len_C = pos_D - pos_C; len_D = pos_E - pos_D; if ((_shine_dal_position >= pos_B) && (_shine_dal_position < pos_C)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_B + pos_C - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position + len_D, genlen); } else if ((_shine_dal_position >= pos_C) && (_shine_dal_position < pos_D)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_C + pos_D - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position + len_D, genlen); } else if ((_shine_dal_position >= pos_D) && (_shine_dal_position < pos_E)) { _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B - len_C, genlen); } for (i = 0; i <_nb_promoters; i++) { if ((_promoter_positions[i] >= pos_B) && (_promoter_positions[i] < pos_C)) { _promoter_positions[i] = pos_B + pos_C - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_D, genlen); } else if ((_promoter_positions[i] >= pos_C) && (_promoter_positions[i] < pos_D)) { _promoter_positions[i] = pos_C + pos_D - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_D, genlen); } else if ((_promoter_positions[i] >= pos_D) && (_promoter_positions[i] < pos_E)) { _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B - len_C, genlen); } } } else if ( pos_min == pos3 ) { pos_B = pos3; pos_C = pos2bis; pos_D = pos0; pos_E = pos1; len_B = pos_C - pos_B; len_C = pos_D - pos_C; len_D = pos_E - pos_D; if ((_shine_dal_position >= pos_B) && (_shine_dal_position < pos_C)) { _shine_dal_position = ae_utils::mod(_shine_dal_position + len_C + len_D, genlen); } else if ((_shine_dal_position >= pos_C) && (_shine_dal_position < pos_D)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_C + pos_D - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B, genlen); } else if ((_shine_dal_position >= pos_D) && (_shine_dal_position < pos_E)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_D + pos_E - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B, genlen); } for (i = 0; i <_nb_promoters; i++) { if ((_promoter_positions[i] >= pos_B) && (_promoter_positions[i] < pos_C)) { _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_C + len_D, genlen); } else if ((_promoter_positions[i] >= pos_C) && (_promoter_positions[i] < pos_D)) { _promoter_positions[i] = pos_C + pos_D - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B, genlen); } else if ((_promoter_positions[i] >= pos_D) && (_promoter_positions[i] < pos_E)) { _promoter_positions[i] = pos_D + pos_E - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B, genlen); } } } else // if ( pos_min == pos0 ) { pos_B = pos0; pos_C = pos1; pos_D = pos3; pos_E = pos2bis; len_B = pos_C - pos_B; len_C = pos_D - pos_C; len_D = pos_E - pos_D; if ((_shine_dal_position >= pos_B) && (_shine_dal_position < pos_C)) { _shine_dal_position = ae_utils::mod(_shine_dal_position + len_C + len_D, genlen); } else if ((_shine_dal_position >= pos_C) && (_shine_dal_position < pos_D)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_C + pos_D - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B, genlen); } else if ((_shine_dal_position >= pos_D) && (_shine_dal_position < pos_E)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = pos_D + pos_E - _shine_dal_position - 1; _shine_dal_position = ae_utils::mod(_shine_dal_position - len_B, genlen); } for (i = 0; i <_nb_promoters; i++) { if ((_promoter_positions[i] >= pos_B) && (_promoter_positions[i] < pos_C)) { _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] + len_C + len_D, genlen); } else if ((_promoter_positions[i] >= pos_C) && (_promoter_positions[i] < pos_D)) { _promoter_positions[i] = pos_C + pos_D - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B, genlen); } else if ((_promoter_positions[i] >= pos_D) && (_promoter_positions[i] < pos_E)) { _promoter_positions[i] = pos_D + pos_E - _promoter_positions[i] - 1; _promoter_positions[i] = ae_utils::mod(_promoter_positions[i] - len_B, genlen); } } } } break; } case INV: { if (breakpoint_inside_segment(pos1, first_cds, last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos2, first_cds, last_cds)) _cds_possibly_modified = true; if (breakpoint_inside_segment(pos1, first_upstream, last_upstream)) _proms_possibly_modified = true; // beginning of the excised segment if (breakpoint_inside_segment(pos2, first_upstream, last_upstream)) _proms_possibly_modified = true; // end of the excised segment if ((_shine_dal_position >= pos1) && (_shine_dal_position < pos2bis)) { if (_strand == LEADING) {_strand = LAGGING;} else {_strand = LEADING;} _shine_dal_position = ae_utils::mod(pos1 + pos2bis - _shine_dal_position - 1, genlen); } break; } case INSERT: { // TO DO break; } case INS_HT: { // TO DO break; } case REPL_HT: { // TO DO break; } } } } void ae_gene_tree_node::register_actual_mutation_effect_on_genes_in_subtree_leaves( ae_gene_tree * tree, ae_mutation * mut, ae_genetic_unit * unit, int32_t gener, double impact_on_metabolic_error) { if ((_left_child != NULL) || (_right_child != NULL)) // I am a internal node, just delegate work to others { if (_left_child != NULL) _left_child->register_actual_mutation_effect_on_genes_in_subtree_leaves( tree, mut, unit, gener, impact_on_metabolic_error); if (_right_child != NULL) _right_child->register_actual_mutation_effect_on_genes_in_subtree_leaves( tree, mut, unit, gener, impact_on_metabolic_error); } else // no child => I am a leaf => there is work to do for me ! { if (_gene_loss_type != NOT_LOST_YET) { // inactive leaf return; } ae_list_node * protnode = NULL; ae_list_node * rnanode = NULL; ae_protein * tmpprot = NULL; ae_rna * rna = NULL; ae_gene_mutation * genemut = NULL; bool found = false; int32_t i = 0; if (_cds_completely_deleted) { genemut = new ae_gene_mutation(*mut, gener, _shine_dal_position, _strand, CDS); genemut->set_impact_on_metabolic_error(impact_on_metabolic_error); _mutation_list->add(genemut); if (gener > tree->_end_gener) tree->_end_gener = gener; _gene_loss_date = gener; _gene_loss_type = DELETED; _protein_pointer = NULL; for (int32_t i = 0; i < _nb_promoters; i++) {_rna_pointers[i] = NULL;} if (gener > tree->_end_gener) tree->_end_gener = gener; (tree->_nb_active_leaves) --; return; } if ( (!_cds_completely_deleted) && (!_cds_possibly_modified) && (!_proms_possibly_modified) ) { // This CDS was not affected by the mutation (it could have be moved or duplicated however). // Just make sure that we have correctly predicted the positions of the SD sequence and of the promoters. if (_strand == LEADING) {protnode = (unit->get_protein_list()[LEADING])->bsearch(&_shine_dal_position, compare_protein_position); found = (protnode != NULL);} else {protnode = (unit->get_protein_list()[LAGGING])->bsearch(&_shine_dal_position, compare_protein_position); found = (protnode != NULL); } if (found) { /* The strand and shine dal position are correct */ /* Update the protein and rna pointers and positions */ _protein_pointer = protnode->get_obj(); _nb_promoters = _protein_pointer->get_rna_list()->get_nb_elts(); if (_promoter_positions != NULL) delete [] _promoter_positions; if (_rna_pointers != NULL) delete [] _rna_pointers; _promoter_positions = new int32_t[_nb_promoters]; _rna_pointers = new ae_rna*[_nb_promoters]; rnanode = _protein_pointer->get_rna_list()->get_first(); rna = NULL; i = 0; while (rnanode != NULL) { rna = rnanode->get_obj(); _rna_pointers[i] = rna; _promoter_positions[i] = rna->get_promoter_pos(); rnanode = rnanode->get_next(); i++; } } else { fprintf(stderr, "Error: cannot find a protein that should have survived.\n"); char str[100]; mut->get_generic_description_string(str); printf("Mutation : %s\n", str); printf("CDS should be at %d ", _shine_dal_position); if (_strand == LEADING) printf("LEADING\n"); else printf("LAGGING\n"); unit->print_proteins(); exit(EXIT_FAILURE); } } if (_cds_possibly_modified || _proms_possibly_modified) { /* Record the impact of the mutation on the metabolic error */ if ((_cds_possibly_modified) && (_proms_possibly_modified)) genemut = new ae_gene_mutation(*mut, gener, _shine_dal_position, _strand, BOTH); else if ((_cds_possibly_modified) && (!_proms_possibly_modified)) genemut = new ae_gene_mutation(*mut, gener, _shine_dal_position, _strand, CDS); else if ((!_cds_possibly_modified) && (_proms_possibly_modified)) genemut = new ae_gene_mutation(*mut, gener, _shine_dal_position, _strand, UPSTREAM); genemut->set_impact_on_metabolic_error(impact_on_metabolic_error); _mutation_list->add(genemut); if (gener > tree->_end_gener) tree->_end_gener = gener; /* Check whether the protein survived the event */ if (_strand == LEADING) {protnode = (unit->get_protein_list()[LEADING])->bsearch(&_shine_dal_position, compare_protein_position); found = (protnode != NULL);} else {protnode = (unit->get_protein_list()[LAGGING])->bsearch(&_shine_dal_position, compare_protein_position); found = (protnode != NULL); } if (found) { /* The strand and shine dal position are correct */ /* Update the protein and rna pointers and positions */ _protein_pointer = protnode->get_obj(); _nb_promoters = _protein_pointer->get_rna_list()->get_nb_elts(); if (_promoter_positions != NULL) delete [] _promoter_positions; if (_rna_pointers != NULL) delete [] _rna_pointers; _promoter_positions = new int32_t[_nb_promoters]; _rna_pointers = new ae_rna*[_nb_promoters]; rnanode = _protein_pointer->get_rna_list()->get_first(); rna = NULL; i = 0; while (rnanode != NULL) { rna = rnanode->get_obj(); _rna_pointers[i] = rna; _promoter_positions[i] = rna->get_promoter_pos(); rnanode = rnanode->get_next(); i++; } } else { /* The protein does not exist anymore, the gene was killed by the event */ _gene_loss_date = gener; if ((mut->get_mut_type() == SWITCH) || (mut->get_mut_type() == S_INS) || (mut->get_mut_type() == S_DEL)) _gene_loss_type = LOST_BY_LOCAL_MUTATION; else if ((mut->get_mut_type() == DUPL) || (mut->get_mut_type() == DEL) || (mut->get_mut_type() == TRANS) || (mut->get_mut_type() == INV)) _gene_loss_type = BROKEN_BY_REAR; _protein_pointer = NULL; for (int32_t i = 0; i < _nb_promoters; i++) {_rna_pointers[i] = NULL;} if (gener > tree->_end_gener) (tree->_end_gener) = gener; (tree->_nb_active_leaves) --; } } if (_gene_possibly_duplicated) { /* Check whether the duplicated CDS found a promoter */ /* It should be on the same strand as myself, at the _putative_position_for_the_duplicate */ if (_strand == LEADING) {protnode = (unit->get_protein_list()[LEADING])->bsearch(&_putative_position_for_the_duplicate, compare_protein_position); found = (protnode != NULL);} else {protnode = (unit->get_protein_list()[LAGGING])->bsearch(&_putative_position_for_the_duplicate, compare_protein_position); found = (protnode != NULL);} if (found) { tmpprot = protnode->get_obj(); if (_protein_pointer != NULL) { // Create a new node for the "old" DNA segment _left_child = new ae_gene_tree_node(gener, _protein_pointer); _left_child->_node_creation_date = gener; _left_child->_dna_creation_date = _dna_creation_date; _left_child->_parent_node = this; } else { // Poor old gene was killed by the insertion of the duplicated segment // We do not create a left child _left_child = NULL; } // Create a new node for the "new" DNA segment _right_child = new ae_gene_tree_node(gener, tmpprot); _right_child->_node_creation_date = gener; _right_child->_dna_creation_date = gener; _right_child->_parent_node = this; // This node becomes internal, it represents an ancestral (obsolete) state of the gene _protein_pointer = NULL; for (int32_t i = 0; i < _nb_promoters; i++) {_rna_pointers[i] = NULL;} _gene_loss_type = DUPLICATED; _gene_loss_date = gener; // Update tree statistics if (_left_child != NULL) { (tree->_total_nb_nodes) += 2; (tree->_nb_internal_nodes) ++; (tree->_nb_leaves) ++; // - 1 + 2 (the ex-leaf becomes an internal node, 2 leaves are created) } else { (tree->_total_nb_nodes) += 1; (tree->_nb_internal_nodes) ++; // (tree->_nb_leaves) remains unchanged <== - 1 + 1 (the ex-leaf becomes an internal node, 1 leave is created) } if (tmpprot != NULL) (tree->_nb_active_leaves) ++; if (gener > tree->_end_gener) (tree->_end_gener) = gener; } // else nothing to do, the duplication was only partial, not a complete gene duplication } /* Get ready for the next mutation */ _cds_possibly_modified = false; _proms_possibly_modified = false; _gene_possibly_duplicated = false; _cds_completely_deleted = false; _putative_position_for_the_duplicate = -1; } } // ================================================================= // Protected Methods // ================================================================= aevol-4.4/src/libaevol/ae_individual_X11.h0000644000175000017500000001236212364240744015405 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // **************************************************************************** #ifndef __AE_INDIVIDUAL_X11_H__ #define __AE_INDIVIDUAL_X11_H__ // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include // ================================================================= // Class declarations // ================================================================= class ae_individual_X11 : public virtual ae_individual { public : // ================================================================= // Constructors // ================================================================= ae_individual_X11( ae_exp_manager* exp_m, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng, ae_params_mut* param_mut, double w_max, int32_t min_genome_length, int32_t max_genome_length, bool allow_plasmids, int32_t id, char* strain_name, int32_t age ); ae_individual_X11( ae_exp_manager* exp_manager, gzFile backup_file ); ae_individual_X11( const ae_individual_X11 &model, bool replication_report_copy ); ae_individual_X11( ae_individual_X11* const parent, int32_t id, ae_jumping_mt* mut_prng, ae_jumping_mt* stoch_prng ); //~ ae_individual_X11( char* genome, int32_t genome_size ); // ================================================================= // Destructors // ================================================================= virtual ~ae_individual_X11( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= virtual void display( void ); virtual void display_cdss( ae_X11_window* win ); virtual void display_rnas( ae_X11_window* win ); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= ae_individual_X11( void ) { printf( "ERROR : Call to forbidden constructor in file %s : l%d\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); }; // ================================================================= // Protected Methods // ================================================================= void reset_sectors( void ); void add_layer( void ); void init_occupied_sectors( void ); // ================================================================= // Protected Attributes // ================================================================= // These are used to manage overlapping CDS and RNA display int16_t _outmost_layer; bool* _occupied_sectors[2][100]; // TODO : find a way to manage this table's size properly? }; // ===================================================================== // Accessors definitions // ===================================================================== #endif // __AE_INDIVIDUAL_X11_H__ aevol-4.4/src/Makefile.in0000644000000000000000000005745712365454415012245 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = aevol_run$(EXEEXT) aevol_create$(EXEEXT) \ aevol_modify$(EXEEXT) aevol_propagate$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_aevol_create_OBJECTS = aevol_create.$(OBJEXT) aevol_create_OBJECTS = $(am_aevol_create_OBJECTS) aevol_create_LDADD = $(LDADD) aevol_create_DEPENDENCIES = $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_modify_OBJECTS = aevol_modify.$(OBJEXT) aevol_modify_OBJECTS = $(am_aevol_modify_OBJECTS) aevol_modify_LDADD = $(LDADD) aevol_modify_DEPENDENCIES = $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_propagate_OBJECTS = aevol_propagate.$(OBJEXT) aevol_propagate_OBJECTS = $(am_aevol_propagate_OBJECTS) aevol_propagate_LDADD = $(LDADD) aevol_propagate_DEPENDENCIES = $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_run_OBJECTS = aevol_run.$(OBJEXT) aevol_run_OBJECTS = $(am_aevol_run_OBJECTS) aevol_run_LDADD = $(LDADD) aevol_run_DEPENDENCIES = $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(aevol_create_SOURCES) $(aevol_modify_SOURCES) \ $(aevol_propagate_SOURCES) $(aevol_run_SOURCES) DIST_SOURCES = $(aevol_create_SOURCES) $(aevol_modify_SOURCES) \ $(aevol_propagate_SOURCES) $(aevol_run_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ############################################ # Variables # ############################################ ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX #################################### # Add hardening option to compiler # #################################### # This replaces insecure unlimited length buffer function calls with # length-limited ones (required for debian and not a bad idea anyway). AM_CPPFLAGS = $(AEVOLCPPFLAGS) -I$(top_srcdir)/src/libaevol \ -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS \ -D__STDC_LIMIT_MACROS -D_FORTIFY_SOURCE=2 AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) SUBDIRS = libaevol post_treatments ############################################ # Set programs to build and library to use # ############################################ ##### The solution below is no longer used since it generates a dependency problem ##### #AM_LDFLAGS = -L$(top_srcdir)/src/libaevol # LDADD = -laevol ##### ##### LDADD = $(top_srcdir)/src/libaevol/libaevol.a $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a CLEANFILES = aevol_run aevol_create aevol_modify aevol_propagate aevol_run_SOURCES = aevol_run.cpp aevol_create_SOURCES = aevol_create.cpp aevol_modify_SOURCES = aevol_modify.cpp aevol_propagate_SOURCES = aevol_propagate.cpp all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) aevol_create$(EXEEXT): $(aevol_create_OBJECTS) $(aevol_create_DEPENDENCIES) $(EXTRA_aevol_create_DEPENDENCIES) @rm -f aevol_create$(EXEEXT) $(CXXLINK) $(aevol_create_OBJECTS) $(aevol_create_LDADD) $(LIBS) aevol_modify$(EXEEXT): $(aevol_modify_OBJECTS) $(aevol_modify_DEPENDENCIES) $(EXTRA_aevol_modify_DEPENDENCIES) @rm -f aevol_modify$(EXEEXT) $(CXXLINK) $(aevol_modify_OBJECTS) $(aevol_modify_LDADD) $(LIBS) aevol_propagate$(EXEEXT): $(aevol_propagate_OBJECTS) $(aevol_propagate_DEPENDENCIES) $(EXTRA_aevol_propagate_DEPENDENCIES) @rm -f aevol_propagate$(EXEEXT) $(CXXLINK) $(aevol_propagate_OBJECTS) $(aevol_propagate_LDADD) $(LIBS) aevol_run$(EXEEXT): $(aevol_run_OBJECTS) $(aevol_run_DEPENDENCIES) $(EXTRA_aevol_run_DEPENDENCIES) @rm -f aevol_run$(EXEEXT) $(CXXLINK) $(aevol_run_OBJECTS) $(aevol_run_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aevol_create.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aevol_modify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aevol_propagate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aevol_run.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/src/aevol_run.cpp0000644000175000017500000002333012361761652012707 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #ifdef __X11 #include #else #include #endif #include #ifndef __NO_X void catch_usr1( int sig_num ); #endif #ifdef __IN2P3 void catch_usr1( int sig_num ); void catch_xcpu( int sig_num ); #endif void print_help( char* prog_path ); void print_version( void ); static ae_exp_manager* exp_manager = NULL; int main( int argc, char* argv[] ) { // Set handlers for signals to be caught #ifndef __NO_X signal( SIGUSR1, catch_usr1 ); #endif #ifdef __IN2P3 signal( SIGUSR1, catch_usr1 ); signal( SIGXCPU, catch_xcpu ); #endif // Print warning for debug mode #ifdef DEBUG printf( "aevol is being run in DEBUG mode\n" ); #endif // ========================================================================= // Get command-line options // ========================================================================= // 1) Initialize command-line option variables with default values // 2) Define allowed options // 3) Get actual values of the command-line options // 4) Check the consistancy of the command-line options // 5) Set file names according to options // ========================================================================= // ------------------------------------------------------------------------- // 1) Initialize command-line option variables with default values // ------------------------------------------------------------------------- bool use_text_files = false; bool pause_on_startup = false; bool verbose = false; int32_t num_gener = 0; int32_t nb_gener = 1000; #ifndef __NO_X bool show_display_on_startup = true; #endif // ------------------------------------------------------------------------- // 2) Define allowed options // ------------------------------------------------------------------------- const char * options_list = "hn:r:tvVwx"; static struct option long_options_list[] = { { "help", no_argument, NULL, 'h' }, { "nbgener", required_argument, NULL, 'n' }, // Number of generations to be run { "resume", required_argument, NULL, 'r' }, // Resume from generation X { "text", no_argument, NULL, 't' }, // Use text files instead of gzipped binary files { "verbose", no_argument, NULL, 'v' }, // Be verbose { "version", no_argument, NULL, 'V' }, { "wait", no_argument, NULL, 'w' }, // Pause after loading { "noX", no_argument, NULL, 'x' }, // Don't display X outputs on start { 0, 0, 0, 0 } }; // ------------------------------------------------------------------------- // 3) Get actual values of the command-line options // ------------------------------------------------------------------------- int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help( argv[0] ); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'n' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -n or --nbgener : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } nb_gener = atoi( optarg ); break; } case 'r' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -r or --resume : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } num_gener = atol( optarg ); break; } case 't' : { use_text_files = true; printf( "%s: error: Option -t or --text not yet implemented.\n", argv[0] ); exit( EXIT_FAILURE ); break; } case 'v' : { verbose = true; break; } case 'w' : { pause_on_startup = true; break; } case 'x' : { #ifdef __NO_X printf( "%s: error: Program was compiled with __NO_X option, no visualisation available.\n", argv[0] ); exit( EXIT_FAILURE ); #else show_display_on_startup = false; #endif break; } default : { // An error message is printed in getopt_long, we just need to exit exit( EXIT_FAILURE ); } } } // ================================================================= // Load the simulation // ================================================================= #ifndef __NO_X exp_manager = new ae_exp_manager_X11(); #else exp_manager = new ae_exp_manager(); #endif exp_manager->load( num_gener, false, verbose ); exp_manager->set_nb_gener( nb_gener ); // Make a numbered copy of each static input file (dynamic files are saved elsewhere) // TODO (?) #ifndef __NO_X if ( show_display_on_startup ) { ((ae_exp_manager_X11*) exp_manager)->toggle_display_on_off(); } #endif // ================================================================= // Run the simulation // ================================================================= exp_manager->run_evolution(); delete exp_manager; //~ return EXIT_SUCCESS; } #ifndef __NO_X void catch_usr1( int sig_num ) { signal( SIGUSR1, catch_usr1 ); printf( "display on/off\n" ); if ( exp_manager != NULL ) { ((ae_exp_manager_X11*) exp_manager)->toggle_display_on_off(); } } #endif #ifdef __IN2P3 void catch_usr1( int sig_num ) { //system( "./make_big_backup.py" ); exit( EXIT_FAILURE ); } void catch_xcpu( int sig_num ) { //system( "./make_big_backup.py" ); exit( EXIT_FAILURE ); } #endif /*! \brief */ void print_help( char* prog_path ) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ( ( prog_name = strrchr( prog_path, '/' )) ) prog_name++; else prog_name = prog_path; printf( "******************************************************************************\n" ); printf( "* *\n" ); printf( "* aevol - Artificial Evolution *\n" ); printf( "* *\n" ); printf( "* Aevol is a simulation platform that allows one to let populations of *\n" ); printf( "* digital organisms evolve in different conditions and study experimentally *\n" ); printf( "* the mechanisms responsible for the structuration of the genome and the *\n" ); printf( "* transcriptome. *\n" ); printf( "* *\n" ); printf( "******************************************************************************\n" ); printf( "\n" ); printf( "%s: run an aevol simulation.\n", prog_name ); printf( "\n" ); printf( "Usage : %s -h or --help\n", prog_name ); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s [-r GENER] [-n NB_GENER] [-tvwx]\n", prog_name ); printf( "\nOptions\n" ); printf( " -h, --help\n\tprint this help, then exit\n\n" ); printf( " -V, --version\n\tprint version number, then exit\n\n" ); printf( " -r, --resume GENER\n\tspecify generation to resume simulation at (default 0)\n\n" ); printf( " -n, --nbgener NB_GENER\n\tspecify number of generations to be run (default 1000)\n\n" ); printf( " -t, --text\n\tuse text files instead of binary files when possible\n\n" ); printf( " -v, --verbose\n\tbe verbose\n\n" ); printf( " -w, --wait\n\tpause after loading\n\n" ); printf( " -x, --noX\n\tdon't display X outputs upon start\n\tsend SIGUSR1 to switch X output on/off\n" ); } /*! \brief */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/aevol_modify.cpp0000644000175000017500000010537412364050651013374 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** const char* DEFAULT_PARAM_FILE_NAME = "param.in"; // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #ifdef __X11 #include #else #include #endif // ================================================================= // Function declarations // ================================================================= enum population_change_type { SUBPOPULATIONS_BASED_ON_NON_CODING_BASES = 3, REMOVE_NON_CODING_BASES_BEST_IND = 4, REMOVE_NON_CODING_BASES_POPULATION = 5, DOUBLE_NON_CODING_BASES_BEST_IND = 6, DOUBLE_NON_CODING_BASES_POPULATION = 7 }; void print_help( char* prog_path ); void print_version( void ); f_line* get_line( FILE* param_file ); void format_line( f_line* formated_line, char* line, bool* line_is_interpretable ); void change_by_cloning_best(ae_population* pop, ae_exp_manager* exp_m); void change_based_on_non_coding_bases_of_best_individual(ae_population* pop, ae_exp_manager* exp_m, population_change_type type); void change_based_on_non_coding_bases_in_population(ae_population* pop, ae_exp_manager* exp_m, population_change_type type); ae_individual* create_clone( ae_individual* dolly, int32_t id ); int main( int argc, char* argv[] ) { // 1) Initialize command-line option variables with default values char* param_file_name = NULL; bool verbose = false; int32_t num_gener = -1; // 2) Define allowed options const char * options_list = "hf:g:V"; static struct option long_options_list[] = { { "help", no_argument, NULL, 'h' }, { "file", required_argument, NULL, 'f' }, // Provide file with parameters to change { "gener", required_argument, NULL, 'g' }, { "version", no_argument, NULL, 'V' }, { 0, 0, 0, 0 } }; // 3) Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help( argv[0] ); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'f' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -f or --file : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } param_file_name = optarg; break; } case 'g' : { num_gener = atoi( optarg ); break; } default : { // An error message is printed in getopt_long, we just need to exit exit( EXIT_FAILURE ); } } } // 4) Set undefined command line parameters to default values if ( param_file_name == NULL ) { param_file_name = new char[strlen(DEFAULT_PARAM_FILE_NAME)+1]; sprintf( param_file_name, "%s", DEFAULT_PARAM_FILE_NAME ); } // 5) Check the consistancy of the command-line options if ( num_gener == -1 ) { printf( "%s: error: You must provide a generation number.\n", argv[0] ); exit( EXIT_FAILURE ); } // 6) Initialize the experiment manager #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( num_gener, false, verbose ); // 7) Define syntaxic sugars for the population, the environment, the selection... ae_population* pop = exp_manager->get_pop(); ae_environment* env = exp_manager->get_env(); ae_selection* sel = exp_manager->get_sel(); // If relevant, load the tree information char tree_file_name[50]; ae_tree * tree = NULL; bool take_care_of_the_tree = exp_manager->get_record_tree() && (exp_manager->get_tree_mode() == NORMAL) && (exp_manager->get_num_gener() > 0); if ( take_care_of_the_tree ) { // If a tree is available, assign the replication reports to the individuals #ifdef __REGUL sprintf( tree_file_name,"tree/tree_%06"PRId32".rae", num_gener ); #else sprintf( tree_file_name,"tree/tree_%06"PRId32".ae", num_gener ); #endif tree = new ae_tree( exp_manager, tree_file_name ); pop->set_replication_reports(tree, num_gener); } // 8) Interpret and apply changes printf("Interpret and apply changes\n"); FILE* param_file = fopen( param_file_name, "r" ); if ( param_file == NULL ) { printf( "%s:%d: error: could not open parameter file %s\n", __FILE__, __LINE__, param_file_name ); exit( EXIT_FAILURE ); } bool env_change = false; bool env_hasbeenmodified = false; f_line* line; int32_t cur_line = 0; while ( ( line = get_line(param_file) ) != NULL ) { cur_line++; if ( strcmp( line->words[0], "ENV_AXIS_FEATURES" ) == 0 ) { int16_t env_axis_nb_segments = line->nb_words / 2; double* env_axis_segment_boundaries = new double [env_axis_nb_segments + 1]; env_axis_segment_boundaries[0] = X_MIN; for ( int16_t i = 1 ; i < env_axis_nb_segments ; i++ ) { env_axis_segment_boundaries[i] = atof( line->words[2*i] ); } env_axis_segment_boundaries[env_axis_nb_segments] = X_MAX; // Set segment features ae_env_axis_feature* env_axis_features = new ae_env_axis_feature[env_axis_nb_segments]; for ( int16_t i = 0 ; i < env_axis_nb_segments ; i++ ) { if ( strcmp( line->words[2*i+1], "NEUTRAL" ) == 0 ) { env_axis_features[i] = NEUTRAL; } else if ( strcmp( line->words[2*i+1], "METABOLISM" ) == 0 ) { env_axis_features[i] = METABOLISM; } else if ( strcmp( line->words[2*i+1], "SECRETION" ) == 0 ) { exp_manager->get_exp_s()->set_with_secretion( true ); env_axis_features[i] = SECRETION; } else if ( strcmp( line->words[2*i+1], "DONOR" ) == 0 ) { env_axis_features[i] = DONOR; } else if ( strcmp( line->words[2*i+1], "RECIPIENT" ) == 0 ) { env_axis_features[i] = RECIPIENT; } else { printf( "ERROR in param file \"%s\" on line %"PRId32" : unknown axis feature \"%s\".\n", param_file_name, cur_line, line->words[2*i+1] ); exit( EXIT_FAILURE ); } } env->set_segmentation( env_axis_nb_segments, env_axis_segment_boundaries, env_axis_features ); env_hasbeenmodified = true; delete env_axis_segment_boundaries; delete env_axis_features; } else if ( strcmp( line->words[0], "POPULATION_SIZE") == 0 ) { if (exp_manager->is_spatially_structured()) { printf( "ERROR in param file \"%s\" on line %"PRId32": the change of population size is not implemented yet\n for spatially structured populations", param_file_name, cur_line ); exit( EXIT_FAILURE ); } pop->set_nb_indivs(atol( line->words[1] )); printf("\tChange of population size to %ld\n",atol( line->words[1] )); } else if ( strcmp( line->words[0], "SELECTION_PRESSURE") == 0 ) { sel->set_selection_pressure(atof( line->words[1] ) ); printf("\tChange of selection pressure to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "POINT_MUTATION_RATE" ) == 0 ) { pop->set_overall_point_mutation_rate( atof( line->words[1] ) ); printf("\tChange of overall point mutation rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "SMALL_INSERTION_RATE" ) == 0 ) { pop->set_overall_small_insertion_rate( atof( line->words[1] ) ); printf("\tChange of overall small insertion rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "SMALL_DELETION_RATE" ) == 0 ) { pop->set_overall_small_deletion_rate( atof( line->words[1] ) ); printf("\tChange of overall small deletion rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "MAX_INDEL_SIZE" ) == 0 ) { pop->set_overall_max_indel_size( atol( line->words[1] ) ); printf("\tChange of overall maximum indel size to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "DUPLICATION_RATE" ) == 0 ) { pop->set_overall_duplication_rate( atof( line->words[1] ) ); printf("\tChange of overall duplication rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "DELETION_RATE" ) == 0 ) { pop->set_overall_deletion_rate( atof( line->words[1] ) ); printf("\tChange of overall deletion rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "TRANSLOCATION_RATE" ) == 0 ) { pop->set_overall_translocation_rate( atof( line->words[1] ) ); printf("\tChange of overall translocation rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "INVERSION_RATE" ) == 0 ) { pop->set_overall_inversion_rate( atof( line->words[1] ) ); printf("\tChange of overall inversion to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "TRANSFER_INS_RATE" ) == 0 ) { pop->set_overall_transfer_ins_rate( atof( line->words[1] ) ); exp_manager->set_HT_ins_rate(atof( line->words[1] )); printf("\tChange of overall transfer insertion rate to %f\n",atof( line->words[1] )); } else if ( strcmp( line->words[0], "TRANSFER_REPL_RATE" ) == 0 ) { pop->set_overall_transfer_repl_rate( atof( line->words[1] ) ); exp_manager->set_HT_repl_rate(atof( line->words[1] )); printf("\tChange of overall transfer replacement rate to %f\n",atof( line->words[1] )); } else if ( ( strcmp( line->words[0], "ENV_ADD_GAUSSIAN" ) == 0 ) || ( strcmp( line->words[0], "ENV_GAUSSIAN" ) == 0 ) ) { if ( env_change ) { env->add_gaussian( atof(line->words[1]), atof(line->words[2]), atof(line->words[3])); printf("\tAddition of a gaussian with %f, %f, %f \n",atof(line->words[1]), atof(line->words[2]), atof(line->words[3])); } else { env->clear_custom_points(); env->clear_gaussians(); env->clear_initial_gaussians(); env->set_gaussians(new ae_list()); env->add_gaussian( atof(line->words[1]), atof(line->words[2]), atof(line->words[3])); printf("\tChange of the environment: first gaussian with %f, %f, %f \n",atof(line->words[1]), atof(line->words[2]), atof(line->words[3])); env_change = true; } env_hasbeenmodified = true; } else if ( strcmp( line->words[0], "ENV_ADD_POINT" ) == 0 ) { if ( env_change ) { env->add_custom_point( atof(line->words[1]), atof(line->words[2]) ); printf("\tAddition of a custom point with x=%f, y=%f\n",atof(line->words[1]), atof(line->words[2])); } else { env->clear_custom_points(); env->clear_gaussians(); env->clear_initial_gaussians(); env->set_custom_points(new ae_list()); env->add_custom_point( atof(line->words[1]), atof(line->words[2])); printf("\tChange of the environment: first custom point with x=%f, y=%f \n",atof(line->words[1]), atof(line->words[2])); env_change = true; } env_hasbeenmodified = true; } else if ( strcmp( line->words[0], "ENV_VARIATION" ) == 0 ) { static bool env_var_already_set = false; if ( env_var_already_set ) { printf( "%s:%d: ERROR in param file : duplicate entry for %s.\n", __FILE__, __LINE__, line->words[0] ); exit( EXIT_FAILURE ); } env_var_already_set = true; if ( strcmp( line->words[1], "none" ) == 0 ) { assert( line->nb_words == 2 ); env->set_var_method( NO_VAR ); printf("\tNo more environmental variation\n"); } else if ( strcmp( line->words[1], "autoregressive_mean_variation" ) == 0 ) { assert( line->nb_words == 5 ); env->set_var_method( AUTOREGRESSIVE_MEAN_VAR ); env->set_var_sigma( atof( line->words[2] ) ); env->set_var_tau( atol( line->words[3] ) ); env->set_var_prng( new ae_jumping_mt(atoi( line->words[4]))); printf("\tChange of environmental variation to a autoregressive mean variation with sigma=%f, tau=%ld and seed=%d\n", atof( line->words[2] ),atol( line->words[3] ),atoi( line->words[4])); } else if ( strcmp( line->words[1], "autoregressive_height_variation" ) == 0 ) { assert( line->nb_words == 5 ); env->set_var_method( AUTOREGRESSIVE_HEIGHT_VAR ); env->set_var_sigma( atof( line->words[2] ) ); env->set_var_tau( atol( line->words[3] ) ); env->set_var_prng( new ae_jumping_mt(atoi( line->words[4]))); printf("\tChange of environmental variation to a autoregressive height variation with sigma=%f, tau=%ld and seed=%d\n", atof( line->words[2] ),atol( line->words[3] ),atoi( line->words[4])); } else if ( strcmp( line->words[1], "add_local_gaussians" ) == 0 ) { assert( line->nb_words == 3 ); env->set_var_method( LOCAL_GAUSSIANS_VAR ); env->set_var_prng( new ae_jumping_mt(atoi(line->words[2]))); printf("\tChange of environmental variation to a local gaussians variation with seed=%d\n", atoi( line->words[2])); } else { printf( "%s:%d: ERROR in param file : unknown environment variation method.\n", __FILE__, __LINE__ ); exit( EXIT_FAILURE ); } } else if ( strcmp( line->words[0], "SECRETION_COST" ) == 0 ) { exp_manager->get_exp_s()->set_secretion_cost( atof( line->words[1] ) ); } else if ( strcmp( line->words[0], "SEED" ) == 0 ) { int32_t seed = atoi( line->words[1] ) ; ae_jumping_mt* prng = new ae_jumping_mt( seed ); // Change prng in ae_selection sel->set_prng( new ae_jumping_mt(*prng) ); if( exp_manager->is_spatially_structured()) { ae_spatial_structure* sp_struct = exp_manager->get_spatial_structure(); sp_struct->set_prng(new ae_jumping_mt(*prng) ); } printf("\tChange of the seed to %d in selection \n",atoi( line->words[1] )); } else if ( strcmp( line->words[0], "MUT_SEED" ) == 0 ) { int32_t mut_seed = atoi( line->words[1] ) ; ae_jumping_mt* mut_prng = new ae_jumping_mt( mut_seed ); // Change prng of the population pop->set_mut_prng( new ae_jumping_mt(*mut_prng) ); printf("\tChange of the seed to %d in mutations \n",atoi( line->words[1] )); } else if ( strcmp( line->words[0], "STOCH_SEED" ) == 0 ) { int32_t stoch_seed = atoi( line->words[1] ) ; ae_jumping_mt* stoch_prng = new ae_jumping_mt( stoch_seed ); // Change prng of the population pop->set_stoch_prng( new ae_jumping_mt(*stoch_prng) ); printf("\tChange of the seed to %d in individuals' stochasticity \n",atoi( line->words[1] )); } else if ( strcmp( line->words[0], "CLONE_BEST" ) == 0 ) { change_by_cloning_best(pop, exp_manager); printf("\tChange of the population for a population with %"PRId32" individuals, all clones of the best one\n",pop->get_nb_indivs()); } else if ( strcmp( line->words[0], "CREATE_3_SUBPOPULATIONS_BASED_ON_NON_CODING_BASES" ) == 0 ) { change_based_on_non_coding_bases_of_best_individual(pop, exp_manager, SUBPOPULATIONS_BASED_ON_NON_CODING_BASES); printf("\tChange of the population for a population with %"PRId32" individuals in 3 equal subpopulations (A: clones of the previous best individual, B: clones of the previous best individual without any non coding bases, C: clones of the previous best individual with twice non bases\n",pop->get_nb_indivs()); printf("WARNING: lineage will not work properly if called with \n"); printf(" a begin generation anterior to this modification \n"); } else if ( strcmp( line->words[0], "REMOVE_NON_CODING_BASES_BEST" ) == 0 ) { change_based_on_non_coding_bases_of_best_individual(pop, exp_manager, REMOVE_NON_CODING_BASES_BEST_IND); printf("\tChange of the population for a population with %"PRId32" clones of the best individual ancestor without any non coding bases\n",pop->get_nb_indivs()); printf("WARNING: lineage will not work properly if called with \n"); printf(" a begin generation anterior to this modification \n"); } else if ( strcmp( line->words[0], "REMOVE_NON_CODING_BASES_POP" ) == 0 ) { change_based_on_non_coding_bases_in_population(pop, exp_manager, REMOVE_NON_CODING_BASES_POPULATION); printf("\tChange of the population for a population with %"PRId32" individuals without any non coding bases\n",pop->get_nb_indivs()); printf("WARNING: lineage will not work properly if called with \n"); printf(" a begin generation anterior to this modification \n"); } else if ( strcmp( line->words[0], "DOUBLE_NON_CODING_BASES_BEST" ) == 0 ) { change_based_on_non_coding_bases_of_best_individual(pop, exp_manager, DOUBLE_NON_CODING_BASES_BEST_IND); printf("\tChange of the population for a population with %"PRId32" clones of the best individual ancestor with twice the non coding bases number \n",pop->get_nb_indivs()); printf("WARNING: lineage will not work properly if called with \n"); printf(" a begin generation anterior to this modification \n"); } else if ( strcmp( line->words[0], "DOUBLE_NON_CODING_BASES_POP" ) == 0 ) { change_based_on_non_coding_bases_in_population(pop, exp_manager, DOUBLE_NON_CODING_BASES_POPULATION); printf("\tChange of the population for a population with %"PRId32" individuals with twice the non coding bases number\n",pop->get_nb_indivs()); printf("WARNING: lineage will not work properly if called with \n"); printf(" a begin generation anterior to this modification \n"); } else { printf( "%s:%d: error: the change %s is not implemented yet \n", __FILE__, __LINE__, line->words[0] ); exit( EXIT_FAILURE ); } delete line; } fclose( param_file ); // Check for incompatible options if ( ( env->get_gaussians() != NULL ) && (env->get_custom_points() != NULL)) { printf( "ERROR in param file \"%s\" : parameters ENV_ADD_POINT and ENV_ADD_GAUSSIAN are incompatible.\n", param_file_name ); exit( EXIT_FAILURE ); } if ( ( env->get_custom_points() != NULL) && ( env->get_var_method() != NO_VAR )) { printf( "ERROR in param file \"%s\" : environmental variation is incompatible with ENV_ADD_POINT, please use ENV_ADD_GAUSSIAN instead. \n", param_file_name ); exit( EXIT_FAILURE ); } printf("OK\n"); if (env_hasbeenmodified) { env->build(); pop->evaluate_individuals(env); pop->sort_individuals(); } // 9) Save the modified experiment if (take_care_of_the_tree) { printf("Save the modified replication reports into tree...\t"); tree->fill_tree_with_cur_gener(); #ifdef __REGUL sprintf( tree_file_name,"tree/tree_%06"PRId32".rae", num_gener ); #else sprintf( tree_file_name,"tree/tree_%06"PRId32".ae", num_gener ); #endif gzFile tree_file = gzopen( tree_file_name, "w" ); tree->write_to_tree_file(tree_file); gzclose( tree_file ); printf("OK\n"); } printf("Save the modified experiment into backup...\t"); exp_manager->write_setup_files(); exp_manager->save(); printf("OK\n"); delete exp_manager; } /*! \brief Get a line in a file and format it \param param_file file with param in which a line is reading \return line (pointer) \see format_line(f_line* formated_line, char* line, bool* line_is_interpretable ) */ f_line* get_line( FILE* param_file ) { char line[255]; f_line* formated_line = new f_line(); bool found_interpretable_line = false; while ( !feof( param_file ) && !found_interpretable_line ) { if ( !fgets( line, 255, param_file ) ) { delete formated_line; return NULL; } format_line( formated_line, line, &found_interpretable_line ); } if ( found_interpretable_line ) { return formated_line; } else { delete formated_line; return NULL; } } /*! \brief Format a line by parsing it and the words inside \param formated_line the resulted formated line \param line original line in char* \param line_is_interpretable boolean with about the possible intrepretation of the line */ void format_line( f_line* formated_line, char* line, bool* line_is_interpretable ) { int16_t i = 0; int16_t j; // Parse line while ( line[i] != '\n' && line[i] != '\0' && line[i] != '\r' ) { j = 0; // Flush white spaces and tabs while ( line[i] == ' ' || line[i] == 0x09 ) i++; // 0x09 is the ASCII code for TAB // Check comments if ( line[i] == '#' ) break; // If we got this far, there is content in the line *line_is_interpretable = true; // Parse word while ( line[i] != ' ' && line[i] != '\n' && line[i] != '\0' && line[i] != '\r' ) { formated_line->words[formated_line->nb_words][j++] = line[i++]; } // Add '\0' at end of word if it's not empty (line ending with space or tab) if ( j != 0 ) { formated_line->words[formated_line->nb_words++][j] = '\0'; } } } void change_by_cloning_best(ae_population* pop, ae_exp_manager* exp_m) { int32_t population_size = pop->get_nb_indivs(); ae_individual* best_indiv = exp_m->get_indiv_by_rank( population_size ); ae_list* new_population = new ae_list(); for ( int32_t i = 0 ; i < population_size ; i++ ) { new_population->add(create_clone( best_indiv, i )); } pop->replace_population( new_population ); // If the population is spatially structured, set each individual's position if ( exp_m->is_spatially_structured() ) { int16_t x = 0, y = 0; int16_t x_max = exp_m->get_grid_width(); int16_t y_max = exp_m->get_grid_height(); ae_grid_cell* grid_cell = NULL; ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; while ( indiv_node != NULL ) { indiv = indiv_node->get_obj(); grid_cell = exp_m->get_grid_cell( x, y ); grid_cell->set_individual( indiv ); x++; if (x == x_max) { x = 0; y++; } indiv_node = indiv_node->get_next(); } } pop->evaluate_individuals( exp_m->get_env() ); pop->sort_individuals(); } /*! \brief Change in the population based on non coding bases on the best individual. 3 types of changes SUBPOPULATIONS_BASED_ON_NON_CODING_BASES: Create the 3 subpopulations in the population. The definition of 3 subpopulations is based on non coding bases. The subpopulation are clonal and based on the ancestor of best individual of pop at begin. The individuals in first subpopulation are clones of the best individual. The individuals in second subpopulation are clones of the best individual without any bases that are not in coding RNA. The individuals in third subpopulation are clones of the best individual with addition of bases that are not in coding RNA to double them. pop is changed into the new population with the 3 subpopulations REMOVE_NON_CODING_BASES_BEST_IND: The individuals of the new population are clones of the best individual but without any bases that are not in coding RNA. DOUBLE_NON_CODING_BASES_BEST_IND: The individuals of the new population are clones of the best individual but with addition of bases that are not in coding RNA to double them. \param pop population to change \param exp_m global exp_manager \param type type of change in the population */ void change_based_on_non_coding_bases_of_best_individual(ae_population* pop, ae_exp_manager* exp_m, population_change_type type) { if(type == SUBPOPULATIONS_BASED_ON_NON_CODING_BASES || type == REMOVE_NON_CODING_BASES_BEST_IND || type == DOUBLE_NON_CODING_BASES_BEST_IND) { // 1) Compute the population size int32_t subpopulation_size = (int)floor(pop->get_nb_indivs()/3); // 2) Get the best individual ae_individual* best_indiv = exp_m->get_indiv_by_rank( pop->get_nb_indivs() ); // 3) Create the new population ae_list* new_generation = new ae_list(); ae_individual* indiv = create_clone(best_indiv, -1); ae_individual* only_coding_indiv = create_clone( best_indiv, -1 ); //one individual being the clone of the chosen individual but without any non coding bases only_coding_indiv->remove_non_coding_bases(); ae_individual* twice_non_coding_indiv = create_clone( best_indiv, -1 ); //one individual being the clone of the chosen individual but without any non coding bases twice_non_coding_indiv->double_non_coding_bases(); int32_t* probe_A = new int32_t[5]; int32_t* probe_B = new int32_t[5]; int32_t* probe_C = new int32_t[5]; for( int32_t i = 0 ; i<5; i++) { probe_A[i] = 1; probe_B[i] = 10; probe_C[i] = 100; } indiv->set_int_probes(probe_A); only_coding_indiv->set_int_probes(probe_B); twice_non_coding_indiv->set_int_probes(probe_C); double* probe_double_A = new double[5]; double* probe_double_B = new double[5]; double* probe_double_C = new double[5]; for( int32_t i = 0 ; i<5; i++) { probe_double_A[i] = 1; probe_double_B[i] = 10; probe_double_C[i] = 100; } indiv->set_double_probes(probe_double_A); only_coding_indiv->set_double_probes(probe_double_B); twice_non_coding_indiv->set_double_probes(probe_double_C); switch(type) { case SUBPOPULATIONS_BASED_ON_NON_CODING_BASES: { int32_t index_new_indiv = 0; for ( int32_t i = 0 ; i < subpopulation_size ; i++ ) // clones of the 3 individuals { new_generation->add(create_clone( indiv, index_new_indiv++ )); new_generation->add(create_clone( only_coding_indiv, index_new_indiv++ )); new_generation->add(create_clone( twice_non_coding_indiv, index_new_indiv++ )); } break; } case REMOVE_NON_CODING_BASES_BEST_IND: { for ( int32_t i = 0 ; i < pop->get_nb_indivs() ; i++ ) { new_generation->add(create_clone( only_coding_indiv, i )); } break; } case DOUBLE_NON_CODING_BASES_BEST_IND: { for ( int32_t i = 0 ; i < pop->get_nb_indivs() ; i++ ) { new_generation->add(create_clone( twice_non_coding_indiv, i )); } break; } default: { fprintf(stderr, "%s:%d: error: wrong population_change_type %d\n", __FILE__, __LINE__, type ); exit( EXIT_FAILURE ); break; } } // 4) Replace the current population by the new one pop->get_indivs()->erase( true ); assert( pop->get_indivs()->is_empty() ); pop->replace_population( new_generation ); // TODO // If the population is spatially structured, set each individual's position // There will be a problem however for the "3 subpopulations" type of change, // if the population size has changed (which is likely given that we do not // generally used population size that are multiple of 3) pop->evaluate_individuals( exp_m->get_env() ); pop->sort_individuals(); } else { printf( "%s:%d: error: wrong population_change_type %d\n", __FILE__, __LINE__, type ); exit( EXIT_FAILURE ); } } /*! \brief Change in the population based on non coding bases. 2 types of changes REMOVE_NON_CODING_BASES_POPULATION: The individual of the new population are the individuals without any bases that are not in coding RNA. DOUBLE_NON_CODING_BASES_POPULATION: The individual of the new population are the individuals with addition of bases that are not in coding RNA to double them. \param pop population to change \param exp_m global exp_manager \param type type of change in the population */ void change_based_on_non_coding_bases_in_population(ae_population* pop, ae_exp_manager* exp_m, population_change_type type) { if(type == REMOVE_NON_CODING_BASES_POPULATION || type == DOUBLE_NON_CODING_BASES_POPULATION) { ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; for ( int32_t i = 0 ; i < pop->get_nb_indivs() ; i++ ) { indiv = indiv_node->get_obj(); if(type == REMOVE_NON_CODING_BASES_POPULATION) { indiv->remove_non_coding_bases(); } else { indiv->double_non_coding_bases(); } indiv_node = indiv_node->get_next(); } } else { printf( "%s:%d: error: wrong population_change_type %d\n", __FILE__, __LINE__, type ); exit( EXIT_FAILURE ); } } /*! \brief Create of clone of an ae_individual \param dolly original individual that would be cloned \param id index of the clone in the population \return clone of dolly */ ae_individual* create_clone( ae_individual* dolly, int32_t id ) { ae_individual* indiv; indiv = new ae_individual( *dolly, true ); indiv->set_id( id ); //printf( "metabolic error of the clonal individual : %f (%"PRId32" gene(s), %"PRId32" non coding bases)\n", // indiv->get_dist_to_target_by_feature(METABOLISM), indiv->get_protein_list()->get_nb_elts(), indiv->get_nb_bases_in_0_coding_RNA()); return indiv; } /*! \brief */ void print_help( char* prog_path ) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ( (prog_name = strrchr( prog_path, '/' )) ) prog_name++; else prog_name = prog_path; printf( "******************************************************************************\n" ); printf( "* *\n" ); printf( "* aevol - Artificial Evolution *\n" ); printf( "* *\n" ); printf( "* Aevol is a simulation platform that allows one to let populations of *\n" ); printf( "* digital organisms evolve in different conditions and study experimentally *\n" ); printf( "* the mechanisms responsible for the structuration of the genome and the *\n" ); printf( "* transcriptome. *\n" ); printf( "* *\n" ); printf( "******************************************************************************\n" ); printf( "\n" ); printf( "%s: modify an experiment as specified in param_file.\n", prog_name ); printf( "\n" ); printf( "Usage : %s -h or --help\n", prog_name ); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s -g GENER [-f param_file]\n", prog_name ); printf( "\nOptions\n" ); printf( " -h, --help\n\tprint this help, then exit\n\n" ); printf( " -V, --version\n\tprint version number, then exit\n\n" ); printf( " -g, --gener GENER\n\tspecify generation number\n\n" ); printf( " -f, --file param_file\n\tspecify parameter file (default: param.in)\n"); } /*! \brief */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/aevol_propagate.cpp0000644000175000017500000003275112364050651014065 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** const char* DEFAULT_PARAM_FILE_NAME = "param.in"; // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #ifdef __X11 #include #else #include #endif #include // ================================================================= // Function declarations // ================================================================= void print_help( char* prog_path ); void print_version( void ); int main( int argc, char* argv[] ) { // 1) Initialize command-line option variables with default values int32_t num_gener = -1; int32_t generalseed = -1; int32_t selseed = -1; int32_t mutseed = -1; int32_t stochseed = -1; int32_t envvarseed = -1; int32_t envnoiseseed = -1; char* input_dir = NULL; char* output_dir = NULL; bool verbose = false; // 2) Define allowed options const char * options_list = "g:hi:o:vVS:s:m:t:e:n:"; static struct option long_options_list[] = { { "gener", required_argument, NULL, 'g' }, { "help", no_argument, NULL, 'h' }, { "in", required_argument, NULL, 'i' }, { "out", required_argument, NULL, 'o' }, { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'V' }, { "general-seed", required_argument, NULL, 'S' }, { "sel-seed", required_argument, NULL, 's' }, { "mut-seed", required_argument, NULL, 'm' }, { "stoch-seed", required_argument, NULL, 't' }, { "env-var-seed", required_argument, NULL, 'e' }, { "env-noise-seed", required_argument, NULL, 'n' }, { 0, 0, 0, 0 } }; // 3) Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help( argv[0] ); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'g' : { num_gener = atoi( optarg ); break; } case 'S' : { generalseed = atoi( optarg ); break; } case 's' : { selseed = atoi( optarg ); break; } case 'm' : { mutseed = atoi( optarg ); break; } case 't' : { stochseed = atoi( optarg ); break; } case 'e' : { envvarseed = atoi( optarg ); break; } case 'n' : { envnoiseseed = atoi( optarg ); break; } case 'i' : { input_dir = new char[strlen(optarg)+1]; strcpy( input_dir, optarg ); break; } case 'o' : { output_dir = new char[strlen(optarg)+1]; strcpy( output_dir, optarg ); break; } case 'v' : { verbose = true; break; } default : { // An error message is printed in getopt_long, we just need to exit exit( EXIT_FAILURE ); } } } if ( (generalseed != -1) && ( (selseed != -1)||(mutseed!=-1)||(stochseed!=-1)||(envvarseed!=-1)||(envnoiseseed!=-1) ) ) { fprintf(stderr, "Error: if you specify a general seed with -S or --seed, you should not specify additional seeds.\n"); exit( EXIT_FAILURE ); } // 4) Set undefined command line parameters to default values if ( input_dir == NULL ) { input_dir = new char[255]; sprintf( input_dir, "%s", "." ); } if ( output_dir == NULL ) { output_dir = new char[255]; sprintf( output_dir, "%s", "output" ); } if ( num_gener == -1 ) { // Set num_gener to the content of the LAST_GENER file if it exists. // If it doesn't, print help and exit char lg_filename[300]; sprintf(lg_filename, "%s/%s", input_dir, LAST_GENER_FNAME); FILE* lg_file = fopen( lg_filename, "r" ); if ( lg_file != NULL ) { fscanf( lg_file, "%"PRId32"\n", &num_gener ); fclose( lg_file ); } else { printf( "aevol_propagate: no generation number provided.\n" ); print_help( argv[0] ); exit( EXIT_FAILURE ); } } // 5) Check whether the output directory is missing struct stat stat_buf; if ( (stat( output_dir, &stat_buf ) == -1) && (errno == ENOENT) ) { // printf( "Directory \"%s\" does not exist. Create it ? [Y/n]\n", output_dir ); // char answer = getchar(); // while ( answer != 'y' and answer != 'n' and answer != '\n' ) // { // printf( "Please answer by 'y' or 'n'. Create output directory ? [Y/n]\n" ); // while( answer != '\n' && answer != EOF) answer = getchar(); // "flush" stdin // answer = getchar(); // } // char flush = answer; // while( flush != '\n' && flush != EOF) flush = getchar(); // "flush" stdin // if ( answer == '\n' ) answer = 'y'; // if ( answer == 'n' ) exit( EXIT_SUCCESS ); if ( mkdir( output_dir, 0755 ) ) { err( EXIT_FAILURE, output_dir, errno ); } } // ================================================================= // Load the model experiment // ================================================================= #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( input_dir, num_gener, false, verbose, false ); if (generalseed != -1) { ae_jumping_mt * prng = new ae_jumping_mt( generalseed ); selseed = prng->random( 1000000 ); mutseed = prng->random( 1000000 ); stochseed = prng->random( 1000000 ); envvarseed = prng->random( 1000000 ); envnoiseseed = prng->random( 1000000 ); ae_jumping_mt * selprng = new ae_jumping_mt( selseed ); ae_jumping_mt * mutprng = new ae_jumping_mt( mutseed ); ae_jumping_mt * stochprng = new ae_jumping_mt( stochseed ); ae_jumping_mt * envvarprng = new ae_jumping_mt( envvarseed ); ae_jumping_mt * envnoiseprng = new ae_jumping_mt( envnoiseseed ); exp_manager->get_sel()->set_prng( selprng ); exp_manager->get_pop()->set_mut_prng( mutprng ); exp_manager->get_pop()->set_stoch_prng( stochprng ); exp_manager->get_env()->set_var_prng( envvarprng ); exp_manager->get_env()->set_noise_prng( envnoiseprng ); if (exp_manager->is_spatially_structured()) { int32_t spatialstructseed = prng->random( 1000000 ); ae_jumping_mt * spatialstructprng = new ae_jumping_mt( spatialstructseed ); exp_manager->get_spatial_structure()->set_prng(spatialstructprng); } delete prng; } else { if ( selseed != -1 ) { ae_jumping_mt * selprng = new ae_jumping_mt( selseed ); if (exp_manager->is_spatially_structured()) { int32_t spatialstructseed = selprng->random( 1000000 ); ae_jumping_mt * spatialstructprng = new ae_jumping_mt( spatialstructseed ); exp_manager->get_spatial_structure()->set_prng(spatialstructprng); } exp_manager->get_sel()->set_prng( selprng ); } if ( mutseed != -1 ) { ae_jumping_mt * mutprng = new ae_jumping_mt( mutseed ); exp_manager->get_pop()->set_mut_prng( mutprng ); } if ( stochseed != -1 ) { ae_jumping_mt * stochprng = new ae_jumping_mt( stochseed ); exp_manager->get_pop()->set_stoch_prng( stochprng ); } if ( envvarseed != -1 ) { ae_jumping_mt * envvarprng = new ae_jumping_mt( envvarseed ); exp_manager->get_env()->set_var_prng( envvarprng ); } if ( envnoiseseed != -1 ) { ae_jumping_mt * envnoiseprng = new ae_jumping_mt( envnoiseseed ); exp_manager->get_env()->set_noise_prng( envnoiseprng ); } } exp_manager->save_copy( output_dir, 0 ); } /*! \brief */ void print_help( char* prog_path ) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ( ( prog_name = strrchr( prog_path, '/' ) ) ) prog_name++; else prog_name = prog_path; printf( "******************************************************************************\n" ); printf( "* *\n" ); printf( "* aevol - Artificial Evolution *\n" ); printf( "* *\n" ); printf( "* Aevol is a simulation platform that allows one to let populations of *\n" ); printf( "* digital organisms evolve in different conditions and study experimentally *\n" ); printf( "* the mechanisms responsible for the structuration of the genome and the *\n" ); printf( "* transcriptome. *\n" ); printf( "* *\n" ); printf( "******************************************************************************\n" ); printf( "\n" ); printf( "%s:\n", prog_name ); printf( "\tCreate a fresh copy of the experiment as it was at the given generation.\n" ); printf( "\tThe generation number of the copy will be reset to 0.\n" ); printf( "\n" ); printf( "Usage : %s -h or --help\n", prog_name ); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s [-v] [-g GENER] [-i INDIR] [-o OUTDIR] [-S GENERALSEED]\n", prog_name ); printf( " or : %s [-v] [-g GENER] [-i INDIR] [-o OUTDIR] [-s SELSEED] [-m MUTSEED] [-t STOCHSEED] [-e ENVVARSEED] [-n ENVNOISESEED] ]\n", prog_name ); printf( "\nOptions\n" ); printf( " -h, --help\n\tprint this help, then exit\n\n" ); printf( " -V, --version\n\tprint version number, then exit\n\n" ); printf( " -v, --verbose\n\tbe verbose\n\n" ); printf( " -g, --gener GENER\n\tspecify generation number\n" ); printf( "\t(default: that contained in file last_gener.txt, if any)\n\n" ); printf( " -i, --in INDIR\n\tspecify input directory (default \".\")\n\n" ); printf( " -o, --out OUTDIR\n\tspecify output directory (default \"./output\")\n\n" ); printf( " -S, --general-seed GENERALSEED\n\tspecify an integer to be used as a seed for random numbers.\n" ); printf( "\tIf you use %s repeatedly to initialize several simulations, you should specify a different\n", prog_name ); printf( "\tseed for each simulation, otherwise all simulations will yield exactly the same results.\n" ); printf( "\tIf you specify this general seed, random drawings will be different for all random processes\n" ); printf( "\tenabled in your simulations (mutations, stochastic gene expression, selection, migration, \n" ), printf( "\tenvironmental variation, environmental noise). To change the random drawings for a specific\n" ); printf( "\trandom process only, do not use -S but the options below.\n" ); printf( " -s, --sel-seed SELSEED\n\tspecify an integer as a seed for random numbers needed for selection\n" ); printf( "\tand migration (if spatial structure is enabled).\n" ); printf( " -m, --mut-seed MUTSEED\n\tspecify an integer as a seed for random numbers needed for mutations\n" ); printf( " -t, --stoch-seed STOCHSEED\n\tspecify an integer as a seed for random numbers needed for \n" ); printf( "\tstochastic gene expression.\n" ); printf( " -e, --env-var-seed ENVVARSEED\n\tspecify an integer as a seed for random numbers needed for \n" ); printf( "\tenvironmental variation.\n" ); printf( " -n, --env-noise-seed ENVNOISESEED\n\tspecify an integer as a seed for random numbers needed for \n" ); printf( "\tenvironmental noise.\n" ); } /*! \brief */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/Makefile.am0000644000175000017500000000343212365452043012241 00000000000000############################################ # Variables # ############################################ AM_CPPFLAGS = $(AEVOLCPPFLAGS) AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) SUBDIRS = libaevol post_treatments AM_CPPFLAGS += -I$(top_srcdir)/src/libaevol ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS #################################### # Add hardening option to compiler # #################################### # This replaces insecure unlimited length buffer function calls with # length-limited ones (required for debian and not a bad idea anyway). AM_CPPFLAGS += -D_FORTIFY_SOURCE=2 ############################################ # Set programs to build and library to use # ############################################ ##### The solution below is no longer used since it generates a dependency problem ##### #AM_LDFLAGS = -L$(top_srcdir)/src/libaevol # LDADD = -laevol ##### ##### LDADD = $(top_srcdir)/src/libaevol/libaevol.a $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a bin_PROGRAMS = aevol_run aevol_create aevol_modify aevol_propagate CLEANFILES = aevol_run aevol_create aevol_modify aevol_propagate aevol_run_SOURCES = aevol_run.cpp aevol_create_SOURCES = aevol_create.cpp aevol_modify_SOURCES = aevol_modify.cpp aevol_propagate_SOURCES = aevol_propagate.cpp aevol-4.4/src/aevol_create.cpp0000644000175000017500000002141412365452043013342 00000000000000//***************************************************************************** // // aevol - Artificial Evolution // // Copyright (C) 2004 LIRIS. // Web: https://liris.cnrs.fr/ // E-mail: carole.knibbe@liris.cnrs.fr // Original Authors : Guillaume Beslon, Carole Knibbe, Virginie Lefort // David Parsons // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //***************************************************************************** /** \class * \brief */ const char* DEFAULT_PARAM_FILE_NAME = "param.in"; // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #ifdef __X11 #include #else #include #endif #include // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); int main( int argc, char* argv[] ) { // 1) Initialize command-line option variables with default values char* param_file_name = NULL; char* output_dir = NULL; char* chromosome_file_name = NULL; char* plasmid_file_name = NULL; // 2) Define allowed options const char * options_list = "hVf:o:c:p:"; static struct option long_options_list[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'V' }, { "file", required_argument, NULL, 'f' }, { "out", required_argument, NULL, 'o' }, { "chromosome", required_argument, NULL, 'c' }, { "plasmid", required_argument, NULL, 'p' }, { 0, 0, 0, 0 } }; // 3) Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'f' : { param_file_name = new char[strlen(optarg)+1]; strcpy( param_file_name, optarg ); break; } case 'o' : { output_dir = new char[strlen(optarg)+1]; strcpy( output_dir, optarg ); break; } case 'c': { chromosome_file_name = new char [strlen(optarg)+1]; strcpy( chromosome_file_name, optarg ); break; } case 'p': { plasmid_file_name = new char [strlen(optarg)+1]; strcpy( plasmid_file_name, optarg ); break; } default : { // An error message is printed in getopt_long, we just need to exit exit( EXIT_FAILURE ); } } } // 4) Set undefined command line parameters to default values if ( param_file_name == NULL ) { param_file_name = new char[strlen(DEFAULT_PARAM_FILE_NAME)+1]; sprintf( param_file_name, "%s", DEFAULT_PARAM_FILE_NAME ); } // 5) Create a param loader for the parameter file param_loader* my_param_loader = new param_loader( param_file_name ); delete param_file_name; // 6) Initialize the experiment manager ae_exp_manager* exp_manager = new ae_exp_manager(); // 7) Initialize the simulation from the parameter file int32_t lchromosome=-1; char* chromosome; if ( chromosome_file_name != NULL ) { char rawchromosome[1000000]; FILE* chromosome_file = fopen(chromosome_file_name,"r"); if (chromosome_file==NULL) { printf("ERROR: failed to open source chromosome file %s\n",chromosome_file_name); exit( EXIT_FAILURE ); } fgets(rawchromosome, 1000000, chromosome_file); lchromosome = strlen(rawchromosome)-1; chromosome = new char[lchromosome]; // Warning: will become the DNA of the first individual created -> no not delete, will be freed in ~ae_dna. strncpy(chromosome, rawchromosome, lchromosome); printf("Loading chromosome from text file %s (%"PRId32" base pairs) \n",chromosome_file_name,lchromosome); fclose(chromosome_file); } int32_t lplasmid=-1; char* plasmid; if ( plasmid_file_name != NULL ) { char rawplasmid[1000000]; FILE* plasmid_file = fopen(plasmid_file_name,"r"); if (plasmid_file==NULL) { printf("ERROR: failed to open source chromosome file %s\n",plasmid_file_name); exit( EXIT_FAILURE ); } fgets(rawplasmid, 1000000, plasmid_file); lplasmid = strlen(rawplasmid)-1; plasmid = new char[lplasmid]; // Warning: will become the DNA of the first individual created -> no not delete, will be freed in ~ae_dna. strncpy(plasmid, rawplasmid, lplasmid); printf("Loading plasmid from text file %s (%"PRId32" base pairs) \n",plasmid_file_name,lplasmid); fclose(plasmid_file); } if (lchromosome > -1) { if (lplasmid > -1) { my_param_loader->load( exp_manager, true, chromosome, lchromosome, plasmid, lplasmid ); } else { my_param_loader->load( exp_manager, true, chromosome, lchromosome ); } } else { my_param_loader->load( exp_manager, true ); } delete my_param_loader; //~ ((ae_exp_manager_X11*)exp_manager)->toggle_display_on_off(); //~ exp_manager->display(); //~ getchar(); // 8) Save the experiment if (output_dir == NULL) { // Create the static setup files (experimental setup and output profile) exp_manager->write_setup_files(); // Create the initial backups exp_manager->save(); } else { // Save everything in the provided directory exp_manager->save_copy(output_dir); delete output_dir; } delete exp_manager; } /*! \brief */ void print_help(char* prog_path) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ( ( prog_name = strrchr( prog_path, '/' ) ) ) prog_name++; else prog_name = prog_path; printf( "******************************************************************************\n" ); printf( "* *\n" ); printf( "* aevol - Artificial Evolution *\n" ); printf( "* *\n" ); printf( "* Aevol is a simulation platform that allows one to let populations of *\n" ); printf( "* digital organisms evolve in different conditions and study experimentally *\n" ); printf( "* the mechanisms responsible for the structuration of the genome and the *\n" ); printf( "* transcriptome. *\n" ); printf( "* *\n" ); printf( "******************************************************************************\n" ); printf( "\n" ); printf( "%s: create an experiment with setup as specified in param_file.\n", prog_name ); printf( "\n" ); printf( "Usage : %s -h or --help\n", prog_name ); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s [-f PARAM_FILE] [-o OUTDIR] [-c CFILE] [-p PFILE]\n", prog_name ); printf( "\nOptions\n" ); printf( " -h, --help\n\tprint this help, then exit\n\n" ); printf( " -V, --version\n\tprint version number, then exit\n\n" ); printf( " -f, --file PARAM_FILE\n\tspecify parameter file (default: param.in)\n" ); printf( " -o, --out OUTDIR\n\tspecify output directory (default \"./\")\n\n" ); printf( " -c, --chromosome CFILE\n\tload chromosome from given text file instead of generating it\n"); printf( " -p, --plasmid PFILE\n\tload plasmid from given text file instead of generating it\n"); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/0000755000000000000000000000000012365454434013472 500000000000000aevol-4.4/src/post_treatments/view_generation.cpp0000644000175000017500000001103412362164073017326 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #ifdef __NO_X #error This program requires graphics libraries #else #include #endif // ================================================================= // Project Files // ================================================================= #include #include #include #include // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); int main( int argc, char* argv[] ) { // ================================================================= // Get command-line options // ================================================================= // // 1) Initialize command-line option variables with default values int32_t gener = 0; // 2) Define allowed options const char * options_list = "hVg:"; static struct option long_options_list[] = { {"version", no_argument, NULL, 'V' }, { "gener", 1, NULL, 'g' }, { 0, 0, 0, 0 } }; // 3) Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'g' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -g or --gener : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } gener = atol( optarg ); break; } } } printf( "Displaying generation %"PRId32"...\n", gener ); // ================================================================= // Read the backup file // ================================================================= // Load simulation from backup ae_exp_manager_X11* exp_manager = new ae_exp_manager_X11(); exp_manager->load( gener, false, true, false ); // ================================================================= // Draw the windows // ================================================================= exp_manager->toggle_display_on_off(); exp_manager->display(); while ( exp_manager->quit_signal_received() == false ) { exp_manager->handle_events(); } delete exp_manager; return EXIT_SUCCESS; } void print_help(char* prog_name) { printf( "\n************* aevol - Artificial Evolution ************* \n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "Copyright (C) 2009 LIRIS.\n" ); printf( "Usage : %s -h\n", prog_name ); printf( " or : %s -f file.ae\n", prog_name ); printf( "\t-h : Display this screen\n" ); printf( "\t-g or --gener n : Display the population at generation n\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/fixed_mutations.cpp0000644000175000017500000005736512362005303017352 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #ifndef __NO_X #include #else #include #endif #include #include #include #include #include #include #include //#include enum check_type { FULL_CHECK = 0, LIGHT_CHECK = 1, ENV_CHECK = 2, NO_CHECK = 3 }; // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); double* dist_to_target_segment; int main(int argc, char** argv) { // The input file (lineage.ae or lineage.rae) must contain the following information: // // - common data (ae_common::write_to_backup) // - begin gener (int32_t) // - end gener (int32_t) // - final individual index (int32_t) // - initial genome size (int32_t) // - initial ancestor (nb genetic units + sequences) (ae_individual::write_to_backup) // - replication report of ancestor at generation begin_gener+1 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+2 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+3 (ae_replic_report::write_to_backup) // - ... // - replication report of ancestor at generation end_gener (ae_replic_report::write_to_backup) // ===================== // Parse command line // ===================== // Default values check_type check = LIGHT_CHECK; char* lineage_file_name = NULL; bool verbose = false; double tolerance = 0; const char * short_options = "hVvncf:t:"; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V' }, {"verbose", no_argument, NULL, 'v'}, {"nocheck", no_argument, NULL, 'n'}, {"fullcheck", no_argument, NULL, 'c'}, {"file", required_argument, NULL, 'f'}, {"tolerance", required_argument, NULL, 't'}, {0, 0, 0, 0} }; int option; while( (option = getopt_long(argc, argv, short_options, long_options, NULL)) != -1 ) { switch( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'v' : verbose = true; break; case 'n' : check = NO_CHECK; break; case 'c' : check = FULL_CHECK; break; case 'f' : { if ( strcmp( optarg, "" ) == 0 ) { fprintf( stderr, "ERROR : Option -f or --file : missing argument.\n" ); exit( EXIT_FAILURE ); } lineage_file_name = new char[strlen(optarg) + 1]; sprintf( lineage_file_name, "%s", optarg ); break; } case 't' : { if ( strcmp( optarg, "" ) == 0 ) { fprintf( stderr, "ERROR : Option -t or --tolerance : missing argument.\n" ); exit( EXIT_FAILURE ); } check = ENV_CHECK; tolerance = atof(optarg); break; } default : { fprintf( stderr, "ERROR : Unknown option, check your syntax.\n" ); print_help(argv[0]); exit( EXIT_FAILURE ); } } } if ( lineage_file_name == NULL ) { fprintf( stderr, "ERROR : Option -f or --file missing. \n" ); exit( EXIT_FAILURE ); } printf("\n"); printf( "WARNING : Parameter change during simulation is not managed in general.\n" ); printf( " Only changes in environmental target done with aevol_modified are handled.\n" ); printf("\n"); // ======================= // Open the lineage file // ======================= gzFile lineage_file = gzopen( lineage_file_name, "r" ); if (lineage_file == Z_NULL) { fprintf( stderr, "ERROR : Could not read the lineage file %s\n", lineage_file_name ); exit( EXIT_FAILURE ); } int32_t begin_gener, end_gener, final_index, num_gener, final_indiv_rank; gzread(lineage_file, &begin_gener, sizeof(begin_gener)); gzread(lineage_file, &end_gener, sizeof(end_gener)); gzread(lineage_file, &final_index, sizeof(final_index) ); gzread(lineage_file, &final_indiv_rank, sizeof(final_indiv_rank) ); if ( verbose ) { printf("\n\n"); printf("================================================================================\n"); printf(" Statistics of the ancestors of indiv. #%"PRId32" (t=%"PRId32" to %"PRId32")\n", final_index, begin_gener, end_gener); printf("================================================================================\n"); } // ========================= // Open the experience manager // ========================= // Open the experiment manager #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( begin_gener, false, true, false ); ae_environment* env = new ae_environment( *(exp_manager->get_env()) ); // independent copy int32_t backup_step = exp_manager->get_backup_step(); // ========================= // Open the output file(s) // ========================= char output_file_name[60]; snprintf( output_file_name, 60, "stats/fixedmut-b%06"PRId32"-e%06"PRId32"-i%"PRId32"-r%"PRId32".out",begin_gener, end_gener, final_index, final_indiv_rank ); FILE * output = fopen( output_file_name, "w" ); if ( output == NULL ) { fprintf( stderr, "ERROR : Could not create the output file %s\n", output_file_name ); exit( EXIT_FAILURE ); } // Write the header fprintf( output, "# #################################################################\n" ); fprintf( output, "# Mutations in the lineage of the best indiv at generation %"PRId32"\n", end_gener ); fprintf( output, "# #################################################################\n" ); fprintf( output, "# 1. Generation (mut. occurred when producing the indiv. of this generation)\n" ); fprintf( output, "# 2. Genetic unit (which underwent the mutation, 0 = chromosome) \n" ); fprintf( output, "# 3. Mutation type (0: switch, 1: smallins, 2: smalldel, 3:dupl, 4: del, 5:trans, 6:inv, 7:insert, 8:ins_HT, 9:repl_HT) \n" ); fprintf( output, "# 4. pos_0 (position for the small events, begin_segment for the rearrangements, begin_segment of the inserted segment for ins_HT, begin_segment of replaced segment for repl_HT) \n" ); fprintf( output, "# 5. pos_1 (-1 for the small events, end_segment for the rearrangements, end_segment of the inserted segment for ins_HT, begin_segment of donor segment for repl_HT) \n" ); fprintf( output, "# 6. pos_2 (reinsertion point for duplic., cutting point in segment for transloc., insertion point in the receiver for ins_HT, end_segment of the replaced segment for repl_HT, -1 for other events)\n" ); fprintf( output, "# 7. pos_3 (reinsertion point for transloc., breakpoint in the donor for ins_HT, end_segment of the donor segment for repl_HT, -1 for other events)\n" ); fprintf( output, "# 8. invert (transloc, was the segment inverted (0/1)?, sense of insertion for ins_HT (0=DIRECT, 1=INDIRECT), sense of the donor segment for repl_HT (0=DIRECT, 1=INDIRECT),-1 for other events)\n" ); fprintf( output, "# 9. align_score (score that was needed for the rearrangement to occur, score of the first alignment for ins_HT and repl_HT)\n" ); fprintf( output, "# 10. align_score2 (score for the reinsertion for transloc, score of the second alignment for ins_HT and repl_HT)\n" ); fprintf( output, "# 11. seg_len (segment length for rearrangement, donor segment length for ins_HT and repl_HT)\n" ); fprintf( output, "# 12. repl_seg_len (replaced segment length for repl_HT, -1 for the others)\n" ); fprintf( output, "# 13. GU_length (before the event)\n" ); fprintf( output, "# 14. Impact of the mutation on the metabolic error (negative value = smaller gap after = beneficial mutation) \n" ); fprintf( output, "# 15. Number of coding RNAs possibly disrupted by the breakpoints \n" ); fprintf( output, "# 16. Number of coding RNAs completely included in the segment (donor segment in the case of a transfer) \n" ); fprintf( output, "# 17. Number of coding RNAs that were completely included in the replaced segment (meaningful only for repl_HT) \n" ); fprintf( output, "####################################################################################################################\n" ); fprintf( output, "#\n" ); fprintf( output, "# Header for R\n" ); fprintf( output, "gener gen_unit mut_type pos_0 pos_1 pos_2 pos_3 invert align_score align_score_2 seg_len repl_seg_len GU_len impact nbgenesatbreak nbgenesinseg nbgenesinreplseg\n" ); // ============================== // Prepare the initial ancestor // ============================== ae_individual * indiv = new ae_individual(exp_manager, lineage_file ); indiv->evaluate( env ); indiv->compute_statistical_data(); if ( verbose ) { printf("Initial fitness = %f\n", indiv->get_fitness()); printf("Initial genome size = %"PRId32"\n", indiv->get_total_genome_size()); } // =============================================================================== // Replay the mutation to get the successive ancestors and analyze them // (and, optionally, check that the rebuilt envir and genome are correct each // time a backup is available) // =============================================================================== ae_replication_report* rep = NULL; ae_list_node* dnarepnode = NULL; ae_dna_replic_report* dnarep = NULL; ae_list_node* mnode = NULL; ae_mutation* mut = NULL; ae_list_node* unitnode = NULL; ae_genetic_unit* unit = NULL; ae_individual* stored_indiv = NULL; ae_list_node* stored_unit_node = NULL; ae_genetic_unit* stored_unit = NULL; int32_t i, index, genetic_unit_number, unitlen_before; int32_t nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment; double metabolic_error_before, metabolic_error_after, impact_on_metabolic_error; char mut_descr_string[80]; ae_exp_manager* exp_manager_backup = NULL; ae_environment* backup_env = NULL; bool check_now = false; for ( i = 0; i < end_gener - begin_gener; i++ ) { num_gener = begin_gener + i + 1; // where are we in time... rep = new ae_replication_report( lineage_file, indiv ); index = rep->get_id(); // who are we building... indiv->set_replication_report(rep); // Check now? check_now = ( ( check == FULL_CHECK && ae_utils::mod( num_gener, backup_step ) == 0 ) || ( check == ENV_CHECK && ae_utils::mod( num_gener, backup_step ) == 0 ) || ( check == LIGHT_CHECK && num_gener == end_gener ) ); if ( verbose ) printf("Rebuilding ancestor at generation %"PRId32" (index %"PRId32")...", num_gener, index); env->build(); env->apply_variation(); indiv->reevaluate(env); // Check, and possibly update, the environment according to the backup files (update necessary if the env. was modified by aevol_modify at some point) if (ae_utils::mod( num_gener, backup_step ) == 0) { char env_file_name[255]; sprintf( env_file_name, "./"ENV_FNAME_FORMAT, num_gener ); gzFile env_file = gzopen( env_file_name, "r" ); backup_env = new ae_environment(); backup_env->load( env_file ); if ( ! env->is_identical_to(backup_env, tolerance) ) { printf("Warning: At t=%"PRId32", the replayed environment is not the same\n", num_gener); printf(" as the one saved at generation %"PRId32"... \n", num_gener ); printf(" with tolerance of %lg\n", tolerance); printf("Replacing the replayed environment by the one stored in the backup.\n"); delete env; env = new ae_environment(*backup_env); } delete backup_env; } // Warning: this portion of code won't work if the number of units changes // during the evolution, or if some translocations occurred between different genetic units genetic_unit_number = 0; dnarepnode = (rep->get_dna_replic_reports())->get_first(); unitnode = (indiv->get_genetic_unit_list())->get_first(); if ( check_now && ae_utils::mod(num_gener, backup_step) == 0) { #ifndef __NO_X exp_manager_backup = new ae_exp_manager_X11(); #else exp_manager_backup = new ae_exp_manager(); #endif exp_manager_backup->load( num_gener, false, true, false ); stored_indiv = new ae_individual( * (ae_individual *)exp_manager_backup->get_indiv_by_id( index ), false ); stored_unit_node = stored_indiv->get_genetic_unit_list()->get_first(); } while ( dnarepnode != NULL ) { assert( unitnode != NULL ); dnarep = (ae_dna_replic_report *) dnarepnode->get_obj(); unit = (ae_genetic_unit *) unitnode->get_obj(); unit->get_dna()->set_replic_report( dnarep ); // *************************************** // Transfer events // *************************************** mnode = dnarep->get_HT()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); metabolic_error_before = indiv->get_dist_to_target_by_feature( METABOLISM ); unitlen_before = unit->get_dna()->get_length(); unit->compute_nb_of_affected_genes(mut, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment); unit->get_dna()->undergo_this_mutation( mut ); indiv->reevaluate(env); metabolic_error_after = indiv->get_dist_to_target_by_feature( METABOLISM ); impact_on_metabolic_error = metabolic_error_after - metabolic_error_before; mut->get_generic_description_string( mut_descr_string ); fprintf( output, "%"PRId32" %"PRId32" %s %"PRId32" %.15f %"PRId32" %"PRId32" %"PRId32" \n",\ num_gener, genetic_unit_number, \ mut_descr_string, unitlen_before, \ impact_on_metabolic_error, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment ); mnode = mnode->get_next(); } // *************************************** // Rearrangement events // *************************************** mnode = dnarep->get_rearrangements()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); metabolic_error_before = indiv->get_dist_to_target_by_feature( METABOLISM ); unitlen_before = unit->get_dna()->get_length(); unit->compute_nb_of_affected_genes(mut, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment); unit->get_dna()->undergo_this_mutation( mut ); indiv->reevaluate(env); metabolic_error_after = indiv->get_dist_to_target_by_feature( METABOLISM ); impact_on_metabolic_error = metabolic_error_after - metabolic_error_before; mut->get_generic_description_string( mut_descr_string ); fprintf( output, "%"PRId32" %"PRId32" %s %"PRId32" %.15f %"PRId32" %"PRId32" %"PRId32" \n",\ num_gener, genetic_unit_number, \ mut_descr_string, unitlen_before, \ impact_on_metabolic_error, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment ); mnode = mnode->get_next(); } // *************************************** // Local events (point mutations & small indels) // *************************************** mnode = dnarep->get_mutations()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); metabolic_error_before = indiv->get_dist_to_target_by_feature( METABOLISM ); unitlen_before = unit->get_dna()->get_length(); unit->compute_nb_of_affected_genes(mut, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment); unit->get_dna()->undergo_this_mutation( mut ); indiv->reevaluate(env); metabolic_error_after = indiv->get_dist_to_target_by_feature( METABOLISM ); impact_on_metabolic_error = metabolic_error_after - metabolic_error_before; mut->get_generic_description_string( mut_descr_string ); fprintf( output, "%"PRId32" %"PRId32" %s %"PRId32" %.15f %"PRId32" %"PRId32" %"PRId32" \n",\ num_gener, genetic_unit_number, \ mut_descr_string, unitlen_before, \ impact_on_metabolic_error, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment ); mnode = mnode->get_next(); } if ( check_now && ae_utils::mod(num_gener, backup_step) == 0) { if ( verbose ) { printf("Checking the sequence of the unit..."); fflush(NULL); } assert( stored_unit_node != NULL ); stored_unit = (ae_genetic_unit *) stored_unit_node->get_obj(); char * str1 = new char[unit->get_dna()->get_length() + 1]; memcpy(str1, unit->get_dna()->get_data(), \ unit->get_dna()->get_length()*sizeof(char)); str1[unit->get_dna()->get_length()] = '\0'; char * str2 = new char[(stored_unit->get_dna())->get_length() + 1]; memcpy(str2, (stored_unit->get_dna())->get_data(), (stored_unit->get_dna())->get_length()*sizeof(char)); str2[(stored_unit->get_dna())->get_length()] = '\0'; if(strncmp(str1,str2, (stored_unit->get_dna())->get_length())==0) { if ( verbose ) printf(" OK\n"); } else { if ( verbose ) printf( " ERROR !\n" ); fprintf( stderr, "Error: the rebuilt unit is not the same as \n"); fprintf( stderr, "the one saved at generation %"PRId32"... ", begin_gener ); fprintf( stderr, "Rebuilt unit : %zu bp\n %s\n", strlen(str1), str1 ); fprintf( stderr, "Stored unit : %zu bp\n %s\n", strlen(str2), str2 ); delete [] str1; delete [] str2; gzclose(lineage_file); delete indiv; delete stored_indiv; delete exp_manager_backup; delete exp_manager; exit(EXIT_FAILURE); } delete [] str1; delete [] str2; stored_unit_node = stored_unit_node->get_next(); } dnarepnode = dnarepnode->get_next(); unitnode = unitnode->get_next(); genetic_unit_number ++; } assert( unitnode == NULL ); if ( verbose ) printf(" OK\n"); delete rep; if ( check_now && ae_utils::mod(num_gener, backup_step) == 0 ) { assert(stored_unit_node == NULL); delete stored_indiv; delete exp_manager_backup; } } gzclose(lineage_file); fclose(output); delete exp_manager; delete indiv; delete env; exit(EXIT_SUCCESS); } /*! \brief */ void print_help(char* prog_path) { printf( "\n" ); printf( "*********************** aevol - Artificial Evolution ******************* \n" ); printf( "* * \n" ); printf( "* Fixed mutations post-treatment program * \n" ); printf( "* * \n" ); printf( "************************************************************************ \n" ); printf( "\n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "Copyright (C) 2009 LIRIS.\n" ); printf( "\n" ); #ifdef __REGUL printf( "Usage : rfixed_mutations -h\n"); printf( "or : rfixed_mutations [-vn] -f lineage_file \n" ); #else printf( "Usage : fixed_mutations -h\n"); printf( "or : fixed_mutations [-vn] -f lineage_file \n" ); #endif printf( "\n" ); printf( "This program computes the fixed mutations of the individuals within the lineage\n" ); printf( "of lineage_file\n" ); printf( "\n" ); printf( "WARNING: This program should not be used for simulations run with several genetic units\n" ); printf( "(eg chromosome + plasmids). It works only for simulations with only a single chromosome.\n" ); printf( "\n" ); printf( "\t-h or --help : Display this help.\n" ); printf( "\n" ); printf( "\t-v or --verbose : Be verbose, listing generations as they are \n" ); printf( "\t treated.\n" ); printf( "\n" ); printf( "\t-n or --nocheck : Disable genome sequence checking. Makes the \n"); printf( "\t program faster, but it is not recommended. \n"); printf( "\t It is better to let the program check that \n"); printf( "\t when we rebuild the genomes of the ancestors\n"); printf( "\t from the lineage file, we get the same sequences\n"); printf( "\t as those stored in the backup files.\n" ); printf( "\n" ); printf( "\t-c or --fullcheck : Will perform the genome and environment checks every\n" ); printf( "\t generations. Default behaviour is\n" ); printf( "\t lighter as it only perform sthese checks at the\n" ); printf( "\t ending generation.\n" ); printf( "\n" ); printf( "\t-f lineage_file or --file lineage_file : \n" ); printf( "\t Compute the fixed mutations of the individuals within lineage_file.\n" ); printf( "\n" ); printf( "\t-t tolerance or --tolerance tolerance : \n"); printf( "\t Tolerance used to compare the replayed environment to environment in backup\n"); printf( "\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/ancstats.cpp0000644000175000017500000007073612363412534015776 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #ifndef __NO_X #include #else #include #endif #include #include #include #include #include #include #include //#include #include #include //#include //debug #include enum check_type { FULL_CHECK = 0, LIGHT_CHECK = 1, ENV_CHECK = 2, NO_CHECK = 3 }; // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); FILE* open_environment_stat_file( const char * prefix, const ae_environment * env ); void write_environment_stats( int32_t num_gener, const ae_environment * env, FILE* env_file); FILE* open_terminators_stat_file( const char * prefix ); void write_terminators_stats( int32_t num_gener, ae_individual * indiv, FILE* terminator_file ); FILE* open_zones_stat_file( const char * prefix ); void write_zones_stats( int32_t num_gener, ae_individual * indiv, ae_environment * env, FILE* zone_file ); FILE* open_operons_stat_file( const char * prefix ); void write_operons_stats( int32_t num_gener, ae_individual * indiv, FILE* operon_file ); double* dist_to_target_segment; int main(int argc, char** argv) { // The input file (lineage.ae or lineage.rae) must contain the following information: // // - common data (ae_common::write_to_backup) // - begin gener (int32_t) // - end gener (int32_t) // - final individual index (int32_t) // - initial genome size (int32_t) // - initial ancestor (nb genetic units + sequences) (ae_individual::write_to_backup) // - replication report of ancestor at generation begin_gener+1 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+2 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+3 (ae_replic_report::write_to_backup) // - ... // - replication report of ancestor at generation end_gener (ae_replic_report::write_to_backup) // ===================== // Parse command line // ===================== // Default values char* lineage_file_name = NULL; bool verbose = false; check_type check = LIGHT_CHECK; double tolerance = 0; const char * short_options = "hVvncf:lt:"; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V' }, {"verbose", no_argument, NULL, 'v'}, {"nocheck", no_argument, NULL, 'n'}, {"fullcheck", no_argument, NULL, 'c'}, {"file", required_argument, NULL, 'f'}, {"tolerance", required_argument, NULL, 't'}, {0, 0, 0, 0} }; int option; while ( (option = getopt_long(argc, argv, short_options, long_options, NULL)) != -1 ) { switch( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'v' : verbose = true; break; case 'n' : check = NO_CHECK; break; case 'c' : check = FULL_CHECK; break; case 'f' : { if ( strcmp( optarg, "" ) == 0 ) { fprintf( stderr, "ERROR : Option -f or --file : missing argument.\n" ); exit( EXIT_FAILURE ); } lineage_file_name = new char[strlen(optarg) + 1]; sprintf( lineage_file_name, "%s", optarg ); break; } case 't' : { if ( strcmp( optarg, "" ) == 0 ) { fprintf( stderr, "ERROR : Option -t or --tolerance : missing argument.\n" ); exit( EXIT_FAILURE ); } check = ENV_CHECK; tolerance = atof(optarg); break; } default : { fprintf( stderr, "ERROR : Unknown option, check your syntax.\n" ); print_help(argv[0]); exit( EXIT_FAILURE ); } } } if ( lineage_file_name == NULL ) { fprintf( stderr, "ERROR : Option -f or --file missing. \n" ); exit( EXIT_FAILURE ); } printf("\n"); printf( "WARNING : Parameter change during simulation is not managed in general.\n" ); printf( " Only changes in environmental target done with aevol_modify are handled.\n" ); printf("\n"); // ======================= // Open the lineage file // ======================= gzFile lineage_file = gzopen( lineage_file_name, "r" ); if ( lineage_file == Z_NULL ) { fprintf( stderr, "ERROR : Could not read the lineage file %s\n", lineage_file_name ); exit( EXIT_FAILURE ); } int32_t begin_gener = 0; int32_t end_gener = 0; int32_t final_indiv_index = 0; int32_t final_indiv_rank = 0; gzread( lineage_file, &begin_gener, sizeof(begin_gener) ); gzread( lineage_file, &end_gener, sizeof(end_gener) ); gzread( lineage_file, &final_indiv_index, sizeof(final_indiv_index) ); gzread( lineage_file, &final_indiv_rank, sizeof(final_indiv_rank) ); if ( verbose ) { printf("\n\n"); printf( "===============================================================================\n" ); printf( " Statistics of the ancestors of indiv. %"PRId32" (rank %"PRId32") from generation %"PRId32" to %"PRId32"\n", final_indiv_index, final_indiv_rank, begin_gener, end_gener ); printf("================================================================================\n"); } // ========================= // Open the experience manager // ========================= #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( begin_gener, false, true, false); ae_environment* env = new ae_environment( *(exp_manager->get_env()) ); // independent copy int32_t backup_step = exp_manager->get_backup_step(); // ========================= // Open the output file(s) // ========================= // Create missing directories int status; status = mkdir( "stats/ancstats/", 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, "stats/ancstats/" ); } char prefix[50]; snprintf( prefix, 50, "ancstats/ancstats-b%06"PRId32"-e%06"PRId32"-i%"PRId32"-r%"PRId32,begin_gener, end_gener, final_indiv_index , final_indiv_rank); bool best_indiv_only = true; bool addition_old_stats = false; bool delete_old_stats = true; ae_stats * mystats = new ae_stats(exp_manager, begin_gener, best_indiv_only, prefix, addition_old_stats, delete_old_stats); //mystats->write_headers(); // Optional outputs FILE* env_output_file = open_environment_stat_file(prefix, env); FILE* term_output_file = open_terminators_stat_file(prefix); FILE* zones_output_file = NULL; if(env->get_nb_segments() > 1) { zones_output_file = open_zones_stat_file(prefix); } FILE* operons_output_file = open_operons_stat_file(prefix); // ================================================== // Prepare the initial ancestor and write its stats // ================================================== ae_individual * indiv = new ae_individual(exp_manager, lineage_file ); indiv->evaluate( env ); indiv->compute_statistical_data(); indiv->compute_non_coding(); mystats->write_statistics_of_this_indiv( indiv, begin_gener ); // Optional outputs write_environment_stats( begin_gener, env, env_output_file ); write_terminators_stats( begin_gener, indiv, term_output_file ); if(env->get_nb_segments() > 1) { write_zones_stats( begin_gener, indiv, env, zones_output_file ); } write_operons_stats( begin_gener, indiv, operons_output_file ); if ( verbose ) { printf("Initial fitness = %f\n", indiv->get_fitness()); printf("Initial genome size = %"PRId32"\n", indiv->get_total_genome_size()); } //delete exp_manager; // =============================================================================== // Replay the mutations to get the successive ancestors and analyze them // (and, optionally, check that the rebuilt envir is correct each time a backup // is available) // =============================================================================== int32_t num_gener = 0; ae_replication_report* rep = NULL; ae_list_node* dnarepnode = NULL; ae_dna_replic_report* dnarep = NULL; ae_list_node* mnode = NULL; ae_mutation* mut = NULL; ae_list_node* unitnode = NULL; ae_genetic_unit* unit = NULL; ae_individual* stored_indiv = NULL; ae_list_node* storedunitnode = NULL; ae_genetic_unit* storedunit = NULL; int32_t index; int32_t nb_gener = end_gener - begin_gener; ae_exp_manager* exp_manager_backup = NULL; ae_environment* backup_env = NULL; bool check_now = false; for ( int32_t i = 0 ; i < nb_gener ; i++ ) { num_gener = begin_gener + i + 1; // where we are in time.. rep = new ae_replication_report( lineage_file, indiv ); index = rep->get_id(); // who we are building... indiv->set_replication_report( rep ); // Check now? check_now = ( ( check == FULL_CHECK && ae_utils::mod( num_gener, backup_step ) == 0 ) || ( check == ENV_CHECK && ae_utils::mod( num_gener, backup_step ) == 0 ) || ( check == LIGHT_CHECK && num_gener == end_gener ) ); if ( verbose ) printf("Rebuilding ancestor at generation %"PRId32" (index %"PRId32")...", num_gener, index); // 1) Rebuild environment env->build(); env->apply_variation(); indiv->reevaluate(env); // Check, and possibly update, the environment according to the backup files (update necessary if the env. was modified by aevol_modify at some point) if (ae_utils::mod( num_gener, backup_step ) == 0) { char env_file_name[255]; sprintf( env_file_name, "./"ENV_FNAME_FORMAT, num_gener ); gzFile env_file = gzopen( env_file_name, "r" ); backup_env = new ae_environment(); backup_env->load( env_file ); if ( ! env->is_identical_to(backup_env, tolerance) ) { printf("Warning: At t=%"PRId32", the replayed environment is not the same\n", num_gener); printf(" as the one saved at generation %"PRId32"... \n", num_gener ); printf(" with tolerance of %lg\n", tolerance); printf("Replacing the replayed environment by the one stored in the backup.\n"); delete env; env = new ae_environment(*backup_env); } delete backup_env; } // Warning: this portion of code won't work if the number of units changes // during the evolution // 2) Replay replication (create current individual's child) dnarepnode = rep->get_dna_replic_reports()->get_first(); unitnode = indiv->get_genetic_unit_list()->get_first(); if ( check_now ) { #ifndef __NO_X exp_manager_backup = new ae_exp_manager_X11(); #else exp_manager_backup = new ae_exp_manager(); #endif exp_manager_backup->load( num_gener, false, true, false ); stored_indiv = new ae_individual( * (ae_individual *)exp_manager_backup->get_indiv_by_id( index ), false ); storedunitnode = stored_indiv->get_genetic_unit_list()->get_first(); } // For each genetic unit, replay the replication (undergo all mutations) while ( dnarepnode != NULL ) { assert( unitnode != NULL ); dnarep = (ae_dna_replic_report *) dnarepnode->get_obj(); unit = (ae_genetic_unit *) unitnode->get_obj(); unit->get_dna()->set_replic_report( dnarep ); mnode = dnarep->get_HT()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); unit->get_dna()->undergo_this_mutation(mut); mnode = mnode->get_next(); } mnode = dnarep->get_rearrangements()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); unit->get_dna()->undergo_this_mutation(mut); mnode = mnode->get_next(); } mnode = dnarep->get_mutations()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); unit->get_dna()->undergo_this_mutation( mut ); mnode = mnode->get_next(); } if ( check_now ) { if ( verbose ) { printf("Checking the sequence of the unit..."); fflush(NULL); } assert( storedunitnode != NULL ); storedunit = (ae_genetic_unit *) storedunitnode->get_obj(); char * str1 = new char[unit->get_dna()->get_length() + 1]; memcpy(str1, unit->get_dna()->get_data(), \ unit->get_dna()->get_length()*sizeof(char)); str1[unit->get_dna()->get_length()] = '\0'; char * str2 = new char[(storedunit->get_dna())->get_length() + 1]; memcpy(str2, (storedunit->get_dna())->get_data(), (storedunit->get_dna())->get_length()*sizeof(char)); str2[(storedunit->get_dna())->get_length()] = '\0'; if ( strncmp( str1, str2, storedunit->get_dna()->get_length() ) == 0 ) { if ( verbose ) printf(" OK\n"); } else { if ( verbose ) printf( " ERROR !\n" ); fprintf( stderr, "Error: the rebuilt genetic unit is not the same as \n"); fprintf( stderr, "the one saved at generation %"PRId32"... ", num_gener ); fprintf( stderr, "Rebuilt unit : %"PRId32" bp\n %s\n", (int32_t)strlen(str1), str1 ); fprintf( stderr, "Stored unit : %"PRId32" bp\n %s\n", (int32_t)strlen(str2), str2 ); delete [] str1; delete [] str2; gzclose(lineage_file); delete indiv; delete stored_indiv; delete exp_manager_backup; delete exp_manager; exit(EXIT_FAILURE); } delete [] str1; delete [] str2; storedunitnode = storedunitnode->get_next(); } dnarepnode = dnarepnode->get_next(); unitnode = unitnode->get_next(); } assert( unitnode == NULL ); // 3) All the mutations have been replayed, we can now evaluate the new individual indiv->reevaluate( env ); indiv->compute_statistical_data(); indiv->compute_non_coding(); mystats->write_statistics_of_this_indiv( indiv, num_gener ); // Optional outputs write_environment_stats( num_gener, env, env_output_file ); write_terminators_stats( num_gener, indiv, term_output_file ); if(env->get_nb_segments() > 1) { write_zones_stats( num_gener, indiv, env, zones_output_file ); } write_operons_stats( num_gener, indiv, operons_output_file ); if ( verbose ) printf(" OK\n"); delete rep; if ( check_now ) { assert( storedunitnode == NULL ); delete stored_indiv; delete exp_manager_backup; } } gzclose(lineage_file); delete exp_manager; delete mystats; delete indiv; delete env; // Optional outputs fclose( env_output_file ); fclose( term_output_file ); if(env->get_nb_segments() > 1) { fclose( zones_output_file ); } fclose( operons_output_file ); exit(EXIT_SUCCESS); } FILE* open_environment_stat_file( const char * prefix, const ae_environment * env ) { // Open file char* env_output_file_name = new char[80]; sprintf( env_output_file_name, "stats/%s_envir.out",prefix ); FILE* env_output_file = fopen( env_output_file_name, "w" ); delete env_output_file_name; // Write headers if ( env->get_gaussians() != NULL) { fprintf( env_output_file, "# Each line contains : Generation, and then, for each gaussian: M W H.\n" ); } else if ( env->get_custom_points() != NULL ) { fprintf( env_output_file, "# Each line contains : Generation, and then, for each point: x y.\n" ); } fprintf( env_output_file, "#\n" ); return env_output_file; } void write_environment_stats( int32_t num_gener, const ae_environment * env, FILE* env_output_file) { // Num gener fprintf( env_output_file, "%"PRId32, num_gener ); if ( env->get_gaussians() != NULL) { // For each gaussian : M W H ae_list_node* gaussnode = env->get_gaussians()->get_first(); ae_gaussian* gauss = NULL; while ( gaussnode != NULL ) { gauss = gaussnode->get_obj(); fprintf( env_output_file, " %.16f %.16f %.16f", gauss->get_mean(), gauss->get_width(), gauss->get_height() ); gaussnode = gaussnode->get_next(); } } else if ( env->get_custom_points() != NULL ) { // For each point : x y ae_list_node* ptnode = env->get_custom_points()->get_first(); ae_point_2d* pt = NULL; while ( ptnode != NULL ) { pt = ptnode->get_obj(); fprintf( env_output_file, " %.16f %.16f", pt->x, pt->y ); ptnode = ptnode->get_next(); } } fprintf( env_output_file, "\n" ); } FILE* open_terminators_stat_file( const char * prefix ) { char* term_output_file_name = new char[80]; sprintf( term_output_file_name, "stats/%s_nb_term.out",prefix ); FILE* term_output_file = fopen( term_output_file_name, "w" ); delete [] term_output_file_name; // Write headers fprintf( term_output_file, "# Each line contains : \n" ); fprintf( term_output_file, "# * Generation\n" ); fprintf( term_output_file, "# * Genome size\n" ); fprintf( term_output_file, "# * Terminator number\n"); fprintf( term_output_file, "#\n" ); return term_output_file; } void write_terminators_stats( int32_t num_gener, ae_individual * indiv, FILE* term_output_file ) { fprintf( term_output_file, "%"PRId32" %"PRId32" %"PRId32"\n", num_gener, indiv->get_total_genome_size(), indiv->get_nb_terminators() ); } FILE* open_zones_stat_file( const char * prefix ) { // Open file char* zones_output_file_name = new char[80]; sprintf( zones_output_file_name, "stats/%s_zones.out",prefix ); FILE* zones_output_file = fopen( zones_output_file_name, "w" ); delete [] zones_output_file_name; // Write headers fprintf( zones_output_file, "# Each line contains : Generation, and then, for each zone:\n" ); fprintf( zones_output_file, "# * Number of activation genes\n" ); fprintf( zones_output_file, "# * Number of inhibition genes\n" ); fprintf( zones_output_file, "# * Geometric area of the activation genes\n" ); fprintf( zones_output_file, "# * Geometric area of the inhibition genes\n" ); fprintf( zones_output_file, "# * Geometric area of the resulting phenotype\n" ); fprintf( zones_output_file, "#\n" ); return zones_output_file; } void write_zones_stats( int32_t num_gener, ae_individual * indiv, ae_environment * env, FILE* zones_output_file ) { assert( env->get_nb_segments() > 1 ); int16_t nb_segments = env->get_nb_segments(); int16_t num_segment = 0; ae_env_segment** segments = env->get_segments(); ae_list* prot_list = indiv->get_protein_list(); ae_list_node* prot_node = NULL; ae_protein* prot = NULL; // Tables : index 0 for the 0 segment // 1 for the neutral segment int32_t nb_genes_activ[nb_segments]; int32_t nb_genes_inhib[nb_segments]; double geom_area_activ[nb_segments]; double geom_area_inhib[nb_segments]; double geom_area_phen[nb_segments]; for ( num_segment = 0 ; num_segment < nb_segments ; num_segment++ ) { nb_genes_activ[num_segment] = 0; nb_genes_inhib[num_segment] = 0; geom_area_activ[num_segment] = 0.0; geom_area_inhib[num_segment] = 0.0; geom_area_phen[num_segment] = 0.0; } ae_fuzzy_set* activ = NULL; ae_fuzzy_set* inhib = NULL; ae_phenotype* phen = NULL; // Compute number of genes in each segment prot_node = prot_list->get_first(); prot = NULL; while ( prot_node != NULL ) { prot = prot_node->get_obj(); // Go to the corresponding segment num_segment = 0; while ( prot->get_mean() > segments[num_segment]->stop ) { num_segment++; } // Add a genes (activ or inhib) if ( prot->get_is_functional() ) { if ( prot->get_height() > 0 ) { nb_genes_activ[num_segment]++; } else if ( prot->get_height() < 0 ) { nb_genes_inhib[num_segment]++; } // It the gene is exactly at the frontier between 2 zones, mark it in both if ( prot->get_mean() == segments[num_segment]->stop && num_segment < nb_segments - 1 ) { if ( prot->get_height() > 0 ) { nb_genes_activ[num_segment+1]++; } else if ( prot->get_height() < 0 ) { nb_genes_inhib[num_segment+1]++; } } } prot_node = prot_node->get_next(); } // Compute the geometric areas activ = indiv->get_phenotype_activ(); inhib = indiv->get_phenotype_inhib(); phen = indiv->get_phenotype(); for ( num_segment = 0 ; num_segment < nb_segments ; num_segment++ ) { geom_area_activ[num_segment] = activ->get_geometric_area( segments[num_segment]->start, segments[num_segment]->stop ); geom_area_inhib[num_segment] = inhib->get_geometric_area( segments[num_segment]->start, segments[num_segment]->stop ); geom_area_phen[num_segment] = phen->get_geometric_area( segments[num_segment]->start, segments[num_segment]->stop ); } // Print stats to file fprintf( zones_output_file, "%"PRId32, num_gener ); for ( num_segment = 0 ; num_segment < nb_segments ; num_segment++ ) { fprintf( zones_output_file, " %"PRId32" %"PRId32" %lf %lf %lf", nb_genes_activ[num_segment], nb_genes_inhib[num_segment], geom_area_activ[num_segment], geom_area_inhib[num_segment], geom_area_phen[num_segment] ); } fprintf( zones_output_file, "\n" ); } FILE* open_operons_stat_file( const char * prefix ) { char* operons_output_file_name = new char[80]; sprintf( operons_output_file_name, "stats/%s_operons.out",prefix); FILE* operons_output_file = fopen( operons_output_file_name, "w" ); delete [] operons_output_file_name, // Write headers fprintf( operons_output_file, "# Each line contains : Generation, and then, for 20 RNA, the number of genes inside the RNA\n" ); return operons_output_file; } void write_operons_stats( int32_t num_gener, ae_individual * indiv, FILE* operons_output_file) { int32_t nb_genes_per_rna[20]; for ( int i = 0 ; i < 20 ; i++ ) { nb_genes_per_rna[i] = 0; } ae_list_node* rna_node = indiv->get_rna_list()->get_first(); ae_rna* rna = NULL; while ( rna_node != NULL ) { rna = rna_node->get_obj(); if ( rna->get_transcribed_proteins()->get_nb_elts() >= 20 ) { printf( "Found operon with 20 genes or more : %"PRId32"\n", rna->get_transcribed_proteins()->get_nb_elts() ); getchar(); } nb_genes_per_rna[rna->get_transcribed_proteins()->get_nb_elts()]++; rna_node = rna_node->get_next(); } fprintf( operons_output_file, "%"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", num_gener, nb_genes_per_rna[0], nb_genes_per_rna[1], nb_genes_per_rna[2], nb_genes_per_rna[3], nb_genes_per_rna[4], nb_genes_per_rna[5], nb_genes_per_rna[6], nb_genes_per_rna[7], nb_genes_per_rna[8], nb_genes_per_rna[9], nb_genes_per_rna[10], nb_genes_per_rna[11], nb_genes_per_rna[12], nb_genes_per_rna[13], nb_genes_per_rna[14], nb_genes_per_rna[15], nb_genes_per_rna[16], nb_genes_per_rna[17], nb_genes_per_rna[18], nb_genes_per_rna[19] ); } /*! \brief */ void print_help(char* prog_path) { printf( "\n" ); printf( "*********************** aevol - Artificial Evolution ******************* \n" ); printf( "* * \n" ); printf( "* Ancstats post-treatment program * \n" ); printf( "* * \n" ); printf( "************************************************************************ \n" ); printf( "\n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "Copyright (C) 2009 LIRIS.\n" ); printf( "\n" ); #ifdef __REGUL printf( "Usage : rancstats -h\n"); printf( "or : rancstats [-vn] -f lineage_file \n" ); #else printf( "Usage : ancstats -h\n"); printf( "or : ancstats [-vn] -f lineage_file \n" ); #endif printf( "\n" ); printf( "This program compute some statistics for the individuals within lineage_file.\n" ); printf( "\n" ); printf( "\n" ); printf( "\t-h or --help : Display this help.\n" ); printf( "\n" ); printf( "\t-v or --verbose : Be verbose, listing generations as they are \n" ); printf( "\t treated.\n" ); printf( "\n" ); printf( "\t-n or --nocheck : Disable genome sequence checking. Makes the \n"); printf( "\t program faster, but it is not recommended. \n"); printf( "\t It is better to let the program check that \n"); printf( "\t when we rebuild the genomes of the ancestors\n"); printf( "\t from the lineage file, we get the same sequences\n"); printf( "\t as those stored in the backup files.\n" ); printf( "\n" ); printf( "\t-c or --fullcheck : Will perform the genome and environment checks every\n" ); printf( "\t generations. Default behaviour is\n" ); printf( "\t lighter as it only perform sthese checks at the\n" ); printf( "\t ending generation.\n" ); printf( "\n" ); printf( "\t-f lineage_file or --file lineage_file : \n" ); printf( "\t Compute the statistics for the individuals within lineage_file.\n" ); printf( "\t-t tolerance or --tolerance tolerance : \n"); printf( "\t Tolerance used to compare the replayed environment to environment in backup\n"); printf( "\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/population_statistics.h0000644000175000017500000000722512122306331020246 00000000000000 /** \class * \brief */ #ifndef __POPULATION_STATISTICS_H__ #define __POPULATION_STATISTICS_H__ // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include //#include #include #include #include #ifdef __NO_X #ifdef __REGUL #include #else #include #endif #elif defined __X11 #ifdef __REGUL #include #else #include #endif #endif // ================================================================= // Class declarations // ================================================================= enum analysis_type { ONE_GENERATION = 0, MULTIPLE_GENERATIONS = 1 }; class population_statistics { public : // ================================================================= // Constructors // ================================================================= population_statistics( void ); population_statistics( analysis_type type, int32_t nb_children = 1000, int32_t wanted_rank = 1, int32_t wanted_index = -1); // ================================================================= // Destructors // ================================================================= virtual ~population_statistics( void ); // ================================================================= // Accessors // ================================================================= // ================================================================= // Public Methods // ================================================================= void compute_reproduction_stats(ae_exp_manager* exp_manager, int32_t num_gener); void compute_population_stats(int32_t num_gener); // ================================================================= // Public Attributes // ================================================================= protected : // ================================================================= // Forbidden Constructors // ================================================================= // ================================================================= // Protected Methods // ================================================================= //int count_affected_genes( ae_individual* parent, ae_individual* child ); //void print_replication_stats( ae_individual* initial_indiv, double* fitnesses, int* nb_aff_genes ); // ================================================================= // Protected Attributes // ================================================================= FILE* _output_file; FILE* _robustness_file; FILE* _replication_file; int _nb_children; int _wanted_rank; int _wanted_index; int32_t _pop_size; double* _f_nu_pop; double* _reprod_proba; double* _fitness; analysis_type _type; }; #endif // __POPULATION_STATISTICS_H__ aevol-4.4/src/post_treatments/extract.cpp0000644000175000017500000004105712363434715015627 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // // This program extracts some data about the individuals and write // them into text files easy to parse with e.g. matlab. // // Two kinds of data can be extracted : // // * data about the phenotype (option -t) : write information about // the proteins in a text file. A space delimits two proteins, a // new line delimits two individuals. For each protein, the output // is "m_h_w_c_r_s_f_l_z_g" where : // * m, h, w and c are the mean, height, width and concentration of the protein // * r is an identifier of the rna it belongs (usefull to // know if several proteins are on the same rna) // * s indicates the strand (LEADING/LAGGING) // * f and l are the first and last translated base // * z indicates the feature (at the center of the protein) // * g indicates the genetic unit to which the protein belongs (0=chromosome, 1=plasmid) // // * sequences of the individuals (option -s) : write the sequences // in a text file. A new line delimits two individuals. In case // there are several GU, they are separated by spaces. // // The option -b only treats the best individual // // The input can be either a generation number, in which case we // will attempt to load a full backup tree, or a population file, // in which case features of the proteins won't be outputed as we // need to know the environment to infer them. // // Examples : // // For generation 20000, write infos about the phenotypes of all the // individuals in phe_020000 and the sequences of all the // individuals in seq_020000 : // // extract -r 20000 -t phe_020000 -s seq_020000 // // For generation 20000, write the best individual's sequence in // seq_020000_best : // // extract -b -r 20000 -s seq_020000_best // or extract -b -p populations/pop_020000.ae -s seq_020000_best // // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include #include #include // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); void analyse_indiv( ae_individual* indiv, FILE* triangles_file, FILE* sequence_file, int16_t gu, ae_environment* env ); void analyse_gu( ae_genetic_unit* gen_unit, int32_t gen_unit_number, FILE* triangles_file, ae_environment* env ); int main( int argc, char* argv[] ) { // Initialize command-line option variables with default values char* pop_file_name = NULL; char* triangles_file_name = NULL; char* sequence_file_name = NULL; bool best_only = false; int16_t gu = -1; int32_t num_gener = -1; // Define allowed options const char * options_list = "hVp:r:t:s:bg:"; static struct option long_options_list[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, {"popfile", required_argument, NULL, 'p'}, {"resume", required_argument, NULL, 'r'}, {"triangles", required_argument, NULL, 't'}, {"sequence", required_argument, NULL, 's'}, {"best", no_argument, NULL, 'b'}, {"gu", required_argument, NULL, 'g'}, {0, 0, 0, 0} }; // Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'p' : pop_file_name = new char[strlen(optarg) + 1]; sprintf( pop_file_name, "%s", optarg ); break; case 'r': num_gener = atol( optarg ); break; case 't' : triangles_file_name = new char[strlen(optarg) + 1]; sprintf( triangles_file_name, "%s", optarg ); break; case 's' : sequence_file_name = new char[strlen(optarg) + 1]; sprintf( sequence_file_name, "%s", optarg ); break; case 'g' : gu = atoi( optarg ); break; case 'b' : best_only = true; break; } } // Open the files FILE* triangles_file = NULL; FILE* sequence_file = NULL; if ( triangles_file_name != NULL ) { triangles_file = fopen(triangles_file_name,"w"); } if ( sequence_file_name != NULL ) { sequence_file = fopen(sequence_file_name,"w"); } ae_population* pop = NULL; ae_environment* env = NULL; ae_exp_manager* exp_manager = new ae_exp_manager(); // Two possible sources: either the user provided a "full" simulation via a generation number (option '-r'), either he just provided a population file (option '-p'). if ( num_gener != -1 ) { exp_manager->load( num_gener, false, false, false ); pop = exp_manager->get_pop(); env = exp_manager->get_env(); } else { if ( pop_file_name == NULL ) { printf("You must specify either a generation number or a source population file"); exit(EXIT_FAILURE); } // Load the simulation from population file pop = new ae_population(exp_manager); gzFile pop_file = gzopen( pop_file_name, "r" ); if ( pop_file == Z_NULL ) { printf( "%s:%d: error: could not open backup file %s\n", __FILE__, __LINE__, pop_file_name ); exit( EXIT_FAILURE ); } pop->load( pop_file, false ); gzclose( pop_file ); } // The best individual is already known because it is the last in the list // Thus we do not need to know anything about the environment and to evaluate the individuals // Parse the individuals if (best_only) { ae_individual* best = pop->get_best(); best->do_transcription_translation_folding(); // We need to recompute proteins if not already done (ie if using a population file and not a full backup) analyse_indiv(best, triangles_file, sequence_file, gu, env); } else { ae_list_node* indiv_node = pop->get_indivs()->get_first(); ae_individual* indiv = NULL; while( indiv_node != NULL ) { indiv = (ae_individual *) indiv_node->get_obj(); indiv->do_transcription_translation_folding(); // We need to recompute proteins if not already done (ie if using a population file and not a full backup) analyse_indiv(indiv, triangles_file, sequence_file, gu, env); indiv_node = indiv_node->get_next(); } } if (sequence_file_name != NULL) { fclose(sequence_file); } if (triangles_file_name != NULL) { fclose(triangles_file); } if (pop_file_name != NULL) {delete [] pop_file_name;} if (triangles_file_name != NULL) {delete [] triangles_file_name;} if (sequence_file_name != NULL) {delete [] sequence_file_name;} delete exp_manager; if ((num_gener == -1)&&(pop!=NULL)) {delete pop;} return EXIT_SUCCESS; } // Parsing an individual inline void analyse_indiv( ae_individual* indiv, FILE* triangles_file, FILE* sequence_file, int16_t gu, ae_environment* env ) { if ( gu == -1 ) // We want to treat all genetic units { int32_t gen_unit_number = 0; ae_list_node* gen_unit_node = indiv->get_genetic_unit_list()->get_first(); while ( gen_unit_node != NULL ) { ae_genetic_unit* gen_unit = (ae_genetic_unit*) gen_unit_node->get_obj(); if ( triangles_file != NULL ) { analyse_gu(gen_unit, gen_unit_number, triangles_file, env); // We call the triangle parser for each GU successively } if ( sequence_file != NULL ) { const char* dna = gen_unit->get_dna()->get_data(); int32_t length = gen_unit->get_dna()->get_length(); fprintf(sequence_file,"%.*s ",length,dna); // We output the sequences of each GU separated by a space } gen_unit_node = gen_unit_node->get_next(); gen_unit_number++; } } else // User specified a genetic unit { ae_genetic_unit* gen_unit = indiv->get_genetic_unit(gu); if ( triangles_file != NULL ) { analyse_gu(gen_unit, gu, triangles_file, env); // We call the triangle parser } if ( sequence_file != NULL ) { const char* dna = gen_unit->get_dna()->get_data(); int32_t length = gen_unit->get_dna()->get_length(); fprintf(sequence_file,"%.*s",length,dna); // We output the sequence } } // We go to next line in each file if ( triangles_file != NULL ) { fprintf(triangles_file,"\n"); } if ( sequence_file != NULL ) { fprintf(sequence_file,"\n"); } } // Parsing a GU inline void analyse_gu( ae_genetic_unit* gen_unit, int32_t gen_unit_number, FILE* triangles_file, ae_environment* env ) { // Construct the list of all rnas ae_list** llrnas = gen_unit->get_rna_list(); ae_list* lrnas = new ae_list(); lrnas->add_list(llrnas[LEADING]); lrnas->add_list(llrnas[LAGGING]); // Parse this list ae_list_node* rna_node = lrnas->get_first();; ae_rna* rna = NULL; int rna_nb = 0; while( rna_node != NULL ) { rna = (ae_rna *) rna_node->get_obj(); ae_list* lprot = rna->get_transcribed_proteins(); ae_list_node* prot_node = lprot->get_first(); ae_protein* prot = NULL; while( prot_node != NULL ) { prot = (ae_protein*) prot_node->get_obj(); double height = prot->get_height(); double width = prot->get_width(); double mean = prot->get_mean(); double concentration=rna->get_basal_level(); int32_t fpos = prot->get_first_translated_pos(); int32_t lpos = prot->get_last_translated_pos(); int nfeat = -1; // Retrieving the feature of the protein also necessitates the an environment file. if ( env != NULL ) { for ( int i=0; i<=(env->get_nb_segments() - 1); i++ ) { if ( (mean > env->get_segment_boundaries(i) ) && (mean < env->get_segment_boundaries(i+1)) ) { nfeat = env->get_axis_feature(i); break; } } } fprintf(triangles_file,"%f_%f_%f_%f_%d_%d_%i_%i_%d_%d ",mean,height,width,concentration,rna_nb,rna->get_strand(),fpos,lpos,nfeat,gen_unit_number); prot_node = prot_node->get_next(); } rna_node = rna_node->get_next(); rna_nb++; } delete lrnas; } void print_help(char* prog_path) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ((prog_name = strrchr(prog_path, '/'))) prog_name++; else prog_name = prog_path; printf("******************************************************************************\n"); printf("* *\n"); printf("* aevol - Artificial Evolution *\n"); printf("* *\n"); printf("* Aevol is a simulation platform that allows one to let populations of *\n"); printf("* digital organisms evolve in different conditions and study experimentally *\n"); printf("* the mechanisms responsible for the structuration of the genome and the *\n"); printf("* transcriptome. *\n"); printf("* *\n"); printf("******************************************************************************\n"); printf("\n"); printf("%s: extracts the genotype and/or data about the phenotype of individuals in the provided population and write them into text files easy to parse with e.g. matlab.\n", prog_name); printf("\n"); printf("Usage : %s -h\n", prog_name); printf(" or : %s -V or --version\n", prog_name); printf(" or : %s [-r GENER | -p POP_FILE] [-t PHEN_FILE] [-s SEQ_FILE] [-g NUM_GU] [-b]\n", prog_name); printf("\nOptions\n"); printf(" -h, --help\n\tprint this help, then exit\n\n"); printf(" -V, --version\n\tprint version number, then exit\n\n"); printf(" -r GENER :\n"); printf("\tread generation GENER from a full aevol backup\n"); printf(" -p POP_FILE:\n"); printf("\tread the population saved in population file POP_FILE\n"); printf(" -t PHEN_FILE:\n"); printf("\textract and save some infos about the phenotypes of the individuals to file PHEN_FILE\n"); printf(" -s SEQ_FILE:\n"); printf("\textract and save the sequences of the individuals to file SEQ_FILE\n"); printf(" -g NUM_GU:\n"); printf("\tonly treat this genetic unit (by default: treat all genetic units)\n"); printf(" -b:\n"); printf("\tonly treat the best individual\n"); printf("\n\n"); printf("\n\ This program extracts some data about the individuals and write\n\ them into text files easy to parse with e.g. matlab.\n\ \n\ Two kinds of data can be extracted :\n\ \n\ * data about the phenotype (option -t) : write information about\n\ the proteins in a text file. A space delimits two proteins, a\n\ new line delimits two individuals. For each protein, the output\n\ is \"m_h_w_c_r_s_f_l_z_g\" where :\n\ * m, h, w and c are the mean, height, width and concentration of the protein\n\ * r is an identifier of the rna it belongs (usefull to\n\ know if several proteins are on the same rna)\n\ * s indicates the strand (LEADING/LAGGING)\n\ * f and l are the first and last translated base\n\ * z indicates the feature (at the center of the protein)\n\ * g indicates the genetic unit to which the protein belongs (0=chromosome, 1=plasmid)\n\ \n\ * sequences of the individuals (option -s) : write the sequences\n\ in a text file. A new line delimits two individuals. In case\n\ there are several GU, they are separated by whitespaces.\n\ \n\ With option -b, only the best individual is treated.\n\ \n\ The input can be either a generation number, in which case we\n\ will attempt to load a full backup tree, or a population file,\n\ in which case features of the proteins won't be outputed as we\n\ need to know the environment to infer them.\n\ \n\ Examples :\n\ \n\ For generation 20000, write infos about the phenotypes of all the\n\ individuals in phe_020000 and the sequences of all the\n\ individuals in seq_020000 :\n\ \n\ extract -r 20000 -t phe_020000 -s seq_020000\n\ \n\ For generation 20000, write the best individual's sequence in\n\ seq_020000_best :\n\ \n\ extract -b -r 20000 -s seq_020000_best\n\ or extract -b -p populations/pop_020000.ae -s seq_020000_best\n"); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/create_eps.cpp0000644000175000017500000013332112362005303016245 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include // for the permission symbols used with mkdir #include // ================================================================= // Project Files // ================================================================= //#include #include #include #include #include #include #include #ifndef __NO_X #include #else #include #endif #include // ======== // TO DO // ======== // // * option --color ? // * Raevol-specific output (EPS file with the network) ? // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); // The height of each triangle is proportional to the product c*m, where c is the // concentration of the protein and m its intrinsic efficiency (depending on its // aminoacid sequence). In the case of Raevol, the concentration used here is the // final one, i.e. the one reached after all the time steps of the lifetime. // If a coding sequence has several promoters, only one triangle is drawn. void draw_triangles( ae_individual* indiv, ae_environment* env, char * directoryName ); // In the case of Raevol, the profile is drawn using the final concentrations // of the proteins, i.e. the ones reached after all the time steps of the lifetime. void draw_pos_neg_profiles( ae_individual * indiv, ae_environment* env, char * directoryName ); // In the case of Raevol, the phenotype is drawn using the final concentrations // of the proteins, i.e. the ones reached after all the time steps of the lifetime. void draw_phenotype( ae_individual * indiv, ae_environment * envir, char * directoryName ); // The chromosome is drawn as a circle. Coding sequences are represented by arcs starting // at the start codon and ending at the stop codon. Coding sequences that are on the // leading (resp. lagging) strand are drawn outside (resp. inside) the circle. If a coding // sequence has several promoters, only one arc is drawn. void draw_genetic_unit_with_CDS( ae_genetic_unit* gen_unit, char * directoryName ); // The chromosome is drawn as a circle. Transcribed sequences are represented by arcs starting // at the first trasncribed position codon and ending at the last transcribed position. mRNAs // that are on the leading (resp. lagging) strand are drawn outside (resp. inside) the circle. // mRNAs which include at least one coding sequence are black, the others are gray. void draw_genetic_unit_with_mRNAs( ae_genetic_unit* gen_unit, char * directoryName ); int main( int argc, char* argv[] ) { // ================================================================= // Get command-line options // ================================================================= // // 1) Initialize command-line option variables with default values //~ bool verbose = false; //~ char* backup_file_name = NULL; int32_t num_gener = -1; int32_t indiv_index = -1; int32_t indiv_rank = -1; // 2) Define allowed options const char * options_list = "hVvi:r:g:"; static struct option long_options_list[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V' }, {"index", required_argument, NULL, 'i'}, {"rank", required_argument, NULL, 'r'}, {"gener", required_argument, NULL, 'g' }, { 0, 0, 0, 0 } }; // 3) Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'i' : indiv_index = atol(optarg); break; case 'r' : indiv_rank = atol(optarg); break; case 'g' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -g or --gener : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } num_gener = atol( optarg ); break; } } } // Check mandatory arguments if ( num_gener == -1 ) { printf( "%s: error: You must provide a generation number.\n", argv[0] ); exit( EXIT_FAILURE ); } if (indiv_index != -1 && indiv_rank != -1) { printf( "%s: error: You must provide either the index or the rank of the individual to plot.\n", argv[0] ); exit( EXIT_FAILURE ); } printf( "Creating eps files for generation %"PRId32"...\n", num_gener ); // ================================================================= // Read the backup file // ================================================================= ae_individual* indiv; ae_environment* env; // Load the simulation #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( num_gener, false, true, false ); env = exp_manager->get_env(); if (indiv_index == -1 && indiv_rank == -1) { indiv = new ae_individual(*exp_manager->get_best_indiv(), false); } else { if (indiv_rank != -1) { indiv = new ae_individual(*exp_manager->get_indiv_by_rank(indiv_rank), false); } else { indiv = new ae_individual(*exp_manager->get_indiv_by_id(indiv_index), false); } } // The constructor of the exp_manager has read the genomes of the individuals // and located their promoters, but has not performed the translation nor the // phenotype computation. We must do it now. // However, as the individuals in the backups are sorted, we don't need to evaluate // all the individuals, only those we are interested in (here only the best one) indiv->evaluate( env ); // ================================================================= // Create the EPS files // ================================================================= char directory_name[30]; sprintf( directory_name, "files-generation%06"PRId32, num_gener ); // Check whether the directory already exists and is writable if ( access( directory_name, F_OK ) == 0 ) { // struct stat status; // stat( directory_name, &status ); // if ( status.st_mode & S_IFDIR ) cout << "The directory exists." << endl; // else cout << "This path is a file." << endl; if ( access( directory_name, X_OK | W_OK) != 0 ) { fprintf(stderr, "Error: cannot enter or write in directory %s.\n", directory_name); exit( EXIT_FAILURE ); } } else { // Create the directory with permissions : rwx r-x r-x if ( mkdir( directory_name, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0 ) { fprintf(stderr, "Error: cannot create directory %s.\n", directory_name); exit( EXIT_FAILURE ); } } // ================================================================= // Write the data in the EPS files // ================================================================= ae_genetic_unit* indiv_main_genome = indiv->get_genetic_unit( 0 ); printf( "Creating the EPS file with the triangles of the chosen individual... " ); fflush(stdout); draw_triangles( indiv, env, directory_name ); printf( "OK\n" ); printf( "Creating the EPS file with the positive and negatives profiles of the chosen individual... " ); fflush(stdout); draw_pos_neg_profiles( indiv, env, directory_name ); printf( "OK\n" ); printf( "Creating the EPS file with the phenotype of the chosen individual... " ); fflush(stdout); draw_phenotype( indiv, env, directory_name ); printf( "OK\n" ); printf( "Creating the EPS file with the CDS of the chosen individual... " ); fflush(stdout); draw_genetic_unit_with_CDS( indiv_main_genome, directory_name ); printf( "OK\n" ); printf( "Creating the EPS file with the mRNAs of the chosen individual... " ); fflush(stdout); draw_genetic_unit_with_mRNAs( indiv_main_genome, directory_name ); printf( "OK\n" ); delete indiv; delete exp_manager; // delete env; // already done by the destructor of the exp_manager return EXIT_SUCCESS; } /*! \brief */ void print_help(char* prog_path) { printf( "\n" ); printf( "*********************** aevol - Artificial Evolution ******************* \n" ); printf( "* * \n" ); printf( "* EPS creation post-treatment program * \n" ); printf( "* * \n" ); printf( "************************************************************************ \n" ); printf( "\n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "Copyright (C) 2009 LIRIS.\n" ); printf( "\n" ); #ifdef __REGUL printf( "Usage : rcreate_eps -h\n"); printf( "or : rcreate_eps [-i index | -r rank] -g generation \n" ); #else printf( "Usage : create_eps -h\n"); printf( "or : create_eps [-i index | -r rank] -g generation \n" ); #endif printf( "\n" ); printf( "This program creates 5 EPS files with the triangles, the positive and negatives \n" ); printf( "profiles, the phenotype, the CDS, the mRNAs of the chosen individual or the best\n"); printf( "individual. This program requires at least one population backup file and one \n" ); printf( "environment backup file of end_gener\n" ); printf( "\n" ); printf( "\n" ); printf( "\t-h or --help : Display this help.\n" ); printf( "\n" ); printf( "\t-i index or --index index : \n" ); printf( "\t Creates the EPS files for the individual whose\n" ); printf( "\t index is index. The index must be comprised \n" ); printf( "\t between 0 and N-1, with N the size of the \n" ); printf( "\t population at the ending generation. If neither\n" ); printf( "\t index nor rank are specified, the program creates \n" ); printf( "\t the EPS files of the best individual\n" ); printf( "\n" ); printf( "\t-r rank or --rank rank : \n" ); printf( "\t Creates the EPS files for the individual whose\n" ); printf( "\t rank is rank. The rank must be comprised \n" ); printf( "\t between 0 and N-1, with N the size of the \n" ); printf( "\t population at the ending generation. If neither\n" ); printf( "\t index nor rank are specified, the program creates \n" ); printf( "\t the EPS files of the best individual\n" ); printf( "\n" ); printf( "\t-g generation or --gener generation : \n" ); printf( "\t Create the EPS files for the chosen individual of end_gener\n" ); printf( "\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } void draw_triangles( ae_individual* indiv, ae_environment* env, char * directoryName ) { const uint8_t bbsize = 200; // a4 paper: 595*842 double margin = 0.1; double scalex = 0.8*(1 - 2*margin); double scaley = 0.4*(1 - 2*margin); char filename[50]; strncpy( filename, directoryName, 29 ); strcat( filename, "/best_triangles.eps" ); FILE * drawingfile = fopen( filename, "w" ); fprintf( drawingfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); fprintf( drawingfile, "%%%%BoundingBox: 0 0 %d %d\n", bbsize, bbsize ); fprintf( drawingfile, "%d %d scale\n", bbsize, bbsize ); fprintf( drawingfile, "%d %d 8 [100 0 0 -100 0 100]\n",bbsize, bbsize ); fprintf( drawingfile, "{currentfile 3 100 mul string readhexstring pop} bind\n" ); // ----------------------------- // paint neutral zones in grey // ----------------------------- if ( env->get_nb_segments() > 1 ) { int16_t nb_segments = env->get_nb_segments(); ae_env_segment** segments = env->get_segments(); for ( int16_t i = 0 ; i < nb_segments ; i++ ) { if ( segments[i]->feature == NEUTRAL ) { fprintf( drawingfile, "%lf 0 moveto\n", margin + scalex * segments[i]->start ); fprintf( drawingfile, "%lf 1 lineto\n", margin + scalex * segments[i]->start ); fprintf( drawingfile, "%lf 1 lineto\n", margin + scalex * segments[i]->stop ); fprintf( drawingfile, "%lf 0 lineto\n", margin + scalex * segments[i]->stop ); fprintf( drawingfile, "closepath\n" ); fprintf( drawingfile, "0.8 setgray\n" ); fprintf( drawingfile, "fill\n" ); fprintf( drawingfile, "0 setgray\n" ); } } } // ----------- // draw axis // ----------- double arrowsize = 0.03; double arrowangle = 3.14/6; fprintf( drawingfile, "0.001 setlinewidth\n" ); fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); // axis X + arrow fprintf( drawingfile, "%lf %lf moveto\n", margin/2, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin, 0.5); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 1-margin, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin-arrowsize*cos(arrowangle), 0.5 + arrowsize*sin(arrowangle) ); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 1-margin, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin-arrowsize*cos(arrowangle), 0.5 - arrowsize*sin(arrowangle) ); fprintf( drawingfile, "stroke\n" ); // axis Y + arrow fprintf( drawingfile, "%lf %lf moveto\n", margin, margin/2); fprintf( drawingfile, "%lf %lf lineto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf moveto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf lineto\n", margin-arrowsize*sin(arrowangle), 1 - margin - arrowsize*cos(arrowangle) ); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf lineto\n", margin+arrowsize*sin(arrowangle), 1 - margin - arrowsize*cos(arrowangle) ); fprintf( drawingfile, "stroke\n" ); // max degree = 1 fprintf( drawingfile, "[0.02 0.02] 0 setdash\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5 + 1.0*scaley); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin, 0.5 + 1.0*scaley); fprintf( drawingfile, "stroke\n" ); // ---------------- // draw triangles // ---------------- fprintf( drawingfile,"[ ] 0 setdash\n" ); double h; ae_list_node* gen_unit_node = indiv->get_genetic_unit_list()->get_first(); ae_genetic_unit* gen_unit = NULL; while ( gen_unit_node != NULL ) { gen_unit = (ae_genetic_unit*) gen_unit_node->get_obj(); ae_list_node* prot_node = NULL; ae_protein* prot = NULL; prot_node = (gen_unit->get_protein_list())[LEADING]->get_first(); while ( prot_node != NULL ) { prot = (ae_protein*) prot_node->get_obj(); h = prot->get_height() * prot->get_concentration(); fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() - prot->get_width()), 0.5); fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean()), 0.5 + scaley*(h)); fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() + prot->get_width()), 0.5); fprintf( drawingfile, "%lf %lf moveto\n", margin + scalex*(1), 0.5); fprintf( drawingfile, "stroke\n" ); prot_node = prot_node->get_next(); } prot_node = (gen_unit->get_protein_list())[LAGGING]->get_first(); while ( prot_node != NULL ) { prot = (ae_protein*) prot_node->get_obj(); h = prot->get_height() * prot->get_concentration(); fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() - prot->get_width()), 0.5); fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean()), 0.5 + scaley*(h)); fprintf( drawingfile, "%lf %lf lineto\n", margin + scalex*(prot->get_mean() + prot->get_width()), 0.5); fprintf( drawingfile, "%lf %lf moveto\n", margin + scalex*(1), 0.5); fprintf( drawingfile, "stroke\n" ); prot_node = prot_node->get_next(); } gen_unit_node = gen_unit_node->get_next(); } fprintf( drawingfile,"%%%%EOF\n" ); fclose(drawingfile); } void draw_pos_neg_profiles( ae_individual * indiv, ae_environment* env, char * directoryName ) { const uint8_t bbsize = 200; // a4 paper: 595*842 double margin = 0.1; double scale = 0.8*(1 - 2*margin); char filename[50]; strncpy( filename, directoryName, 29 ); strcat( filename, "/best_pos_neg_profiles.eps" ); FILE * drawingfile = fopen( filename, "w" ); fprintf( drawingfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); fprintf( drawingfile, "%%%%BoundingBox: 0 0 %d %d\n", bbsize, bbsize); fprintf( drawingfile, "%d %d scale\n", bbsize, bbsize); fprintf( drawingfile, "%d %d 8 [100 0 0 -100 0 100]\n",bbsize, bbsize); fprintf( drawingfile, "{currentfile 3 100 mul string readhexstring pop} bind\n" ); // ----------------------------- // paint neutral zones in grey // ----------------------------- if ( env->get_nb_segments() > 1 ) { int16_t nb_segments = env->get_nb_segments(); ae_env_segment** segments = env->get_segments(); for ( int16_t i = 0 ; i < nb_segments ; i++ ) { if ( segments[i]->feature == NEUTRAL ) { fprintf( drawingfile, "%lf 0 moveto\n", margin + scale * segments[i]->start ); fprintf( drawingfile, "%lf 1 lineto\n", margin + scale * segments[i]->start ); fprintf( drawingfile, "%lf 1 lineto\n", margin + scale * segments[i]->stop ); fprintf( drawingfile, "%lf 0 lineto\n", margin + scale * segments[i]->stop ); fprintf( drawingfile, "closepath\n" ); fprintf( drawingfile, "0.8 setgray\n" ); fprintf( drawingfile, "fill\n" ); fprintf( drawingfile, "0 setgray\n" ); } } } // ----------- // draw axis // ----------- double arrowsize = 0.03; double arrowangle = 3.14/6; fprintf( drawingfile, "0.001 setlinewidth\n" ); fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); // axis X + arrow fprintf( drawingfile, "%lf %lf moveto\n", margin/2, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin, 0.5); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 1-margin, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin-arrowsize*cos(arrowangle), 0.5 + arrowsize*sin(arrowangle) ); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 1-margin, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin-arrowsize*cos(arrowangle), 0.5 - arrowsize*sin(arrowangle) ); fprintf( drawingfile, "stroke\n" ); // axis Y + arrow fprintf( drawingfile, "%lf %lf moveto\n", margin, margin/2); fprintf( drawingfile, "%lf %lf lineto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf moveto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf lineto\n", margin-arrowsize*sin(arrowangle), 1 - margin - arrowsize*cos(arrowangle) ); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf lineto\n", margin+arrowsize*sin(arrowangle), 1 - margin - arrowsize*cos(arrowangle) ); fprintf( drawingfile, "stroke\n" ); // ----------------------- // draw positive profile // ----------------------- fprintf( drawingfile,"[ ] 0 setdash\n" ); fprintf( drawingfile, "0.002 setlinewidth\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5); ae_list_node* node = indiv->get_phenotype_activ()->get_points()->get_first(); ae_point_2d* pt = NULL; while (node != NULL) { pt = node->get_obj(); fprintf( drawingfile, "%lf %lf lineto\n", margin + scale*pt->x, 0.5 + scale*pt->y); node = node->get_next(); } fprintf( drawingfile, "stroke\n" ); // ----------------------- // draw negative profile // ----------------------- fprintf( drawingfile,"[ ] 0 setdash\n" ); fprintf( drawingfile, "0.002 setlinewidth\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, 0.5); node = ((indiv->get_phenotype_inhib())->get_points())->get_first(); pt = NULL; while (node != NULL) { pt = (ae_point_2d *) node->get_obj(); fprintf( drawingfile, "%lf %lf lineto\n", margin + scale*pt->x, 0.5 + scale*pt->y); node = node->get_next(); } fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile,"%%%%EOF\n" ); fclose(drawingfile); } void draw_phenotype( ae_individual* indiv, ae_environment* env, char* directoryName ) { const uint8_t bbsize = 200; // a4 paper: 595*842 double margin = 0.1; double scale = 0.8*(1 - 2*margin); char filename[50]; strncpy( filename, directoryName, 29 ); strcat( filename, "/best_phenotype.eps" ); FILE * drawingfile = fopen( filename, "w" ); if (drawingfile == NULL) { fprintf(stderr, "Error: could not create the file %s\n", filename); return; } fprintf( drawingfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); fprintf( drawingfile, "%%%%BoundingBox: 0 0 %d %d\n", bbsize, bbsize); fprintf( drawingfile, "%d %d scale\n", bbsize, bbsize); fprintf( drawingfile, "%d %d 8 [100 0 0 -100 0 100]\n",bbsize, bbsize); fprintf( drawingfile, "{currentfile 3 100 mul string readhexstring pop} bind\n" ); // ----------------------------- // paint neutral zones in grey // ----------------------------- if ( env->get_nb_segments() > 1 ) { int16_t nb_segments = env->get_nb_segments(); ae_env_segment** segments = env->get_segments(); for ( int16_t i = 0 ; i < nb_segments ; i++ ) { if ( segments[i]->feature == NEUTRAL ) { fprintf( drawingfile, "%lf 0 moveto\n", margin + scale * segments[i]->start ); fprintf( drawingfile, "%lf 1 lineto\n", margin + scale * segments[i]->start ); fprintf( drawingfile, "%lf 1 lineto\n", margin + scale * segments[i]->stop ); fprintf( drawingfile, "%lf 0 lineto\n", margin + scale * segments[i]->stop ); fprintf( drawingfile, "closepath\n" ); fprintf( drawingfile, "0.8 setgray\n" ); fprintf( drawingfile, "fill\n" ); fprintf( drawingfile, "0 setgray\n" ); } } } // ----------- // draw axis // ----------- double arrowsize = 0.03; double arrowangle = 3.14/6; fprintf( drawingfile, "0.001 setlinewidth\n" ); fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); // axis X + arrow fprintf( drawingfile, "%lf %lf moveto\n", margin/2, margin); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin, margin); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 1-margin, margin); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin-arrowsize*cos(arrowangle), margin + arrowsize*sin(arrowangle) ); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 1-margin, margin); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin-arrowsize*cos(arrowangle), margin - arrowsize*sin(arrowangle) ); fprintf( drawingfile, "stroke\n" ); // axis Y + arrow fprintf( drawingfile, "%lf %lf moveto\n", margin, margin/2); fprintf( drawingfile, "%lf %lf lineto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf moveto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf lineto\n", margin-arrowsize*sin(arrowangle), 1 - margin - arrowsize*cos(arrowangle) ); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, 1-margin); fprintf( drawingfile, "%lf %lf lineto\n", margin+arrowsize*sin(arrowangle), 1 - margin - arrowsize*cos(arrowangle) ); fprintf( drawingfile, "stroke\n" ); // max degree = 1 fprintf( drawingfile, "[0.02 0.02] 0 setdash\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, margin + 1*scale); fprintf( drawingfile, "%lf %lf lineto\n", 1-margin, margin + 1*scale); fprintf( drawingfile, "stroke\n" ); // ---------------- // draw phenotype // ---------------- fprintf( drawingfile,"[ ] 0 setdash\n" ); fprintf( drawingfile, "0.002 setlinewidth\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, margin); ae_list_node* node = indiv->get_phenotype()->get_points()->get_first(); ae_point_2d* pt = NULL; while (node != NULL) { pt = (ae_point_2d *) node->get_obj(); fprintf( drawingfile, "%lf %lf lineto\n", margin + scale*pt->x, margin + scale*pt->y); node = node->get_next(); } fprintf( drawingfile, "stroke\n" ); // ------------------ // draw environment // ------------------ fprintf( drawingfile,"[ ] 0 setdash\n" ); fprintf( drawingfile, "0.001 setlinewidth\n" ); fprintf( drawingfile, "%lf %lf moveto\n", margin, margin); node = (env->get_points())->get_first(); pt = NULL; while (node != NULL) { pt = (ae_point_2d *) node->get_obj(); fprintf( drawingfile, "%lf %lf lineto\n", margin + scale*pt->x, margin + scale*pt->y); node = node->get_next(); } fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile,"%%%%EOF\n" ); fclose(drawingfile); } void draw_genetic_unit_with_CDS( ae_genetic_unit* gen_unit, char * directoryName ) { const uint8_t bbsize = 200; // a4 paper: 595*842 int32_t gen_length = (gen_unit->get_dna())->get_length(); double r = 0.35; double scale = 2*M_PI*r/gen_length; char filename[50]; strncpy( filename, directoryName, 29 ); strcat( filename, "/best_genome_with_CDS.eps" ); FILE * drawingfile = fopen( filename, "w" ); fprintf( drawingfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); fprintf( drawingfile, "%%%%BoundingBox: 0 0 %d %d\n", bbsize, bbsize); fprintf( drawingfile, "%d %d scale\n", bbsize, bbsize); fprintf( drawingfile, "%d %d 8 [100 0 0 -100 0 100]\n",bbsize, bbsize); fprintf( drawingfile, "{currentfile 3 100 mul string readhexstring pop} bind\n" ); // ----------- // chromosome // ----------- fprintf( drawingfile, "0.001 setlinewidth\n" ); fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); fprintf( drawingfile, "%lf %lf %lf 0 360 arc\n", 0.5, 0.5, r); // arcn = clockwise arc fprintf( drawingfile, "stroke\n" ); // ----------- // scale // ----------- double scalesize = 0.15; fprintf( drawingfile, "%lf %lf moveto\n", 0.5-scalesize/2, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 0.5+scalesize/2, 0.5); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "/Helvetica findfont\n" ); fprintf( drawingfile, "0.035 scalefont\n" ); fprintf( drawingfile, "setfont\n" ); fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 0.5-scalesize/3, 0.52); fprintf( drawingfile, "(scale : %.0lf bp) show\n", scalesize/scale); // ----------- // genes // ----------- ae_list_node* node = NULL; ae_protein* prot = NULL; int32_t first; int32_t last; int8_t layer = 0; int8_t outmost_layer = 1; int16_t nb_sect; int16_t rho; int16_t angle; bool sectors_free; int16_t alpha_first; int16_t alpha_last; int16_t theta_first; int16_t theta_last; // To handle gene overlaps, we remember where we have aldready drawn // something, with a precision of 1 degree. We handle up to 100 layers: // - 50 layers inside the circle (lagging strand), // - 50 layers outside the cricle (leading strand). // At first, only one layer is created, we create new layers when we // need them. bool* occupied_sectors[2][50]; occupied_sectors[LEADING][0] = new bool[360]; occupied_sectors[LAGGING][0] = new bool[360]; for ( int16_t angle = 0 ; angle < 360 ; angle++ ) { occupied_sectors[LEADING][0][angle] = false; occupied_sectors[LAGGING][0][angle] = false; } // printf("LEADING\n" ); node = (gen_unit->get_protein_list())[LEADING]->get_first(); while (node != NULL) { prot = (ae_protein *) node->get_obj(); first = prot->get_first_translated_pos(); last = prot->get_last_translated_pos(); // h = prot->get_height() * prot->get_concentration(); alpha_first = (int16_t) round( (double)(360 * first) / (double)gen_length ); // == sect1 == alphaB alpha_last = (int16_t) round( (double)(360 * last) / (double)gen_length ); // == sect2 == alphaA theta_first = ae_utils::mod( 90 - alpha_first, 360 ); // == tetaB theta_last = ae_utils::mod( 90 - alpha_last, 360 ); // == tetaA if ( theta_first == theta_last ) theta_first = ae_utils::mod( theta_first + 1, 360 ); nb_sect = ae_utils::mod( theta_first - theta_last + 1, 360 ); // Outside the circle, look for the inmost layer that has all the sectors between // theta_first and theta_last free layer = 0; sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( rho = 0 ; rho < nb_sect ; rho++ ) { if ( occupied_sectors[LEADING][layer][ae_utils::mod(theta_first - rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( (layer >= outmost_layer) && (layer < 49) ) { // Add a new layer (actually, 2 layers, to maintain the symmetry) occupied_sectors[LEADING][outmost_layer] = new bool[360]; occupied_sectors[LAGGING][outmost_layer] = new bool[360]; for ( int16_t angle = 0 ; angle < 360 ; angle++ ) { occupied_sectors[LEADING][outmost_layer][angle] = false; occupied_sectors[LAGGING][outmost_layer][angle] = false; } outmost_layer++; break; // A new layer is necessarily free, no need to look further } if ( layer == 49 ) { // We shall not create a 51th layer, the CDS will be drawn on the // layer, probably over another CDS break; } } } // printf("f %d, l %d, af %d, al %d, tf %d, tl %d, nbsect %d, layer %d\n", first, last, alpha_first, alpha_last, theta_first, theta_last, nb_sect, layer); // Mark sectors to be drawn as occupied for ( rho = 0 ; rho < nb_sect ; rho++ ) { occupied_sectors[LEADING][layer][ae_utils::mod(theta_first - rho, 360)] = true; } // Mark flanking sectors as occupied occupied_sectors[LEADING][layer][ae_utils::mod(theta_first + 1, 360)] = true; occupied_sectors[LEADING][layer][ae_utils::mod(theta_first - nb_sect, 360)] = true; // draw ! fprintf( drawingfile, "0.018 setlinewidth\n" ); // fprintf( drawingfile, "%lf %lf %lf setrgbcolor\n", 1-(0.8*h/max_height + 0.2), 1-(0.8*h/max_height + 0.2),1-(0.8*h/max_height + 0.2)); layer++; // index starting at 0 but needed to start at 1 if (theta_last > theta_first) { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, theta_last, 360); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, 0, theta_first); fprintf( drawingfile, "stroke\n" ); } else { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, theta_last, theta_first); fprintf( drawingfile, "stroke\n" ); } node = node->get_next(); } // printf("LAGGING\n" ); node = (gen_unit->get_protein_list())[LAGGING]->get_first(); while (node != NULL) { prot = (ae_protein *) node->get_obj(); first = prot->get_first_translated_pos(); last = prot->get_last_translated_pos(); // h = prot->get_height() * prot->get_concentration(); alpha_first = (int16_t) round( (double)(360 * first) / (double)gen_length ); alpha_last = (int16_t) round( (double)(360 * last) / (double)gen_length ); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); if ( theta_first == theta_last ) theta_last = ae_utils::mod( theta_last + 1, 360 ); nb_sect = ae_utils::mod( theta_last - theta_first + 1, 360 ); // Inside the circle, look for the inmost layer that has all the sectors between // theta_first and theta_last free layer = 0; sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( rho = 0 ; rho < nb_sect ; rho++ ) { if ( occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first + rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( (layer >= outmost_layer) && (layer < 49) ) { // Add a new layer (actually, 2 layers, to maintain the symmetry) occupied_sectors[LEADING][outmost_layer] = new bool[360]; occupied_sectors[LAGGING][outmost_layer] = new bool[360]; for ( angle = 0 ; angle < 360 ; angle++ ) { occupied_sectors[LEADING][outmost_layer][angle] = false; occupied_sectors[LAGGING][outmost_layer][angle] = false; } outmost_layer++; break; // A new layer is necessarily free, no need to look further } if ( layer == 49 ) { // We shall not create a 51th layer, the CDS will be drawn on the // layer, probably over another CDS break; } } } // printf("f %d, l %d, af %d, al %d, tf %d, tl %d, nbsect %d, layer %d\n", first, last, alpha_first, alpha_last, theta_first, theta_last, nb_sect, layer); // Mark sectors to be drawn as occupied for ( rho = 0 ; rho < nb_sect ; rho++ ) { occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first + rho, 360)] = true; } // Mark flanking sectors as occupied occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first - 1, 360)] = true; occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first + nb_sect, 360)] = true; // draw ! fprintf( drawingfile, "0.018 setlinewidth\n" ); // fprintf( drawingfile, "%lf %lf %lf setrgbcolor\n", 1-(0.8*h/max_height + 0.2), 1-(0.8*h/max_height + 0.2),1-(0.8*h/max_height + 0.2)); layer++; // index starting at 0 but needed to start at 1 if (theta_first > theta_last) { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, theta_first, 360); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, 0, theta_last); fprintf( drawingfile, "stroke\n" ); } else { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, theta_first, theta_last); fprintf( drawingfile, "stroke\n" ); } node = node->get_next(); } fprintf( drawingfile,"showpage\n" ); fprintf( drawingfile,"%%%%EOF\n" ); fclose(drawingfile); for ( layer = 0 ; layer < outmost_layer ; layer++ ) { delete occupied_sectors[LEADING][layer]; delete occupied_sectors[LAGGING][layer]; } } void draw_genetic_unit_with_mRNAs( ae_genetic_unit* gen_unit, char * directoryName ) { const uint8_t bbsize = 200; // a4 paper: 595*842 int32_t gen_length = (gen_unit->get_dna())->get_length(); double r = 0.35; double scale = 2*M_PI*r/gen_length; char filename[50]; strncpy( filename, directoryName, 29 ); strcat( filename, "/best_genome_with_mRNAs.eps" ); FILE * drawingfile = fopen( filename, "w" ); fprintf( drawingfile, "%%!PS-Adobe-3.0 EPSF-3.0\n" ); fprintf( drawingfile, "%%%%BoundingBox: 0 0 %d %d\n", bbsize, bbsize); fprintf( drawingfile, "%d %d scale\n", bbsize, bbsize); fprintf( drawingfile, "%d %d 8 [100 0 0 -100 0 100]\n",bbsize, bbsize); fprintf( drawingfile, "{currentfile 3 100 mul string readhexstring pop} bind\n" ); // ----------- // chromosome // ----------- fprintf( drawingfile, "0.001 setlinewidth\n" ); fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); fprintf( drawingfile, "%lf %lf %lf 0 360 arc\n", 0.5, 0.5, r); // arcn = clockwise arc fprintf( drawingfile, "stroke\n" ); // ----------- // scale // ----------- double scalesize = 0.15; fprintf( drawingfile, "%lf %lf moveto\n", 0.5-scalesize/2, 0.5); fprintf( drawingfile, "%lf %lf lineto\n", 0.5+scalesize/2, 0.5); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "/Helvetica findfont\n" ); fprintf( drawingfile, "0.035 scalefont\n" ); fprintf( drawingfile, "setfont\n" ); fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf moveto\n", 0.5-scalesize/3, 0.52); fprintf( drawingfile, "(scale : %.0lf bp) show\n", scalesize/scale); // ----------- // mRNAs // ----------- ae_list_node* node = NULL; ae_rna* rna = NULL; int32_t first; int32_t last; int8_t layer = 0; int8_t outmost_layer = 1; int16_t nb_sect; int16_t rho; int16_t angle; bool sectors_free; int16_t alpha_first; int16_t alpha_last; int16_t theta_first; int16_t theta_last; // To handle gene overlaps, we remember where we have aldready drawn // something, with a precision of 1 degree. We handle up to 100 layers: // - 50 layers inside the circle (lagging strand), // - 50 layers outside the cricle (leading strand). // At first, only one layer is created, we create new layers when we // need them. bool* occupied_sectors[2][50]; occupied_sectors[LEADING][0] = new bool[360]; occupied_sectors[LAGGING][0] = new bool[360]; for ( int16_t angle = 0 ; angle < 360 ; angle++ ) { occupied_sectors[LEADING][0][angle] = false; occupied_sectors[LAGGING][0][angle] = false; } node = (gen_unit->get_rna_list())[LEADING]->get_first(); while (node != NULL) { rna = (ae_rna *) node->get_obj(); first = rna->get_first_transcribed_pos(); last = rna->get_last_transcribed_pos(); alpha_first = (int16_t) round( (double)(360 * first) / (double)gen_length ); // == sect1 == alphaB alpha_last = (int16_t) round( (double)(360 * last) / (double)gen_length ); // == sect2 == alphaA theta_first = ae_utils::mod( 90 - alpha_first, 360 ); // == tetaB theta_last = ae_utils::mod( 90 - alpha_last, 360 ); // == tetaA if ( theta_first == theta_last ) theta_first = ae_utils::mod( theta_first + 1, 360 ); nb_sect = ae_utils::mod( theta_first - theta_last + 1, 360 ); // Outside the circle, look for the inmost layer that has all the sectors between // theta_first and theta_last free layer = 0; sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( rho = 0 ; rho < nb_sect ; rho++ ) { if ( occupied_sectors[LEADING][layer][ae_utils::mod(theta_first - rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( (layer >= outmost_layer) && (layer < 49) ) { // Add a new layer (actually, 2 layers, to maintain the symmetry) occupied_sectors[LEADING][outmost_layer] = new bool[360]; occupied_sectors[LAGGING][outmost_layer] = new bool[360]; for ( int16_t angle = 0 ; angle < 360 ; angle++ ) { occupied_sectors[LEADING][outmost_layer][angle] = false; occupied_sectors[LAGGING][outmost_layer][angle] = false; } outmost_layer++; break; // A new layer is necessarily free, no need to look further } if ( layer == 49 ) { // We shall not create a 51th layer, the CDS will be drawn on the // layer, probably over another CDS break; } } } // Mark sectors to be drawn as occupied for ( rho = 0 ; rho < nb_sect ; rho++ ) { occupied_sectors[LEADING][layer][ae_utils::mod(theta_first - rho, 360)] = true; } // Mark flanking sectors as occupied occupied_sectors[LEADING][layer][ae_utils::mod(theta_first + 1, 360)] = true; occupied_sectors[LEADING][layer][ae_utils::mod(theta_first - nb_sect, 360)] = true; // draw ! fprintf( drawingfile, "0.018 setlinewidth\n" ); if ( rna->is_coding() ) fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); else fprintf( drawingfile, "0.7 0.7 0.7 setrgbcolor\n" ); layer++; // index starting at 0 but needed to start at 1 if (theta_last > theta_first) { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, theta_last, 360); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, 0, theta_first); fprintf( drawingfile, "stroke\n" ); } else { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r + layer*0.02, theta_last, theta_first); fprintf( drawingfile, "stroke\n" ); } node = node->get_next(); } node = (gen_unit->get_rna_list())[LAGGING]->get_first(); while (node != NULL) { rna = (ae_rna *) node->get_obj(); first = rna->get_first_transcribed_pos(); last = rna->get_last_transcribed_pos(); alpha_first = (int16_t) round( (double)(360 * first) / (double)gen_length ); alpha_last = (int16_t) round( (double)(360 * last) / (double)gen_length ); theta_first = ae_utils::mod( 90 - alpha_first, 360 ); theta_last = ae_utils::mod( 90 - alpha_last, 360 ); nb_sect = ae_utils::mod( alpha_first - alpha_last + 1, 360 ); // Inside the circle, look for the inmost layer that has all the sectors between // theta_first and theta_last free layer = 0; sectors_free = false; while ( ! sectors_free ) { sectors_free = true; for ( rho = 0 ; rho < nb_sect ; rho++ ) { if ( occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first + rho, 360)] ) { sectors_free = false; break; } } if ( sectors_free ) { break; // All the needed sectors are free on the current layer } else { layer++; if ( (layer >= outmost_layer) && (layer < 49) ) { // Add a new layer (actually, 2 layers, to maintain the symmetry) occupied_sectors[LEADING][outmost_layer] = new bool[360]; occupied_sectors[LAGGING][outmost_layer] = new bool[360]; for ( angle = 0 ; angle < 360 ; angle++ ) { occupied_sectors[LEADING][outmost_layer][angle] = false; occupied_sectors[LAGGING][outmost_layer][angle] = false; } outmost_layer++; break; // A new layer is necessarily free, no need to look further } if ( layer == 49 ) { // We shall not create a 51th layer, the CDS will be drawn on the // layer, probably over another CDS break; } } } // Mark sectors to be drawn as occupied for ( rho = 0 ; rho < nb_sect ; rho++ ) { occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first + rho, 360)] = true; } // Mark flanking sectors as occupied occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first - 1, 360)] = true; occupied_sectors[LAGGING][layer][ae_utils::mod(theta_first + nb_sect, 360)] = true; // draw ! fprintf( drawingfile, "0.018 setlinewidth\n" ); if ( rna->is_coding() ) fprintf( drawingfile, "0 0 0 setrgbcolor\n" ); else fprintf( drawingfile, "0.7 0.7 0.7 setrgbcolor\n" ); layer++; // index starting at 0 but needed to start at 1 if (theta_first > theta_last) { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, theta_first, 360); fprintf( drawingfile, "stroke\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, 0, theta_last); fprintf( drawingfile, "stroke\n" ); } else { fprintf( drawingfile, "newpath\n" ); fprintf( drawingfile, "%lf %lf %lf %d %d arc\n", 0.5, 0.5, r - layer*0.02, theta_first, theta_last); fprintf( drawingfile, "stroke\n" ); } node = node->get_next(); } fprintf( drawingfile,"showpage\n" ); fprintf( drawingfile,"%%%%EOF\n" ); fclose(drawingfile); for ( layer = 0 ; layer < outmost_layer ; layer++ ) { delete occupied_sectors[LEADING][layer]; delete occupied_sectors[LAGGING][layer]; } } aevol-4.4/src/post_treatments/Makefile.in0000644000000000000000000006147012365454415015466 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = aevol_misc_robustness$(EXEEXT) \ aevol_misc_ancstats$(EXEEXT) aevol_misc_create_eps$(EXEEXT) \ aevol_misc_fixed_mutations$(EXEEXT) \ aevol_misc_gene_families$(EXEEXT) aevol_misc_lineage$(EXEEXT) \ aevol_misc_compute_pop_stats$(EXEEXT) \ aevol_misc_extract$(EXEEXT) $(am__EXEEXT_1) @WITH_X_TRUE@am__append_1 = aevol_misc_view_generation noinst_PROGRAMS = aevol_misc_template$(EXEEXT) subdir = src/post_treatments DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @WITH_X_TRUE@am__EXEEXT_1 = aevol_misc_view_generation$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_aevol_misc_ancstats_OBJECTS = ancstats.$(OBJEXT) aevol_misc_ancstats_OBJECTS = $(am_aevol_misc_ancstats_OBJECTS) aevol_misc_ancstats_LDADD = $(LDADD) aevol_misc_ancstats_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_compute_pop_stats_OBJECTS = \ population_statistics.$(OBJEXT) compute_pop_stats.$(OBJEXT) aevol_misc_compute_pop_stats_OBJECTS = \ $(am_aevol_misc_compute_pop_stats_OBJECTS) aevol_misc_compute_pop_stats_LDADD = $(LDADD) aevol_misc_compute_pop_stats_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_create_eps_OBJECTS = create_eps.$(OBJEXT) aevol_misc_create_eps_OBJECTS = $(am_aevol_misc_create_eps_OBJECTS) aevol_misc_create_eps_LDADD = $(LDADD) aevol_misc_create_eps_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_extract_OBJECTS = extract.$(OBJEXT) aevol_misc_extract_OBJECTS = $(am_aevol_misc_extract_OBJECTS) aevol_misc_extract_LDADD = $(LDADD) aevol_misc_extract_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_fixed_mutations_OBJECTS = fixed_mutations.$(OBJEXT) aevol_misc_fixed_mutations_OBJECTS = \ $(am_aevol_misc_fixed_mutations_OBJECTS) aevol_misc_fixed_mutations_LDADD = $(LDADD) aevol_misc_fixed_mutations_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_gene_families_OBJECTS = gene_families.$(OBJEXT) aevol_misc_gene_families_OBJECTS = \ $(am_aevol_misc_gene_families_OBJECTS) aevol_misc_gene_families_LDADD = $(LDADD) aevol_misc_gene_families_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_lineage_OBJECTS = lineage.$(OBJEXT) aevol_misc_lineage_OBJECTS = $(am_aevol_misc_lineage_OBJECTS) aevol_misc_lineage_LDADD = $(LDADD) aevol_misc_lineage_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_robustness_OBJECTS = population_statistics.$(OBJEXT) \ robustness.$(OBJEXT) aevol_misc_robustness_OBJECTS = $(am_aevol_misc_robustness_OBJECTS) aevol_misc_robustness_LDADD = $(LDADD) aevol_misc_robustness_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_template_OBJECTS = template.$(OBJEXT) aevol_misc_template_OBJECTS = $(am_aevol_misc_template_OBJECTS) aevol_misc_template_LDADD = $(LDADD) aevol_misc_template_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a am_aevol_misc_view_generation_OBJECTS = view_generation.$(OBJEXT) aevol_misc_view_generation_OBJECTS = \ $(am_aevol_misc_view_generation_OBJECTS) aevol_misc_view_generation_LDADD = $(LDADD) aevol_misc_view_generation_DEPENDENCIES = \ $(top_srcdir)/src/libaevol/libaevol.a \ $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(aevol_misc_ancstats_SOURCES) \ $(aevol_misc_compute_pop_stats_SOURCES) \ $(aevol_misc_create_eps_SOURCES) $(aevol_misc_extract_SOURCES) \ $(aevol_misc_fixed_mutations_SOURCES) \ $(aevol_misc_gene_families_SOURCES) \ $(aevol_misc_lineage_SOURCES) $(aevol_misc_robustness_SOURCES) \ $(aevol_misc_template_SOURCES) \ $(aevol_misc_view_generation_SOURCES) DIST_SOURCES = $(aevol_misc_ancstats_SOURCES) \ $(aevol_misc_compute_pop_stats_SOURCES) \ $(aevol_misc_create_eps_SOURCES) $(aevol_misc_extract_SOURCES) \ $(aevol_misc_fixed_mutations_SOURCES) \ $(aevol_misc_gene_families_SOURCES) \ $(aevol_misc_lineage_SOURCES) $(aevol_misc_robustness_SOURCES) \ $(aevol_misc_template_SOURCES) \ $(aevol_misc_view_generation_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ############################################ # Set a few variables # ############################################ ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX #################################### # Add hardening option to compiler # #################################### # This replaces insecure unlimited length buffer function calls with # length-limited ones (required for debian and not a bad idea anyway). AM_CPPFLAGS = $(AEVOLCPPFLAGS) -I$(top_srcdir)/src/libaevol \ -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS \ -D__STDC_LIMIT_MACROS -D_FORTIFY_SOURCE=2 AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) -L$(top_srcdir)/src/libaevol ############################################ # Set aevol library to use # ############################################ LDADD = $(top_srcdir)/src/libaevol/libaevol.a $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a CLEANFILES = aevol_misc_ancstats aevol_misc_compute_pop_stats aevol_misc_create_eps aevol_misc_extract aevol_misc_fixed_mutations aevol_misc_gene_families aevol_misc_lineage aevol_misc_robustness aevol_misc_template aevol_misc_view_generation aevol_misc_ancstats_SOURCES = ancstats.cpp #aevol_misc_compute_pop_stats_HEADERS = population_statistics.h aevol_misc_compute_pop_stats_SOURCES = population_statistics.cpp \ compute_pop_stats.cpp population_statistics.h aevol_misc_create_eps_SOURCES = create_eps.cpp aevol_misc_extract_SOURCES = extract.cpp aevol_misc_fixed_mutations_SOURCES = fixed_mutations.cpp aevol_misc_gene_families_SOURCES = gene_families.cpp aevol_misc_lineage_SOURCES = lineage.cpp #aevol_misc_robustness_HEADERS = population_statistics.h aevol_misc_robustness_SOURCES = population_statistics.cpp \ robustness.cpp population_statistics.h aevol_misc_template_SOURCES = template.cpp aevol_misc_view_generation_SOURCES = view_generation.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/post_treatments/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/post_treatments/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) aevol_misc_ancstats$(EXEEXT): $(aevol_misc_ancstats_OBJECTS) $(aevol_misc_ancstats_DEPENDENCIES) $(EXTRA_aevol_misc_ancstats_DEPENDENCIES) @rm -f aevol_misc_ancstats$(EXEEXT) $(CXXLINK) $(aevol_misc_ancstats_OBJECTS) $(aevol_misc_ancstats_LDADD) $(LIBS) aevol_misc_compute_pop_stats$(EXEEXT): $(aevol_misc_compute_pop_stats_OBJECTS) $(aevol_misc_compute_pop_stats_DEPENDENCIES) $(EXTRA_aevol_misc_compute_pop_stats_DEPENDENCIES) @rm -f aevol_misc_compute_pop_stats$(EXEEXT) $(CXXLINK) $(aevol_misc_compute_pop_stats_OBJECTS) $(aevol_misc_compute_pop_stats_LDADD) $(LIBS) aevol_misc_create_eps$(EXEEXT): $(aevol_misc_create_eps_OBJECTS) $(aevol_misc_create_eps_DEPENDENCIES) $(EXTRA_aevol_misc_create_eps_DEPENDENCIES) @rm -f aevol_misc_create_eps$(EXEEXT) $(CXXLINK) $(aevol_misc_create_eps_OBJECTS) $(aevol_misc_create_eps_LDADD) $(LIBS) aevol_misc_extract$(EXEEXT): $(aevol_misc_extract_OBJECTS) $(aevol_misc_extract_DEPENDENCIES) $(EXTRA_aevol_misc_extract_DEPENDENCIES) @rm -f aevol_misc_extract$(EXEEXT) $(CXXLINK) $(aevol_misc_extract_OBJECTS) $(aevol_misc_extract_LDADD) $(LIBS) aevol_misc_fixed_mutations$(EXEEXT): $(aevol_misc_fixed_mutations_OBJECTS) $(aevol_misc_fixed_mutations_DEPENDENCIES) $(EXTRA_aevol_misc_fixed_mutations_DEPENDENCIES) @rm -f aevol_misc_fixed_mutations$(EXEEXT) $(CXXLINK) $(aevol_misc_fixed_mutations_OBJECTS) $(aevol_misc_fixed_mutations_LDADD) $(LIBS) aevol_misc_gene_families$(EXEEXT): $(aevol_misc_gene_families_OBJECTS) $(aevol_misc_gene_families_DEPENDENCIES) $(EXTRA_aevol_misc_gene_families_DEPENDENCIES) @rm -f aevol_misc_gene_families$(EXEEXT) $(CXXLINK) $(aevol_misc_gene_families_OBJECTS) $(aevol_misc_gene_families_LDADD) $(LIBS) aevol_misc_lineage$(EXEEXT): $(aevol_misc_lineage_OBJECTS) $(aevol_misc_lineage_DEPENDENCIES) $(EXTRA_aevol_misc_lineage_DEPENDENCIES) @rm -f aevol_misc_lineage$(EXEEXT) $(CXXLINK) $(aevol_misc_lineage_OBJECTS) $(aevol_misc_lineage_LDADD) $(LIBS) aevol_misc_robustness$(EXEEXT): $(aevol_misc_robustness_OBJECTS) $(aevol_misc_robustness_DEPENDENCIES) $(EXTRA_aevol_misc_robustness_DEPENDENCIES) @rm -f aevol_misc_robustness$(EXEEXT) $(CXXLINK) $(aevol_misc_robustness_OBJECTS) $(aevol_misc_robustness_LDADD) $(LIBS) aevol_misc_template$(EXEEXT): $(aevol_misc_template_OBJECTS) $(aevol_misc_template_DEPENDENCIES) $(EXTRA_aevol_misc_template_DEPENDENCIES) @rm -f aevol_misc_template$(EXEEXT) $(CXXLINK) $(aevol_misc_template_OBJECTS) $(aevol_misc_template_LDADD) $(LIBS) aevol_misc_view_generation$(EXEEXT): $(aevol_misc_view_generation_OBJECTS) $(aevol_misc_view_generation_DEPENDENCIES) $(EXTRA_aevol_misc_view_generation_DEPENDENCIES) @rm -f aevol_misc_view_generation$(EXEEXT) $(CXXLINK) $(aevol_misc_view_generation_OBJECTS) $(aevol_misc_view_generation_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ancstats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compute_pop_stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/create_eps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extract.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fixed_mutations.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gene_families.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lineage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/population_statistics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/robustness.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/template.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/view_generation.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/src/post_treatments/gene_families.cpp0000644000175000017500000007430712363412534016743 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include // for the permission symbols used with mkdir // ================================================================= // Project Files // ================================================================= #include #ifndef __NO_X #include #else #include #endif #include #include #include #include #include #include #include #include #include // TODO : predire la position de tous les genes apres la mutation // puis verifier dans la liste des genes de l'indiv apres evaluation // s'il y a bien toujours un gene a cet endroit // TODO : transfers // TODO : in gene tree file, print gene sequence, final position, list of proteins and M, W, H enum check_type { FULL_CHECK = 0, LIGHT_CHECK = 1, ENV_CHECK = 2, NO_CHECK = 3 }; // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); void update_pointers_in_trees(ae_list * gene_trees, ae_genetic_unit * unit); void anticipate_mutation_effect_on_genes_in_trees(ae_list * gene_trees, ae_mutation * mut, int32_t unitlen_before); void register_actual_mutation_effect_on_genes_in_trees(ae_list * gene_trees, ae_mutation * mut, ae_genetic_unit * unit, int32_t gener, double impact_on_metabolic_error); void search_protein_in_gene_trees(ae_list * gene_trees, ae_protein * prot, ae_gene_tree ** resultTree, ae_gene_tree_node ** resultNode); void set_end_gener_if_active_leaves_in_trees(ae_list * gene_trees, int32_t gener); void write_gene_trees_to_files(ae_list * gene_trees, int32_t end_gener); void print_gene_trees_to_screen(ae_list * gene_trees); // For debug purposes int main(int argc, char** argv) { // The input file (lineage.ae or lineage.rae) must contain the following information: // // - common data (ae_common::write_to_backup) // - begin gener (int32_t) // - end gener (int32_t) // - final individual index (int32_t) // - initial genome size (int32_t) // - initial ancestor (nb genetic units + sequences) (ae_individual::write_to_backup) // - replication report of ancestor at generation begin_gener+1 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+2 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+3 (ae_replic_report::write_to_backup) // - ... // - replication report of ancestor at generation end_gener (ae_replic_report::write_to_backup) // ===================== // Parse command line // ===================== // Default values check_type check = LIGHT_CHECK; char* lineage_file_name = NULL; bool verbose = false; double tolerance = 0; const char * short_options = "hVvncf:t:"; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V' }, {"verbose", no_argument, NULL, 'v'}, {"nocheck", no_argument, NULL, 'n'}, {"fullcheck", no_argument, NULL, 'c'}, {"file", required_argument, NULL, 'f'}, {"tolerance", required_argument, NULL, 't'}, {0, 0, 0, 0} }; int option; while( (option = getopt_long(argc, argv, short_options, long_options, NULL)) != -1 ) { switch( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'v' : verbose = true; break; case 'n' : check = NO_CHECK; break; case 'c' : check = FULL_CHECK; break; case 'f' : { if ( strcmp( optarg, "" ) == 0 ) { fprintf( stderr, "ERROR : Option -f or --file : missing argument.\n" ); exit( EXIT_FAILURE ); } lineage_file_name = new char[strlen(optarg) + 1]; sprintf( lineage_file_name, "%s", optarg ); break; } case 't' : { if ( strcmp( optarg, "" ) == 0 ) { fprintf( stderr, "ERROR : Option -t or --tolerance : missing argument.\n" ); exit( EXIT_FAILURE ); } check = ENV_CHECK; tolerance = atof(optarg); break; } default : { fprintf( stderr, "ERROR : Unknown option, check your syntax.\n" ); print_help(argv[0]); exit( EXIT_FAILURE ); } } } if ( lineage_file_name == NULL ) { fprintf( stderr, "ERROR : Option -f or --file missing. \n" ); exit( EXIT_FAILURE ); } printf("\n"); printf( "WARNING : Parameter change during simulation is not managed in general.\n" ); printf( " Only changes in environmental target done with aevol_modify are handled.\n" ); printf("\n"); // ======================= // Open the lineage file // ======================= gzFile lineage_file = gzopen( lineage_file_name, "r" ); if (lineage_file == Z_NULL) { fprintf( stderr, "ERROR : Could not read the lineage file %s\n", lineage_file_name ); exit( EXIT_FAILURE ); } int32_t begin_gener, end_gener, final_index, num_gener, final_indiv_rank; gzread(lineage_file, &begin_gener, sizeof(begin_gener)); gzread(lineage_file, &end_gener, sizeof(end_gener)); gzread(lineage_file, &final_index, sizeof(final_index) ); gzread(lineage_file, &final_indiv_rank, sizeof(final_indiv_rank) ); if ( verbose ) { printf("\n\n"); printf("================================================================================\n"); printf(" Gene families of the ancestors of indiv. #%"PRId32" (t=%"PRId32" to %"PRId32")\n", final_index, begin_gener, end_gener); printf("================================================================================\n"); } // ========================= // Open the experience manager // ========================= #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( begin_gener, false, true, false ); ae_environment* env = new ae_environment( *(exp_manager->get_env()) ); // independent copy int32_t backup_step = exp_manager->get_backup_step(); // ============================== // Prepare the initial ancestor // ============================== ae_individual * indiv = new ae_individual(exp_manager, lineage_file ); indiv->evaluate( env ); indiv->compute_statistical_data(); if ( verbose ) { printf("Initial fitness = %e\n", indiv->get_fitness()); printf("Initial genome size = %"PRId32"\n", indiv->get_total_genome_size()); } // =========================================================================== // Prepare the initial gene trees (one for each coding RNA in the ancestor) // =========================================================================== // Each initial gene in this ancestral genome will be the root of a gene tree, // where the paralogs (gene copies created by duplication) will be monitored ae_list * gene_trees = new ae_list(); ae_list_node* unitnode = NULL; ae_genetic_unit * unit = NULL; ae_list_node *prot_node = NULL; ae_protein *prot = NULL; unitnode = indiv->get_genetic_unit_list()->get_first(); while (unitnode != NULL) { unit = unitnode->get_obj(); prot_node = (unit->get_protein_list()[LEADING])->get_first(); while(prot_node != NULL) { prot = prot_node->get_obj(); gene_trees->add(new ae_gene_tree(begin_gener, prot)); prot_node = prot_node->get_next(); } prot_node = (unit->get_protein_list()[LAGGING])->get_first(); while(prot_node != NULL) { prot = prot_node->get_obj(); gene_trees->add(new ae_gene_tree(begin_gener, prot)); prot_node = prot_node->get_next(); } unitnode = unitnode->get_next(); } // =============================================================================== // Replay the mutation to get the successive ancestors and analyze them // (and, optionally, check that the rebuilt envir and genome are correct each // time a backup is available) // =============================================================================== ae_replication_report* rep = NULL; ae_list_node* dnarepnode = NULL; ae_dna_replic_report* dnarep = NULL; ae_list_node* mnode = NULL; ae_mutation* mut = NULL; unitnode = NULL; unit = NULL; ae_individual* stored_indiv = NULL; ae_list_node* stored_unit_node = NULL; ae_genetic_unit* stored_unit = NULL; int32_t i, index, genetic_unit_number, unitlen_before; double metabolic_error_before, metabolic_error_after, impact_on_metabolic_error; ae_gene_tree * genetree = NULL; ae_gene_tree_node * genetreenode = NULL; ae_exp_manager* exp_manager_backup = NULL; ae_environment* backup_env = NULL; bool check_now = false; for ( i = 0; i < end_gener - begin_gener; i++ ) { num_gener = begin_gener + i + 1; // where are we in time... env->build(); rep = new ae_replication_report( lineage_file, indiv ); index = rep->get_id(); // who are we building... indiv->set_replication_report(rep); // Check now? check_now = ( ( check == FULL_CHECK && ae_utils::mod( num_gener, backup_step ) == 0 ) || ( check == ENV_CHECK && ae_utils::mod( num_gener, backup_step ) == 0 ) || ( check == LIGHT_CHECK && num_gener == end_gener ) ); if ( verbose ) printf("Rebuilding ancestor at generation %"PRId32" (index %"PRId32")...", num_gener, index); env->build(); env->apply_variation(); indiv->reevaluate(env); // Check, and possibly update, the environment according to the backup files (update necessary if the env. was modified by aevol_modify at some point) if (ae_utils::mod( num_gener, backup_step ) == 0) { char env_file_name[255]; sprintf( env_file_name, "./"ENV_FNAME_FORMAT, num_gener ); gzFile env_file = gzopen( env_file_name, "r" ); backup_env = new ae_environment(); backup_env->load( env_file ); if ( ! env->is_identical_to(backup_env, tolerance) ) { printf("Warning: At t=%"PRId32", the replayed environment is not the same\n", num_gener); printf(" as the one saved at generation %"PRId32"... \n", num_gener ); printf(" with tolerance of %lg\n", tolerance); printf("Replacing the replayed environment by the one stored in the backup.\n"); delete env; env = new ae_environment(*backup_env); } delete backup_env; } // Warning: this portion of code won't work if the number of units changes // during the evolution, or if some translocations occurred between different genetic units genetic_unit_number = 0; dnarepnode = (rep->get_dna_replic_reports())->get_first(); unitnode = (indiv->get_genetic_unit_list())->get_first(); if ( check_now ) { #ifndef __NO_X exp_manager_backup = new ae_exp_manager_X11(); #else exp_manager_backup = new ae_exp_manager(); #endif exp_manager_backup->load( num_gener, false, true, false ); stored_indiv = new ae_individual( * (ae_individual *)exp_manager_backup->get_indiv_by_id( index ), false ); stored_unit_node = stored_indiv->get_genetic_unit_list()->get_first(); } while ( dnarepnode != NULL ) { assert( unitnode != NULL ); dnarep = dnarepnode->get_obj(); unit = unitnode->get_obj(); unit->get_dna()->set_replic_report( dnarep ); update_pointers_in_trees(gene_trees, unit); // because of the reevaluate at each new generation (envir. variation possible) // *************************************** // Transfer events // *************************************** // TO DO /* mnode = dnarep->get_HT()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); metabolic_error_before = indiv->get_dist_to_target_by_feature( METABOLISM ); unitlen_before = unit->get_dna()->get_length(); unit->compute_nb_of_affected_genes(mut, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment); unit->get_dna()->undergo_this_mutation( mut ); indiv->reevaluate(env); metabolic_error_after = indiv->get_dist_to_target_by_feature( METABOLISM ); impact_on_metabolic_error = metabolic_error_after - metabolic_error_before; mut->get_generic_description_string( mut_descr_string ); fprintf( output, "%"PRId32" %"PRId32" %s %"PRId32" %.15f %"PRId32" %"PRId32" %"PRId32" \n",\ num_gener, genetic_unit_number, \ mut_descr_string, unitlen_before, \ impact_on_metabolic_error, nb_genes_at_breakpoints, nb_genes_in_segment, nb_genes_in_replaced_segment ); mnode = mnode->get_next(); } */ // *************************************** // Rearrangement events // *************************************** mnode = dnarep->get_rearrangements()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); metabolic_error_before = indiv->get_dist_to_target_by_feature( METABOLISM ); unitlen_before = unit->get_dna()->get_length(); anticipate_mutation_effect_on_genes_in_trees(gene_trees, mut, unitlen_before); unit->get_dna()->undergo_this_mutation( mut ); indiv->reevaluate(env); metabolic_error_after = indiv->get_dist_to_target_by_feature( METABOLISM ); impact_on_metabolic_error = metabolic_error_after - metabolic_error_before; register_actual_mutation_effect_on_genes_in_trees(gene_trees, mut, unit, num_gener, impact_on_metabolic_error); /* New genes that have been created "from scratch", i.e. not by duplication => new gene tree */ prot_node = (unit->get_protein_list()[LEADING])->get_first(); while (prot_node != NULL) { prot = prot_node->get_obj(); search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode); if (genetreenode == NULL) { gene_trees->add(new ae_gene_tree(num_gener, prot, mut)); } prot_node = prot_node->get_next(); } prot_node = (unit->get_protein_list()[LAGGING])->get_first(); while (prot_node != NULL) { prot = prot_node->get_obj(); search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode); if (genetreenode == NULL) { gene_trees->add(new ae_gene_tree(num_gener, prot, mut)); } prot_node = prot_node->get_next(); } // print_gene_trees_to_screen(gene_trees);// DEBUG // indiv->print_protein_list(); // DEBUG mnode = mnode->get_next(); } // *************************************** // Local events (point mutations & small indels) // *************************************** mnode = dnarep->get_mutations()->get_first(); while ( mnode != NULL ) { mut = (ae_mutation *) mnode->get_obj(); metabolic_error_before = indiv->get_dist_to_target_by_feature( METABOLISM ); unitlen_before = unit->get_dna()->get_length(); anticipate_mutation_effect_on_genes_in_trees(gene_trees, mut, unitlen_before); unit->get_dna()->undergo_this_mutation( mut ); indiv->reevaluate(env); metabolic_error_after = indiv->get_dist_to_target_by_feature( METABOLISM ); impact_on_metabolic_error = metabolic_error_after - metabolic_error_before; register_actual_mutation_effect_on_genes_in_trees(gene_trees, mut, unit, num_gener, impact_on_metabolic_error); /* New genes that have been created "from scratch", i.e. not by duplication => new gene tree */ prot_node = (unit->get_protein_list()[LEADING])->get_first(); while (prot_node != NULL) { prot = prot_node->get_obj(); search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode); if (genetreenode == NULL) { gene_trees->add(new ae_gene_tree(num_gener, prot, mut)); } prot_node = prot_node->get_next(); } prot_node = (unit->get_protein_list()[LAGGING])->get_first(); while (prot_node != NULL) { prot = prot_node->get_obj(); search_protein_in_gene_trees(gene_trees, prot, &genetree, &genetreenode); if (genetreenode == NULL) { gene_trees->add(new ae_gene_tree(num_gener, prot, mut)); } prot_node = prot_node->get_next(); } // print_gene_trees_to_screen(gene_trees);// DEBUG // indiv->print_protein_list(); // DEBUG mnode = mnode->get_next(); } if ( check_now && ae_utils::mod(num_gener, backup_step) == 0) { if ( verbose ) { printf("Checking the sequence of the unit..."); fflush(NULL); } assert( stored_unit_node != NULL ); stored_unit = (ae_genetic_unit *) stored_unit_node->get_obj(); char * str1 = new char[unit->get_dna()->get_length() + 1]; memcpy(str1, unit->get_dna()->get_data(), \ unit->get_dna()->get_length()*sizeof(char)); str1[unit->get_dna()->get_length()] = '\0'; char * str2 = new char[(stored_unit->get_dna())->get_length() + 1]; memcpy(str2, (stored_unit->get_dna())->get_data(), (stored_unit->get_dna())->get_length()*sizeof(char)); str2[(stored_unit->get_dna())->get_length()] = '\0'; if(strncmp(str1,str2, (stored_unit->get_dna())->get_length())==0) { if ( verbose ) printf(" OK\n"); } else { if ( verbose ) printf( " ERROR !\n" ); fprintf( stderr, "Error: the rebuilt unit is not the same as \n"); fprintf( stderr, "the one saved at generation %"PRId32"... ", begin_gener ); fprintf( stderr, "Rebuilt unit : %zu bp\n %s\n", strlen(str1), str1 ); fprintf( stderr, "Stored unit : %zu bp\n %s\n", strlen(str2), str2 ); delete [] str1; delete [] str2; gzclose(lineage_file); delete indiv; delete stored_indiv; delete exp_manager_backup; delete exp_manager; exit(EXIT_FAILURE); } delete [] str1; delete [] str2; stored_unit_node = stored_unit_node->get_next(); } dnarepnode = dnarepnode->get_next(); unitnode = unitnode->get_next(); genetic_unit_number ++; } assert( unitnode == NULL ); if ( verbose ) printf(" OK\n"); delete rep; if ( check_now && ae_utils::mod(num_gener, backup_step) == 0 ) { assert(stored_unit_node == NULL); delete stored_indiv; delete exp_manager_backup; } } set_end_gener_if_active_leaves_in_trees(gene_trees, end_gener); write_gene_trees_to_files(gene_trees, end_gener); gene_trees->erase(true); delete gene_trees; gzclose(lineage_file); delete exp_manager; delete indiv; delete env; exit(EXIT_SUCCESS); } void search_protein_in_gene_trees(ae_list * gene_trees, ae_protein * prot, ae_gene_tree ** resultTree, ae_gene_tree_node ** resultNode) { fflush(stdout); ae_list_node * n = gene_trees->get_first(); ae_gene_tree * tree = NULL; ae_gene_tree_node * result = NULL; int32_t tree_number = 0; while ((n!= NULL) && (result==NULL)) { tree = n->get_obj(); result = tree->search_in_leaves(prot); n = n->get_next(); tree_number++; } if(result != NULL) { *resultTree = tree; *resultNode = result; } else { *resultTree = NULL; *resultNode = NULL; } } void update_pointers_in_trees(ae_list * gene_trees, ae_genetic_unit * unit) { ae_list_node * n = gene_trees->get_first(); ae_gene_tree * tree = NULL; while (n!= NULL) { tree = n->get_obj(); tree->update_pointers_in_tree_leaves(unit); n = n->get_next(); } } void anticipate_mutation_effect_on_genes_in_trees(ae_list * gene_trees, ae_mutation * mut, int32_t unitlen_before) { ae_list_node * n = gene_trees->get_first(); ae_gene_tree * tree = NULL; while (n!= NULL) { tree = n->get_obj(); tree->anticipate_mutation_effect_on_genes_in_tree_leaves(mut, unitlen_before); n = n->get_next(); } } void register_actual_mutation_effect_on_genes_in_trees(ae_list * gene_trees, ae_mutation * mut, ae_genetic_unit * unit, int32_t gener, double impact_on_metabolic_error) { ae_list_node * n = gene_trees->get_first(); ae_gene_tree * tree = NULL; while (n!= NULL) { tree = n->get_obj(); tree->register_actual_mutation_effect_on_genes_in_tree_leaves(mut, unit, gener, impact_on_metabolic_error); n = n->get_next(); } } void set_end_gener_if_active_leaves_in_trees(ae_list * gene_trees, int32_t gener) { ae_list_node * n = gene_trees->get_first(); ae_gene_tree * tree = NULL; while (n!= NULL) { tree = n->get_obj(); tree->set_end_gener_if_active_leaves(gener); n = n->get_next(); } } void print_gene_trees_to_screen(ae_list * gene_trees) { ae_list_node * n = gene_trees->get_first(); ae_gene_tree* tree = NULL; int32_t tree_number = 0; while (n!= NULL) { tree = n->get_obj(); printf("Content of tree %d :\n", tree_number); tree->print_to_screen(); n = n->get_next(); tree_number++; } } void write_gene_trees_to_files(ae_list * gene_trees, int32_t end_gener) { // Prepare the directory for the outputs files related to the gene trees char directory_name[] = "gene_trees"; // Check whether the directory already exists and is writable if ( access( directory_name, F_OK ) == 0 ) { // struct stat status; // stat( directory_name, &status ); // if ( status.st_mode & S_IFDIR ) cout << "The directory exists." << endl; // else cout << "This path is a file." << endl; if ( access( directory_name, X_OK | W_OK) != 0 ) { fprintf(stderr, "Error: cannot enter or write in directory %s.\n", directory_name); exit( EXIT_FAILURE ); } } else { // Create the directory with permissions : rwx r-x r-x if ( mkdir( directory_name, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0 ) { fprintf(stderr, "Error: cannot create directory %s.\n", directory_name); exit( EXIT_FAILURE ); } } FILE * tree_statistics_file = fopen("gene_trees/gene_tree_statistics.txt", "w"); if (tree_statistics_file == NULL) { fprintf(stderr, "Error: cannot create file gene_trees/gene_tree_statistics.txt.\n"); exit(EXIT_FAILURE); } fprintf(tree_statistics_file, "treeID creationType beginGener endGener nbNodes nbInternalNodes nbLeaves nbActiveLeaves\n"); FILE * nodeattr_tabular_file = fopen("gene_trees/nodeattr_tabular.txt", "w"); if (nodeattr_tabular_file == NULL) { fprintf(stderr, "Error: cannot create file gene_trees/nodeattr_tabular.txt.\n"); exit(EXIT_FAILURE); } fprintf(nodeattr_tabular_file, "treeID nodeID parentID leftchildID rightchildID nodeCreationDate dnaCreationDate nodeStatus geneLossOrDupDate strand shineDalPos nbProm meanTriangle widthTriangle heightTriangle concentration nbMutTot nbLocalmutUpstreamNeutral nbLocalmutUpstreamBenef nbLocalmutUpstreamDelet nbLocalmutCdsNeutral nbLocalmutCdsBenef nbLocalmutCdsDelet nbRearUpstreamNeutral nbRearUpstreamBenef nbRearUpstreamDelet nbRearCdsNeutral nbRearCdsBenef nbRearCdsDelet\n"); char topol_file_name[128]; char node_attr_file_name[128]; ae_list_node * n = gene_trees->get_first(); ae_gene_tree * tree = NULL; int32_t tree_number = 0; while (n!= NULL) { tree = n->get_obj(); fprintf(tree_statistics_file, "%"PRId32" ", tree_number); if (tree->get_creation_type() == INITIALIZATION) fprintf(tree_statistics_file, "INITIALIZATION "); else if (tree->get_creation_type() == LOCAL_MUTATION) fprintf(tree_statistics_file, "LOCAL_MUTATION "); else if (tree->get_creation_type() == REARRANGEMENT) fprintf(tree_statistics_file, "REARRANGEMENT "); else fprintf(tree_statistics_file, "TRANSFER "); fprintf(tree_statistics_file, "%"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32" %"PRId32"\n", tree->get_begin_gener(), tree->get_end_gener(), tree->get_total_nb_nodes(), tree->get_nb_internal_nodes(), tree->get_nb_leaves(), tree->get_nb_active_leaves()); sprintf(topol_file_name, "gene_trees/genetree%06"PRId32"-topology.tre", tree_number); sprintf(node_attr_file_name, "gene_trees/genetree%06"PRId32"-nodeattr.txt", tree_number); tree->write_to_files(topol_file_name, node_attr_file_name, end_gener); tree->write_nodes_in_tabular_file(tree_number, nodeattr_tabular_file); n = n->get_next(); tree_number ++; } fclose(tree_statistics_file); fclose(nodeattr_tabular_file); } /*! \brief */ void print_help(char* prog_path) { printf( "\n" ); printf( "*********************** aevol - Artificial Evolution ******************* \n" ); printf( "* * \n" ); printf( "* Gene families post-treatment program * \n" ); printf( "* * \n" ); printf( "************************************************************************ \n" ); printf( "\n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "Copyright (C) 2009 LIRIS.\n" ); printf( "\n" ); #ifdef __REGUL printf( "Usage : rgene_families -h\n"); printf( "or : rgene_families [-vn] -f lineage_file \n" ); #else printf( "Usage : gene_families -h\n"); printf( "or : gene_families [-vn] -f lineage_file \n" ); #endif printf( "\n" ); printf( "This program traces the evolution of gene families on a lineage.\n" ); printf( "of lineage_file\n" ); printf( "\n" ); printf( "WARNING: This program should not be used for simulations run with several genetic units\n" ); printf( "(eg chromosome + plasmids). It works only for simulations with only a single chromosome.\n" ); printf( "\n" ); printf( "\t-h or --help : Display this help.\n" ); printf( "\n" ); printf( "\t-v or --verbose : Be verbose, listing generations as they are \n" ); printf( "\t treated.\n" ); printf( "\n" ); printf( "\t-n or --nocheck : Disable genome sequence checking. Makes the \n"); printf( "\t program faster, but it is not recommended. \n"); printf( "\t It is better to let the program check that \n"); printf( "\t when we rebuild the genomes of the ancestors\n"); printf( "\t from the lineage file, we get the same sequences\n"); printf( "\t as those stored in the backup files.\n" ); printf( "\n" ); printf( "\t-c or --fullcheck : Will perform the genome and environment checks every\n" ); printf( "\t generations. Default behaviour is\n" ); printf( "\t lighter as it only perform sthese checks at the\n" ); printf( "\t ending generation.\n" ); printf( "\n" ); printf( "\t-f lineage_file or --file lineage_file : \n" ); printf( "\t Compute the fixed mutations of the individuals within lineage_file.\n" ); printf( "\n" ); printf( "\t-t tolerance or --tolerance tolerance : \n"); printf( "\t Tolerance used to compare the replayed environment to environment in backup\n"); printf( "\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/lineage.cpp0000644000175000017500000006167512362005303015553 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #ifndef __NO_X #include #else #include #endif #include #include #include #include #include #include #include //#include enum check_type { FULL_CHECK = 0, LIGHT_CHECK = 1, NO_CHECK = 2 }; // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); int main(int argc, char** argv) { // The output file (lineage.ae or lineage.rae) contains the following information: // // - common data (ae_common::write_to_backup) // - begin gener (int32_t) // - end gener (int32_t) // - final individual index (int32_t) // - initial genome size (int32_t) // - initial ancestor (nb genetic units + sequences) (ae_individual::write_to_backup) // - replication report of ancestor at generation begin_gener+1 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+2 (ae_replic_report::write_to_backup) // - replication report of ancestor at generation begin_gener+3 (ae_replic_report::write_to_backup) // - ... // - replication report of ancestor at generation end_gener (ae_replic_report::write_to_backup) printf("\n WARNING : Parameters' change in the middle of a simulation is not managed.\n"); // ===================== // Parse command line // ===================== // Default values check_type check_genome = LIGHT_CHECK; bool verbose = false; int32_t begin_gener = 0; int32_t end_gener = -1; int32_t final_indiv_index = -1; int32_t final_indiv_rank = -1; char tree_file_name[50]; const char * short_options = "hVvncb:i:r:e:"; static struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, {"verbose", no_argument, NULL, 'v'}, {"nocheck", no_argument, NULL, 'n'}, {"fullcheck", no_argument, NULL, 'c'}, {"begin", required_argument, NULL, 'b'}, {"index", required_argument, NULL, 'i'}, {"rank", required_argument, NULL, 'r'}, {"end", required_argument, NULL, 'e' }, {0, 0, 0, 0} }; int option; while( (option = getopt_long(argc, argv, short_options, long_options, NULL)) != -1 ) { switch( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'v' : verbose = true; break; case 'n' : check_genome = NO_CHECK; break; case 'c' : check_genome = FULL_CHECK; break; case 'b' : begin_gener = atol(optarg); break; case 'i' : final_indiv_index = atol(optarg); break; case 'r' : final_indiv_rank = atol(optarg); break; case 'e' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -e or --end : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } end_gener = atol( optarg ); break; } } } if ( end_gener == -1 ) { printf( "%s: error: You must provide a generation number.\n", argv[0] ); exit( EXIT_FAILURE ); } // Load the simulation #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( end_gener, false, true, false ); if ( exp_manager->get_tree_mode() == LIGHT ) { printf( "%s: error: The light tree mode is not managed", argv[0] ); exit( EXIT_FAILURE ); } int32_t tree_step = exp_manager->get_tree_step(); //delete exp_manager; // The tree ae_tree * tree = NULL; // Indices, ranks and replication reports of the individuals in the lineage int32_t * indices = new int32_t[end_gener - begin_gener + 1]; //~ int32_t * ranks = new int32_t[end_gener - begin_gener + 1]; ae_replication_report ** reports = new ae_replication_report*[end_gener - begin_gener]; // NB: we do not need the report of the ancestor at generation begin_gener // (it might be the generation 0, for which we have no reports) // reports[0] = how ancestor at generation begin_gener + 1 was created // reports[i] = how ancestor at generation begin_gener + i + 1 was created // reports[end_gener - begin_gener - 1] = how the final individual was created // // ----------------------------------------------------------------------------------------- // reports | gener_0 => gener_1 | gener_1 => gener_2 | ... | gener_n-1 => gener_n | //////////////// | // ----------------------------------------------------------------------------------------- // indices | index at gener_0 | index at gener_1 | ... | index at gener_n-1 | index at gener_n | // ----------------------------------------------------------------------------------------- // ========================= // Load the last tree file // ========================= if ( verbose ) { printf( "\n\n" ); printf( "====================================\n" ); printf( " Loading the last tree file ... " ); fflush( stdout ); } // Example for ae_common::rec_params->get_tree_step() == 100 : // // tree_000100.ae ==> generations 1 to 100. // tree_000200.ae ==> generations 101 to 200. // tree_000300.ae ==> generations 201 to 300. // etc. // // Thus, the information for generation end_gener are located // in the file called (end_gener/ae_common::rec_params->get_tree_step() + 1) * ae_common::rec_params->get_tree_step(), // except if end_gener%ae_common::rec_params->get_tree_step()==0. #ifdef __REGUL sprintf( tree_file_name,"tree/tree_%06"PRId32".rae", end_gener ); #else sprintf( tree_file_name,"tree/tree_%06"PRId32".ae", end_gener ); #endif char pop_file_name[255]; sprintf( pop_file_name, POP_FNAME_FORMAT, end_gener ); tree = new ae_tree( exp_manager, tree_file_name ); if ( verbose ) { printf("OK\n"); printf("====================================\n"); } // ============================================================================ // Find the index of the final individual and retreive its replication report // ============================================================================ if ( final_indiv_index != -1 ) { // The index was directly provided, get the replication report and update the indices and ranks tables reports[end_gener - begin_gener - 1] = new ae_replication_report( *(tree->get_report_by_index(end_gener, final_indiv_index)) ); final_indiv_rank = reports[end_gener - begin_gener - 1]->get_rank(); indices[end_gener - begin_gener] = final_indiv_index; //~ ranks[end_gener - begin_gener] = final_indiv_rank; } else { if ( final_indiv_rank == -1 ) { // No index nor rank was given in the command line. // By default, we construct the lineage of the best individual, the rank of which // is simply the number of individuals in the population. final_indiv_rank = tree->get_nb_indivs( end_gener ); } reports[end_gener - begin_gener - 1] = new ae_replication_report( *(tree->get_report_by_rank(end_gener, final_indiv_rank)) ); final_indiv_index = reports[end_gener - begin_gener - 1]->get_id(); indices[end_gener - begin_gener] = final_indiv_index; //~ ranks[end_gener - begin_gener] = final_indiv_rank; } if ( verbose ) printf( "The final individual has the index %"PRId32" (rank %"PRId32")\n", final_indiv_index, final_indiv_rank ); // ======================= // Open the output file // ======================= char output_file_name[101]; #ifdef __REGUL snprintf( output_file_name, 100, "lineage-b%06"PRId32"-e%06"PRId32"-i%"PRId32"-r%"PRId32".rae", begin_gener, end_gener, final_indiv_index, final_indiv_rank); #else snprintf( output_file_name, 100, "lineage-b%06"PRId32"-e%06"PRId32"-i%"PRId32"-r%"PRId32".ae", begin_gener, end_gener, final_indiv_index, final_indiv_rank); #endif gzFile lineage_file = gzopen(output_file_name, "w"); if ( lineage_file == NULL ) { fprintf(stderr, "File %s could not be created, exiting.\n", output_file_name); fprintf(stderr, "Please check your permissions in this directory.\n"); exit(EXIT_FAILURE); } // =================================================== // Retrieve the replication reports of the ancestors // =================================================== if ( verbose ) { printf("\n\n\n"); printf("======================================================================\n"); printf(" Parsing tree files to retrieve the ancestors' replication reports... \n"); printf("======================================================================\n"); } // Retreive the index of the first ancestor from the last replicatino report indices[end_gener - begin_gener -1] = reports[end_gener - begin_gener -1]->get_parent_id(); int32_t i, num_gener; for ( i = end_gener - begin_gener - 2 ; i >= 0 ; i-- ) { // We want to fill reports[i], that is to say, how the ancestor // at generation begin_gener + i + 1 was created num_gener = begin_gener + i + 1; if ( verbose ) printf( "Getting the replication report for the ancestor at generation %"PRId32"\n", num_gener ); if ( ae_utils::mod( num_gener, tree_step ) == 0 ) { // Change the tree file delete tree; #ifdef __REGUL sprintf( tree_file_name,"tree/tree_%06"PRId32".rae", num_gener ); #else sprintf( tree_file_name,"tree/tree_%06"PRId32".ae", num_gener ); #endif sprintf( pop_file_name, POP_FNAME_FORMAT, num_gener ); tree = new ae_tree( exp_manager, tree_file_name ); } // Copy the replication report of the ancestor reports[i] = new ae_replication_report( *(tree->get_report_by_index(num_gener, indices[i + 1])) ); // Retreive the index and rank of the next ancestor from the report indices[i] = reports[i]->get_parent_id(); } delete exp_manager; if ( verbose ) printf("OK\n"); // ============================================================================= // Get the intial genome from the backup file, and write it in the output file // ============================================================================= if ( verbose ) { printf("\n\n\n"); printf("=============================================== \n"); printf(" Getting the initial genome sequence... "); fflush(NULL); } // Load the simulation #ifndef __NO_X exp_manager = new ae_exp_manager_X11(); #else exp_manager = new ae_exp_manager(); #endif exp_manager->load( begin_gener, false, true, false ); // Copy the initial ancestor // NB : The list of individuals is sorted according to the index ae_individual * initial_ancestor_tmp = exp_manager->get_indiv_by_id( indices[0] ); ae_individual * initial_ancestor = new ae_individual( *initial_ancestor_tmp, false ); gzwrite( lineage_file, &begin_gener, sizeof(begin_gener) ); gzwrite( lineage_file, &end_gener, sizeof(end_gener) ); gzwrite( lineage_file, &final_indiv_index, sizeof(final_indiv_index) ); gzwrite( lineage_file, &final_indiv_rank, sizeof(final_indiv_rank) ); initial_ancestor->save( lineage_file ); if ( verbose ) { printf("OK\n"); printf("=============================================== \n"); } // =============================================================================== // Write the replication reports of the successive ancestors in the output file // (and, optionally, check that the rebuilt genome is correct each time a backup // is available) // =============================================================================== if ( verbose ) { printf("\n\n\n"); printf("============================================================ \n"); printf(" Write the replication reports in the output file... \n"); printf("============================================================ \n"); } ae_list_node* report_node = NULL; ae_list_node* mut_node = NULL; ae_list_node* gen_unit_node = NULL; ae_dna_replic_report* rep = NULL; ae_mutation* mut = NULL; ae_genetic_unit* unit = NULL; ae_individual* stored_indiv = NULL; ae_list_node* stored_gen_unit_node = NULL; ae_genetic_unit* stored_gen_unit = NULL; ae_exp_manager* exp_manager_backup = NULL; // NB: I must keep the genome encapsulated inside an ae_individual, because // replaying the mutations has side effects on the list of promoters, // which is stored in the individual bool check_genome_now = false; for ( i = 0 ; i < end_gener - begin_gener ; i++ ) { // Where are we in time... num_gener = begin_gener + i + 1; // Do we need to check the genome now? check_genome_now = ( ( check_genome == FULL_CHECK && ae_utils::mod( num_gener, tree_step ) == 0 ) || ( check_genome == LIGHT_CHECK && num_gener == end_gener ) ); // Write the replication report of the ancestor for current generation if ( verbose ) { printf( "Writing the replication report for generation %"PRId32" (built from indiv %"PRId32" at generation %"PRId32")\n", num_gener, indices[i], num_gener-1 ); } reports[i]->write_to_tree_file( lineage_file ); if ( verbose ) printf( " OK\n" ); if ( check_genome_now ) { // Load the simulation #ifndef __NO_X exp_manager_backup = new ae_exp_manager_X11(); #else exp_manager_backup = new ae_exp_manager(); #endif exp_manager_backup->load( num_gener, false, true, false ); // Copy the ancestor from the backup // NB : The list of individuals is sorted according to the index ae_individual * stored_indiv_tmp = exp_manager_backup->get_indiv_by_id( indices[i+1] ); stored_indiv = new ae_individual( *stored_indiv_tmp, false ); stored_gen_unit_node = stored_indiv->get_genetic_unit_list()->get_first(); } // Warning: this portion of code won't work if the number of units changes // during the evolution report_node = reports[i]->get_dna_replic_reports()->get_first(); gen_unit_node = initial_ancestor->get_genetic_unit_list()->get_first(); while ( report_node != NULL ) { assert( gen_unit_node != NULL ); rep = (ae_dna_replic_report *) report_node->get_obj(); unit = (ae_genetic_unit *) gen_unit_node->get_obj(); mut_node = rep->get_HT()->get_first(); while ( mut_node != NULL ) { mut = (ae_mutation *) mut_node->get_obj(); (unit->get_dna())->undergo_this_mutation( mut ); mut_node = mut_node->get_next(); } mut_node = rep->get_rearrangements()->get_first(); while ( mut_node != NULL ) { mut = (ae_mutation *) mut_node->get_obj(); (unit->get_dna())->undergo_this_mutation( mut ); mut_node = mut_node->get_next(); } mut_node = rep->get_mutations()->get_first(); while ( mut_node != NULL ) { mut = (ae_mutation *) mut_node->get_obj(); unit->get_dna()->undergo_this_mutation( mut ); mut_node = mut_node->get_next(); } if ( check_genome_now ) { if ( verbose ) { printf( "Checking the sequence of the unit..." ); fflush( stdout ); } assert( stored_gen_unit_node != NULL ); stored_gen_unit = (ae_genetic_unit *) stored_gen_unit_node->get_obj(); char * str1 = new char[unit->get_dna()->get_length() + 1]; memcpy( str1, unit->get_dna()->get_data(), unit->get_dna()->get_length() * sizeof(char) ); str1[unit->get_dna()->get_length()] = '\0'; char * str2 = new char[stored_gen_unit->get_dna()->get_length() + 1]; memcpy(str2, stored_gen_unit->get_dna()->get_data(), stored_gen_unit->get_dna()->get_length() * sizeof(char)); str2[stored_gen_unit->get_dna()->get_length()] = '\0'; if ( strncmp( str1, str2, stored_gen_unit->get_dna()->get_length() ) == 0 ) { if ( verbose ) printf( " OK\n" ); } else { if ( verbose ) printf( " ERROR !\n" ); fprintf( stderr, "Error: the rebuilt unit is not the same as \n"); fprintf( stderr, "the one stored in backup file at %"PRId32"\n", num_gener); //fprintf( stderr, "Rebuilt unit : %"PRId32" bp\n %s\n", (int32_t)strlen(str1), str1 ); //fprintf( stderr, "Stored unit : %"PRId32" bp\n %s\n", (int32_t)strlen(str2), str2 ); delete [] str1; delete [] str2; gzclose( lineage_file ); delete initial_ancestor; delete stored_indiv; delete exp_manager_backup; delete exp_manager; delete [] reports; fflush( stdout ); exit(EXIT_FAILURE); } delete [] str1; delete [] str2; stored_gen_unit_node = stored_gen_unit_node->get_next(); } report_node = report_node->get_next(); gen_unit_node = gen_unit_node->get_next(); } assert( gen_unit_node == NULL ); if ( check_genome_now ) { assert( stored_gen_unit_node == NULL ); delete stored_indiv; delete exp_manager_backup; } } gzclose(lineage_file); delete initial_ancestor; delete [] reports; delete exp_manager; exit(EXIT_SUCCESS); } /*! \brief */ void print_help(char* prog_path) { // default values : // begin_gener = 0 // indiv = best individual at generation end_gener // there must be a genome backup file for begin_gener // not relevant if crossover printf( "\n" ); printf( "*********************** aevol - Artificial Evolution ******************* \n" ); printf( "* * \n" ); printf( "* Lineage post-treatment program * \n" ); printf( "* * \n" ); printf( "************************************************************************ \n" ); printf( "\n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "Copyright (C) 2009 LIRIS.\n" ); printf( "\n" ); #ifdef __REGUL printf( "Usage : rlineage -h\n"); printf( "or : rlineage [-vn] [-i index | -r rank] [-b gener1] -e end_gener \n" ); #else printf( "Usage : lineage -h\n"); printf( "or : lineage [-vn] [-i index | -r rank] [-b gener1] -e end_gener \n" ); #endif printf( "\n" ); #ifdef __REGUL printf( "This program retrieves the ancestral lineage of an individual and writes \n" ); printf( "it in an output file called lineage.rae. Specifically, it retrieves the \n"); printf( "lineage of the individual of end_gener whose index is index, going \n" ); printf( "back in time up to gener1. This program requires at least one population backup\n" ); printf( "file (for the generation gener1), one environment backup file (for the generation gener1)\n" ); printf( "and all tree files for generations gener1 to end_gener.\n" ); #else printf( "This program retrieves the ancestral lineage of an individual and writes \n" ); printf( "it in an output file called lineage.ae. Specifically, it retrieves the \n"); printf( "lineage of the individual of end_gener whose index is index, going \n" ); printf( "back in time up to gener1. This program requires at least one population backup\n" ); printf( "file (for the generation gener1), one environment backup file (for the generation gener1)\n" ); printf( "and all tree files for generations gener1 to end_gener.\n" ); #endif printf( "\n" ); printf( "WARNING: This program should not be used for simulations run with lateral\n" ); printf( "transfer. When an individual has more than one parent, the notion of lineage\n" ); printf( "used here is not relevant.\n" ); printf( "\n" ); printf( "\t-h or --help : Display this help.\n" ); printf( "\n" ); printf( "\t-v or --verbose : Be verbose, listing generations as they are \n" ); printf( "\t treated.\n" ); printf( "\n" ); printf( "\t-n or --nocheck : Disable genome sequence checking. Makes the \n"); printf( "\t program faster, but it is not recommended. \n"); printf( "\t It is better to let the program check that \n"); printf( "\t when we rebuild the genomes of the ancestors\n"); printf( "\t from the lineage file, we get the same sequences\n"); printf( "\t as those stored in the backup files.\n" ); printf( "\n" ); printf( "\t-c or --fullcheck : Will perform the genome checks every \n" ); printf( "\t generations. Default behaviour is lighter as it\n" ); printf( "\t only performs these checks at the ending generation.\n" ); printf( "\n" ); printf( "\t-i index or --index index : \n" ); printf( "\t Retrieve the lineage of the individual whose\n" ); printf( "\t index is index. The index must be comprised \n" ); printf( "\t between 0 and N-1, with N the size of the \n" ); printf( "\t population at the ending generation. If neither\n" ); printf( "\t index nor rank are specified, the program computes \n" ); printf( "\t the lineage of the best individual of the ending \n" ); printf( "\t generation.\n"); printf( "\n" ); printf( "\t-r rank or --rank rank : \n" ); printf( "\t Retrieve the lineage of the individual whose\n" ); printf( "\t rank is rank. The rank must be comprised \n" ); printf( "\t between 1 and N, with N the size of the \n" ); printf( "\t population at the endind generation. If neither\n" ); printf( "\t index nor rank are specified, the program computes \n" ); printf( "\t the lineage of the best individual of the ending \n" ); printf( "\t generation.\n"); printf( "\n" ); printf( "\t-b gener1 or --begin gener1 : \n" ); printf( "\t Retrieve the lineage up to generation gener1.\n" ); printf( "\t There must be a genome backup file for this\n" ); printf( "\t generation. If not specified, the program \n" ); printf( "\t retrieves the lineage up to generation 0.\n"); printf( "\n" ); printf( "\t-e end_gener or --end end_gener : \n" ); printf( "\t Retrieve the lineage of the individual of end_gener \n" ); printf( "\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/population_statistics.cpp0000644000175000017500000005424212362227455020621 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include "population_statistics.h" #define STATS_DIR "stats" #define ROBUSTNESS_FILE STATS_DIR"/robustness_%06"PRId32".out" #define REPLICATION_FILE STATS_DIR"/replication_%06"PRId32".out" #define POP_STAT_FILE STATS_DIR"/global_pop_stats.out" #define POP_STAT_DIR STATS_DIR"/pop_stats/" #define POP_STATE_BASE "gen_%06"PRId32 #define POP_STATE_ROBUSTNESS_FILE POP_STAT_DIR"/robustness_%06"PRId32".out" #define POP_STATE_REPLICATION_FILE POP_STAT_DIR"/replication_%06"PRId32".out" //############################################################################## // # // Class population_statistics # // # //############################################################################## // ================================================================= // Definition of static attributes // ================================================================= // ================================================================= // Constructors // ================================================================= /*! \brief Default constructor of population_statitistics class Initialisation of default values _nb_children (number of replications to compute proportion of neutral offsrpings), _wanted_rank and _wanted_index (indications of individual of whom we want more replication information), and anaylsis type By default, the number of replications is 1,000 and the wanted individual is the best one (rank = 1) and the analysis is only one generation). */ population_statistics::population_statistics( void ) { _output_file = NULL; _replication_file = NULL; _robustness_file = NULL; _nb_children = 1000; _wanted_rank = 1; _wanted_index = -1; _f_nu_pop = NULL; _reprod_proba = NULL; _fitness = NULL; _type = ONE_GENERATION; } /*! \brief Constructor of population_statitistics class with non-default values Initialisation of _nb_children, _wanted_rank and _wanted_index and _type with the given values \param type analysis type: ONE_GENERATION or MULTIPLE_GENERATIONS \param nb_children number of replications needed to compute the proportion of neutral offsprings of each individual \param wanted_rank rank of the individual of whom we want more replication information \param wanted_index index of the individual of whom we want more replication information */ population_statistics::population_statistics( analysis_type type, int32_t nb_children, int32_t wanted_rank, int32_t wanted_index) { _nb_children = nb_children; _wanted_rank = wanted_rank; _wanted_index = wanted_index; _type = type; _f_nu_pop = NULL; _reprod_proba = NULL; _fitness = NULL; _output_file = NULL; _replication_file = NULL; _robustness_file = NULL; if (_type != ONE_GENERATION) { _output_file = fopen(POP_STAT_FILE,"w"); int status = mkdir( POP_STAT_DIR, 0755 ); if ( (status == -1) && (errno != EEXIST) ) { err( EXIT_FAILURE, POP_STAT_DIR ); } assert(_output_file!=NULL); } fflush( stderr ); } // ================================================================= // Destructors // ================================================================= /*! \brief Destructor of population_statistics class */ population_statistics::~population_statistics( void ) { if (_output_file != NULL) { fclose(_output_file); } delete [] _f_nu_pop; delete [] _reprod_proba; delete [] _fitness; } // ================================================================= // Public Methods // ================================================================= /*! \brief Compute statistics of reproduction at population level at generation num_gener Compute at generation num_gener for each individual: * Fitness * Metabolic error * Genome size * Functional gene number * Reproduction probability * Proportion of neutral offsprings * Proportion of beneficial offsprings * Proportion of deleterious offsprings * Theoretical proportion of deleterious offsprings * Fitness mean of offsprings * Fitness variance of offsprings * Genome size mean of offsprings * Genome size variance of offsprings * Functional gene number mean of offsprings; * 17. Functional gene number variance of offsprings Write this information in a file robustness_numgener.out Compute for each offspring of a choosen individual (by index or rank): * Fitness * Metabolic error * Genome size * Functional gene number * Number of coding bases * Number of transcribed but not translated bases * Number of non transcribed bases Write this information in a file replication_numgener.out Complete _f_nu_pop, _reprod_proba, _fitness with proportion of neutral offspring, reproduction probability and fitness of each individual at num_gener \param exp_manager current exp_manager \param num_gener current generation number */ void population_statistics::compute_reproduction_stats(ae_exp_manager* exp_manager, int32_t num_gener) { // ---------------------------------------- // Open output files // ---------------------------------------- char* robustness_file_name = new char[255]; char* replication_file_name = new char[255]; if (_type == ONE_GENERATION) { sprintf( robustness_file_name, ROBUSTNESS_FILE, num_gener ); sprintf( replication_file_name, REPLICATION_FILE, num_gener ); } else { sprintf( robustness_file_name, POP_STATE_ROBUSTNESS_FILE, num_gener ); sprintf( replication_file_name, POP_STATE_REPLICATION_FILE, num_gener ); } _robustness_file = fopen(robustness_file_name,"w"); _replication_file = fopen(replication_file_name,"w"); assert(_replication_file!=NULL); assert(_robustness_file!=NULL); delete [] robustness_file_name; delete [] replication_file_name; // ------------------------------------- // Write header // ------------------------------------- fprintf(_robustness_file, "# ######################################################################\n" ); fprintf(_robustness_file, "# Robustness data of individuals at generation %"PRId32"\n",num_gener ); fprintf(_robustness_file, "# ######################################################################\n" ); fprintf(_robustness_file,"# 1. Rank\n"); fprintf(_robustness_file,"# 2. Index\n"); fprintf(_robustness_file,"# 3. Fitness\n"); fprintf(_robustness_file,"# 4. Metabolic error\n"); fprintf(_robustness_file,"# 5. Genome size\n"); fprintf(_robustness_file,"# 6. Functional gene number\n"); fprintf(_robustness_file,"# 7. Reproduction probability\n"); fprintf(_robustness_file,"# 8. Proportion of neutral offsprings\n"); fprintf(_robustness_file,"# 9. Proportion of beneficial offsprings\n"); fprintf(_robustness_file,"# 10. Proportion of deleterious offsprings\n"); fprintf(_robustness_file,"# 11. Theoretical proportion of netural offsprings\n"); fprintf(_robustness_file,"# 12. Fitness mean of offsprings\n"); fprintf(_robustness_file,"# 13. Fitness variance of offsprings\n"); fprintf(_robustness_file,"# 14. Genome size mean of offsprings\n"); fprintf(_robustness_file,"# 15. Genome size variance of offsprings\n"); fprintf(_robustness_file,"# 16. Functional gene number mean of offsprings\n"); fprintf(_robustness_file,"# 17. Functional gene number variance of offsprings\n"); fprintf(_robustness_file, "# ######################################################################\n" ); fprintf(_replication_file, "# #######################################################################################################\n" ); fprintf(_replication_file,"# Offspring details of individual with rank %"PRId32" and index %"PRId32" at generation %"PRId32" \n",_wanted_rank, _wanted_index, num_gener ); fprintf(_replication_file, "# #######################################################################################################\n" ); fprintf(_replication_file,"# 1. Fitness\n"); fprintf(_replication_file,"# 2. Metabolic error\n"); fprintf(_replication_file,"# 3. Genome size\n"); fprintf(_replication_file,"# 4. Functional gene number\n"); fprintf(_replication_file,"# 5. Number of coding bases\n"); fprintf(_replication_file,"# 6. Number of transcribed but not translated bases\n"); fprintf(_replication_file,"# 7. Number of non transcribed bases\n"); fprintf(_replication_file, "# #######################################################################################################\n" ); // -------------------------------------------------------------- // Get genome(s) of interest and compute Fv // -------------------------------------------------------------- _pop_size = exp_manager->get_nb_indivs(); ae_individual* initial_indiv = NULL; ae_list_node* node = exp_manager->get_pop()->get_indivs()->get_last(); int32_t current_rank = 1; int32_t current_index = -1; double* reproduction_statistics = new double[3]; double* offsprings_statistics = new double[6]; double th_fv; if (_f_nu_pop != NULL) { delete [] _f_nu_pop;} if (_fitness != NULL) { delete [] _fitness;} if (_reprod_proba != NULL) { delete [] _reprod_proba;} _f_nu_pop = new double[_pop_size]; _fitness = new double[_pop_size]; _reprod_proba = new double [_pop_size]; exp_manager->get_exp_s()->get_sel()->compute_prob_reprod(); double* tmp_reprod = exp_manager->get_exp_s()->get_sel()->get_prob_reprod(); // simply parse through individuals and keep those that are wanted while (node != NULL) { ae_individual* tmpind = (ae_individual*) node->get_obj(); node = node->get_prev(); // ------------------------------------ // Get initial individual // ------------------------------------ #ifdef __NO_X #ifndef __REGUL initial_indiv = new ae_individual( tmpind, current_index, exp_manager->get_exp_s()->get_sel()->get_prng(), exp_manager->get_exp_s()->get_sel()->get_prng()); #else initial_indiv = new ae_individual_R( (dynamic_cast(tmpind)), current_index, exp_manager->get_exp_s()->get_sel()->get_prng(), exp_manager->get_exp_s()->get_sel()->get_prng()); #endif #elif defined __X11 #ifndef __REGUL initial_indiv = new ae_individual_X11( (dynamic_cast(tmpind)), current_index, exp_manager->get_exp_s()->get_sel()->get_prng(), exp_manager->get_exp_s()->get_sel()->get_prng() ); #else initial_indiv = new ae_individual_R_X11( (dynamic_cast(tmpind)), current_index, exp_manager->get_exp_s()->get_sel()->get_prng(), exp_manager->get_exp_s()->get_sel()->get_prng() ); #endif #endif current_index = tmpind->get_id(); current_rank = _pop_size - tmpind->get_rank() + 1; initial_indiv->evaluate(exp_manager->get_env()); _fitness[current_rank] = initial_indiv->get_fitness(); _reprod_proba[current_rank] = tmp_reprod[_pop_size-current_rank]; // ------------------------------------ // Compute Fv // ------------------------------------ th_fv = initial_indiv->compute_theoritical_f_nu(); if ( (_wanted_rank == current_rank) || (_wanted_index == current_index)) { initial_indiv->compute_experimental_f_nu( _nb_children, reproduction_statistics, offsprings_statistics, _replication_file); } else { initial_indiv->compute_experimental_f_nu( _nb_children, reproduction_statistics, offsprings_statistics); } _f_nu_pop[current_rank] = reproduction_statistics[0]; // ------------------------------------ // Write to file // ------------------------------------ fprintf( _robustness_file, "%"PRId32" %"PRId32" %le %le %"PRId32" %"PRId32" %le %le %le %le %le %le %le %le %le %le %le\n", current_rank, current_index, initial_indiv->get_fitness(),initial_indiv->get_dist_to_target_by_feature(METABOLISM ),initial_indiv->get_total_genome_size(), initial_indiv->get_nb_functional_genes(), _reprod_proba[current_rank-1], reproduction_statistics[0], reproduction_statistics[1], reproduction_statistics[2], th_fv, offsprings_statistics[0], offsprings_statistics[1], offsprings_statistics[2], offsprings_statistics[3],offsprings_statistics[4],offsprings_statistics[5]); delete initial_indiv; } //delete exp_manager; delete [] reproduction_statistics; delete [] offsprings_statistics; fclose(_replication_file); fclose(_robustness_file); } /*! \brief Compute statistics at population level at generation num_gener Compute at generation num_gener for each individual: * Variation * Population_variability * Proportion of neutral offspring of the best individual * Variability of the best individual * Size of the first quasi species * Number of different fitness Write this information in _output_file Before this function, compute_reproduction_stats have to be called \see compute_reproduction_stats(ae_exp_manager* exp_manager, int32_t num_gener) \param num_gener current generation number */ void population_statistics::compute_population_stats(int32_t num_gener) { printf("\n\nCompute population stats\n"); double variation = 0; double population_variability = 0; double best_variability = 1. - _f_nu_pop[0]; int fitness_number = 1; int quasi_species_size = 1; population_variability = _f_nu_pop[0] * _reprod_proba[0]; for (int i = 1; i < _pop_size; i++) { if ( fabs(_fitness[i] - _fitness[i-1]) > 1e-10*std::max(_fitness[i],_fitness[i-1])) { fitness_number += 1; } else if ( fitness_number == 1) { quasi_species_size += 1; } population_variability += _f_nu_pop[i] * _reprod_proba[i]; } population_variability = 1. - population_variability; variation = (static_cast(fitness_number)) / (static_cast(_pop_size)); printf("\n Global population stats : \n \tgeneration : %"PRId32"\n \tpopulation size : %"PRId32"\n \tvariation : %le\n \tpopulation variability : %le\n \tbest f nu : %le\n \tbest variability : %le\n \tbest quasi species size : %d\n \tfitness number : %d\n", num_gener, _pop_size, variation, population_variability, _f_nu_pop[0], best_variability, quasi_species_size, fitness_number); fprintf( _output_file, "%"PRId32" %"PRId32" %le %le %le %le %d %d\n", num_gener, _pop_size, variation, population_variability, _f_nu_pop[0], best_variability, quasi_species_size, fitness_number); fflush( _output_file ); } // ================================================================= // Protected Methods // ================================================================= // count how many proteins were modified after replication /*int population_statistics::count_affected_genes( ae_individual* parent, ae_individual* child ) { // ------------------------------------------------------------ // list all functional proteins of the child // ------------------------------------------------------------ // Copy protein list ae_list* child_protein_list = new ae_list( *(child->get_protein_list()) ); // Delete all nodes containing degenerated proteins ae_list_node* current_prot_node = child_protein_list->get_first(); ae_list_node* next_prot_node = NULL; ae_protein* current_prot = NULL; while ( current_prot_node != NULL ) { current_prot = current_prot_node->get_obj(); next_prot_node = current_prot_node->get_next(); if ( current_prot->get_is_functional() == false ) { //delete the node but not the protein child_protein_list->remove( current_prot_node, true, false ); } current_prot_node = next_prot_node; } // ---------------------------------------------------------------- // for each functional protein of the parent, search for // the same one in the child's proteins and pop it out of the // list if found // ---------------------------------------------------------------- ae_list_node* parent_prot_node = parent->get_protein_list()->get_first(); ae_protein* parent_prot = NULL; ae_list_node* child_prot_node = NULL; ae_protein* child_prot = NULL; bool found = false; int nb_proteins_left = 0; // parse parent protein list while ( parent_prot_node != NULL ) { parent_prot = parent_prot_node->get_obj(); if ( parent_prot->get_is_functional() == true ) { found = false; // parse remaining protein list of the child child_prot_node = child_protein_list->get_first(); while ( child_prot_node != NULL ) { child_prot = (ae_protein*) child_prot_node->get_obj(); // compare the two proteins if ( (fabs(child_prot->get_mean() - parent_prot->get_mean()) < 1e-20) && (fabs(child_prot->get_width() - parent_prot->get_width()) < 1e-20) && (fabs(child_prot->get_height() - parent_prot->get_height()) < 1e-20) ) { found = true; // delete the node but not the protein child_protein_list->remove( child_prot_node, true, false); child_prot_node=NULL; } else { child_prot_node=child_prot_node->get_next(); } } // ------------------------------------------------------------------------------------ // if the protein was not found, it means that one of the genes were modified in child // ------------------------------------------------------------------------------------ if (found==false) nb_proteins_left++; } parent_prot_node = parent_prot_node->get_next(); } // -------------------------------------------------------------- // with low probability, some genes [dis]appeared // therefore, the number of proteins of the parent not // retreived in the child might not be equal to the number // of proteins left in child. We keep the biggest element, // neglecting possible compensations // -------------------------------------------------------------- //~ printf("%d %d \n",child_protein_list->get_nb_elts(), nb_proteins_left); int result = (child_protein_list->get_nb_elts() > nb_proteins_left) ? child_protein_list->get_nb_elts() : nb_proteins_left; delete child_protein_list; return result; }*/ // print stats about replications of the individual /*void population_statistics::print_replication_stats( ae_individual* initial_indiv, double* fitnesses, int* nb_aff_genes ) { if ( _replication_output == NULL ) return; double fitness_initial_indiv = initial_indiv->get_fitness(); // -------------------------------------------------------------- // compute statistics on fitness variations // -------------------------------------------------------------- double average_fit = 0.0; double sd = 0.0; double prop_better_than_parent = 0; double prop_same_as_parent = 0; double prop_no_genes_affected = 0; double avg_nb_aff_genes = 0.0; for (int i = 0; i < _nb_children; i++) { average_fit += fitnesses[i]; avg_nb_aff_genes += nb_aff_genes[i]; sd += fitnesses[i]*fitnesses[i]; if ( fabs(fitnesses[i] - fitness_initial_indiv) < 1e-10*std::max(fitnesses[i],fitness_initial_indiv) ) { prop_same_as_parent += 1; } else if ( fitnesses[i] > fitness_initial_indiv ) { prop_better_than_parent += 1; } if ( nb_aff_genes[i] == 0 ) { prop_no_genes_affected += 1; } } average_fit /= _nb_children; avg_nb_aff_genes /= _nb_children; prop_no_genes_affected /= _nb_children; sd /= _nb_children; sd -= (average_fit)*(average_fit); sd = sqrt(sd); prop_better_than_parent /= _nb_children; prop_same_as_parent /= _nb_children; // -------------------------------------------------------------- // print statistics on current line // -------------------------------------------------------------- fprintf(_replication_output, " %le %le %le %le %le %le ", average_fit, sd, prop_same_as_parent, prop_better_than_parent, prop_no_genes_affected, avg_nb_aff_genes); fprintf(_replication_output, "\n"); // -------------------------------------------------------------- // print fitness statistics for each child // -------------------------------------------------------------- for (int i = 0; i < _nb_children; i++) { fprintf(_replication_output, "%le %d \n", fitnesses[i], nb_aff_genes[i]); } }*/ aevol-4.4/src/post_treatments/compute_pop_stats.cpp0000644000175000017500000002126112363425161017713 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #include //#include #ifndef __NO_X #include #else #include #endif //#include // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); // ===================================================================== // Main Function // ===================================================================== //#define FV_FILE "fv.out" //#define REP_FILE "replications.out" int main( int argc, char* argv[] ) { // ---------------------------------------- // command-line option parsing // ---------------------------------------- int32_t nb_children = 1000; int32_t backup_step = 0; int32_t generation_number = -1; int32_t wanted_rank = -1; int32_t wanted_index = -1; int32_t begin_generation = 0; const char * options_list = "hVe:b:r:i:n:"; static struct option long_options_list[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V' }, {"end", required_argument, NULL, 'e' }, {"begin", required_argument, NULL, 'b' }, {"rank", required_argument, NULL, 'r'}, {"index", required_argument, NULL, 'i'}, {"nb-children", required_argument, NULL, 'n'}, {0, 0, 0, 0} }; int option = -1; while((option=getopt_long(argc,argv,options_list,long_options_list,NULL))!=-1) { switch(option) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'e' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -e or --end : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } generation_number = atol( optarg ); break; } case 'n' : nb_children = atol(optarg); break; case 'b': { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -b or --begin : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } begin_generation = atol( optarg ); break; } case 'r' : wanted_rank = atol(optarg); wanted_index = -1; break; case 'i' : wanted_index = atol(optarg); wanted_rank = -1; break; } } if(wanted_rank == -1 && wanted_index ==-1){ wanted_rank = 1; } if ( generation_number == -1 ) { printf( "%s: error: You must provide a generation number.\n", argv[0] ); exit( EXIT_FAILURE ); } analysis_type type = MULTIPLE_GENERATIONS; population_statistics* population_statistics_compute = new population_statistics(type, nb_children, wanted_rank, wanted_index); // Load simulation #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( begin_generation, false, true, false ); backup_step = exp_manager->get_backup_step(); printf("\n\n Generation : %d\n\n", begin_generation); population_statistics_compute->compute_reproduction_stats(exp_manager,begin_generation); population_statistics_compute->compute_population_stats(begin_generation); delete exp_manager; for ( int32_t i = begin_generation + backup_step ; i <= generation_number ; i += backup_step ) { printf("\n\n Generation : %d\n\n", i); #ifndef __NO_X exp_manager = new ae_exp_manager_X11(); #else exp_manager = new ae_exp_manager(); #endif exp_manager->load( i, false, true, false ); population_statistics_compute->compute_reproduction_stats(exp_manager,i); population_statistics_compute->compute_population_stats(i); delete exp_manager; } delete population_statistics_compute; return EXIT_SUCCESS; } /*! \brief */ void print_help(char* prog_path) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ( ( prog_name = strrchr( prog_path, '/' ) ) ) prog_name++; else prog_name = prog_path; printf( "******************************************************************************\n" ); printf( "* *\n" ); printf( "* aevol - Artificial Evolution *\n" ); printf( "* *\n" ); printf( "* Aevol is a simulation platform that allows one to let populations of *\n" ); printf( "* digital organisms evolve in different conditions and study experimentally *\n" ); printf( "* the mechanisms responsible for the structuration of the genome and the *\n" ); printf( "* transcriptome. *\n" ); printf( "* *\n" ); printf( "******************************************************************************\n" ); printf( "\n" ); printf( "%s: computes some population and replication statistics at each available backup from begin_gener until end_gener.\n", prog_name ); printf( "These statistics are saved in global_pop_stats.out and in files inside stats/pop_stats.\n"); printf( "The replication statistics (information about the children_nb offsprings) of the individual of given rank or index are written at each backup.\n" ); printf( "\n" ); printf( "WARNING: This program should not be used for simulations run with lateral\n" ); printf( "transfer. When an individual has more than one parent, the notion of lineage\n" ); printf( "used here is not relevant.\n" ); printf( "\n" ); printf( "Usage : %s -h\n", prog_name); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s -e GENER2 [-b GENER1] [-r RANK | -i INDEX]\n", prog_name ); printf( "\nOptions\n" ); printf( " -h, --help\n\tprint this help, then exit\n\n" ); printf( " -V, --version\n\tprint version number, then exit\n\n" ); printf( " -b GENER1 or --begin GENER1 :\n" ); printf( "\tFirst backup used to compute the statistics\n" ); printf( "\t-e GENER2 or --end GENER2 :\n" ); printf( "\tLast backup used to compute the statistics\n" ); printf( "\t-i INDEX or --index INDEX :\n" ); printf( "\tIndex of individual of whom we want information about the offsprings at each backup\n" ); printf( "\n" ); printf( "\t-r RANK or --rank RANK :\n" ); printf( "\tRank of individual of whom we want information about the offsprings at each backup\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/Makefile.am0000644000175000017500000000542212365452043015475 00000000000000############################################ # Set a few variables # ############################################ AM_CPPFLAGS = $(AEVOLCPPFLAGS) AM_CXXFLAGS = $(AEVOLCXXFLAGS) AM_LDFLAGS = $(AEVOLLDFLAGS) AM_CPPFLAGS += -I$(top_srcdir)/src/libaevol AM_LDFLAGS += -L$(top_srcdir)/src/libaevol ############################################ # Set aevol library to use # ############################################ LDADD = $(top_srcdir)/src/libaevol/libaevol.a $(top_srcdir)/src/libaevol/SFMT-src-1.4/libsfmt.a ############################################ # C99 exact-width integer specific support # ############################################ # __STDC_FORMAT_MACROS allows us to use exact-width integer format specifiers e.g. PRId32 (for printf etc) # __STDC_CONSTANT_MACROS allows us to define exact-width integer macros with e.g. INT32_C( ) # __STDC_LIMIT_MACROS allows us to use exact-width integer limit macros with e.g. INT32_MAX AM_CPPFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS #################################### # Add hardening option to compiler # #################################### # This replaces insecure unlimited length buffer function calls with # length-limited ones (required for debian and not a bad idea anyway). AM_CPPFLAGS += -D_FORTIFY_SOURCE=2 ############################################ # Set programs to build # ############################################ bin_PROGRAMS = aevol_misc_robustness aevol_misc_ancstats aevol_misc_create_eps aevol_misc_fixed_mutations aevol_misc_gene_families aevol_misc_lineage aevol_misc_compute_pop_stats aevol_misc_extract if WITH_X bin_PROGRAMS += aevol_misc_view_generation endif # X noinst_PROGRAMS = aevol_misc_template CLEANFILES = aevol_misc_ancstats aevol_misc_compute_pop_stats aevol_misc_create_eps aevol_misc_extract aevol_misc_fixed_mutations aevol_misc_gene_families aevol_misc_lineage aevol_misc_robustness aevol_misc_template aevol_misc_view_generation aevol_misc_ancstats_SOURCES = ancstats.cpp #aevol_misc_compute_pop_stats_HEADERS = population_statistics.h aevol_misc_compute_pop_stats_SOURCES = population_statistics.cpp compute_pop_stats.cpp aevol_misc_compute_pop_stats_SOURCES += population_statistics.h aevol_misc_create_eps_SOURCES = create_eps.cpp aevol_misc_extract_SOURCES = extract.cpp aevol_misc_fixed_mutations_SOURCES = fixed_mutations.cpp aevol_misc_gene_families_SOURCES = gene_families.cpp aevol_misc_lineage_SOURCES = lineage.cpp #aevol_misc_robustness_HEADERS = population_statistics.h aevol_misc_robustness_SOURCES = population_statistics.cpp robustness.cpp aevol_misc_robustness_SOURCES +=population_statistics.h aevol_misc_template_SOURCES = template.cpp aevol_misc_view_generation_SOURCES = view_generation.cpp aevol-4.4/src/post_treatments/robustness.cpp0000644000175000017500000001667612362227455016375 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include #include #include #include #include #include // ================================================================= // Project Files // ================================================================= #include #include #ifndef __NO_X #include #else #include #endif // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); // ===================================================================== // Main Function // ===================================================================== int main( int argc, char* argv[] ) { // ---------------------------------------- // command-line option parsing // ---------------------------------------- int32_t nb_children = 1000; int32_t wanted_rank = -1; int32_t wanted_index = -1; int32_t num_gener = 0; const char * options_list = "hVg:n:r:i:"; static struct option long_options_list[] = { {"help", no_argument, NULL, 'h'}, {"version", no_argument, NULL, 'V'}, {"gener", required_argument, NULL, 'g'}, {"nb-children", required_argument, NULL, 'n'}, {"rank", required_argument, NULL, 'r'}, {"index", required_argument, NULL, 'i'}, {0, 0, 0, 0} }; int option = -1; while((option=getopt_long(argc,argv,options_list,long_options_list,NULL))!=-1) { switch(option) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'g' : { if ( strcmp( optarg, "" ) == 0 ) { printf( "%s: error: Option -g or --gener : missing argument.\n", argv[0] ); exit( EXIT_FAILURE ); } num_gener = atol( optarg ); break; } case 'n' : nb_children = atol(optarg); break; case 'r' : wanted_rank = atol(optarg); wanted_index = -1; break; case 'i' : wanted_index = atol(optarg); wanted_rank = -1; break; } } if(wanted_rank == -1 && wanted_index ==-1){ wanted_rank = 1; } analysis_type type = ONE_GENERATION; population_statistics* population_statistics_compute = new population_statistics(type, nb_children, wanted_rank, wanted_index); // Load simulation #ifndef __NO_X ae_exp_manager* exp_manager = new ae_exp_manager_X11(); #else ae_exp_manager* exp_manager = new ae_exp_manager(); #endif exp_manager->load( num_gener, false, true, false ); population_statistics_compute->compute_reproduction_stats(exp_manager, num_gener); delete exp_manager; delete population_statistics_compute; return EXIT_SUCCESS; } /*! \brief */ void print_help(char* prog_path) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ( ( prog_name = strrchr( prog_path, '/' )) ) prog_name++; else prog_name = prog_path; printf( "\n" ); printf( "*********************** aevol - Artificial Evolution ******************* \n" ); printf( "* * \n" ); printf( "* Robustness post-treatment program * \n" ); printf( "* * \n" ); printf( "************************************************************************ \n" ); printf( "\n\n" ); printf( "This program is Free Software. No Warranty.\n" ); printf( "\n" ); printf( "Usage : %s -h\n", prog_name); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s -g numgener [-n nbchildren] [-r rank | -i index]\n", prog_name); printf( "\n" ); printf( "This program computes the replication statistics of all the individuals of a given generation,\n"); printf( "like the proportion of neutral, beneficial, deleterious offsprings. This is done by simulating\n"); printf( "\'nbchildren\' replications for each individual, with its mutation, rearrangement and transfer rates.\n" ); printf( "Depending on those rates and genome size, there can be several events per replication.\n" ); printf( "Those global statistics are written in %s/robustness_numgener.out, one line per individual\n", STATS_DIR ); printf( "in the specified generation.\n\n" ); printf( "The program also outputs detailed statistics for one of the individuals (the best one by default). \n"); printf( "The detailed statistics for this individual are written in %s/replication_numgener.out,\n", STATS_DIR); printf( "with one line per simulated child of this particular individual.\n"); printf( "\n" ); printf( "\n" ); printf( "\t-h or --help : Display this help, then exit\n" ); printf( "\n" ); printf( "\t-V or --version : Print version number, then exit\n" ); printf( "\n" ); printf( "\t-g numgener or --gener numgener : \n" ); printf( "\t Generation at which the statistics are computed\n" ); printf( "\n" ); printf( "\t-n nbchildren or --nb-children nbchildren : \n" ); printf( "\t Use nbchildren replications per individual to compute its statistics. Default = 1000.\n" ); printf( "\n" ); printf( "\t-i index or --index index : \n" ); printf( "\t Index of individual for whom we want detailed information about the simulated offsprings\n" ); printf( "\n" ); printf( "\t-r rank or --rank rank : \n" ); printf( "\t Rank of individual for whom we want detailed information about the simulated offsprings\n" ); printf( "\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/src/post_treatments/template.cpp0000644000175000017500000001334712363701210015754 00000000000000// **************************************************************************** // // Aevol - An in silico experimental evolution platform // // **************************************************************************** // // Copyright: See the AUTHORS file provided with the package or // Web: http://www.aevol.fr/ // E-mail: See // Original Authors : Guillaume Beslon, Carole Knibbe, David Parsons // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // //***************************************************************************** // ================================================================= // Libraries // ================================================================= #include #include #include #include // ================================================================= // Project Files // ================================================================= #include // ================================================================= // Function declarations // ================================================================= void print_help(char* prog_path); void print_version( void ); int main( int argc, char* argv[] ) { // 1) Initialize command-line option variables with default values bool opt = false; char* input_dir = NULL; int32_t num_gener = -1; // 2) Define allowed options const char * options_list = "hVoi:g:"; static struct option long_options_list[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'V' }, { "opt", no_argument, NULL, 'o' }, { "in", required_argument, NULL, 'i' }, { "gener", required_argument, NULL, 'g' }, { 0, 0, 0, 0 } }; // 3) Get actual values of the command-line options int option; while ( ( option = getopt_long(argc, argv, options_list, long_options_list, NULL) ) != -1 ) { switch ( option ) { case 'h' : { print_help(argv[0]); exit( EXIT_SUCCESS ); } case 'V' : { print_version(); exit( EXIT_SUCCESS ); } case 'o' : { opt = true; break; } case 'i' : { input_dir = new char[strlen(optarg)+1]; strcpy( input_dir, optarg ); break; } case 'g' : { num_gener = atol(optarg); break; } default : { // An error message is printed in getopt_long, we just need to exit exit( EXIT_FAILURE ); } } } // 4) Check for missing mandatory arguments if (input_dir == NULL) { printf( "%s: error: You must provide an input directory.\n", argv[0] ); exit( EXIT_FAILURE ); } if ( num_gener == -1 ) { printf( "%s: error: You must provide a generation number.\n", argv[0] ); exit( EXIT_FAILURE ); } // Load the experiment ae_exp_manager* exp = new ae_exp_manager(); exp->load(input_dir, num_gener, false, false, false); // *********************************************************************** // // Do something here // *********************************************************************** // delete exp; } /*! \brief */ void print_help(char* prog_path) { // Get the program file-name in prog_name (strip prog_path of the path) char* prog_name; // No new, it will point to somewhere inside prog_path if ((prog_name = strrchr(prog_path, '/'))) prog_name++; else prog_name = prog_path; printf( "******************************************************************************\n" ); printf( "* *\n" ); printf( "* aevol - Artificial Evolution *\n" ); printf( "* *\n" ); printf( "* Aevol is a simulation platform that allows one to let populations of *\n" ); printf( "* digital organisms evolve in different conditions and study experimentally *\n" ); printf( "* the mechanisms responsible for the structuration of the genome and the *\n" ); printf( "* transcriptome. *\n" ); printf( "* *\n" ); printf( "******************************************************************************\n" ); printf( "\n" ); printf( "%s: does nothing (template file).\n", prog_name ); printf( "\n" ); printf( "Usage : %s -h or --help\n", prog_name ); printf( " or : %s -V or --version\n", prog_name ); printf( " or : %s [-o] -a arg\n", prog_name ); printf( "\nOptions\n" ); printf( " -h, --help\n\tprint this help, then exit\n\n" ); printf( " -V, --version\n\tprint version number, then exit\n\n" ); printf( " -o, --opt\n\toption with no argument\n" ); printf( " -a, --arg argument\n\toption with an argument\n" ); } /*! \brief Print aevol version number */ void print_version( void ) { printf( "aevol %s\n", VERSION ); } aevol-4.4/INSTALL0000644000175000017500000003633211501451021010436 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. aevol-4.4/configure0000755000000000000000000071252512365454415011312 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for AEVOL 4.4. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: aevol-bug-report@lists.gforge.liris.cnrs.fr about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='AEVOL' PACKAGE_TARNAME='aevol' PACKAGE_VERSION='4.4' PACKAGE_STRING='AEVOL 4.4' PACKAGE_BUGREPORT='aevol-bug-report@lists.gforge.liris.cnrs.fr' PACKAGE_URL='www.aevol.fr' ac_unique_file="src/aevol_run.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS WITH_IN2P3_FALSE WITH_IN2P3_TRUE WITH_DEBUG_FALSE WITH_DEBUG_TRUE WITH_CPPUNIT_FALSE WITH_CPPUNIT_TRUE WANT_DOXYGEN_FALSE WANT_DOXYGEN_TRUE CPPUNIT_LIBS CPPUNIT_CFLAGS CPPUNIT_CONFIG HAVE_DOXYGEN ENABLE_DEVEL_FALSE ENABLE_DEVEL_TRUE ENABLE_FORCEPJ_FALSE ENABLE_FORCEPJ_TRUE WITH_NORMALIZED_FITNESS_FALSE WITH_NORMALIZED_FITNESS_TRUE WITH_OPTIM_FALSE WITH_OPTIM_TRUE X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF WITH_X_FALSE WITH_X_TRUE EGREP GREP CPP AEVOLLDFLAGS AEVOLCXXFLAGS AEVOLCPPFLAGS RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_x enable_optim enable_normalized_fitness enable_mtperiod enable_trivialjumps enable_devel with_cppunit_prefix with_cppunit_exec_prefix enable_debug enable_in2p3 ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures AEVOL 4.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/aevol] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of AEVOL 4.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-optim turn off compile time optimization --enable-normalized-fitness to enable fitness normalization --enable-mtperiod=period Set the Mersenne Twister period to 2^period (default is 2^607). Possible values are 607, 1279, 2281, 4253, 11213, 19937, 44497, 86243, 132049 and 216091 Consider using in conjunction with --enable-trivialjumps for large periods --enable-trivialjumps=jumpsize When this option is set, a trivial jump algorithm will be used instead of the polynomial-based method. This is recommended for large Mersenne Twister periods when huge jumps are not needed since the polynomial-based method takes more time in that case. For the standard MT (period 2^19937), it takes approx. the same time to draw a few million numbers than it does to make the same jump using the polynomial-based method. The jumpsize argument allows to set the desired jump size. The default value is 1000 which is enough to avoid overlaps in most cases. --enable-devel turn on development features --enable-debug to enable degugging features --enable-in2p3 to enable IN2P3 specific features Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-x to disable graphical output --with-x use the X Window System --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional) --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional) Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . AEVOL home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF AEVOL configure 4.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------------- ## ## Report this to aevol-bug-report@lists.gforge.liris.cnrs.fr ## ## ---------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by AEVOL $as_me 4.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # We want to use automake am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='aevol' VERSION='4.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Check the existance of an arbitrary source file # Build config.h using config.h.in as a template #AC_CONFIG_HEADERS([config.h:config.h.in]) # Change default value for CXXFLAGS test_CXXFLAGS=${CXXFLAGS+set} if test "$test_CXXFLAGS" != set; then CXXFLAGS="" fi # Checks for programs ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -f conftest2.$ac_objext && { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # Initialize configure-time defined flags AEVOLCPPFLAGS="" # C PreProcessor flags AEVOLCXXFLAGS="" # C++ Compile flags AEVOLLDFLAGS="" # Linker flags # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" else as_fn_error $? "PACKAGE_NAME requires the math library, please install it." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 $as_echo_n "checking for gzread in -lz... " >&6; } if ${ac_cv_lib_z_gzread+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gzread (); int main () { return gzread (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_gzread=yes else ac_cv_lib_z_gzread=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 $as_echo "$ac_cv_lib_z_gzread" >&6; } if test "x$ac_cv_lib_z_gzread" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else as_fn_error $? "PACKAGE_NAME requires the zlib development library, please install it." "$LINENO" 5 fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in inttypes.h limits.h stdint.h stdlib.h string.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int8_t $ac_cv_c_int8_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. for ac_func in floor memset mkdir pow rint sqrt gzread do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # **************************************************************************** # OPTIONS # # Supported options [default]: # --with-x [yes] # --enable-optim [enabled] # --enable-normalized-fitness [disabled] # --enable-mtperiod=period [disabled] # --enable-trivialjumps=jumpsize [disabled] # --enable-devel [disabled] # --enable-debug [disabled] # --enable-in2p3 [disabled] # # **************************************************************************** # ******************* check option consistency *************************** { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking parameter consistency" >&5 $as_echo_n "checking checking parameter consistency... " >&6; } if test "x$enable_in2p3" = "xyes" ; then if test "x$enable_debug" = "xyes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: FAIL" >&5 $as_echo "FAIL" >&6; } as_fn_error $? "debug and in2p3 are not compatible" "$LINENO" 5 fi if test "x$with_x" != xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: FAIL" >&5 $as_echo "FAIL" >&6; } as_fn_error $? "x and in2p3 are not compatible" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 $as_echo "OK" >&6; } # ************************ --without-x option ********************* # # When this option is set, typing make will produce aevol and # most post-treatment programs, but not aevol_X11. # This is useful if we want to run computations on a cluster where the # X libraries are not present. If, on the contrary, we type ./configure # without this option, then typing make will produce aevol_X11 and # view_generation_X11 (and the other post-treatment programs). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable graphical outputs" >&5 $as_echo_n "checking whether to enable graphical outputs... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; else with_x=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_x" >&5 $as_echo "$with_x" >&6; } if test x"$with_x" != xno; then WITH_X_TRUE= WITH_X_FALSE='#' else WITH_X_TRUE='#' WITH_X_FALSE= fi if test "x$with_x" != xno ; then $as_echo "#define __X11 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi # AC_PATH_XTRA updates X_LIBS and X_CFLAGS but not CPPFLAGS, CXXFLAGS or LDFLAGS. # Thus we need to add X_CFLAGS to AEVOLCPPFLAGS, and X_LIBS to AEVOLLDFLAGS. # Moreover, on MacOS, AC_CHECK_LIB needs correct CPPFLAGS to find X11. But CPPFLAGS is normally a user # variable, which we should not change. Thus we save its previous value to restore it after AC_CHECK_LIB. ac_cppflags_save="$CPPFLAGS" CPPFLAGS+=" $X_CFLAGS" AEVOLCPPFLAGS+=" $X_CFLAGS" AEVOLLDFLAGS+=" $X_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $X_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBX11 1 _ACEOF LIBS="-lX11 $LIBS" else as_fn_error $? "the X11 library could not be found on your system. Please install it or re-run with the --without-x option" "$LINENO" 5 fi for ac_header in X11/Xlib.h X11/Xutil.h X11/keysym.h X11/Xatom.h X11/cursorfont.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="$ac_cppflags_save" else $as_echo "#define __NO_X 1" >>confdefs.h fi # ******************* --enable-optim option *************************** # # With this option, the programs are compiled with the # optimization options (-O3 - fexpensive-optimizations...). # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use compile time optimization" >&5 $as_echo_n "checking whether to use compile time optimization... " >&6; } # Check whether --enable-optim was given. if test "${enable_optim+set}" = set; then : enableval=$enable_optim; else enable_optim=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_optim" >&5 $as_echo "$enable_optim" >&6; } if test x"$enable_optim" != xno; then WITH_OPTIM_TRUE= WITH_OPTIM_FALSE='#' else WITH_OPTIM_TRUE='#' WITH_OPTIM_FALSE= fi if test "x$enable_optim" = "xyes" ; then AEVOLCXXFLAGS+=" -O3 -ffast-math -pipe -fexpensive-optimizations" else AEVOLCXXFLAGS+=" -O0" fi # ******************* --enable-normalized-fitness option *************************** # # With this option, the NORMALIZED_FITNESS flag is defined, # allowing a different fitness calculation { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use normalized fitness" >&5 $as_echo_n "checking whether to use normalized fitness... " >&6; } # Check whether --enable-normalized-fitness was given. if test "${enable_normalized_fitness+set}" = set; then : enableval=$enable_normalized_fitness; else enable_normalized_fitness=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_normalized_fitness" >&5 $as_echo "$enable_normalized_fitness" >&6; } if test x"$enable_normalized_fitness" != xno; then WITH_NORMALIZED_FITNESS_TRUE= WITH_NORMALIZED_FITNESS_FALSE='#' else WITH_NORMALIZED_FITNESS_TRUE='#' WITH_NORMALIZED_FITNESS_FALSE= fi if test "x$enable_normalized_fitness" = "xyes" ; then $as_echo "#define NORMALIZED_FITNESS 1" >>confdefs.h fi # ************************* --enable-mtperiod=period option ******************************* # # This option sets a particular period for the Mersenne Twister. # Default is --enable-mtperiod=607 corresponding to a period of 2^607. # Possible values are 607, 1279, 2281, 4253, 11213, 19937, 44497, 86243, 132049 and 216091 # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use a particular period for the Mersenne Twister" >&5 $as_echo_n "checking whether to use a particular period for the Mersenne Twister... " >&6; } # Check whether --enable-mtperiod was given. if test "${enable_mtperiod+set}" = set; then : enableval=$enable_mtperiod; period=$enableval else period=607 fi if test $period != 607 && test $period != 1279 && test $period != 2281 && test $period != 4253 && test $period != 11213 && test $period != 19937 && test $period != 44497 && test $period != 86243 && test $period != 132049 && test $period != 216091 ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: FAIL" >&5 $as_echo "FAIL" >&6; } as_fn_error $? "$period is not a valid Mersenne Twister period" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $period" >&5 $as_echo "$period" >&6; } cat >>confdefs.h <<_ACEOF #define SFMT_MEXP $period _ACEOF # ************************* --enable-trivialjumps=jumpsize option ******************************* # # When this option is set, a trivial jump algorithm will be used instead of the polynomial-based method. # This is recommended for large Mersenne Twister periods when huge jumps are not needed since # the polynomial-based method takes more time in that case. # # For the standard MT (period 2^19937), it takes approx. the same time to draw a few million numbers # than it does to make the same jump using the polynomial-based method. # # The jumpsize argument allows to set the desired jump size. The default value is 1000 which is enough to # avoid overlaps in most cases. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use trivial Mersenne Twister jumps" >&5 $as_echo_n "checking whether to use trivial Mersenne Twister jumps... " >&6; } # Check whether --enable-trivialjumps was given. if test "${enable_trivialjumps+set}" = set; then : enableval=$enable_trivialjumps; trivialjumps=$enableval else trivialjumps=no fi if test "x$trivialjumps" != "xyes" && test "x$trivialjumps" != "xno" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($trivialjumps)" >&5 $as_echo "yes ($trivialjumps)" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $trivialjumps" >&5 $as_echo "$trivialjumps" >&6; } fi if test x"$trivialjumps" != xno; then ENABLE_FORCEPJ_TRUE= ENABLE_FORCEPJ_FALSE='#' else ENABLE_FORCEPJ_TRUE='#' ENABLE_FORCEPJ_FALSE= fi if test "x$trivialjumps" = "xyes" ; then $as_echo "#define TRIVIAL_METHOD_JUMP_SIZE 1000" >>confdefs.h elif test "x$trivialjumps" != "xno" ; then cat >>confdefs.h <<_ACEOF #define TRIVIAL_METHOD_JUMP_SIZE $trivialjumps _ACEOF fi # ******************* --enable-devel option *************************** # # This enables developers' features: # adds a call to make clean at the end of the configure script. # enables doxygen if available # enforces use of cppunit # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use devel features" >&5 $as_echo_n "checking whether to use devel features... " >&6; } # Check whether --enable-devel was given. if test "${enable_devel+set}" = set; then : enableval=$enable_devel; else enable_devel=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_devel" >&5 $as_echo "$enable_devel" >&6; } if test x"$enable_devel" != xno; then ENABLE_DEVEL_TRUE= ENABLE_DEVEL_FALSE='#' else ENABLE_DEVEL_TRUE='#' ENABLE_DEVEL_FALSE= fi if test "x$enable_devel" = "xyes" ; then # Make clean at the end of the configuration process # (usefull when several configurations are done consecutively, typically during development) ac_config_commands="$ac_config_commands make" # Check for Doxygen for ac_prog in doxygen do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_DOXYGEN"; then ac_cv_prog_HAVE_DOXYGEN="$HAVE_DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_DOXYGEN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_DOXYGEN=$ac_cv_prog_HAVE_DOXYGEN if test -n "$HAVE_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DOXYGEN" >&5 $as_echo "$HAVE_DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$HAVE_DOXYGEN" && break done if test -z "$HAVE_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Doxygen not found - continuing without Doxygen support" >&5 $as_echo "$as_me: WARNING: Doxygen not found - continuing without Doxygen support" >&2;} fi # Check for CppUnit # AC_CHECK_LIB does not work with C++ libraries, this is why we use AM_PATH_CPPUNIT # This macro will check whether a Cppunit version >= 1.10.2 is installed # and, if, yes, will define CPPUNIT_CFLAGS and CPPUNIT_LIBS. # This macro is defined in the cppunit.m4 file provided by the cppunit package # when it is installed. Hence aclocal must be run before autoconf to have the # macro known by autoconf. If cppunit is installed in a non-standard # directory, you need to specify where to find cppunit.m4. For example, if # cppunit is installed under /usr/local, run: # ACLOCAL="aclocal -I /usr/local/share/aclocal" autoreconf -if cppunit_missing=no # Check whether --with-cppunit-prefix was given. if test "${with_cppunit_prefix+set}" = set; then : withval=$with_cppunit_prefix; cppunit_config_prefix="$withval" else cppunit_config_prefix="" fi # Check whether --with-cppunit-exec-prefix was given. if test "${with_cppunit_exec_prefix+set}" = set; then : withval=$with_cppunit_exec_prefix; cppunit_config_exec_prefix="$withval" else cppunit_config_exec_prefix="" fi if test x$cppunit_config_exec_prefix != x ; then cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config fi fi if test x$cppunit_config_prefix != x ; then cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config fi fi # Extract the first word of "cppunit-config", so it can be a program name with args. set dummy cppunit-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CPPUNIT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $CPPUNIT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_CPPUNIT_CONFIG="$CPPUNIT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_CPPUNIT_CONFIG" && ac_cv_path_CPPUNIT_CONFIG="no" ;; esac fi CPPUNIT_CONFIG=$ac_cv_path_CPPUNIT_CONFIG if test -n "$CPPUNIT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPPUNIT_CONFIG" >&5 $as_echo "$CPPUNIT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cppunit_version_min=1.10.2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cppunit - version >= $cppunit_version_min" >&5 $as_echo_n "checking for Cppunit - version >= $cppunit_version_min... " >&6; } no_cppunit="" if test "$CPPUNIT_CONFIG" = "no" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } no_cppunit=yes else CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` cppunit_version=`$CPPUNIT_CONFIG --version` cppunit_major_version=`echo $cppunit_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` cppunit_minor_version=`echo $cppunit_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` cppunit_micro_version=`echo $cppunit_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` cppunit_major_min=`echo $cppunit_version_min | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` if test "x${cppunit_major_min}" = "x" ; then cppunit_major_min=0 fi cppunit_minor_min=`echo $cppunit_version_min | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` if test "x${cppunit_minor_min}" = "x" ; then cppunit_minor_min=0 fi cppunit_micro_min=`echo $cppunit_version_min | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x${cppunit_micro_min}" = "x" ; then cppunit_micro_min=0 fi cppunit_version_proper=`expr \ $cppunit_major_version \> $cppunit_major_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \> $cppunit_minor_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \= $cppunit_minor_min \& \ $cppunit_micro_version \>= $cppunit_micro_min ` if test "$cppunit_version_proper" = "1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&5 $as_echo "$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } no_cppunit=yes fi fi if test "x$no_cppunit" = x ; then : else CPPUNIT_CFLAGS="" CPPUNIT_LIBS="" cppunit_missing=yes fi if test "x$cppunit_missing" != xno ; then as_fn_error $? "cppunit not found, make will fail - please install cppunit." "$LINENO" 5 fi else # Output a warning message about multi-configuration and make clean ac_config_commands="$ac_config_commands user_warning" fi if test -n "$HAVE_DOXYGEN"; then WANT_DOXYGEN_TRUE= WANT_DOXYGEN_FALSE='#' else WANT_DOXYGEN_TRUE='#' WANT_DOXYGEN_FALSE= fi if test -n "$cppunit_missing"; then WITH_CPPUNIT_TRUE= WITH_CPPUNIT_FALSE='#' else WITH_CPPUNIT_TRUE='#' WITH_CPPUNIT_FALSE= fi # ******************* --enable-debug option *************************** # # With this option, the DEBUG flag is defined, and the programs are # compiled with debugging options (-g -Wall). # { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use debugging features" >&5 $as_echo_n "checking whether to use debugging features... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; else enable_debug=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5 $as_echo "$enable_debug" >&6; } if test x"$enable_debug" != xno; then WITH_DEBUG_TRUE= WITH_DEBUG_FALSE='#' else WITH_DEBUG_TRUE='#' WITH_DEBUG_FALSE= fi if test "x$enable_debug" = "xyes" ; then $as_echo "#define DEBUG 1" >>confdefs.h AEVOLCXXFLAGS+=" -g -Wall" else $as_echo "#define NDEBUG 1" >>confdefs.h fi # ******************* --enable-in2p3 option *************************** # # With this option, the IN2P3 flag is defined { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use IN2P3 specific features" >&5 $as_echo_n "checking whether to use IN2P3 specific features... " >&6; } # Check whether --enable-in2p3 was given. if test "${enable_in2p3+set}" = set; then : enableval=$enable_in2p3; else enable_in2p3=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_in2p3" >&5 $as_echo "$enable_in2p3" >&6; } if test x"$enable_in2p3" != xno; then WITH_IN2P3_TRUE= WITH_IN2P3_FALSE='#' else WITH_IN2P3_TRUE='#' WITH_IN2P3_FALSE= fi if test "x$enable_in2p3" = "xyes" ; then $as_echo "#define __IN2P3 1" >>confdefs.h fi # ************************* back to GENERAL stuff ******************************* ac_config_files="$ac_config_files Makefile src/Makefile src/libaevol/Makefile src/libaevol/SFMT-src-1.4/Makefile src/libaevol/tests/Makefile src/post_treatments/Makefile doc/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_X_TRUE}" && test -z "${WITH_X_FALSE}"; then as_fn_error $? "conditional \"WITH_X\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_OPTIM_TRUE}" && test -z "${WITH_OPTIM_FALSE}"; then as_fn_error $? "conditional \"WITH_OPTIM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_NORMALIZED_FITNESS_TRUE}" && test -z "${WITH_NORMALIZED_FITNESS_FALSE}"; then as_fn_error $? "conditional \"WITH_NORMALIZED_FITNESS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FORCEPJ_TRUE}" && test -z "${ENABLE_FORCEPJ_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FORCEPJ\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DEVEL_TRUE}" && test -z "${ENABLE_DEVEL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEVEL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WANT_DOXYGEN_TRUE}" && test -z "${WANT_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"WANT_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CPPUNIT_TRUE}" && test -z "${WITH_CPPUNIT_FALSE}"; then as_fn_error $? "conditional \"WITH_CPPUNIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_DEBUG_TRUE}" && test -z "${WITH_DEBUG_FALSE}"; then as_fn_error $? "conditional \"WITH_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_IN2P3_TRUE}" && test -z "${WITH_IN2P3_FALSE}"; then as_fn_error $? "conditional \"WITH_IN2P3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by AEVOL $as_me 4.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to . AEVOL home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ AEVOL config.status 4.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "make") CONFIG_COMMANDS="$CONFIG_COMMANDS make" ;; "user_warning") CONFIG_COMMANDS="$CONFIG_COMMANDS user_warning" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libaevol/Makefile") CONFIG_FILES="$CONFIG_FILES src/libaevol/Makefile" ;; "src/libaevol/SFMT-src-1.4/Makefile") CONFIG_FILES="$CONFIG_FILES src/libaevol/SFMT-src-1.4/Makefile" ;; "src/libaevol/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/libaevol/tests/Makefile" ;; "src/post_treatments/Makefile") CONFIG_FILES="$CONFIG_FILES src/post_treatments/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "make":C) make clean ;; "user_warning":C) { $as_echo "$as_me:${as_lineno-$LINENO}: Consider using make clean if you are re-configuring." >&5 $as_echo "$as_me: Consider using make clean if you are re-configuring." >&6;} ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi aevol-4.4/doc/0000755000000000000000000000000012365454434010215 500000000000000aevol-4.4/doc/aevol_misc_lineage.10000644000175000017500000000256612363425417014064 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_lineage \-h | .B \-\-help .br .B aevol_misc_lineage \-V | .B \-\-version .br .B aevol_misc_lineage \fR[\fB\-i\fI INDEX\fR | \fB\-r\fI RANK\fR] \fR[\fB\-b\fI GENER1\fR] \fB\-e\fI GENER2 .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_lineage allows for the reconstruction of the lineage of a given individual. Requires the tree to have been recorded during evolution. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-i, \-\-index .I INDEX .br specify the index (ID in current generation) of the individual whose lineage is to be reconstructed .HP .B \-r, \-\-rank .I RANK .br specify the rank of the individual whose lineage is to be reconstructed .HP .B \-b, \-\-begin .I GENER .br specify the generation up to which the lineage is to be reconstructed .HP .B \-e, \-\-end .I GENER .br specify the generation of the individual whose lineage is to be reconstructed .SH "SEE ALSO" .B aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol.conf0000755000175000017500000017760711763677725012204 00000000000000# Doxyfile 1.6.2 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = aevol # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = . # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 2 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = NO # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = __X11 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES aevol-4.4/doc/aevol_misc_ancstats.10000644000175000017500000000170612363425417014273 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_ancstats \-h | .B \-\-help .br .B aevol_misc_ancstats \-V | .B \-\-version .br .B aevol_misc_ancstats \fB\-f\fI LINEAGE_FILE .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_ancstats issues statistics for the line of descent of a given individual. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-f, \-\-file .I LINEAGE_FILE .br specify which lineage file to use. Lineage files are created by the ae_misc_lineage tool .SH "SEE ALSO" .B ae_misc_lineage, aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol_misc_gene_families.10000644000175000017500000000175612363425417015247 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_gene_families \-h | .B \-\-help .br .B aevol_misc_gene_families \-V | .B \-\-version .br .B aevol_misc_gene_families \fB\-f\fI LINEAGE_FILE .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_gene_families issues the detailed history of each gene family on the lineage of a given individual .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-f, \-\-file .I LINEAGE_FILE .br specify which lineage file to use. Lineage files are created by the ae_misc_lineage tool .SH "SEE ALSO" .B ae_misc_lineage, aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol_create.10000644000175000017500000000234412365452043012677 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_create \-h or .B \-\-help .br .B aevol_create \-V or .B \-\-version .br .B aevol_create \fR[\fB\-v\fR] \fR[\fB\-f\fI PARAM_FILE\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-c\fI CFILE\fR] \fR[\fB\-p\fI PFILE\fR] .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_create create an experiment with setup as specified in .I param_file .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-f, \-\-file .I PARAM_FILE .br specify parameter file (default: param.in) .HP .B \-o, \-\-out .I OUTDIR .br specify output directory (default "./") .HP .B \-c, \-\-chromosome .I CFILE .br load chromosome from given text file instead of generating it .HP .B \-p, \-\-plasmid .I PFILE .br load plasmid from given text file instead of generating it (params must allow plasmids) .SH "SEE ALSO" .B aevol_run, aevol_modify, aevol_propagate aevol-4.4/doc/aevol_misc_create_eps.10000644000175000017500000000213212363425417014557 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_create_eps \-h | .B \-\-help .br .B aevol_misc_create_eps \-V | .B \-\-version .br .B aevol_misc_create_eps \fR[\fB\-i\fI INDEX\fR | \fB\-r\fI RANK\fR] \fB\-g\fI GENER .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_create_eps produces several eps files describing an individual of this population .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-i, \-\-index .I INDEX .br specify the index (ID in current generation) of the individual .HP .B \-r, \-\-rank .I RANK .br specify the rank of the individual .HP .B \-g, \-\-gener .I GENER .br specify the generation of the individual .SH "SEE ALSO" .B aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol_misc_robustness.10000644000175000017500000000415712363425417014665 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_robustness \-h | .B \-\-help .br .B aevol_misc_robustness \-V | .B \-\-version .br .B aevol_misc_robustness \fR\fB\-g\fI GENER\fR [\fB\-n\fI NBCHILDREN] \fR[\fB\-i\fI INDEX\fR | \fB\-r\fI RANK\fR] .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_robustness computes the replication statistics of all the individuals of a given generation, like the proportion of neutral, beneficial, deleterious offsprings. This is done by simulating NBCHILDREN replications for each individual (1000 replications by default), with its mutation, rearrangement and transfer rates. Depending on those rates and genome size, there can be several mutations per replication. Those global statistics are written in stat/robustness_GENER.out, with one line per individual in the specified generation. The program also outputs detailed statistics for one of the individuals (the best one by default). The detailed statistics for this individual are written in stats/replication_GENER.out, with one line per simulated child of this particular individual. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-g, \-\-gener .I GENER .br specify the generation number for which the robustness statistics are desired .HP .B \-n, \-\-nb\-children .I NBCHILDREN .br specify the number of reproductions to simulate for each individual .HP .B \-i, \-\-index .I INDEX .br specify the index (ID in current generation) of the individual for whom detailed reproduction statistics are desired .HP .B \-r, \-\-rank .I RANK .br specify the rank of the individual for whom detailed reproduction statistics are desired .SH "SEE ALSO" .B aevol_create, aevol_modify, aevol_propagate, aevol_run, aevol_misc_view_generation, aevol_misc_create_eps aevol-4.4/doc/README.txt0000644000175000017500000000015212136521737011660 00000000000000The documentation being quite heavy, it is not included in basic distributions. Please visit www.aevol.fr aevol-4.4/doc/Makefile.in0000644000000000000000000003412012365454415012201 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(dist_man1_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Man pages dist_man1_MANS = aevol_create.1 aevol_run.1 aevol_modify.1 \ aevol_propagate.1 aevol_misc_lineage.1 aevol_misc_ancstats.1 \ aevol_misc_robustness.1 aevol_misc_compute_pop_stats.1 \ aevol_misc_view_generation.1 aevol_misc_create_eps.1 \ aevol_misc_extract.1 aevol_misc_fixed_mutations.1 \ aevol_misc_gene_families.1 # Cleaning rules CLEANFILES = index.html # Extra files to include in releases (dist) EXTRA_DIST = README.txt aevol.conf all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-local \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-man uninstall-man1 # Set default behaviour depending on configure options @WANT_DOXYGEN_TRUE@all: doxygen @WANT_DOXYGEN_FALSE@all: # How to build the devel doc doxygen: ../src/*.cpp ../src/libaevol/*.h ../src/libaevol/*.cpp ../src/post_treatments/*.cpp doxygen aevol.conf ; echo "document generated\n" > doxygen clean-local: rm -rf html doxygen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/doc/aevol_modify.10000644000175000017500000000163612363425417012731 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_modify \-h or .B \-\-help .br .B aevol_modify \-V or .B \-\-version .br .B aevol_modify \-g\fI GENER \fR[\fB\-f\fI param_file\fR] .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_modify modify an experiment as specified in .I param_file .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-g, \-\-gener .I GENER .br specify generation number .HP .B \-f, \-\-file .I param_file .br specify parameter file (default: param.in) .SH "SEE ALSO" .B aevol_create, aevol_run, aevol_propagate aevol-4.4/doc/aevol_misc_view_generation.10000644000175000017500000000166512363425417015644 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_view_generation \-h | .B \-\-help .br .B aevol_misc_view_generation \-V | .B \-\-version .br .B aevol_misc_view_generation \fB\-g\fI GENER .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_view_generation allows one to visualize a generation using the exact same graphical outputs used in aevol_run. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-g, \-\-gener .I GENER .br specify generation to visualize (default 0) .SH "SEE ALSO" .B aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol_misc_extract.10000644000175000017500000000301412363425417014117 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_extract \-h | .B \-\-help .br .B aevol_misc_extract \-V | .B \-\-version .br .B aevol_misc_extract \fR[\fB\-r\fI GENER\fR | \fB\-p\fI POP_FILE\fR] \fR[\fB\-t\fI PHEN_FILE\fR] \fR[\fB\-s\fI SEQ_FILE\fR] \fR[\fB\-g\fI NUM_GU\fR] \fR[\fB\-b\fR] .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_extract extracts the genotype and/or data about the phenotype of individuals in the provided population and write them into text files easy to parse with e.g. matlab. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-r .I GENER .br read generation GENER from a full aevol backup .HP .B \-p .I POP_FILE .br read the population saved in population file POP_FILE .HP .B \-t .I PHEN_FILE .br extract and save some infos about the phenotypes of the individuals to file PHEN_FILE .HP .B \-s .I SEQ_FILE .br extract and save the sequences of the individuals to file SEQ_FILE .HP .B \-g .I num_gu .br only treat this genetic unit (by default: treat all genetic units) .HP .B \-b .br only treat the best individual .SH "SEE ALSO" .B ae_misc_lineage, aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol_misc_fixed_mutations.10000644000175000017500000000177212363425417015660 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_fixed_mutations \-h | .B \-\-help .br .B aevol_misc_fixed_mutations \-V | .B \-\-version .br .B aevol_misc_fixed_mutations \fB\-f\fI LINEAGE_FILE .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_fixed_mutations issues the detailed list of mutations that occurred in the lineage of a given individual .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-f, \-\-file .I LINEAGE_FILE .br specify which lineage file to use. Lineage files are created by the ae_misc_lineage tool .SH "SEE ALSO" .B ae_misc_lineage, aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/doc/aevol_run.10000644000175000017500000000227012365452043012236 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_run \-h | .B \-\-help .br .B aevol_run \-V | .B \-\-version .br .B aevol_run \fR[\fB\-r\fI GENER\fR] \fR[\fB\-n\fI NB_GENER\fR] \fR[\fB\-tvwx\fR] .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_run run an aevol simulation. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-r, \-\-resume .I GENER .br specify generation to resume simulation at (default 0) .HP .B \-n, \-\-nbgener .I NB_GENER .br specify number of generations to be run (default 1000) .TP .B \-t, \-\-text use text files instead of binary files when possible .TP .B \-v, \-\-verbose be verbose .TP .B \-w, \-\-wait pause after loading .TP .B \-x, \-\-noX don't display X outputs upon start .br send SIGUSR1 to switch X output on/off .SH "SEE ALSO" .B aevol_create, aevol_modify, aevol_propagate aevol-4.4/doc/Makefile.am0000644000175000017500000000152612365452043012221 00000000000000 # Set default behaviour depending on configure options if WANT_DOXYGEN all: doxygen else all: endif # Man pages dist_man1_MANS = aevol_create.1 aevol_run.1 aevol_modify.1 aevol_propagate.1 dist_man1_MANS += aevol_misc_lineage.1 aevol_misc_ancstats.1 dist_man1_MANS += aevol_misc_robustness.1 aevol_misc_compute_pop_stats.1 dist_man1_MANS += aevol_misc_view_generation.1 aevol_misc_create_eps.1 dist_man1_MANS += aevol_misc_extract.1 aevol_misc_fixed_mutations.1 dist_man1_MANS += aevol_misc_gene_families.1 # How to build the devel doc doxygen: ../src/*.cpp ../src/libaevol/*.h ../src/libaevol/*.cpp ../src/post_treatments/*.cpp doxygen aevol.conf ; echo "document generated\n" > doxygen # Cleaning rules CLEANFILES = index.html clean-local: rm -rf html doxygen # Extra files to include in releases (dist) EXTRA_DIST = README.txt aevol.conf aevol-4.4/doc/aevol_propagate.10000644000175000017500000000650712365452043013423 00000000000000\"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_propagate \-h or .B \-\-help .br .B aevol_propagate \-V or .B \-\-version .br .B aevol_propagate \fR[\fB\-v\fR] \fR[\fB\-g\fI GENER\fR] \fR[\fB\-i\fI INDIR\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-S\fI GENERALSEED\fR] .br .B aevol_propagate \fR[\fB\-v\fR] \fR[\fB\-g\fI GENER\fR] \fR[\fB\-i\fI INDIR\fR] \fR[\fB\-o\fI OUTDIR\fR] \fR[\fB\-s\fI SELSEED\fR] \fR[\fB\-m\fI MUTSEED\fR] \fR[\fB\-t\fI STOCHSEED\fR] \fR[\fB\-e\fI ENVVARSEED\fR] \fR[\fB\-n\fI ENVNOISESEED\fR] .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_propagate creates a fresh copy of the experiment as it was at the given generation. The generation number of the copy will be reset to 0. If you use aevol_propagate repeatedly to initialize several simulations, you should specify a different seed for each simulation, otherwise all simulations will yield exactly the same results. You can use the option -S to do so. In this case, the random drawings will be different for all random processes enabled in your simulations (mutations, stochastic gene expression, selection, migration, environmental variation, environmental noise). Alternatively, to change the random drawings for specific random processes only, do not use -S but the options -m, -s, -t, -e, -n (see below). .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .TP .B \-v, \-\-verbose be verbose .HP .B \-g, \-\-gener .I GENER .br specify generation number (default: that contained in file last_gener.txt, if any) .HP .B \-i, \-\-in .I INDIR .br specify input directory (default ".") .HP .B \-o, \-\-out .I OUTDIR .br specify output directory (default "./output") .HP .B \-S, \-\-general\-seed .I GENERALSEED .br specify an integer to be used as a seed for random numbers. If you use aevol_propagate repeatedly to initialize several simulations, you should specify a different seed for each simulation, otherwise all simulations will yield exactly the same results. If you specify this general seed, random drawings will be different for all random processes enabled in your simulations (mutations, stochastic gene expression, selection, migration, environmental variation, environmental noise). To change the random drawings for a specific random process only, do not use -S but the options below. .HP .B \-s, \-\-sel\-seed .I SELSEED .br specify an integer as a seed for random numbers needed for selection and migration (if spatial structure is enabled). .HP .B \-m, \-\-mut\-seed .I MUTSEED .br specify an integer as a seed for random numbers needed for mutations. .HP .B \-t, \-\-stoch\-seed .I STOCHSEED .br specify an integer as a seed for random numbers needed for stochastic gene expression. .HP .B \-e, \-\-env\-var\-seed .I ENVVARSEED .br specify an integer as a seed for random numbers needed for environmental variation. .HP .B \-n, \-\-env\-noise\-seed .I ENVNOISESEED .br specify an integer as a seed for random numbers needed for environmental noise. .SH "SEE ALSO" .B aevol_create, aevol_run, aevol_modify aevol-4.4/doc/aevol_misc_compute_pop_stats.10000644000175000017500000000276612363424757016240 00000000000000./"test with man -l .TH AEVOL "1" "July 2014" "aevol 4.4" "User Manual" .SH NAME aevol \- an in silico experimental evolution platform .SH SYNOPSIS .B aevol_misc_compute_pop_stats \-h | .B \-\-help .br .B aevol_misc_compute_pop_stats \-V | .B \-\-version .br .B aevol_misc_compute_pop_stats \fR[\fB\-i\fI INDEX\fR | \fB\-r\fI RANK\fR] \fR[\fB\-b\fI GENER1\fR] \fB\-e\fI GENER2 .SH DESCRIPTION .B Aevol is a simulation platform that allows one to let populations of digital organisms evolve in different conditions and study experimentally the mechanisms responsible for the structuration of the genome and the transcriptome. .TP .B aevol_misc_compute_pop_stats issues population and replication statistics for each available backup from GENER1 to GENER2. These statistics are written in files global_pop_stats.out and stats/pop_stats/*. .SH OPTIONS .TP .B \-h, \-\-help print help, then exit .TP .B \-V, \-\-version print version number, then exit .HP .B \-i, \-\-index .I INDEX .br specify the index (ID in current generation) of the individual whose replication statistics should be outputted .HP .B \-r, \-\-rank .I RANK .br specify the rank of the individual whose replication statistics should be outputted .HP .B \-b, \-\-begin .I GENER .br specify the first generation for which the statistics should be computed .HP .B \-e, \-\-end .I GENER .br specify the last generation for which the statistics should be computed .SH "SEE ALSO" .B ae_misc_lineage, aevol_create, aevol_modify, aevol_propagate, aevol_run aevol-4.4/NEWS0000644000175000017500000004111312365452043010113 00000000000000New in 4.4: * aevol_create now gives a name to the created strain. It can be defined using the STRAIN_NAME keyword in the param file. If this keyword is not present, a default one will be generated. * New option -o or --out in aevol_create Allows one to create the experiment in any location. * aevol_propagate can now reset the PRNGs (random generators) with the new general option -S (affecting all random processes) or the new more specific options -m, -s, -t, -e and -n (each affects a single random process, see man page). * The environmental target can be defined by a list of custom points using the ENV_ADD_POINT keyword in the parameter file. This is an alternative to the usual way, where it is defined as a sum of gaussians. Note, however, that environmental variation is possible only for the "gaussian" way. * The aevol_misc_fixed_mutations program now outputs the number of genes affected by each mutation. More precisely, three new columns are produced: - the number of coding RNAs possibly disrupted by a switch, a small indel or a rearrangement breakpoint, - the number of coding RNAs entirely included in a rearranged segment, - in the case of a transfer by replacement, the number of genes that were entirely included in the replaced segment. This program does not work yet if plasmids are allowed. * The programs aevol_misc_lineage, aevol_misc_ancstats, aevol_misc_fixed_mutations, aevol_misc_gene_families now work when the environment was changed at some point by aevol_modify. * The fitness proportionate selection scheme now works with spatial structure * In aevol_modify, it is now possible to replace a population by clones of the best individual. To do so, add the line CLONE_BEST_NO_TREE or CLONE_BEST_AND_CHANGE_TREE in the parameter file you supply to aevol_modify. Use CLONE_BEST_AND_CHANGE_TREE if your simulation campaign uses the genealogical trees, that is to say if you set RECORD_TREE to true. Otherwise, use CLONE_BEST_NO_TREE. * Manual pages were added for aevol_misc_lineage, aevol_misc_ancstats, aevol_misc_fixed_mutations, aevol_misc_gene_families, aevol_misc_create_eps, aevol_misc_view_generation. * New option (-c and -p) in aevol_create. Allows one to load a chromosome (and possibly plasmid) from a text file. If -p is used, ALLOW_PLASMIDS must be set to true and -c must also be used. If -c is used and ALLOW_PLASMIDS is set to true, -p must also be used. * Add a script (src/misc/movies.py) to produce a movie from an aevol simulation with dumps activated. run ./src/misc/movies.py -h for help. Needs ffmpeg in path. * The aevol_misc_gene_families program issues the detailed history of each gene family on the lineage of a given individual (providing its lineage file). A gene family is defined here as a set of coding sequences that arised by duplications of a single original gene. The original gene, called the root of the family, can either be one of the genes in the initial ancestor, or a new gene created from scratch (for example by a local mutation that transformed a non-coding RNA into a coding RNA). The history of gene duplications, gene losses and gene mutations in each gene family is represented by a binary tree. The program starts by loading the initial genome at the beginning of the lineage and by tagging each gene in this initial genome. Each of these initial genes is marked as the root of a gene family. Then, each mutation recorded in the lineage file is replayed and the fate of all tagged genes is followed and recorded in their respective families. When a gene is duplicated, the corresponding node in one of the gene trees becomes an internal node, and two children nodes are added to it, representing the two gene copies. When a gene sequence is modified, the mutation is recorded in its corresponding node in one of the gene trees. When a gene is lost, the corresponding node in one of the gene trees is labelled as lost. When a new gene appears from scratch, i.e. not by gene duplication, it becomes the root of a new gene tree. Environmental variations are also replayed exactly as they occured during the main run. When all mutations have been replayed, several output files are written in a directory called gene_trees. Two general text files are produced. The file called gene_tree_statistics.txt contains general data on each gene family, like its creation date, its extinction date, or how many nodes it contained. The file called nodeattr_tabular.txt contains information about each node of each gene tree, like when it was duplicated or lost or how many mutations occurred on its branch. In addition, for each gene tree, two text files are generated: a file called genetree******-topology.tre contains the topology of the gene tree in the Newick format, and a file called genetree******-nodeattr.txt that contains the detailed list of events that happened to each node in the tree file, before it was either duplicated or lost. Usage: ae_misc_gene_families [-c | -n] [-t tolerance] -f lineage_file Changes in 4.4: * In the input file containing the parameters for aevol_create, the SELECTION_SCHEME and SELECTION_PRESSURE keywords have been merged. Only the SELECTION_SCHEME keyword is allowed, it sets both the selection scheme itself and the selection pressure (if any). e.g. SELECTION_SCHEME fitness SELECTION_PRESSURE 750 becomes SELECTION_SCHEME fitness 750 * The default value of duplication_rate, deletion_rate, translocation_rate and inversion_rate is now 1e-5 (instead of 5e-5 before). * The name of binaries no longer depend on configure-time options. e.g. aevol_run is no longer called aevol_run_X11 when x output is enabled. WARNING: If you build several times with different options enabled, you will need to make clean after reconfiguring. * Changed the way the min/max total genome size and the min/max genetic unit size are handled. If you do not use plasmids (ALLOW_PLASMIDS not set, or equal to false), replace INITIAL_GENOME_LENGTH by CHROMOSOME_INITIAL_LENGTH in param.in, and everything will work as it did before. If you do use plasmids, you can now define values for the PLASMID_INITIAL_LENGTH, the PLASMID_MINIMAL_LENGTH, the PLASMID_MAXIMAL_LENGTH, the CHROMOSOME_MINIMAL_LENGTH and the CHROMOSOME_MAXIMAL_LENGTH. In all cases, MIN_GENOME_LENGTH and MAX_GENOME_LENGTH now control the total genome size (i.e., chromosome + plasmids) instead of just controlling the chomosome size. * In aevol_misc_create_eps and aevol_misc_robustness, option -e or --end is now -g or --gener for consistency reasons. * In aevol_modify, the transfer rates are now stored in the mutation parameters of each individual, they are not global parameters anymore. * Removed the historical dependencies to libXi and libXmu, and modified the way compilation flags are handled according to GNU best practices. * Updated post-treatment template and added it to the compiled sources (so that one can make a new post-treatment with no need for autotools). Bugs fixed in 4.4: * Ctrl-Q was not quitting anymore, it does now. Similarly, switching display on/off wasn't working any more, this is now fixed. * Specific "chromosome" and "plasmids" stat files were issued regardless of whether plasmids were allowed or not. Now they are issued only when plasmids are allowed. * When recording stats for each genetic unit, total metabolic fitness and metabolic error were reported instead of "by-genetic-unit" metabolic fitness and metabolic error. This is now corrected. * Translocations between different genetic units were not reported in logs when tree recording was disabled. This is now fixed. * In aevol_create, init_method always set to at least ONE_GOOD_GENE | CLONE, regardless of what was written in the parameter file. This is now fixed. * In aevol_misc_lineage, there was a segmentation fault when the population was spatially structured. This is now corrected. * In aevol_misc_create_eps, there was a systematic segmentation fault since version 4.0. This is now fixed. This program also produces better scaled figures for the triangles. * In aevol_misc_fixed_mutations, the fitness impact of some mutations was wrong if there was some environmental variation. This is now corrected. * In aevol_modify, correction of a segmentation fault on change of population size. * In aevol_propagate, the input directory option (-i) is now working. This program does not write stats anymore, as it should... * The method ae_list::get_object() returned a type T* instead of T&. The bugged version of this method was never used, hence the behavior of the simulations is unaffected. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 4.3 * The post-treatment view_generation is now functional for aevol (with or without space), but not for R-aevol yet. This post-treatment is available if X was enabled at the "configure" step, which is the case by default. * Lateral transfer by replacement can now be constrained to replace a segment of roughly the same size and sequence as the one given by the donor, to simulate allelic recombination. To use this kind of transfer by replacement rather than the usual one (where the donor and replaced segments only have similar sequences at their extremities), add the line "REPL_TRANSFER_WITH_CLOSE_POINTS true" in the param.in file. Specifically, a small region of high similarity is searched for between the donor chromosome and the receiving chromosome. Then this initial alignment is extended until there is no sequence similarity anymore or until a random event stops the extension -- at each extension step, there is a probability called REPL_TRANSFER_DETACH_RATE to stop the extension even if there is some sequence similarity. Below is an example of how to write the param.in file to try for a lateral transfer by replacement in 50% of the reproductions, with the constraint that the replaced segment must have roughly the same size and sequence as the donor segment (the last six parameters are for the alignment search): WITH_TRANSFER true TRANSFER_REPL_RATE 0.5 REPL_TRANSFER_WITH_CLOSE_POINTS true REPL_TRANSFER_DETACH_RATE 0.3 NEIGHBOURHOOD_RATE 1e-1 ALIGN_FUNCTION SIGMOID 0 40 ALIGN_W_ZONE_H_LEN 50 ALIGN_MAX_SHIFT 20 ALIGN_MATCH_BONUS 1 ALIGN_MISMATCH_COST 2 * Lateral transfer events by insertion or replacement can be logged during the main evolutionary run by adding the line "LOG TRANSFER" in the param.in file. They will be written in an output file called log_transfer.out. * Post-treatments lineage and ancstats can replay lateral transfer events. To simplify the post-treatments, lateral transfer events are treated as mutations and rearrangements. They are managed in ae_dna and ae_mutation and no more in ae_selection. If RECORD_TREE is set to true and if TREE_MODE is set to normal in param.in, the transfer events will be saved in the tree files with the transferred sequence. * Examples are now provided in the "examples" dir. Changes in 4.3 * Replaced most of the --with-xxxxx configure script options with --enable-xxxxx. Supported options for the configure script are now [default value in brackets]: --with-x [yes] --enable-optim [enabled] --enable-raevol [disabled] --enable-normalized-fitness [disabled] --enable-mtperiod=period [disabled] --enable-trivialjumps=jumpsize [disabled] --enable-devel [disabled] --enable-debug [disabled] --enable-in2p3 [disabled] * Post-treatment executables are installed into ${prefix}/bin rather than ${prefix}/libexec (we realized it wasn't a good idea after all...). Bugs fixed in 4.3: * Bug #289: Missing lines in the header of stats_bp_best.out * Bug #293: Initialisation with a clonal population: Individuals in the first generation had a rank equal to -1. * Bug #294: Problems in constructor and copy method of ae_vis_a_vis * Bug #300: Missing length data in the tree files for the rearrangements (NORMAL tree mode). * aevol_create produced a segmentation fault if param.in did not contain a line specifying ENV_AXIS_FEATURES. Now this parameter can be omitted, in which case the default value would be METABOLISM for the whole x-axis. * Correction of the default value for the initialisation method, which was 0 instead of "ONE_GOOD_GENE | CLONE". * Correction of memory leaks in the constructor of ae_stats and in the destructor of ae_mutation for some mutations. * Correction of a bug in the lineage post-treatment, which would fail after ~1.000 tree files were loaded because the files were never closed. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 4.2 * Post-treatment executables are now prefixed with aevol_misc_ and are installed into ${prefix}/libexec rather than ${prefix}/bin Bugs fixed in 4.2 * Bugs #281 and #282: Bug in gene position This bug happenned whenever a promoter at the end of the genome on the LEADING strand transcribed a gene that was at the beginning of the genome (or a promoter at the beginning on the LAGGING strand transcribed a gene that was at the end of the genome) The position of the protein was then out of the genome bound (> genome len when LEADING or < 0 when LAGGING) If this gene was also transcribed on another rna that didn't satisfy the above constraint, it wasn't recognized as the same gene. Either bugs had no effect whatsoever on the fitness and hence on the outcome of evolution. It could however lead to erroneous statistics regarding the number of RNAs a gene is transcribed onto. * Bug #284: Undefined behavior when there is no terminator in the genome After a big deletion, it can happen that a genetic unit does not contain any teminator anymore. There can however be a promoter somewhere. The behavior of the program was different depending on the strand where the promoter was. If it was on the lagging strand, the RNA was supposed to be as long as the whole genetic unit, and could carry coding sequences. If the promoter was on the leading strand, the length of the RNA was left as is, that is, either to -1 for generation 0, or to the length inherited from the parent, which made no sense anymore once the terminator has disappeared. We decided that it is best that no RNA is produced in this case (no terminator = incomplete gene, assumed to be non-functional). * Bug #285: "Barrier" events logged twice When a deletion would cause the genetic unit to be smaller than the size of a promoter, the mutation was not performed and (if the BARRIER option was chosen in the logs), and the event was logged twice. This kind of mutations is now performed normally (and hence no log entry should be issued) as long as it doesn't make the genetic unit smaller than the minimum length specified (which is independent of the promoter size). * Bug #286: Log files incorrectly regenerated when resuming a run When resuming a run, log files are regenerated by copying the header of the former log file and its entries until the generation chosen to resume the run. During this copy, (1) the first entry was skipped, and (2) the entries for the resuming generation were copied, and thus ended up duplicated. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 4.1 * Ported the "extract" post-treatment from version 3. This programs can extract from a backup the sequence and the list of all proteins for every individual in an easily parsable text-based format. * aevol_modify allows to modify the axis features and segmentation as well as secretion properties * Added man pages for the 4 main executables Bugs fixed in 4.1 * Supressed memory leaks * Introduced in 4.0: Major bias in the spatial competition caused by a bad update. * In aevol_modify, changing environment gaussians was causing a segfault when NOT using environmental variations. * Bug #279: make install no longer fails with error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New in 4.0 * The main aevol executable has been split into 4: - aevol_create: create an experiment with setup as specified in param_file - aevol_run: run a simulation - aevol_modify: modify an experiment as specified in param_file - aevol_propagate: create a fresh copy of the experiment aevol-4.4/install-sh0000755000175000017500000003253711501451021011414 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: aevol-4.4/Makefile.in0000644000000000000000000005431512365454415011444 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS compile depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AEVOLCPPFLAGS = @AEVOLCPPFLAGS@ AEVOLCXXFLAGS = @AEVOLCXXFLAGS@ AEVOLLDFLAGS = @AEVOLLDFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src doc EXTRA_DIST = examples all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: aevol-4.4/depcomp0000755000175000017500000004426711501451021010770 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: aevol-4.4/AUTHORS0000644000175000017500000000074412227455210010465 00000000000000Original authors: Guillaume Beslon Carole Knibbe David P. Parsons Major Contributors: Bérénice Batut Antoine Frénoy Dusan Misevic Virginie Mathivet Yolanda Sanchez-Dehesa Other Contributors: Guillaume Debras Renaud Dessales Stephan Fischer Yann Hourdel Charles Rocabert Elie Rotenberg Florian Thoni Note: Aevol is distributed with SFMT (SIMD oriented Fast Mersenne Twister) but they are considered a separate package, not part of Aevol proper. aevol-4.4/COPYING0000644000175000017500000010451311501451021010435 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . aevol-4.4/ChangeLog0000644000175000017500000000000111501451021011137 00000000000000 aevol-4.4/README0000644000175000017500000000000012230016363014440 1aevol-4.4/examples/README00000000000000aevol-4.4/aclocal.m40000644000000000000000000011471112365454414011233 00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) dnl dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl AC_DEFUN([AM_PATH_CPPUNIT], [ AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)], cppunit_config_prefix="$withval", cppunit_config_prefix="") AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)], cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="") if test x$cppunit_config_exec_prefix != x ; then cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config fi fi if test x$cppunit_config_prefix != x ; then cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" if test x${CPPUNIT_CONFIG+set} != xset ; then CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config fi fi AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) cppunit_version_min=$1 AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min) no_cppunit="" if test "$CPPUNIT_CONFIG" = "no" ; then AC_MSG_RESULT(no) no_cppunit=yes else CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` cppunit_version=`$CPPUNIT_CONFIG --version` cppunit_major_version=`echo $cppunit_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` cppunit_minor_version=`echo $cppunit_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` cppunit_micro_version=`echo $cppunit_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` cppunit_major_min=`echo $cppunit_version_min | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` if test "x${cppunit_major_min}" = "x" ; then cppunit_major_min=0 fi cppunit_minor_min=`echo $cppunit_version_min | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` if test "x${cppunit_minor_min}" = "x" ; then cppunit_minor_min=0 fi cppunit_micro_min=`echo $cppunit_version_min | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x${cppunit_micro_min}" = "x" ; then cppunit_micro_min=0 fi cppunit_version_proper=`expr \ $cppunit_major_version \> $cppunit_major_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \> $cppunit_minor_min \| \ $cppunit_major_version \= $cppunit_major_min \& \ $cppunit_minor_version \= $cppunit_minor_min \& \ $cppunit_micro_version \>= $cppunit_micro_min ` if test "$cppunit_version_proper" = "1" ; then AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) else AC_MSG_RESULT(no) no_cppunit=yes fi fi if test "x$no_cppunit" = x ; then ifelse([$2], , :, [$2]) else CPPUNIT_CFLAGS="" CPPUNIT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(CPPUNIT_CFLAGS) AC_SUBST(CPPUNIT_LIBS) ]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR aevol-4.4/compile0000755000175000017500000000727111501451021010763 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2009-10-06.20; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software # Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: aevol-4.4/missing0000755000175000017500000001533112151150261011004 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: aevol-4.4/configure.ac0000644000175000017500000002731712365453404011716 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # Require version 2.65 (or newer) of the autotools AC_PREREQ([2.65]) # Provide FULL-PACKAGE-NAME, VERSION and BUG-REPORT-ADDRESS AC_INIT([AEVOL], [4.4], [aevol-bug-report@lists.gforge.liris.cnrs.fr], , [www.aevol.fr]) # We want to use automake AM_INIT_AUTOMAKE # Check the existance of an arbitrary source file AC_CONFIG_SRCDIR([src/aevol_run.cpp]) # Build config.h using config.h.in as a template #AC_CONFIG_HEADERS([config.h:config.h.in]) # Change default value for CXXFLAGS test_CXXFLAGS=${CXXFLAGS+set} if test "$test_CXXFLAGS" != set; then CXXFLAGS="" fi # Checks for programs AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB AM_PROG_CC_C_O # Initialize configure-time defined flags AC_SUBST(AEVOLCPPFLAGS, "") # C PreProcessor flags AC_SUBST(AEVOLCXXFLAGS, "") # C++ Compile flags AC_SUBST(AEVOLLDFLAGS, "") # Linker flags # Checks for libraries. AC_CHECK_LIB([m], [cos], , [AC_MSG_ERROR([PACKAGE_NAME requires the math library, please install it.])]) AC_CHECK_LIB([z], [gzread], , [AC_MSG_ERROR([PACKAGE_NAME requires the zlib development library, please install it.])]) # Checks for header files. AC_CHECK_HEADERS([inttypes.h limits.h stdint.h stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT8_T AC_TYPE_SIZE_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T # Checks for library functions. AC_CHECK_FUNCS([floor memset mkdir pow rint sqrt gzread]) # **************************************************************************** # OPTIONS # # Supported options [default]: # --with-x [yes] # --enable-optim [enabled] # --enable-normalized-fitness [disabled] # --enable-mtperiod=period [disabled] # --enable-trivialjumps=jumpsize [disabled] # --enable-devel [disabled] # --enable-debug [disabled] # --enable-in2p3 [disabled] # # **************************************************************************** # ******************* check option consistency *************************** AC_MSG_CHECKING([checking parameter consistency]) if test "x$enable_in2p3" = "xyes" ; then if test "x$enable_debug" = "xyes" ; then AC_MSG_RESULT([FAIL]) AC_MSG_ERROR([debug and in2p3 are not compatible]) fi if test "x$with_x" != xno ; then AC_MSG_RESULT([FAIL]) AC_MSG_ERROR([x and in2p3 are not compatible]) fi fi AC_MSG_RESULT([OK]) # ************************ --without-x option ********************* # # When this option is set, typing make will produce aevol and # most post-treatment programs, but not aevol_X11. # This is useful if we want to run computations on a cluster where the # X libraries are not present. If, on the contrary, we type ./configure # without this option, then typing make will produce aevol_X11 and # view_generation_X11 (and the other post-treatment programs). AC_MSG_CHECKING([whether to enable graphical outputs]) AC_ARG_WITH(x, [ --without-x to disable graphical output], , with_x=yes) AC_MSG_RESULT($with_x) AM_CONDITIONAL(WITH_X, test x"$with_x" != xno) if test "x$with_x" != xno ; then AC_DEFINE(__X11) AC_PATH_XTRA # AC_PATH_XTRA updates X_LIBS and X_CFLAGS but not CPPFLAGS, CXXFLAGS or LDFLAGS. # Thus we need to add X_CFLAGS to AEVOLCPPFLAGS, and X_LIBS to AEVOLLDFLAGS. # Moreover, on MacOS, AC_CHECK_LIB needs correct CPPFLAGS to find X11. But CPPFLAGS is normally a user # variable, which we should not change. Thus we save its previous value to restore it after AC_CHECK_LIB. ac_cppflags_save="$CPPFLAGS" CPPFLAGS+=" $X_CFLAGS" AEVOLCPPFLAGS+=" $X_CFLAGS" AEVOLLDFLAGS+=" $X_LIBS" AC_CHECK_LIB(X11, XOpenDisplay, , [AC_MSG_ERROR([the X11 library could not be found on your system. Please install it or re-run with the --without-x option])],$X_LIBS) AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h X11/keysym.h X11/Xatom.h X11/cursorfont.h]) CPPFLAGS="$ac_cppflags_save" else AC_DEFINE(__NO_X) fi # ******************* --enable-optim option *************************** # # With this option, the programs are compiled with the # optimization options (-O3 - fexpensive-optimizations...). # AC_MSG_CHECKING([whether to use compile time optimization]) AC_ARG_ENABLE(optim, [ --disable-optim turn off compile time optimization], , enable_optim=yes) AC_MSG_RESULT($enable_optim) AM_CONDITIONAL(WITH_OPTIM, test x"$enable_optim" != xno) if test "x$enable_optim" = "xyes" ; then AEVOLCXXFLAGS+=" -O3 -ffast-math -pipe -fexpensive-optimizations" else AEVOLCXXFLAGS+=" -O0" fi # ******************* --enable-normalized-fitness option *************************** # # With this option, the NORMALIZED_FITNESS flag is defined, # allowing a different fitness calculation AC_MSG_CHECKING([whether to use normalized fitness]) AC_ARG_ENABLE(normalized-fitness, [ --enable-normalized-fitness to enable fitness normalization], , enable_normalized_fitness=no) AC_MSG_RESULT($enable_normalized_fitness) AM_CONDITIONAL(WITH_NORMALIZED_FITNESS, test x"$enable_normalized_fitness" != xno) if test "x$enable_normalized_fitness" = "xyes" ; then AC_DEFINE(NORMALIZED_FITNESS) fi # ************************* --enable-mtperiod=period option ******************************* # # This option sets a particular period for the Mersenne Twister. # Default is --enable-mtperiod=607 corresponding to a period of 2^607. # Possible values are 607, 1279, 2281, 4253, 11213, 19937, 44497, 86243, 132049 and 216091 # AC_MSG_CHECKING([whether to use a particular period for the Mersenne Twister]) AC_ARG_ENABLE(mtperiod, [ --enable-mtperiod=period Set the Mersenne Twister period to 2^period (default is 2^607). Possible values are 607, 1279, 2281, 4253, 11213, 19937, 44497, 86243, 132049 and 216091 Consider using in conjunction with --enable-trivialjumps for large periods ], period=$enableval, period=607) if test $period != 607 && test $period != 1279 && test $period != 2281 && test $period != 4253 && test $period != 11213 && test $period != 19937 && test $period != 44497 && test $period != 86243 && test $period != 132049 && test $period != 216091 ; then AC_MSG_RESULT([FAIL]) AC_MSG_ERROR([$period is not a valid Mersenne Twister period]) fi AC_MSG_RESULT($period) AC_DEFINE_UNQUOTED([SFMT_MEXP], [$period]) # ************************* --enable-trivialjumps=jumpsize option ******************************* # # When this option is set, a trivial jump algorithm will be used instead of the polynomial-based method. # This is recommended for large Mersenne Twister periods when huge jumps are not needed since # the polynomial-based method takes more time in that case. # # For the standard MT (period 2^19937), it takes approx. the same time to draw a few million numbers # than it does to make the same jump using the polynomial-based method. # # The jumpsize argument allows to set the desired jump size. The default value is 1000 which is enough to # avoid overlaps in most cases. # AC_MSG_CHECKING([whether to use trivial Mersenne Twister jumps]) AC_ARG_ENABLE(trivialjumps, [ --enable-trivialjumps=jumpsize When this option is set, a trivial jump algorithm will be used instead of the polynomial-based method. This is recommended for large Mersenne Twister periods when huge jumps are not needed since the polynomial-based method takes more time in that case. For the standard MT (period 2^19937), it takes approx. the same time to draw a few million numbers than it does to make the same jump using the polynomial-based method. The jumpsize argument allows to set the desired jump size. The default value is 1000 which is enough to avoid overlaps in most cases. ], trivialjumps=$enableval, trivialjumps=no) if test "x$trivialjumps" != "xyes" && test "x$trivialjumps" != "xno" ; then AC_MSG_RESULT([yes ($trivialjumps)]) else AC_MSG_RESULT([$trivialjumps]) fi AM_CONDITIONAL(ENABLE_FORCEPJ, test x"$trivialjumps" != xno) if test "x$trivialjumps" = "xyes" ; then AC_DEFINE([TRIVIAL_METHOD_JUMP_SIZE], [1000]) elif test "x$trivialjumps" != "xno" ; then AC_DEFINE_UNQUOTED([TRIVIAL_METHOD_JUMP_SIZE], [$trivialjumps]) fi # ******************* --enable-devel option *************************** # # This enables developers' features: # adds a call to make clean at the end of the configure script. # enables doxygen if available # enforces use of cppunit # AC_MSG_CHECKING([whether to use devel features]) AC_ARG_ENABLE(devel, [ --enable-devel turn on development features], , enable_devel=no) AC_MSG_RESULT($enable_devel) AM_CONDITIONAL(ENABLE_DEVEL, test x"$enable_devel" != xno) if test "x$enable_devel" = "xyes" ; then # Make clean at the end of the configuration process # (usefull when several configurations are done consecutively, typically during development) AC_CONFIG_COMMANDS(make, [make clean]) # Check for Doxygen AC_CHECK_PROGS([HAVE_DOXYGEN], [doxygen]) if test -z "$HAVE_DOXYGEN"; then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) fi # Check for CppUnit # AC_CHECK_LIB does not work with C++ libraries, this is why we use AM_PATH_CPPUNIT # This macro will check whether a Cppunit version >= 1.10.2 is installed # and, if, yes, will define CPPUNIT_CFLAGS and CPPUNIT_LIBS. # This macro is defined in the cppunit.m4 file provided by the cppunit package # when it is installed. Hence aclocal must be run before autoconf to have the # macro known by autoconf. If cppunit is installed in a non-standard # directory, you need to specify where to find cppunit.m4. For example, if # cppunit is installed under /usr/local, run: # ACLOCAL="aclocal -I /usr/local/share/aclocal" autoreconf -if cppunit_missing=no AM_PATH_CPPUNIT(1.10.2, , cppunit_missing=yes) if test "x$cppunit_missing" != xno ; then AC_MSG_ERROR([cppunit not found, make will fail - please install cppunit.]) fi else # Output a warning message about multi-configuration and make clean AC_CONFIG_COMMANDS([user_warning], [AC_MSG_NOTICE([Consider using make clean if you are re-configuring.])]) fi AM_CONDITIONAL([WANT_DOXYGEN], [test -n "$HAVE_DOXYGEN"]) AM_CONDITIONAL([WITH_CPPUNIT], [test -n "$cppunit_missing"]) # ******************* --enable-debug option *************************** # # With this option, the DEBUG flag is defined, and the programs are # compiled with debugging options (-g -Wall). # AC_MSG_CHECKING([whether to use debugging features]) AC_ARG_ENABLE(debug, [ --enable-debug to enable degugging features], , enable_debug=no) AC_MSG_RESULT($enable_debug) AM_CONDITIONAL(WITH_DEBUG, test x"$enable_debug" != xno) if test "x$enable_debug" = "xyes" ; then AC_DEFINE(DEBUG) AEVOLCXXFLAGS+=" -g -Wall" else AC_DEFINE(NDEBUG) fi # ******************* --enable-in2p3 option *************************** # # With this option, the IN2P3 flag is defined AC_MSG_CHECKING([whether to use IN2P3 specific features]) AC_ARG_ENABLE(in2p3, [ --enable-in2p3 to enable IN2P3 specific features], , enable_in2p3=no) AC_MSG_RESULT($enable_in2p3) AM_CONDITIONAL(WITH_IN2P3, test x"$enable_in2p3" != xno) if test "x$enable_in2p3" = "xyes" ; then AC_DEFINE(__IN2P3) fi # ************************* back to GENERAL stuff ******************************* AC_CONFIG_FILES([Makefile src/Makefile src/libaevol/Makefile src/libaevol/SFMT-src-1.4/Makefile src/libaevol/tests/Makefile src/post_treatments/Makefile doc/Makefile]) AC_OUTPUT aevol-4.4/Makefile.am0000644000175000017500000000005112365453404011446 00000000000000SUBDIRS = src doc EXTRA_DIST = examples