Analysis of pairwise competition
Abstract
Here we compile the amplicon sequencing outputs from all the different batches for later analysis.
1 Setup
1.1 Libraries
1.2 Global variables
2 Read data
2.1 Compiled pairs data
Show/hide code
bind_rows(read_tsv(here::here(data, "20240711_BTK_illumina_v3", "pairs_counts.tsv"), col_types = "cccddddddccc"),
read_tsv(here::here(data, "20241024_BTK_illumina_v3", "pairs_counts.tsv"), col_types = "cccddddddccc"),
) %>%
# these steps ensure we don't get duplicates of some masterplate samples sequenced again in the second batch
# filtering to keep samples closest to the target f value
mutate(del_f = abs(f_thresh-target_f_masterplate)) %>%
group_by(sample, strainID) %>%
filter(if_else(community_type == "masterplate", del_f == min(del_f), TRUE )) %>%
ungroup() %>%
dplyr::select(-del_f) %>%
write_tsv(here::here(data, "2sps_compiled_9010.tsv"))
read_tsv(here::here(data, "20250502_BTK_illumina_v3", "pairs_counts.tsv"), col_types = "cccddddddccc") %>%
write_tsv(here::here(data, "2sps_compiled_5050.tsv"))
2.2 Compiled trios data
Show/hide code
bind_rows(read_tsv(here::here(data, "20240711_BTK_illumina_v3", "trios_counts.tsv"), col_types = "cccddddddccc"),
read_tsv(here::here(data, "20241024_BTK_illumina_v3", "trios_counts.tsv"), col_types = "cccddddddccc"),
read_tsv(here::here(data, "20250127_BTK_illumina_v3", "trios_counts.tsv"), col_types = "cccddddddccc"),
read_tsv(here::here(data, "20250502_BTK_illumina_v3", "trios_counts.tsv"), col_types = "cccddddddccc")) %>%
write_tsv(here::here(data, "3sps_compiled.tsv"))