ASV data

Below we will use the provided ASV data to combine two data frames and perform some typical calculations.

1 Compile ASV and metadata

library(tidyverse)
Warning: package 'ggplot2' was built under R version 4.2.3
Warning: package 'tidyr' was built under R version 4.2.3
Warning: package 'readr' was built under R version 4.2.3
Warning: package 'dplyr' was built under R version 4.2.3
Warning: package 'stringr' was built under R version 4.2.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ 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
# head(metadata)
asv_long <- asv_table %>%
  pivot_longer(starts_with("Gorda"), names_to = "SAMPLEID") %>% 
  left_join(metadata %>% select(SAMPLEID = SAMPLE, everything()))
Joining with `by = join_by(SAMPLEID)`
# View(asv_long)

2 Get temperature data from data frame

Isolate samples that have a temperature greater than 15 C.

asv_long %>% 
  filter(temp > 15)
# A tibble: 42,039 × 10
   FeatureID Taxon SAMPLEID value VENT  SITE  Sample_or_Control SAMPLETYPE DEPTH
   <chr>     <chr> <chr>    <int> <chr> <chr> <chr>             <chr>      <chr>
 1 00056209… Euka… GordaRi…     0 Cand… Gord… Sample            Vent       2730 
 2 00056209… Euka… GordaRi…     0 Sir … Gord… Sample            Vent       2732 
 3 00056209… Euka… GordaRi…     0 Cand… Gord… Sample            Vent       2730 
 4 00056209… Euka… GordaRi…     0 Sir … Gord… Sample            Vent       2732 
 5 00056209… Euka… GordaRi…     0 Mt E… Gord… Sample            Vent       2707 
 6 00056209… Euka… GordaRi…     0 Mt E… Gord… Sample            Vent       2707 
 7 00056209… Euka… GordaRi…     0 Sir … Gord… Sample            Vent       2732 
 8 00056209… Euka… GordaRi…     0 Mt E… Gord… Sample            Vent       2707 
 9 00056209… Euka… GordaRi…     0 Cand… Gord… Sample            Vent       2730 
10 00096455… Euka… GordaRi…     0 Cand… Gord… Sample            Vent       2730 
# ℹ 42,029 more rows
# ℹ 1 more variable: temp <dbl>
# Make a list of vent sites from Gorda Ridge that had a temperature greater than 15 C.

What are the average temperatures at the vent, plume, versus background samples? And how many of each sample are there?

asv_long %>% 

3 Parse taxon names

asv_long %>% 

4 Calculate relative abundance

Create a table with sequence counts and ASV counts by supergroup.

asv_long %>% 

4.1 Make a bar plot

asv_long %>%