This script analyses the data set data_csgA413.csv. This data set contains the results of an experiment testing the pure culture and in-mixture phenotypes of five csgA plasmid-insertion mutants (one of GJV1, four of natural isolates). The mutants were tested in mixture with all parental strains.

Step 1

We import the data and make a plot to visualize spore production.

## 'data.frame':    277 obs. of  10 variables:
##  $ replicate  : int  1 2 3 4 1 2 3 4 1 2 ...
##  $ plate      : chr  "Chihaya20 csgA:Chihaya 20" "Chihaya20 csgA:Chihaya 20" "Chihaya20 csgA:Chihaya 20" "Chihaya20 csgA:Chihaya 20" ...
##  $ focalstrain: chr  "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" ...
##  $ partner    : chr  "Chihaya 20" "Chihaya 20" "Chihaya 20" "Chihaya 20" ...
##  $ antibiotic : chr  "kan" "kan" "kan" "kan" ...
##  $ mutant     : chr  "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" ...
##  $ proficient : chr  "Chihaya 20" "Chihaya 20" "Chihaya 20" "Chihaya 20" ...
##  $ count      : chr  "mutant" "mutant" "mutant" "mutant" ...
##  $ dilution   : int  3 3 3 3 1 1 1 1 1 1 ...
##  $ cfus       : int  63 16 29 91 0 0 0 0 0 0 ...
## 'data.frame':    252 obs. of  12 variables:
##  $ replicate  : int  1 2 3 4 1 2 3 4 1 2 ...
##  $ plate      : chr  "Chihaya20 csgA:Chihaya 20" "Chihaya20 csgA:Chihaya 20" "Chihaya20 csgA:Chihaya 20" "Chihaya20 csgA:Chihaya 20" ...
##  $ focalstrain: chr  "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" ...
##  $ partner    : chr  "Chihaya 20" "Chihaya 20" "Chihaya 20" "Chihaya 20" ...
##  $ antibiotic : chr  "kan" "kan" "kan" "kan" ...
##  $ mutant     : chr  "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" "Chihaya 20 csgA" ...
##  $ proficient : chr  "Chihaya 20" "Chihaya 20" "Chihaya 20" "Chihaya 20" ...
##  $ count      : chr  "mutant" "mutant" "mutant" "mutant" ...
##  $ dilution   : int  3 3 3 3 1 1 1 1 1 1 ...
##  $ cfus       : int  63 16 29 91 0 0 0 0 0 0 ...
##  $ numspores  : num  63000 16000 29000 91000 0 0 0 0 0 0 ...
##  $ logspores  : num  4.8 4.2 4.46 4.96 0 ...

Step 2

Now we calculate whether any mutants produced more spores in mixture than expected based on their pure culture performance.

Are the mutants complemented by the proficient strains (complementation > 0)? Are the mutants harmed by the proficient strains (complementation < 0)?

##  [1] "Chihaya20 csgA:Chihaya 20"      "Chihaya20 csgA:GH 3.5.6c2"     
##  [3] "Chihaya20 csgA:GJV1"            "Chihaya20 csgA:MC 3.5.9c15"    
##  [5] "Chihaya20 csgA:Serengeti 01"    "DK5208:GJV1"                   
##  [7] "GH 3.5.6c2 csgA:Chihaya 20"     "GH 3.5.6c2 csgA:GH 3.5.6c2"    
##  [9] "GH 3.5.6c2 csgA:GJV1"           "GH 3.5.6c2 csgA:MC 3.5.9c15"   
## [11] "GH 3.5.6c2 csgA:Serengeti 01"   "GJV1 csgA:Chihaya 20"          
## [13] "GJV1 csgA:GH 3.5.6c2"           "GJV1 csgA:GJV1"                
## [15] "GJV1 csgA:MC 3.5.9c15"          "GJV1 csgA:Serengeti 01"        
## [17] "MC 3.5.9c15 csgA:Chihaya 20"    "MC 3.5.9c15 csgA:GH 3.5.6c2"   
## [19] "MC 3.5.9c15 csgA:GJV1"          "MC 3.5.9c15 csgA:MC 3.5.9c15"  
## [21] "MC 3.5.9c15 csgA:Serengeti 01"  "Serengeti 01 csgA:Chihaya 20"  
## [23] "Serengeti 01 csgA:GH 3.5.6c2"   "Serengeti 01 csgA:GJV1"        
## [25] "Serengeti 01 csgA:MC 3.5.9c15"  "Serengeti 01 csgA:Serengeti 01"
##  [1] 0.0006    NaN 0.2141    NaN    NaN 0.0016 0.0508 0.2691 0.0072 0.5069
## [11] 0.0508 0.0006 0.0006 0.0508 0.0006 0.0006 0.0006 0.0006 0.0138 0.1507
## [21] 0.0006 0.0384 0.0384 0.0508 0.0384 0.4021

