Load vsearch output

Philly 2017 pollen

trnL_PH_pollen <- load_blast6("~/vsearchr/inst/extdata/trnL_vsearch_philly.output/pollen/")
ITS1_PH_pollen <- load_blast6("~/vsearchr/inst/extdata/ITS1_vsearch_philly.output/pollen/")
ITS2_PH_pollen <- load_blast6("~/vsearchr/inst/extdata/ITS2_vsearch_philly.output/pollen/")
write_csv(trnL_PH_pollen, "trnL_PH_pollen.csv")
write_csv(ITS1_PH_pollen, "ITS1_PH_pollen.csv")
write_csv(ITS2_PH_pollen, "ITS2_PH_pollen.csv")
trnL_PH_pollen <- read_csv("trnL_PH_pollen.csv", col_names = TRUE)
ITS1_PH_pollen <- read_csv("ITS1_PH_pollen.csv", col_names = TRUE)
ITS2_PH_pollen <- read_csv("ITS2_PH_pollen.csv", col_names = TRUE)

Philly 2017 honey

trnL_PH_honey <- load_blast6("~/vsearchr/inst/extdata/trnL_vsearch_philly.output/honey/")
ITS1_PH_honey <- load_blast6("~/vsearchr/inst/extdata/ITS1_vsearch_philly.output/honey/")
ITS2_PH_honey <- load_blast6("~/vsearchr/inst/extdata/ITS2_vsearch_philly.output/honey/")
# write_csv(trnL_PH_honey, "trnL_PH_honey.csv")
# write_csv(ITS1_PH_honey, "ITS1_PH_honey.csv")
# write_csv(ITS2_PH_honey, "ITS2_PH_honey.csv")
trnL_PH_honey <- read_csv("trnL_PH_honey.csv", col_names = TRUE)
ITS1_PH_honey <- read_csv("ITS1_PH_honey.csv", col_names = TRUE)
ITS2_PH_honey <- read_csv("ITS2_PH_honey.csv", col_names = TRUE)

Philly jarred honey

trnL_PH_jarred_honey <- load_blast6_alt("~/vsearchr/inst/extdata/trnL_vsearch_philly.output/jarred_honey/")
ITS1_PH_jarred_honey <- load_blast6_alt("~/vsearchr/inst/extdata/ITS1_vsearch_philly.output/jarred_honey/")
ITS2_PH_jarred_honey <- load_blast6_alt("~/vsearchr/inst/extdata/ITS2_vsearch_philly.output/jarred_honey/")

Philly 2017 blanks

trnL_PH_blanks <- load_blast6_alt("~/vsearchr/inst/extdata/trnL_vsearch_philly.output/blanks/")
ITS1_PH_blanks <- load_blast6_alt("~/vsearchr/inst/extdata/ITS1_vsearch_philly.output/blanks/")
ITS2_PH_blanks <- load_blast6_alt("~/vsearchr/inst/extdata/ITS2_vsearch_philly.output/blanks/")

Load taxonomy tables

Philly 2017

trnL_PH_tax <- load_MTXA("~/vsearchr/inst/extdata/trnL_PH_Amplicons2.tax")
ITS1_PH_tax <- load_MTXA("~/vsearchr/inst/extdata/ITS1_PH_Amplicons.tax")
ITS2_PH_tax <- load_MTXA("~/vsearchr/inst/extdata/ITS2_PH_Amplicons.tax")

Join vsearch output to taxonomy tables

Philly 2017 pollen

trnL_PH_pollen_join <- tax_join(trnL_PH_pollen, trnL_PH_tax, min_id = 97.0, min_len = 150)
ITS1_PH_pollen_join <- tax_join(ITS1_PH_pollen, ITS1_PH_tax, min_id = 95.0, min_len = 300)
ITS2_PH_pollen_join <- tax_join(ITS2_PH_pollen, ITS2_PH_tax, min_id = 95.0, min_len = 300)
write_csv(trnL_PH_pollen_join, "trnL_PH_pollen_join.csv")
write_csv(ITS1_PH_pollen_join, "ITS1_PH_pollen_join.csv")
write_csv(ITS2_PH_pollen_join, "ITS2_PH_pollen_join.csv")
#trnL_PH_pollen_join <- read_csv("trnL_PH_pollen_join.csv", col_names = TRUE)
#ITS1_PH_pollen_join <- read_csv("ITS1_PH_pollen_join.csv", col_names = TRUE)
#ITS2_PH_pollen_join <- read_csv("ITS2_PH_pollen_join.csv", col_names = TRUE)

