0.1 Introduction

Amanita is a genus of fungi that is primarily made up of agarics, which are a particular kind of fungus that grows on mushrooms. There are about 600 distinct agaric species in the genus Amanita of fungus. Among the many different types of fungi that are known to exist are the deadliest mushrooms in the world, as well as some highly valued culinary varieties. The genus Amanita of mushrooms belongs to the Amanitaceae family of fungi that create mushrooms.

The Classification of This Genus Follows the Levels as Follows -

Kingdom: Fungi

Division: Basidiomycota

Class: Agaricomycetes

Order: Agaricales

Family: Amanitaceae

0.2 R packages used

library(traits)
library(treeio)
library(ggtree)
library(reshape2)
library(ggstance)
library(ape)
library(seqinr)
library(adegenet)
library(DECIPHER)
library(viridis)
library(ggplot2)
library(tidyverse)

0.3 Downloading Data from NCBI

0.3.1 we’ll be using the Library trait

Sequence <- ncbi_byid(ids = c("NR_187078.1", "NR_187077.1", "NR_187076.1", "NR_187075.1", "NR_187074.1", "NR_187073.1", "NR_187072.1", "NR_187071.1", "NR_187070.1", "NR_187069.1", "NR_187068.1", "NR_187067.1", "NR_187066.1", "NR_185704.1", "NR_185703.1", "NR_184989.1", "NR_184934.1", "NR_182949.1", "NR_182712.1", "NR_182711.1", "NR_182482.1", "NR_178171.1", "NR_177541.1", "NR_177182.1", "NR_177133.1", "NR_176704.1", "NR_175723.1", "NR_175722.1", "NR_175721.1", "NR_175720.1", "NR_175719.1", "NR_175718.1", "NR_175717.1", "NR_175716.1", "NR_175715.1", "NR_175714.1", "NR_175713.1", "NR_175712.1", "NR_175711.1", "NR_175710.1", "NR_175709.1", "NR_175708.1", "NR_175707.1", "NR_174910.1", "NR_173939.1", "NR_173938.1", "NR_173801.1", "NR_173776.1", "NR_173773.1", "NR_173766.1", "NR_173190.1", "NR_173189.1", "NR_173188.1", "NR_173187.1", "NR_173159.1", "NR_173158.1", "NR_172802.1", "NR_169902.1", "NR_166224.1", "NR_164607.1", "NR_164606.1", "NR_164493.1", "NR_119968.1", "NR_119715.1", "NR_119714.1", "NR_119713.1", "NR_119499.1", "NR_119498.1", "NR_119390.1", "NR_119389.1", "NR_119388.1", "NR_119387.1", "NR_159596.1", "NR_159595.1", "NR_159593.1", "NR_159592.1", "NR_159591.1", "NR_159590.1", "NR_159589.1", "NR_159588.1", "NR_159587.1", "NR_159586.1", "NR_159585.1", "NR_159584.1", "NR_159583.1", "NR_159582.1", "NR_159581.1", "NR_159580.1", "NR_159579.1", "NR_159577.1", "NR_159576.1", "NR_159575.1", "NR_159574.1", "NR_159572.1", "NR_159571.1", "NR_159570.1", "NR_159569.1", "NR_159568.1", "NR_159567.1", "NR_159564.1", "NR_151657.1", "NR_151656.1", "NR_158347.1", "NR_158316.1", "NR_154703.1", "NR_154693.1", "NR_154692.1", "NR_154691.1", "NR_154690.1", "NR_154689.1", "NR_154683.1", "NR_154668.1", "NR_151654.1", "NR_151653.1", "NR_151652.1", "NR_151651.1", "NR_151650.1", "NR_151649.1", "NR_147634.1", "NR_147633.1", "NR_147632.1", "NR_137609.1", "NR_137116.1", "NR_151655.1"), verbose = TRUE)

0.3.2 View Data

Sequence

0.4 Preprocessing

0.4.1 Impact of filtering and normalization

#create a table from the data by selecting columns using dplyr
Seq <- Sequence %>% 
  select(acc_no, taxon, journal, country, sequence, first_author)
Seq

0.4.2 table of filtered and normalized data

Seqq <- Seq %>%
  filter(journal != "Unpublished") #get rid of unpublished data
Seqqq <- Seqq %>%
  filter(first_author != "NA") #get rid of data with no known author
Seqqqq <- Seqqq %>%
  filter(country != "NA") #get rid of data with no country recorded
Seqqqq

0.4.3 Selecting Relevant column

Seqs <- Seqqqq %>%
  select(acc_no, country, taxon, sequence)
Seqs

0.5 Exporting and Importing with MEGA

The next step is done with MEGA software, the Sequences are copied out to MEGA software and aligned and edited. The phylogenetic tree is constructed and the export via newick file format into R