NaN’s for Chihaya 20 (N2) csgA are for mixes where it produced no spores across replicates in either the mix or in PC.

Chihaya20 csgA:Chihaya 20 0.0006398953 Chihaya20 csgA:GH 3.5.6c2 NaN Chihaya20 csgA:GJV1 0.2140747321 Chihaya20 csgA:MC 3.5.9c15 NaN Chihaya20 csgA:Serengeti 01 NaN GH 3.5.6c2 csgA:Chihaya 20 0.0508358225 GH 3.5.6c2 csgA:GH 3.5.6c2 0.2691001526 GH 3.5.6c2 csgA:GJV1 0.0071745053 GH 3.5.6c2 csgA:MC 3.5.9c15 0.5068714863 GH 3.5.6c2 csgA:Serengeti 01 0.0508358225 GJV1 csgA:Chihaya 20 0.0006398953 GJV1 csgA:GH 3.5.6c2 0.0006398953 GJV1 csgA:GJV1 0.0508358225 GJV1 csgA:MC 3.5.9c15 0.0006398953 GJV1 csgA:Serengeti 01 0.0006398953 DK5208:GJV1 0.0015822012 MC 3.5.9c15 csgA:Chihaya 20 0.0006455040 MC 3.5.9c15 csgA:GH 3.5.6c2 0.0006455040 MC 3.5.9c15 csgA:GJV1 0.0137723790 MC 3.5.9c15 csgA:MC 3.5.9c15 0.1506743848 MC 3.5.9c15 csgA:Serengeti 01 0.0006455040 Serengeti 01 csgA:Chihaya 20 0.0383941406 Serengeti 01 csgA:GH 3.5.6c2 0.0383941406 Serengeti 01 csgA:GJV1 0.0508358225 Serengeti 01 csgA:MC 3.5.9c15 0.0383941406 Serengeti 01 csgA:Serengeti 01 0.4020659191

Step 3

First, we calculate the final frequencies of the mutants in mixture, then we calculate the relative fitness parameter Wij.

Wij = log(number spores of cheater in mixture/number initial cells of cheater in mixture) - log(number spores of partner in mixture/number initial cells of partner in mixture).

We replace 0 spore counts with 9s. If I saw 0 spores at the lowest dilution plated (10^-1), then 0.9 is the most conservative estimate for the number of spores produced below the detection limit, giving a total of 9 spores produced.

We test whether any of the mutants have significantly lower spore production than the wild-type.

Fit a general linear model using ANOVA and then check contrasts.

##                   Df Sum Sq Mean Sq F value   Pr(>F)    
## mutant             5  59.60  11.921   56.13  < 2e-16 ***
## proficient         4   7.08   1.771    8.34 1.18e-05 ***
## mutant:proficient 16 240.14  15.009   70.67  < 2e-16 ***
## Residuals         78  16.57   0.212                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Fitness of the strain depends on the mutant, the proficient strain, and the interaction between the two.

