1. Program compilation

gcc -o simulate_mode_of_evolution  -O2 simulate_mode_of_evolution.c



2. Simulation of random breakage model

./simulate_mode_of_evolution input_MeA.txt 1000 0 0 2 0 0 fragile_mode_1.txt > random_breakage_MeA.txt
./simulate_mode_of_evolution input_MeB.txt 1000 0 0 2 0 0 fragile_mode_1.txt > random_breakage_MeB.txt
./simulate_mode_of_evolution input_MeC.txt 1000 0 0 2 0 0 fragile_mode_1.txt > random_breakage_MeC.txt
./simulate_mode_of_evolution input_MeD.txt 1000 0 0 2 0 0 fragile_mode_1.txt > random_breakage_MeD.txt
./simulate_mode_of_evolution input_MeE.txt 1000 0 0 2 0 0 fragile_mode_1.txt > random_breakage_MeE.txt



3. Calculation of P-values for size of orthologous landmarks (3rd column named Gad.)

./calculate_P.pl observed_MeA.txt random_breakage_MeA.txt 1 1000 1 0
./calculate_P.pl observed_MeB.txt random_breakage_MeB.txt 1 1000 1 0
./calculate_P.pl observed_MeC.txt random_breakage_MeC.txt 1 1000 1 0
./calculate_P.pl observed_MeD.txt random_breakage_MeD.txt 1 1000 1 0
./calculate_P.pl observed_MeE.txt random_breakage_MeE.txt 1 1000 1 0



4. Calculation of P-values for number of neighbouring orthologous (3rd column named Gad.)

./calculate_P.pl observed_MeA.txt random_breakage_MeA.txt 1 1000 4 1
./calculate_P.pl observed_MeB.txt random_breakage_MeB.txt 1 1000 4 1
./calculate_P.pl observed_MeC.txt random_breakage_MeC.txt 1 1000 4 1
./calculate_P.pl observed_MeD.txt random_breakage_MeD.txt 1 1000 4 1
./calculate_P.pl observed_MeE.txt random_breakage_MeE.txt 1 1000 4 1



5. Simulation of mode of evolution R2 and F1 for optimal degree of resilience and fragility (may take a few minutes)

./simulate_mode_of_evolution input_MeA.txt 1000 0.34 0 2 0.92 0 fragile_mode_1.txt > optimal_R2F1_MeA.txt
./simulate_mode_of_evolution input_MeB.txt 1000 0.15 0 2 0.94 0 fragile_mode_1.txt > optimal_R2F1_MeB.txt
./simulate_mode_of_evolution input_MeC.txt 1000 0.18 0 2 0.92 0 fragile_mode_1.txt > optimal_R2F1_MeC.txt
./simulate_mode_of_evolution input_MeD.txt 1000 0.11 0 2 0.94 0 fragile_mode_1.txt > optimal_R2F1_MeD.txt
./simulate_mode_of_evolution input_MeE.txt 1000 0.28 0 2 0.91 0 fragile_mode_1.txt > optimal_R2F1_MeE.txt



6. Calculation of P-values for both proxies (3rd column named Gad.) for mode of evolution R2 and F1

./calculate_P.pl observed_MeA.txt optimal_R2F1_MeA.txt 1 1000 1 0
./calculate_P.pl observed_MeB.txt optimal_R2F1_MeB.txt 1 1000 1 0
./calculate_P.pl observed_MeC.txt optimal_R2F1_MeC.txt 1 1000 1 0
./calculate_P.pl observed_MeD.txt optimal_R2F1_MeD.txt 1 1000 1 0
./calculate_P.pl observed_MeE.txt optimal_R2F1_MeE.txt 1 1000 1 0

./calculate_P.pl observed_MeA.txt optimal_R2F1_MeA.txt 1 1000 4 1
./calculate_P.pl observed_MeB.txt optimal_R2F1_MeB.txt 1 1000 4 1
./calculate_P.pl observed_MeC.txt optimal_R2F1_MeC.txt 1 1000 4 1
./calculate_P.pl observed_MeD.txt optimal_R2F1_MeD.txt 1 1000 4 1
./calculate_P.pl observed_MeE.txt optimal_R2F1_MeE.txt 1 1000 4 1



7. Simulation of mode of evolution R2 and F1 for Combined Element with optimal parameters (may take a few minutes)

./simulate_mode_of_evolution input_MeB.txt 1000 0.17 0 2 0.93 0 fragile_mode_1.txt > optimal_R2F1_CE_MeB.txt
./simulate_mode_of_evolution input_MeD.txt 1000 0.17 0 2 0.93 0 fragile_mode_1.txt > optimal_R2F1_CE_MeD.txt
./simulate_mode_of_evolution input_MeE.txt 1000 0.17 0 2 0.93 0 fragile_mode_1.txt > optimal_R2F1_CE_MeE.txt



8. Calculation of P-values for both proxies (3rd column named Gad.) for mode of evolution R2 and F1 for Combined Element with optimal parameters

./calculate_P.pl observed_MeB.txt optimal_R2F1_CE_MeB.txt observed_MeD.txt optimal_R2F1_CE_MeD.txt observed_MeE.txt optimal_R2F1_CE_MeE.txt 1 1000 1 0
./calculate_P.pl observed_MeB.txt optimal_R2F1_CE_MeB.txt observed_MeD.txt optimal_R2F1_CE_MeD.txt observed_MeE.txt optimal_R2F1_CE_MeE.txt 1 1000 4 1

