-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
90 lines (66 loc) · 3.02 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
title: mixexptr - Analyze microbial interactions in mix experiments
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![R-CMD-check](https://github.com/matryoshkev/mixexptr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/matryoshkev/mixexptr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
A common experimental design for studying microbial interactions is to mix together two different microbes (different bacterial genotypes, for example) then measure how their fitness and behavior depends on mix frequency. How do they behave differently together compared to on their own?
`mixexptr` is an R package that provides tools to **calculate and plot the fitness effects of microbial interactions**, helping researchers get the most out of their data.
## Calculate fitness effects
`mixexptr` provides a convenient way to calculate best-practice fitness measures that are:
* Robust and quantitatively comparable across different species and types of interaction
* Well-suited to statistical analysis of effect sizes and confidence intervals
* Meaningful for both kin and multilevel selection theories of social evolution
```{r}
fitness_results <- calculate_mix_fitness(
data_smith_2010,
var_names = c(
initial_number_A = "initial_cells_evolved",
initial_number_B = "initial_cells_ancestral",
final_number_A = "final_spores_evolved",
final_number_B = "final_spores_ancestral",
name_A = "GVB206.3",
name_B = "GJV10"
)
)
head(fitness_results)
```
## Plot fitness effects
`mixexptr` provides convenient ways to plot calculated fitness effects. Here's a quick diagnostic plot of the different fitness measures for this dataset:
```r
plot_mix_fitness(fitness_results, mix_scale = "fraction")
```
![Diagnostic plot from mixexptr](./man/figures/README-smith-2010.png)
## Installation
You can install the development version of `mixexptr` from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("matryoshkev/mixexptr")
```
## Further reading
* smith j and Inglis RF (2021) Evaluating kin and group selection as tools for quantitative analysis of microbial data. Proceedings B 288:20201657. [https://doi.org/10.1098/rspb.2020.1657](https://doi.org/10.1098/rspb.2020.1657)
<!--
## Example
This is a basic example which shows you how to solve a common problem:
```{r example}
# library(mixexptr)
## basic example code
```
What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so:
You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this.
You can also embed plots, for example:
```{r pressure, echo = FALSE}
# plot(pressure)
```
In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN.
-->