##  [1] "Chihaya20 csgA:Chihaya 20"      "Chihaya20 csgA:GH 3.5.6c2"     
##  [3] "Chihaya20 csgA:GJV1"            "Chihaya20 csgA:MC 3.5.9c15"    
##  [5] "Chihaya20 csgA:Serengeti 01"    "DK5208:GJV1"                   
##  [7] "GH 3.5.6c2 csgA:Chihaya 20"     "GH 3.5.6c2 csgA:GH 3.5.6c2"    
##  [9] "GH 3.5.6c2 csgA:GJV1"           "GH 3.5.6c2 csgA:MC 3.5.9c15"   
## [11] "GH 3.5.6c2 csgA:Serengeti 01"   "GJV1 csgA:Chihaya 20"          
## [13] "GJV1 csgA:GH 3.5.6c2"           "GJV1 csgA:GJV1"                
## [15] "GJV1 csgA:MC 3.5.9c15"          "GJV1 csgA:Serengeti 01"        
## [17] "MC 3.5.9c15 csgA:Chihaya 20"    "MC 3.5.9c15 csgA:GH 3.5.6c2"   
## [19] "MC 3.5.9c15 csgA:GJV1"          "MC 3.5.9c15 csgA:MC 3.5.9c15"  
## [21] "MC 3.5.9c15 csgA:Serengeti 01"  "Serengeti 01 csgA:Chihaya 20"  
## [23] "Serengeti 01 csgA:GH 3.5.6c2"   "Serengeti 01 csgA:GJV1"        
## [25] "Serengeti 01 csgA:MC 3.5.9c15"  "Serengeti 01 csgA:Serengeti 01"
##  [1] 0.0888 0.0000 0.0002 0.0002 0.0001 0.0317 0.0000 0.0571 0.0111 0.0109
## [11] 0.0000 0.0000 0.0000 0.5790 0.0000 0.0000 0.0001 0.0000 0.0006 0.1529
## [21] 0.0000 0.0000 0.0000 0.0001 0.0000 0.8335

DK5208:GJV1 p = 0.032 Chihaya so csgA:Chihaya 20 p = 0.09 GH 3.5.6c2 csgA:GH 3.5.6c2 p = 0.06 GJV1 csgA:GJV1 p = 0.06 MC 3.5.9c15 csgA:MC 3.5.9c15 p = 0.15 Serengeti 01 csgA:Serengeti 01 p = 0.83

GH 3.5.6c2 csgA:MC 3.5.9c15 p = 0.01, mean = -0.84 +/- 0.42

26 2-sided t-tests against 0 corrected using the Bonferroni-Holm method.

Step 4

Compare DK5208 and GJV1 csgA relative sporulation. We don’t include this above because we are above comparing the epistatic effect of the same mutations across different genetic backgrounds. Here we are comparing the different effects of two different mutations in the same genetic background.

We test whether there is a difference between Wij for these two strains.

## 
##  Paired t-test
## 
## data:  epistasis by focalstrain
## t = -20.237, df = 3, p-value = 0.0002638
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.529887 -5.483460
## sample estimates:
## mean of the differences 
##               -6.506673

Yes, there is a difference caused by the mutation, p = 0.0003, paired t-test, df = 3, mean of differences with 95% confidence interval = 6.5[5.4, 7.5].

Step 5

We calculate a measure of epistasis: sporulation of the mutant in pure culture relative to its parent strain in pure culture.

We test whether any of the mutants have significantly lower spore production than the wild-type.

Fit a general linear model using ANOVA and then check contrasts.

##             Df Sum Sq Mean Sq F value   Pr(>F)    
## focalstrain  5 130.87  26.174   18.49 1.58e-06 ***
## Residuals   18  25.48   1.415                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The “strain” variable explains some of the variability of the data set, so we do t-tests to check whether the relative spore production for any of the strains is less than zero (we expect mutating csgA to produce a developmental defect).

## [1] "DK5208"    "GJV1 csgA" "N2 csgA"   "N9 csgA"   "N16 csgA"  "N23 csgA"
## [1] 0.0003 0.2653 0.0001 0.0300 0.0279 0.0003

GJV1 csgA is not shown to be defective: p = 0.26.

The remaining strains are defective: p <= 0.03, 6 1-sided t-tests against 0 corrected using the Bonferroni-Holm method.

Output figures