-
Notifications
You must be signed in to change notification settings - Fork 0
/
006_TreeTime.R
38 lines (33 loc) · 1.54 KB
/
006_TreeTime.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Take tree generated by MrBayes analysis and generate tree's with color/contextual information
# Objective:
# 1 - Import the tree file
# 2 - Add dates, community, labels, etc
# 3 -
# Load libraries
library(tidyverse)
library(phylotools)
library(phytools)
library(ape)
# Load the community data
kitikmeotdata <- read_tsv("data/workingdata_2024_02_05.tsv")
# Load just Cambridge Bay, Kugluktuk, Gjoa Haven, Kugaaruk, and Taloyoak
cambridgebay <- read_tsv("data/cambridgebay_2024_01_22.tsv")
kugluktuk <- read_tsv("data/kugluktuk_2024_01_22.tsv")
gjoahaven <- read_tsv("data/gjoahaven_2024_01_22.tsv")
kugaaruk <- read_tsv("data/kugaaruk_2024_01_22.tsv")
taloyoak <- read_tsv("data/taloyoak_2024_01_22.tsv")
# Load the generated tree from MrBayes
# These are the 8 BINs detected in Cambridge Bay
# We'll do that using the APE library. The output from MrBayes is a tree file in NEXUS format.
AAA6916 <- read.nexus(file = "data/TREE/AAA6916.tree")
AAB7094 <- read.nexus(file = "data/TREE/AAB7094.tree")
# From there, let's try a plot
plot(AAA6916)
# Select first group
one_AAA6916 <- kitikmeotdata %>%
filter(`Sample ID` %in% c("CHARS00328-F05","CHARS00474-C05","CHARS00474-C06","BIOUG75673-H05","BIOUG75674-B04",
"BIOUG75674-C02","BIOUG75674-C05","BIOUG75674-C08","CHARS00017-G10","CHARS00018-D03",
"CHARS00022-C04","CBG-A11489-E07","BIOUG95972-G09","BIOUG90593-G08","BIOUG91199-A06",
"BIOUG91198-C08","BIOUG91200-F11"))
two_AA6916 <- kitikmeotdata %>%
filter(`Sample ID` %in% c(""))