Hello all, and thank you in advance for your time.
My question relates to the rooted-tree.qza created in QIIME 2 2019.4, and how to change the tip labels from sequence IDs from DADA2 to taxa annotations, using R.
I have exported rooted-tree.qza to newick format:
qiime tools export
…and uploaded it to R using the package ‘ape’:
phy <- read.tree(file = “tree.nwk”)
Additionally, I have exported and modified the taxonomy.qza created with SILVA classifier.
qiime tools export taxonomy.qza --output-dir exp-tree
echo $‘LABELS\nSEPARATOR TAB\nDATA’ > taxonomy.txt
sed “1d” taxonomy.tsv | cut -f1,2 >> taxonomy.txt
I then uploaded taxonomy.txt as a df in R, as seen below:
5 D_0__Bacteria;D_1__Bacteroidetes;D_2__Bacteroidia;D_3__Bacteroidales;D_4__Bacteroidetes vadinHA17
My goal is to match the sequence IDs on my tree (vector named phy) to the annotations dataframe (newtips). I have attempted to use join(), to replace the IDs, as seen below:
phytips <- phy$tip.label
relabeled.phy <- join(newtips, phytips)
…but this has been unsuccessful. I have also annotated my tree using iTOL, yet my exported newick file is saved as .txt, posing new and additional difficulty. I am open to any suggestions?
Thank you for your patience and help,