Philly 2017 honey

trnL_PH_honey_join <- tax_join(trnL_PH_honey, trnL_PH_tax, min_id = 0.97)
ITS1_PH_honey_join <- tax_join(ITS1_PH_honey, ITS1_PH_tax, min_id = 0.95)
ITS2_PH_honey_join <- tax_join(ITS2_PH_honey, ITS2_PH_tax, min_id = 0.95)
# write_csv(trnL_PH_honey_join, "trnL_PH_honey_join.csv")
# write_csv(ITS1_PH_honey_join, "ITS1_PH_honey_join.csv")
# write_csv(ITS2_PH_honey_join, "ITS2_PH_honey_join.csv")
# trnL_PH_honey_join <- read_csv("trnL_PH_honey_join.csv", col_names = TRUE)
# ITS1_PH_honey_join <- read_csv("ITS1_PH_honey_join.csv", col_names = TRUE)
# ITS2_PH_honey_join <- read_csv("ITS2_PH_honey_join.csv", col_names = TRUE)

Philly 2017 jarred honey

trnL_PH_jarred_honey_join <- tax_join(trnL_PH_jarred_honey, trnL_PH_tax, min_id = 0.97)
ITS1_PH_jarred_honey_join <- tax_join(ITS1_PH_jarred_honey, ITS1_PH_tax, min_id = 0.95)
ITS2_PH_jarred_honey_join <- tax_join(ITS2_PH_jarred_honey, ITS2_PH_tax, min_id = 0.95)
# write_csv(trnL_PH_jarred_honey_join, "trnL_PH_jarred_honey_join.csv")
# write_csv(ITS1_PH_jarred_honey_join, "ITS1_PH_jarred_honey_join.csv")
# write_csv(ITS2_PH_jarred_honey_join, "ITS2_PH_jarred_honey_join.csv")
# trnL_PH_jarred_honey_join <- read_csv("trnL_PH_jarred_honey_join.csv", col_names = TRUE)
# ITS1_PH_jarred_honey_join <- read_csv("ITS1_PH_jarred_honey_join.csv", col_names = TRUE)
# ITS2_PH_jarred_honey_join <- read_csv("ITS2_PH_jarred_honey_join.csv", col_names = TRUE)

Philly 2017 blanks

trnL_PH_blanks_join <- tax_join(trnL_PH_blanks, trnL_PH_tax, min_id = 0.97)
ITS1_PH_blanks_join <- tax_join(ITS1_PH_blanks, ITS1_PH_tax, min_id = 0.95)
ITS2_PH_blanks_join <- tax_join(ITS2_PH_blanks, ITS2_PH_tax, min_id = 0.95)
# write_csv(trnL_PH_blanks_join, "trnL_PH_blanks_join.csv")
# write_csv(ITS1_PH_blanks_join, "ITS1_PH_blanks_join.csv")
# write_csv(ITS2_PH_blanks_join, "ITS2_PH_blanks_join.csv")
# trnL_PH_blanks_join <- read_csv("trnL_PH_blanks_join.csv", col_names = TRUE)
# ITS1_PH_blanks_join <- read_csv("ITS1_PH_blanks_join.csv", col_names = TRUE)
# ITS2_PH_blanks_join <- read_csv("ITS2_PH_blanks_join.csv", col_names = TRUE)

Tally genera by sample

Philly 2017 pollen

trnL_PH_pollen_tally <- tally_gen(trnL_PH_pollen_join)
ITS1_PH_pollen_tally <- tally_gen(ITS1_PH_pollen_join)
ITS2_PH_pollen_tally <- tally_gen(ITS2_PH_pollen_join)

Philly 2017 honey

trnL_PH_honey_tally <- tally_gen(trnL_PH_honey_join)
ITS1_PH_honey_tally <- tally_gen(ITS1_PH_honey_join)
ITS2_PH_honey_tally <- tally_gen(ITS2_PH_honey_join)

Philly jarred honey