Ltest_nkk <- '(((((((((((((((A.pseudoarenaria_1:0.00445873,A.pseudoarenaria_2:0.00445873):0.01713777,A.pseudoarenaria_3:0.02159650):0.02759544,A.pseudoarenaria_4:0.04919194):0.01307103,(A.compacta_2:0.01714966,(A.compacta_1:0.01556117,A.compacta_3:0.01556117):0.00158849):0.04511332):0.00486265,A.arenarioides:0.06712562):0.02690224,((A.pupatju_1:0.00258909,A.pupatju_2:0.00258909):0.00258393,(A.pupatju_3:0.00430060,A.pupatju_4:0.00430060):0.00087242):0.08885484):0.00313545,((A.sabulosa_1:0.00602535,A.sabulosa_2:0.00602535):0.01820041,(A.sabulosa_3:0.01221972,A.sabulosa_4:0.01221972):0.01200604):0.07293755):0.03703862,(A.wadulawitu:0.04811741,A.lesueurii:0.04811741):0.08608452):0.02234678,(A.ballerina:0.11586863,(A.rimosa:0.09267446,((A.griseorosea:0.06031118,A.molliuscula:0.06031118):0.02337492,(A.brunneitoxicaria:0.08182125,(((A.millsii:0.00631723,A.gardneri:0.00631723):0.02543180,(A.harkoneniana:0.02486628,A.bweyeyensis:0.02486628):0.00688275):0.04078182,(A.fuligineoides:0.06257769,(A.subfuliginea:0.05753188,(A.pallidorosea:0.03415399,A.subpallidorosea:0.03415399):0.02337788):0.00504581):0.00995316):0.00929040):0.00186485):0.00898837):0.02319417):0.04068008):0.00695176,(A.pallidoverruca:0.14812392,A.vernicoccora:0.14812392):0.01537655):0.00492062,((A.kalasinensis:0.13829976,A.bingensis:0.13829976):0.01915166,(((A.submelleialba:0.10853137,A.sinensis:0.10853137):0.01969124,(A.ravicrocina:0.12217698,A.robusta:0.12217698):0.00604564):0.01946750,(A.calida:0.11961742,(A.griseofolia:0.09532887,(A.drummondii:0.08851321,(A.vladimirii:0.07586025,(A.liquii:0.07011680,(A.griseocaerulea:0.06463814,((A.rhacopus:0.05165592,A.variicolor:0.05165592):0.00453720,((A.simulans:0.03805585,A.glarea:0.03805585):0.00824963,(A.lividopallescens:0.01405982,A.griseofusca:0.01405982):0.03224566):0.00988765):0.00844501):0.00547867):0.00574344):0.01265296):0.00681566):0.02428856):0.02807269):0.00976131):0.01096968):0.01883455,A.fulvopulverulenta:0.18725565):0.00136853,(((((A.brunneola_1:0.00337299,A.brunneola_2:0.00337299):0.00511145,A.brunneola_5:0.00848444):0.00157146,(A.brunneola_3:0.00165926,A.brunneola_4:0.00165926):0.00839663):0.11268580,A.quenda:0.12274169):0.03522496,(A.heishidingensis:0.13773328,(((A.cretaceaverruca_3:0.00170516,A.cretaceaverruca_8:0.00170516):0.00516006,A.cretaceaverruca_5:0.00686522):0.00813293,(A.cretaceaverruca_7:0.01251455,(A.cretaceaverruca_4:0.01048093,(A.cretaceaverruca_2:0.00591665,(A.cretaceaverruca_1:0.00335774,A.cretaceaverruca_6:0.00335774):0.00255891):0.00456428):0.00203362):0.00248360):0.12273513):0.02023336):0.03065754):0.00413188,A.minima:0.19275607):0.00000000,A.goossensfontanae:0.20404385);'

Tree <- read.tree(text=Ltest_nkk)

0.6 Creating a design for grouping the tree construction in R

0.6.1 checking the data to be used for the grouping

group = read.table('newick design.txt', sep = '\t',
                   col.names = c('Ids', 'Country'),
                   header = FALSE, stringsAsFactors = FALSE)
group <- as_tibble(group)
group

0.6.2 Convert Tree from phylo to a structured data

Tree1 <- as_tibble(Tree)
Tree1

0.7 Full join of the structured tree data with the design

using the full join , we joined the tree data with the design we created by the label.

Join_Tree <- full_join(Tree1, group, by = c('label' = 'Ids'))

0.8 Clean the new joined data

we ensure to eliminate branch length without figure.

Join_Tree1 <- Join_Tree %>%
  filter(branch.length != "NA")
Join_Tree1

0.9 convert the structured tree to treedata

Join_Tree2 <- as.treedata(Join_Tree1)

0.10 Plotting with ggtree

ggtree(Join_Tree2, layout = 'circular') + geom_treescale(fontsize=3, linesize=0.2, offset=0, color = 'red') +
  geom_tiplab(aes(color = Country)) + 
  theme(legend.position = 'left') +
  geom_highlight(node = 84:95, fill='red', alpha=.2)

0.11 Just Exploring

Joseph is a R for evolution biology learner, still figuring out how this works please connect with me here. comment and help become better.

THANKS