Chapter 8 Aligned individual-level and population-level task directed evolution experiment

8.1 Overview

Supplemental information and data analyses for the directed evolution experiment where rewards for individual- and population-level tasks are aligned.

8.2 Analysis dependencies

Load all required R libraries

These analyses were knit with the following environment:

##                _                           
## platform       x86_64-pc-linux-gnu         
## arch           x86_64                      
## os             linux-gnu                   
## system         x86_64, linux-gnu           
## status                                     
## major          4                           
## minor          2.1                         
## year           2022                        
## month          06                          
## day            23                          
## svn rev        82513                       
## language       R                           
## version.string R version 4.2.1 (2022-06-23)
## nickname       Funny-Looking Kid

8.3 Setup

Load experiment summary data.

Load time series data.

Load task coverage per population data.

Miscellaneous setup

8.4 Best single-population task coverage

## Saving 7 x 5 in image

Statistical results:

## 
##  Kruskal-Wallis rank sum test
## 
## data:  max_trait_coverage by SELECTION_METHOD
## Kruskal-Wallis chi-squared = 232.92, df = 6, p-value < 2.2e-16
## 
##  Pairwise comparisons using Wilcoxon rank sum test with continuity correction 
## 
## data:  exp_summary_data$max_trait_coverage and exp_summary_data$SELECTION_METHOD 
## 
##          elite   elite-10 tourn   lex     nde     random 
## elite-10 0.713   -        -       -       -       -      
## tourn    1.000   1.000    -       -       -       -      
## lex      5.7e-07 5.4e-10  1.5e-11 -       -       -      
## nde      1.000   0.056    0.098   2.0e-09 -       -      
## random   2.2e-15 3.6e-16  < 2e-16 2.4e-16 < 2e-16 -      
## none     4.9e-12 7.1e-14  1.9e-15 7.8e-08 7.5e-15 3.6e-11
## 
## P value adjustment method: bonferroni

8.4.1 Best single-population task coverage time series

To speed up graphing, we plot a low-resolution version of the time series.

## Warning: Computation failed in `stat_summary()`:

## Warning: Computation failed in `stat_summary()`:

8.5 Metapopulation task coverage

## Saving 7 x 5 in image

Statistical results:

## 
##  Kruskal-Wallis rank sum test
## 
## data:  total_trait_coverage by SELECTION_METHOD
## Kruskal-Wallis chi-squared = 269.5, df = 6, p-value < 2.2e-16
## 
##  Pairwise comparisons using Wilcoxon rank sum test with continuity correction 
## 
## data:  exp_summary_data$total_trait_coverage and exp_summary_data$SELECTION_METHOD 
## 
##          elite   elite-10 tourn   lex     nde     random 
## elite-10 1.00000 -        -       -       -       -      
## tourn    1.00000 1.00000  -       -       -       -      
## lex      < 2e-16 < 2e-16  < 2e-16 -       -       -      
## nde      2.2e-14 2.6e-12  6.9e-15 1.1e-15 -       -      
## random   7.7e-11 5.6e-13  6.2e-14 < 2e-16 < 2e-16 -      
## none     2.2e-08 0.00014  3.1e-06 < 2e-16 4.9e-08 < 2e-16
## 
## P value adjustment method: bonferroni

8.5.1 Metapopulation task coverage time series

To speed up graphing, we plot a low-resolution version of the time series.

## Warning: Computation failed in `stat_summary()`:

## Warning: Computation failed in `stat_summary()`:

8.5.1.1 First 30 cycles of the experiment

## Warning: Computation failed in `stat_summary()`:

## Warning: Computation failed in `stat_summary()`:

After just 10 cycles, we observed significant gains from using NDE and LEX selection protocols.

## 
##  Kruskal-Wallis rank sum test
## 
## data:  total_trait_coverage by SELECTION_METHOD
## Kruskal-Wallis chi-squared = 202.89, df = 6, p-value < 2.2e-16
## 
##  Pairwise comparisons using Wilcoxon rank sum test with continuity correction 
## 
## data:  early_data$total_trait_coverage and early_data$SELECTION_METHOD 
## 
##          elite   elite-10 tourn   lex     nde     random
## elite-10 1.0000  -        -       -       -       -     
## tourn    0.1043  1.0000   -       -       -       -     
## lex      4.0e-16 5.5e-15  2.6e-12 -       -       -     
## nde      3.6e-16 4.2e-15  2.5e-12 1.0000  -       -     
## random   5.3e-05 0.0062   1.0000  2.8e-14 4.7e-14 -     
## none     9.9e-06 0.0013   1.0000  3.8e-13 3.1e-13 1.0000
## 
## P value adjustment method: bonferroni

8.6 Metapopulation task profile diversity

We measured the “phenotypic” diversity within evolved metapopulations in three ways:

  1. the number of task profiles (richness)
  2. the spread of task profiles as the average cosine distance from the centroid profile
  3. the Shannon entropy of task profiles

8.6.1 Number of different task profiles

## Saving 7 x 5 in image

Statistical results