trnL_PH_jarred_honey_tally <- tally_gen(trnL_PH_jarred_honey_join)
ITS1_PH_jarred_honey_tally <- tally_gen(ITS1_PH_jarred_honey_join)
ITS2_PH_jarred_honey_tally <- tally_gen(ITS2_PH_jarred_honey_join)

Philly 2017 blanks

trnL_PH_blanks_tally <- tally_gen(trnL_PH_blanks_join)
ITS1_PH_blanks_tally <- tally_gen(ITS1_PH_blanks_join)
ITS2_PH_blanks_tally <- tally_gen(ITS2_PH_blanks_join)

Add sample metadata, create consensus data sets, create genus summary fields

Philly 2017 pollen

trnL_PH_pollen_final <- add_meta(trnL_PH_pollen_tally, "~/vsearchr/inst/extdata/PH_2017_key.csv")
ITS1_PH_pollen_final <- add_meta(ITS1_PH_pollen_tally, "~/vsearchr/inst/extdata/PH_2017_key.csv")
ITS2_PH_pollen_final <- add_meta(ITS2_PH_pollen_tally, "~/vsearchr/inst/extdata/PH_2017_key.csv")

PH_pollen_consensus <- consensus_xyz_gen(trnL_PH_pollen_final, ITS1_PH_pollen_final, ITS2_PH_pollen_final,
                                         min_prop = 0.0005) %>%
  add_meta("~/vsearchr/inst/extdata/PH_2017_key.csv") %>%
  mutate(period = case_when(date > "2017-05-20" & date < "2017-06-15" ~ "May/June",
                            date > "2017-06-20" & date < "2017-07-15" ~ "June/July",
                            date > "2017-07-20" & date < "2017-08-15" ~ "Aug",
                            date > "2017-08-20" & date < "2017-09-15" ~ "Sept",
                            is.na(date) & site == "SHARE" ~ "June/July"))

PH_pollen_consensus_MayJune <- filter(PH_pollen_consensus, period == "May/June")
PH_pollen_consensus_JuneJuly <- filter(PH_pollen_consensus, period == "June/July")
PH_pollen_consensus_Aug <- filter(PH_pollen_consensus, period == "Aug")
PH_pollen_consensus_Sept <- filter(PH_pollen_consensus, period == "Sept")


PH_pollen_genus_summary <- PH_pollen_consensus %>%
  group_by(genus) %>%
  summarize(gen_freq = n())

PH_pollen_genus_summary_MayJune <- PH_pollen_consensus_MayJune %>%
  group_by(genus) %>%
  summarize(gen_freq = n(),
            mean_prop = sum(scaled_prop)/8) # We only had 8 sites for the MayJune sample; we had 12 sites for all others

PH_pollen_genus_summary_JuneJuly <- PH_pollen_consensus_JuneJuly %>%
  group_by(genus) %>%
  summarize(gen_freq = n(),
            mean_prop = sum(scaled_prop)/12)

PH_pollen_genus_summary_Aug <- PH_pollen_consensus_Aug %>%
  group_by(genus) %>%
  summarize(gen_freq = n(),
            mean_prop = sum(scaled_prop)/12)

PH_pollen_genus_summary_Sept <- PH_pollen_consensus_Sept %>%
  group_by(genus) %>%
  summarize(gen_freq = n(),
            mean_prop = sum(scaled_prop)/12)


PH_pollen_final <- left_join(PH_pollen_consensus, PH_pollen_genus_summary, by = "genus")
PH_pollen_final_MayJune <- left_join(PH_pollen_consensus_MayJune, PH_pollen_genus_summary_MayJune, by = "genus")
PH_pollen_final_JuneJuly <- left_join(PH_pollen_consensus_JuneJuly, PH_pollen_genus_summary_JuneJuly, by = "genus")
PH_pollen_final_Aug <- left_join(PH_pollen_consensus_Aug, PH_pollen_genus_summary_Aug, by = "genus")
PH_pollen_final_Sept <- left_join(PH_pollen_consensus_Sept, PH_pollen_genus_summary_Sept, by = "genus")

Philly 2017 honey

