---
title: "poster QPCR"
author: "Noah Krebs"
date: "2023-07-25"
output:
  github_document: default
  html_document: default
---
```{r}
library(tidyverse)
library(stats)
```

```{r}
qpcr <- read.csv("../data/qPCR-poster.csv", header = TRUE)

```


```{r}

qpcr %>%
  filter(Target == "Cg_Def(1160/1)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("Defensin")

# Save the plot as a high-quality PNG
ggsave("../Images/defensin.png", width = 8, height = 6, dpi = 300)

```

```{r}
qpcr %>%
  filter(Target == "Cg_ATPsynthase(1385/6)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("ATP Synthase")

# Save the plot as a high-quality PNG
ggsave("../Images/ATPsynthase.png", width = 8, height = 6, dpi = 300)
```

```{r}
qpcr %>%
  filter(Target == "Cg_citratesynthase(1383/4)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("Citrate Synthase")

# Save the plot as a high-quality PNG
ggsave("../Images/Citratesynthase.png", width = 8, height = 6, dpi = 300)
```
```{r}
qpcr %>%
  filter(Target == "Cg_GAPDH(1172/3)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("GADPH")

# Save the plot as a high-quality PNG
ggsave("../Images/GADPH.png", width = 8, height = 6, dpi = 300)
```
```{r}
qpcr %>%
  filter(Target == "IL-17_internal(256/7)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("Interleukin-17")

# Save the plot as a high-quality PNG
ggsave("../Images/IL-17.png", width = 8, height = 6, dpi = 300)
```
```{r}
qpcr %>%
  filter(Target == "Cg_HSP70(598/9)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("HSP70")

# Save the plot as a high-quality PNG
ggsave("../Images/HSP70.png", width = 8, height = 6, dpi = 300)
```

```{r}
qpcr %>%
  filter(Target == "Cg_HSP90(1532/3)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("HSP90")

# Save the plot as a high-quality PNG
ggsave("../Images/HSP90.png", width = 8, height = 6, dpi = 300)
```

```{r}
qpcr %>%
  filter(Target == "Cg_VIPERIN(1828/9)") %>%
  ggplot(mapping = aes(x = Treatment, y = AEV)) + 
  geom_boxplot() +
  geom_boxplot(aes(fill = Treatment)) +
  scale_fill_manual(values = c("control" = "blue", "heat" = "red", "heat::mech" = "green", "mechanical" = "orange")) +
  geom_jitter(aes(color = History), width = 0.1, alpha = 0.7, size = 3) +
  theme(legend.position = "right" ,
        axis.text.x = element_text(size = 12),
        axis.text.y = element_text(size = 12),
        axis.title.x = element_text(size = 14),  # Increase x-axis label font size to 14
        axis.title.y = element_text(size = 14),  # Increase y-axis label font size to 14
        plot.title = element_text(hjust = 0.5, size = 16)) +
  ylab("Arbitrary Expression Value") +
  ggtitle("VIPERIN")

# Save the plot as a high-quality PNG
ggsave("../Images/Viperin.png", width = 8, height = 6, dpi = 300)
```
```{r}


# Run ANOVA for each group separately and store the results in a list
group1_anova <- qpcr_filtered %>%
  filter(Treatment == "heat") %>%
  aov(AEV ~ Treatment, data = .)

group2_anova <- qpcr_filtered %>%
  filter(Treatment == "heat::mech") %>%
  aov(AEV ~ Treatment, data = .)

group3_anova <- qpcr_filtered %>%
  filter(Treatment == "mechanical") %>%
  aov(AEV ~ Treatment, data = .)

# View the ANOVA summaries for each group
summary(group1_anova)
summary(group2_anova)
summary(group3_anova)
```
```{r}
result_anova <- aov(AEV ~ History, data = qpcr)
summary(result_anova)
```