## 
##  Kruskal-Wallis rank sum test
## 
## data:  num_pop_trait_profiles by SELECTION_METHOD
## Kruskal-Wallis chi-squared = 247.78, df = 6, p-value < 2.2e-16
## 
##  Pairwise comparisons using Wilcoxon rank sum test with continuity correction 
## 
## data:  exp_summary_data$num_pop_trait_profiles and exp_summary_data$SELECTION_METHOD 
## 
##          elite   elite-10 tourn   lex     nde     random 
## elite-10 1.00000 -        -       -       -       -      
## tourn    0.12006 1.00000  -       -       -       -      
## lex      9.0e-07 0.00066  0.64177 -       -       -      
## nde      < 2e-16 < 2e-16  < 2e-16 < 2e-16 -       -      
## random   1.00000 0.19565  0.00081 2.5e-10 < 2e-16 -      
## none     < 2e-16 < 2e-16  < 2e-16 < 2e-16 < 2e-16 < 2e-16
## 
## P value adjustment method: bonferroni

8.6.2 Task profile spread

## Saving 7 x 5 in image

Statistical results:

## 
##  Kruskal-Wallis rank sum test
## 
## data:  avg_cosine_dist_from_centroid by SELECTION_METHOD
## Kruskal-Wallis chi-squared = 281.91, df = 6, p-value < 2.2e-16
## 
##  Pairwise comparisons using Wilcoxon rank sum test with continuity correction 
## 
## data:  exp_summary_data$avg_cosine_dist_from_centroid and exp_summary_data$SELECTION_METHOD 
## 
##          elite   elite-10 tourn   lex     nde     random 
## elite-10 1.0000  -        -       -       -       -      
## tourn    0.0644  0.6009   -       -       -       -      
## lex      < 2e-16 < 2e-16  < 2e-16 -       -       -      
## nde      < 2e-16 < 2e-16  < 2e-16 7.5e-15 -       -      
## random   0.0015  0.0121   0.4682  < 2e-16 1.3e-15 -      
## none     < 2e-16 < 2e-16  < 2e-16 < 2e-16 3.7e-09 5.4e-14
## 
## P value adjustment method: bonferroni

8.6.3 Task profile entropy

## Saving 7 x 5 in image

Statistical results:

## 
##  Kruskal-Wallis rank sum test
## 
## data:  pop_trait_profile_entropy by SELECTION_METHOD
## Kruskal-Wallis chi-squared = 271.97, df = 6, p-value < 2.2e-16
## 
##  Pairwise comparisons using Wilcoxon rank sum test with continuity correction 
## 
## data:  exp_summary_data$pop_trait_profile_entropy and exp_summary_data$SELECTION_METHOD 
## 
##          elite   elite-10 tourn   lex     nde     random 
## elite-10 1.00    -        -       -       -       -      
## tourn    0.12    1.00     -       -       -       -      
## lex      5.2e-16 5.1e-14  2.4e-10 -       -       -      
## nde      < 2e-16 < 2e-16  < 2e-16 < 2e-16 -       -      
## random   0.77    1.00     1.00    6.2e-13 < 2e-16 -      
## none     < 2e-16 < 2e-16  3.0e-16 2.3e-16 < 2e-16 < 2e-16
## 
## P value adjustment method: bonferroni

8.7 Task coverage per N populations

We analyzed the (maximum) number of tasks added to metapopulation task coverage for a given number (N) of member populations considered. That is, for each N, we solved the maximum set coverage problem for task coverage: what is the maximum number of tasks that can be covered given N populations from this metapopulation?

## Warning: Removed 28350 rows containing non-finite values (stat_summary).
## Removed 28350 rows containing non-finite values (stat_summary).
## Warning: Computation failed in `stat_summary()`:

## Warning: Removed 28350 rows containing non-finite values (stat_summary).
## Warning: Removed 28350 rows containing non-finite values (stat_summary).
## Warning: Computation failed in `stat_summary()`:

8.8 Average number of different populations selected per generation

## Saving 7 x 5 in image
## [1] 1
## [1] 10
## [1] 50.1328
## [1] 91.50978
## [1] 12.18061
## [1] 60.84774

8.9 Average number of organisms in populations at end of maturation period

## Warning: Removed 1 rows containing non-finite values (stat_ydensity).
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).
## Warning: Removed 1 rows containing missing values (geom_point).

## Saving 7 x 5 in image
## Warning: Removed 1 rows containing non-finite values (stat_ydensity).
## Warning: Removed 1 rows containing non-finite values (stat_boxplot).
## Warning: Removed 1 rows containing missing values (geom_point).

8.11 Manuscript figures

Without time series:

With time series:

## Warning: Computation failed in `stat_summary()`:
## Warning: Computation failed in `stat_summary()`:
## Warning in as_grob.default(plot): Cannot convert object of class themegg into a
## grob.
## Warning: Graphs cannot be horizontally aligned unless the axis parameter is set.
## Placing graphs unaligned.

## Warning: Computation failed in `stat_summary()`:
## Warning in as_grob.default(plot): Cannot convert object of class themegg into a
## grob.
## Warning: Graphs cannot be horizontally aligned unless the axis parameter is set.
## Placing graphs unaligned.

## Warning in as_grob.default(plot): Cannot convert object of class themegg into a
## grob.

## Warning in as_grob.default(plot): Graphs cannot be horizontally aligned unless
## the axis parameter is set. Placing graphs unaligned.