class: inverse, center, middle # FishPhyloMaker ## An R package to generate phylogeny for bony fishes <img src="Figs/Logo_FishPhyloMaker.png" width="300px"/> .large[Gabriel Nakamura | LEFF meeting | 2021-08-27 ] --- # Phylogenies in Ecology .pull-left[ Cam Webb ![](Figs/camWebb.jpeg) ] .pull-right[ - Understand character evolution - Community assembling mechanisms - Historical factors associated with community assembly ![](Figs/Webb-phylogenies-2002.png) ] --- # Let´s use phylogenetic trees in ecological studies .pull-left[ ## Back to 2012 - There was a master thesis to be done - This thesis needed a phylogeny - More precisely, a fish phylogeny - So, let's pick a phylogeny ] -- .pull-right[ ![](https://media.giphy.com/media/BpGWitbFZflfSUYuZ9/giphy.gif) .center[It will be ease] ] --- # And then, let's pick a phylogeny .pull-left[ ### The first comprehensive fish phylogeny was [Betancur-R, 2017](https://bmcecolevol.biomedcentral.com/articles/10.1186/s12862-017-0958-3) .center[ <img src="Figs/Betancur-R-phylo.png" width="70%" /> ] ] -- .pull-right[ ### Then, let's do what ecologists like to do .midle[ .center[ .can-edit[ ((Cichlasoma_paranaense:43.65148501,Crenicichla_britskii:43.65148494):133.8257517,((((Ancistrus_pirareta:66.43187279,Ancistrus_reisi:66.43187272):27.3886498,((Curculionichthys_insperatus:42.59221138,Hypostomus_iheringii:42.59221131):8.661809897,Loricaria_luciae:51.25402127):42.56650131):22.23951779,(Bryconamericus_exodon:59.41152614,Astyanax_lacustris:59.41152616):56.64851415):8.34683831,Gymnotus_inaequilabiatus:124.4068786):53.07035805); ] ] ] ] ] --- # We have a phylogeny **but**... - Species in the specie spool are absent from the most comprehensive phylogeny (Darwinian shortfall) .center[ <img src="Figs/Shortfall_hortal_etal.png" width="70%" height="70%" /> ] -- - We work with a lot of data -- - We need to insert them **e.g.** Phylomatic for plant species --- # But, wait! we are talking about fishes 🐟 .pull-left[ ### Problems - Lack of a comprehensive phylogeny *specially in the tropical region* - Lack of an "fish Phylomatic" ] -- .pull-right[ ### Solutions - Construct a comprehensive phylogeny using molecular tools - Expensive; - Available only for few groups e.g. *OR* - Make it "by-hand" ] --- # Finding for solutions .pull-left[ - Ok, We don´t have money .center[ <img src="Figs/money-michaelscott.gif" width="70%" height="70%" /> ] - I only live once, and the life is too short to edit newick files "by hand" .center[ <img src="https://media.giphy.com/media/xT5LME4JUdxhiGQl4Q/giphy.gif" width="70%" height="70%" /> ] ] -- .pull-right[ ### Did you ever try to edit by-hand newick files? Take a shot.. .can-edit[ ((Cichlasoma_paranaense:43.65148501,Crenicichla_britskii:43.65148494):133.8257517,((((Ancistrus_pirareta:66.43187279,Ancistrus_reisi:66.43187272):27.3886498,((Curculionichthys_insperatus:42.59221138,Hypostomus_iheringii:42.59221131):8.661809897,Loricaria_luciae:51.25402127):42.56650131):22.23951779,(Bryconamericus_exodon:59.41152614,Astyanax_lacustris:59.41152616):56.64851415):8.34683831,Gymnotus_inaequilabiatus:124.4068786):53.07035805); ] ] --- # Finding for solutions ## We need a reproducible science - Work directly on newick file brings some (many) problems, for example: -- - How phylogeny was edited? -- - How species was added? -- - How can I obtain the same phylogeny that **you** made? --- class: inverse, center, middle # Get Started <img src="Figs/Logo_FishPhyloMaker.png" width="473" /> --- # What **FishPhyloMaker** solve? - Produce phylogenetic trees for any assemblage of finned-ray fishes in a reliable and fast way -- - Provide a fully reproducible method for the obtention of phylogenetic trees -- - Allows to check for valid names of species -- - Provides the first measure of Darwinian shortfalls --- # General anatomy of FishPhyloMaker .center[ Backbone phylogeny <img src="Figs/Fishtreeoflife.png" width="60%" height="60%" /> ] .center[ **+** ] .center[ Validate scientific names <img src="Figs/Fishbase.png" width="60%" height="60%" /> ] --- # General anatomy of FishPhyloMaker <img src="Figs/Fig1_SchematicFig_procedure.png" width="200%" height="200%" /> --- # Fishing the *Fish**Phylo**Maker* To install `FishPhyloMaker` package from [Github](https://github.com/GabrielNakamura/FishPhyloMaker): ```r remotes::install_github("GabrielNakamura/FishPhyloMaker", force = TRUE, build_vignettes = TRUE) ``` -- After installation we recommend to relaunch RStudio. -- Now, let the fish swim ```r library(FishPhyloMaker) ``` --- # Inside the *Fish[PhyloMaker]* ## FishPhyloMaker package has 3 main functions `FishTaxaMaker()`: Check species names accordingly to [FishBase]() `FishPhyloMaker()`: Generate phylogenetic tree `DarwinianShortfall()`: Calculates the amount of PD due to Darwinian Shortfalls $$ PDdefict = PDinserted/PDinserted + PDpresent $$ --- # Inside the *Fish[PhyloMaker]* ## Obtaining a taxon table Let´s use a dataset present in the package .panelset[ .panel[.panel-name[Code automatic] ```r library(FishPhyloMaker) data(neotropical_comm) data_comm <- neotropical_comm[, -c(1, 2)] # removing latitude and longitude data <- FishPhyloMaker::FishTaxaMaker(data_comm, allow.manual.insert = FALSE) # or... # data <- FishPhyloMaker::FishTaxaMaker(data_comm, allow.manual.insert = TRUE) ``` ] .panel[.panel-name[Table automatic]
] .panel[.panel-name[Code manual] ```r data_manual <- FishPhyloMaker::FishTaxaMaker(data_comm, allow.manual.insert = TRUE) Characidae Characiformes Characidae Siluriformes Characidae Characiformes Cichlidae Cichliformes Caracidae Characiformes Gymnotidae Gymnotiformes Loricariidae Siluriformes Loricariidae Siluriformes Loricariidae Siluriformes Loricariidae Siluriformes Heptapteriidae Siluriformes Characidae Characiformes Loricariidae Siluriformes Characidae Characiformes ``` ] .panel[.panel-name[Table Manual]
] ] --- # Inside The *Fish[PhyloMaker]* ## Generating a phylogeny for a local pool of species Finally we can generate a phylogenetic tree with `FishPhyloMaker` function .panelset[ .panel[.panel-name[R Code] ```r phylo_fish_streams <- FishPhyloMaker(data = data_manual$Taxon_data_FishPhyloMaker, return.insertions = TRUE, insert.base.node = TRUE, progress.bar = TRUE) ``` ] .panel[.panel-name[Plot] <img src="Figs/phylogeny_fishphylomaker.png" width="60%" /> ] .panel[.panel-name[Table insertions]
] ] --- # Phylogenetic tree with many insertions .center[ <img src="Figs/Fig_phyloEcoregions.png" width="80%" height="80%" /> ] --- # Darwinian showrfalls .center[ <img src="Figs/world_map.png" width="100%" height="100%" /> $$ PDdefict = PDinserted/PDinserted + PDpresent $$ ] --- # Advances that FishPhyloMaker bring 1- Reliable and fast way to obtain phylogenies for ray-finned fishes 2- Quantify Darwinian shortfalls -- # Next steps .center[ Expand the package for other taxa ] --- class: inverse, middle, center # More information [FishPhyloMaker website](https://gabrielnakamura.github.io/FishPhyloMaker/) .center[ <img src="Figs/website-fishphylo.png" width="100%" height="100%" /> ]