2021 Spawns
June Spawns
load libraries
###libraries###
library(tidyverse)
## Warning: package 'tibble' was built under R version 4.3.3
## Warning: package 'lubridate' was built under R version 4.3.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.1 ✔ stringr 1.5.1
## ✔ ggplot2 4.0.0 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
## Warning: package 'readxl' was built under R version 4.3.3
load June 2021 dataset
June_2021 <- read_excel("June 2021.xlsx",
sheet = "6.18.21 fertilization revisit")
## New names:
## • `` -> `...2`
## • `` -> `...3`
## • `` -> `...4`
## • `` -> `...5`
## • `` -> `...6`
## • `` -> `...7`
## • `` -> `...8`
## • `` -> `...9`
## • `` -> `...10`
## • `` -> `...11`
## • `` -> `...12`
## • `` -> `...13`
## • `` -> `...14`
## • `` -> `...15`
## • `` -> `...16`
## • `` -> `...17`
View(June_2021)
Clean June crosses
June_2021 <- read_excel("June 2021.xlsx",
sheet = "6.18.21 fertilization revisit",
skip = 6) %>%
janitor::clean_names() %>%
tidyr::fill(cross, female, male,
female_id, male_id,
cross_id, cross_type,
.direction = "down") %>%
dplyr::mutate(cross_date = "2021-06-18") %>%
tidyr::extract(cross, into = "cross",
regex = "Cross (\\d+)")
View(June_2021)
Calculate the average fertilization rates across replicates. Not that there are two measures of fertilization success that use either the presence of cell division alone or include the presence of polar bodies
june_fert_tbl <- June_2021 %>%
group_by(cross_date, cross_type, cross, female_id, male_id) %>%
summarize(mean_fert_rate = mean(percent_w_p_bs)) %>%
ungroup()
## `summarise()` has grouped output by 'cross_date', 'cross_type', 'cross',
## 'female_id'. You can override using the `.groups` argument.
Now we can plot the results
ggplot(june_fert_tbl, aes(x = cross_type, y = mean_fert_rate)) +
geom_point()
July Spawns
Load July datasets
July_2021 <- read_excel(" July 2021-2.xlsx",
sheet = "7.13.21 (67)",
skip = 1,
col_names = TRUE)%>%
janitor::clean_names() %>%
tidyr::fill(cross, female_id, male_id, cross_type,
.direction = "down") %>%
mutate(cross_date = "2021-07-13") %>%
filter(cross_type != "NA") %>%
mutate(cross = as.character(cross))
## New names:
## • `` -> `...7`
## • `` -> `...17`
july_fert_tbl <- July_2021 %>%
group_by(cross_date, cross, cross_type, female_id, male_id) %>%
summarize(mean_fert_rate = mean(fertilization_percent)) %>%
ungroup()
## `summarise()` has grouped output by 'cross_date', 'cross', 'cross_type',
## 'female_id'. You can override using the `.groups` argument.
ggplot(july_fert_tbl, aes(x = cross_type, y = mean_fert_rate)) +
geom_point()
Combine crosses
hyb_crosses_2021 <- bind_rows(june_fert_tbl, july_fert_tbl)
ggplot(hyb_crosses_2021, aes(x = cross_type, y = mean_fert_rate)) +
geom_point()
stats
hyb_crosses_2021 %>%
group_by(cross_type) %>%
summarize(fert_rate = mean(mean_fert_rate))
## # A tibble: 4 × 2
## cross_type fert_rate
## <chr> <dbl>
## 1 NN 59.5
## 2 NS 16.4
## 3 SN 56.2
## 4 SS 44.5
res <- lm(mean_fert_rate ~ cross_type + cross_date + female_id + male_id, data = hyb_crosses_2021)
summary(res)
##
## Call:
## lm(formula = mean_fert_rate ~ cross_type + cross_date + female_id +
## male_id, data = hyb_crosses_2021)
##
## Residuals:
## Min 1Q Median 3Q Max
## -25.891 -3.403 0.000 5.378 26.526
##
## Coefficients: (17 not defined because of singularities)
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 144.1711 21.7185 6.638 7.62e-08 ***
## cross_typeNS -44.5349 12.0449 -3.697 0.000685 ***
## cross_typeSN -70.3668 14.6661 -4.798 2.49e-05 ***
## cross_typeSS -65.4375 19.5681 -3.344 0.001866 **
## cross_date2021-07-13 -68.2883 18.3049 -3.731 0.000622 ***
## female_idCV-MGB-001 -84.3135 26.9868 -3.124 0.003406 **
## female_idCV-MGB-002 -89.0235 29.1656 -3.052 0.004130 **
## female_idCV-MGB-004 -88.3262 29.1656 -3.028 0.004402 **
## female_idCV-MGB-005 -77.1007 29.1656 -2.644 0.011855 *
## female_idCV-MGB-007 -73.8836 26.9868 -2.738 0.009360 **
## female_idCV-ULM-001 -29.9248 25.6569 -1.166 0.250742
## female_idCV-ULM-002 10.1220 25.6569 0.395 0.695407
## female_idCV-ULM-003 -4.8435 25.6569 -0.189 0.851271
## female_idCV-ULM-004 -22.0852 22.6538 -0.975 0.335776
## female_idCV-ULM-005 -16.9088 22.6538 -0.746 0.460019
## female_idCV-ULM-006 NA NA NA NA
## female_idMGB-1-F 3.8522 9.2484 0.417 0.679370
## female_idMGB-2-F -5.0451 15.4918 -0.326 0.746466
## female_idMGB-3-F -23.7708 15.4918 -1.534 0.133214
## female_idMGB-4-F -65.7544 20.1648 -3.261 0.002348 **
## female_idMGB-5-F -19.9317 20.1648 -0.988 0.329190
## female_idMGB-7-F -28.7174 20.1648 -1.424 0.162568
## female_idMGB-8-F -59.0732 20.1648 -2.930 0.005713 **
## female_idMGB-9-F -3.7959 16.0187 -0.237 0.813956
## female_idMGB-F-10 NA NA NA NA
## female_idorig. M, bad F 83.6940 10.5174 7.958 1.29e-09 ***
## female_idoriginally called M 42.4626 26.1062 1.627 0.112101
## female_idPAC-1-F 53.9445 20.6139 2.617 0.012665 *
## female_idPAC-pool 31.2301 20.6139 1.515 0.138047
## female_idULM-0-F 86.9163 10.5174 8.264 5.15e-10 ***
## female_idULM-1-F 50.5519 11.0364 4.580 4.88e-05 ***
## female_idULM-10-F -2.5233 18.4228 -0.137 0.891782
## female_idULM-11-F 16.7402 26.1062 0.641 0.525219
## female_idULM-12-F 28.3924 20.6139 1.377 0.176466
## female_idULM-13-F -10.4453 20.6139 -0.507 0.615284
## female_idULM-4-F 74.2124 11.0364 6.724 5.82e-08 ***
## female_idULM-5-F 79.4128 18.9943 4.181 0.000165 ***
## female_idULM-6-F 8.4350 18.9943 0.444 0.659503
## female_idULM-7-F -7.9012 18.9943 -0.416 0.679768
## female_idULM-8-F -6.1808 18.9943 -0.325 0.746661
## female_idULM-9-F 55.3168 18.4228 3.003 0.004714 **
## female_idULM-M-2 40.8705 20.6139 1.983 0.054669 .
## female_idULM-pool 63.4912 20.6139 3.080 0.003836 **
## male_idCV-MGB-014 NA NA NA NA
## male_idCV-MGB-015 NA NA NA NA
## male_idCV-MGB-017 30.1051 25.6569 1.173 0.247948
## male_idCV-ULM-012 NA NA NA NA
## male_idCV-ULM-013 NA NA NA NA
## male_idCV-ULM-016 NA NA NA NA
## male_idMBG-1-M -0.5865 10.7412 -0.055 0.956743
## male_idMBG-17-M 17.3790 16.0187 1.085 0.284792
## male_idMBG-2-M 3.9801 10.7412 0.371 0.713033
## male_idMGB-1-M 9.1788 13.9237 0.659 0.513728
## male_idMGB-12-M 20.4617 16.0187 1.277 0.209222
## male_idMGB-16-M NA NA NA NA
## male_idMGB-2-M 2.0679 11.9802 0.173 0.863872
## male_idMGB-3-M 5.3979 9.2227 0.585 0.561820
## male_idMGB-4-M NA NA NA NA
## male_idoriginally called F -4.7908 16.0187 -0.299 0.766510
## male_idPAC-2-M -16.5944 16.0187 -1.036 0.306777
## male_idPAC-4-F NA NA NA NA
## male_idPAC-7-M NA NA NA NA
## male_idPAC-pool NA NA NA NA
## male_idULM-10-M 1.0112 8.8636 0.114 0.909774
## male_idULM-10M 9.1788 13.9237 0.659 0.513728
## male_idULM-11-M -13.7880 16.0187 -0.861 0.394776
## male_idULM-12-M NA NA NA NA
## male_idULM-13-M 8.8985 16.0187 0.556 0.581805
## male_idULM-15-M NA NA NA NA
## male_idULM-3-M -0.4172 8.0093 -0.052 0.958728
## male_idULM-9-M NA NA NA NA
## male_idULM-F-4 NA NA NA NA
## male_idULM-pool NA NA NA NA
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 16.02 on 38 degrees of freedom
## Multiple R-squared: 0.9126, Adjusted R-squared: 0.7862
## F-statistic: 7.216 on 55 and 38 DF, p-value: 2.49e-09
hybrid box plot
ggplot(hyb_crosses_2021, aes(x = cross_type, y = mean_fert_rate)) +
geom_boxplot(outlier.shape = NA, fill = "lightblue") +
geom_jitter(width = 0.15, alpha = 0.6, color = "darkblue") +
labs(
x = "Cross Type",
y = "% Fertilization Rate"
) +
theme_minimal()
2024 Spawns
F1 spawn 1
F1_spawn_1 <- read_excel("F1 spawn 1.xlsx")
View(F1_spawn_1)
clean data
F1_spawn_1 <- readxl::read_excel("F1 spawn 1.xlsx") %>%
janitor::clean_names() %>%
tidyr::fill(cross, cross_type, female_id, male_id,
.direction = "down") %>%
dplyr::mutate(cross_date = as.Date("2024-04-08"))
view(F1_spawn_1)
plot data
F1_spawn_1_tbl <- F1_spawn_1 %>%
group_by(cross_date, cross_type, cross, female_id, male_id) %>%
summarize(mean_fert_rate = mean(total_percent_fertilized, na.rm = TRUE)) %>%
ungroup()
## `summarise()` has grouped output by 'cross_date', 'cross_type', 'cross',
## 'female_id'. You can override using the `.groups` argument.
ggplot(F1_spawn_1_tbl, aes(x = cross_type, y = mean_fert_rate)) +
geom_point()
F1 spawn 2
load dataset
F1_spawn_2 <- read_excel("F1 spawn 2.xlsx")
View(F1_spawn_2)
clean dataset
F1_spawn_2 <- read_excel("F1 spawn 2.xlsx") %>%
janitor::clean_names() %>%
tidyr::fill(cross_id, cross_type, female_id, male_id,
.direction = "down") %>%
dplyr::mutate(cross_date = as.Date("2024-04-08"))
view(F1_spawn_2)
plot data
F1_spawn_2_tbl <- F1_spawn_2 %>%
group_by(cross_date, cross_type, cross_id, female_id, male_id) %>%
summarize(mean_fert_rate = mean(total_percent_fertilized, na.rm = TRUE)) %>%
ungroup()
## `summarise()` has grouped output by 'cross_date', 'cross_type', 'cross_id',
## 'female_id'. You can override using the `.groups` argument.
ggplot(F1_spawn_2_tbl, aes(x = cross_type, y = mean_fert_rate)) +
geom_point()
combine and boxplot all 2024 hybrid data
Hyb_crosses_2024 <- bind_rows(F1_spawn_1_tbl, F1_spawn_2_tbl)
ggplot(Hyb_crosses_2024, aes(x = cross_type, y = mean_fert_rate)) +
geom_point()
ggplot(Hyb_crosses_2024, aes(x = cross_type, y = mean_fert_rate)) +
geom_boxplot(outlier.shape = NA) +
geom_jitter(width = 0.15, alpha = 0.7) +
theme_bw() +
labs(
x = "Cross Type",
y = "% Fertilization Rate",
title = "F1 Hybrid Crosses - 2024"
)