trnL_PH_honey_final <- add_meta(trnL_PH_honey_tally, "~/vsearchr/inst/extdata/PH_2017_key.csv")
ITS1_PH_honey_final <- add_meta(ITS1_PH_honey_tally, "~/vsearchr/inst/extdata/PH_2017_key.csv")
ITS2_PH_honey_final <- add_meta(ITS2_PH_honey_tally, "~/vsearchr/inst/extdata/PH_2017_key.csv")
PH_honey_consensus <- consensus_xyz_gen(trnL_PH_honey_final, ITS1_PH_honey_final, ITS2_PH_honey_final,
                                         min_prop = 0.001, xname = "trnL", yname = "ITS1", zname = "ITS2") %>%
  add_meta("~/vsearchr/inst/extdata/PH_2017_key.csv") %>%
  mutate(period = case_when(date > "2017-05-20" & date < "2017-06-15" ~ "May/June",
                            date > "2017-06-20" & date < "2017-07-15" ~ "June/July",
                            date > "2017-07-20" & date < "2017-08-15" ~ "July/Aug",
                            date > "2017-08-20" & date < "2017-09-15" ~ "Aug/Sept",
                            is.na(date) & site == "SHARE" ~ "June/July"))

Philly 2017 jarred_honey -- no metadata to add

PH_jarred_honey_consensus <- consensus_xyz_gen(trnL_PH_jarred_honey_tally, ITS1_PH_jarred_honey_tally, ITS2_PH_jarred_honey_tally,
                                         min_prop = 0.001, xname = "trnL", yname = "ITS1", zname = "ITS2")

Philly 2017 blanks -- no metadata to add

PH_blanks_consensus <- consensus_xyz_gen(trnL_PH_blanks_tally, ITS1_PH_blanks_tally, ITS2_PH_blanks_tally,
                                         min_prop = 0.001, xname = "trnL", yname = "ITS1", zname = "ITS2") 

Plot data

Philly 2017 pollen

trnL only
ggplot(filter(trnL_PH_pollen_final, gen_prop >= 0.01), aes(x = date, y = reorder(genus, gen_freq), fill = gen_prop)) +
  geom_tile(width = 32, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS1 only
ggplot(filter(ITS1_PH_pollen_final, gen_prop >= 0.01), aes(x = date, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 12, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS2 only
ggplot(filter(ITS2_PH_pollen_final, gen_prop >= 0.01), aes(x = date, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 12, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
2-of-3 consensus
# pdf("~/vsearchr/inst/extdata/figures/PH_final.pdf", height = 5, width = 8.5)
# ggplot(PH_pollen_final, aes(x = date, y = reorder(genus, gen_freq), fill = scaled_prop)) +
#   geom_tile(width = 30, color = "gray40") +
#   scale_fill_gradient(low = "gray95", high = "purple") +
#   theme_bw(4) +
#   ylab("Genus") +
#   xlab("Sample") +
#   labs(fill = "Proportional\nabundance") +
#   facet_grid(~site) +
#   theme(axis.text.x = element_text(angle = 45, hjust = 1))
# dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_mayjune.pdf", height = 11, width = 8.5)
ggplot(filter(PH_pollen_final_MayJune, period == "May/June"), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_junejuly.pdf", height = 11, width = 8.5)
ggplot(filter(PH_pollen_final_JuneJuly, period == "June/July"), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_aug.pdf", height = 11, width = 8.5)
ggplot(filter(PH_pollen_final_Aug, period == "Aug"), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_sept.pdf", height = 11, width = 8.5)
ggplot(filter(PH_pollen_final_Sept, period == "Sept"), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

# pdf("~/vsearchr/inst/extdata/figures/PH_final_period.pdf", height = 5, width = 8.5)
# ggplot(filter(PH_pollen_final_join, !is.na(date)), 
#        aes(x = reorder(period, date), y = reorder(genus, gen_freq), fill = scaled_prop)) +
#   geom_tile(width = 0.5, color = "white") +
#   scale_fill_gradient(low = "gray95", high = "purple") +
#   theme_bw(8) +
#   ylab("Genus") +
#   xlab("Sample") +
#   labs(fill = "Proportional\nabundance") +
#   theme(axis.text.x = element_text(angle = 45, hjust = 1))
# dev.off()


############ Trimmed figures for presentation #################

# pdf("~/vsearchr/inst/extdata/figures/PH_final.pdf", height = 5, width = 8.5)
# ggplot(PH_pollen_final, aes(x = date, y = reorder(genus, gen_freq), fill = scaled_prop)) +
#   geom_tile(width = 30, color = "gray40") +
#   scale_fill_gradient(low = "gray95", high = "purple") +
#   theme_bw(4) +
#   ylab("Genus") +
#   xlab("Sample") +
#   labs(fill = "Proportional\nabundance") +
#   facet_grid(~site) +
#   theme(axis.text.x = element_text(angle = 45, hjust = 1))
# dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_mayjune_PresTrim.pdf", height = 6, width = 6.5)
ggplot(filter(PH_pollen_final_MayJune, period == "May/June", gen_freq > 1 | mean_prop >= 0.05), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_junejuly_PresTrim.pdf", height = 6, width = 6.5)
ggplot(filter(PH_pollen_final_JuneJuly, period == "June/July", gen_freq > 1 | mean_prop >= 0.05), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_aug_PresTrim.pdf", height = 5, width = 6.5)
ggplot(filter(PH_pollen_final_Aug, period == "Aug", gen_freq > 1 | mean_prop >= 0.05), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

pdf("~/vsearchr/inst/extdata/figures/PH_final_sept_PresTrim.pdf", height = 5, width = 6.5)
ggplot(filter(PH_pollen_final_Sept, period == "Sept", gen_freq > 1 | mean_prop >= 0.05), aes(x = site, y = reorder(genus, mean_prop), fill = scaled_prop)) +
  geom_tile(color = "gray40") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Site") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
dev.off()

# pdf("~/vsearchr/inst/extdata/figures/PH_final_period.pdf", height = 5, width = 8.5)
# ggplot(filter(PH_pollen_final_join, !is.na(date)), 
#        aes(x = reorder(period, date), y = reorder(genus, gen_freq), fill = scaled_prop)) +
#   geom_tile(width = 0.5, color = "white") +
#   scale_fill_gradient(low = "gray95", high = "purple") +
#   theme_bw(8) +
#   ylab("Genus") +
#   xlab("Sample") +
#   labs(fill = "Proportional\nabundance") +
#   theme(axis.text.x = element_text(angle = 45, hjust = 1))
# dev.off()

Philly 2017 honey

trnL only
ggplot(filter(trnL_PH_honey_final, gen_prop >= 0.01), aes(x = date, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 32, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS1 only
ggplot(filter(ITS1_PH_honey_final, gen_prop >= 0.01), aes(x = date, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 12, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS2 only
ggplot(filter(ITS2_PH_honey_final, gen_prop >= 0.01), aes(x = date, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 12, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
2-of-3 consensus
ggplot(filter(PH_honey_consensus, scaled_prop >= 0.025), aes(x = date, y = reorder(genus, scaled_prop), fill = scaled_prop)) +
  geom_tile(width = 32, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  facet_grid(~site) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Philly jarred_honey

trnL only
ggplot(filter(trnL_PH_jarred_honey_tally, gen_prop >= 0.01), aes(x = sample, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS1 only
ggplot(filter(ITS1_PH_jarred_honey_tally, gen_prop >= 0.01), aes(x = sample, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS2 only
ggplot(filter(ITS2_PH_jarred_honey_tally, gen_prop >= 0.01), aes(x = sample, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
2-of-3 consensus
ggplot(filter(PH_jarred_honey_consensus, scaled_prop >= 0.025), aes(x = sample, y = reorder(genus, scaled_prop), fill = scaled_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +``
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

Philly 2017 blanks

trnL only
ggplot(filter(trnL_PH_blanks_tally, gen_prop >= 0.01), aes(x = sample, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS1 only
ggplot(filter(ITS1_PH_blanks_tally, gen_prop >= 0.01), aes(x = sample, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
ITS2 only
ggplot(filter(ITS2_PH_blanks_tally, gen_prop >= 0.01), aes(x = sample, y = reorder(genus, gen_prop), fill = gen_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))
2-of-3 consensus
ggplot(filter(PH_blanks_consensus, scaled_prop >= 0.025), aes(x = sample, y = reorder(genus, scaled_prop), fill = scaled_prop)) +
  geom_tile(width = 1, color = "white") +
  scale_fill_gradient(low = "gray95", high = "purple") +
  theme_bw(12) +
  ylab("Genus") +
  xlab("Sample") +
  labs(fill = "Proportional\nabundance") +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


sponslerdb/vsearchR documentation built on June 19, 2020, 10:01 a.m.