Package: DAISIEprep 0.4.2

DAISIEprep: Extracts Phylogenetic Island Community Data from Phylogenetic Trees

Extracts colonisation and branching times of island species to be used for analysis in the R package 'DAISIE'. It uses phylogenetic and endemicity data to extract the separate island colonists and store them.

Authors:Joshua W. Lambert [aut, cre], Luis Valente [aut], Pedro Santos Neves [aut], Lizzie Roeble [aut], Theo Pannetier [aut]

DAISIEprep_0.4.2.tar.gz
DAISIEprep_0.4.2.zip(r-4.5)DAISIEprep_0.4.2.zip(r-4.4)DAISIEprep_0.4.2.zip(r-4.3)
DAISIEprep_0.4.2.tgz(r-4.4-any)DAISIEprep_0.4.2.tgz(r-4.3-any)
DAISIEprep_0.4.2.tar.gz(r-4.5-noble)DAISIEprep_0.4.2.tar.gz(r-4.4-noble)
DAISIEprep_0.4.2.tgz(r-4.4-emscripten)DAISIEprep_0.4.2.tgz(r-4.3-emscripten)
DAISIEprep.pdf |DAISIEprep.html
DAISIEprep/json (API)
NEWS

# Install 'DAISIEprep' in R:
install.packages('DAISIEprep', repos = c('https://joshwlambert.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/joshwlambert/daisieprep/issues

On CRAN:

data-scienceisland-biogeographyphylogenetics

6.16 score 6 stars 20 scripts 195 downloads 77 exports 105 dependencies

Last updated 6 months agofrom:a9c0459eae. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 16 2024
R-4.5-winOKNov 16 2024
R-4.5-linuxOKNov 16 2024
R-4.4-winOKNov 16 2024
R-4.4-macOKNov 16 2024
R-4.3-winOKNov 16 2024
R-4.3-macOKNov 16 2024

Exports:add_asr_node_statesadd_island_colonistadd_missing_speciesadd_multi_missing_speciesadd_outgroupall_descendants_conspecificall_endemicity_statusany_back_colonisationany_outgroupany_polyphylyas_daisie_datatablebenchmarkbind_colonist_to_tblcheck_island_colonistcheck_island_tblcheck_multi_island_tblcheck_phylo_datacount_missing_speciescreate_daisie_datacreate_endemicity_statuscreate_test_phylodendemicity_to_sse_statesextract_asr_cladeextract_biogeobears_ancestral_states_probsextract_endemic_cladeextract_endemic_singletonextract_island_speciesextract_multi_tip_speciesextract_nonendemicextract_species_asrextract_species_minextract_stem_ageget_branching_timesget_clade_nameget_clade_typeget_col_max_ageget_col_timeget_extracted_speciesget_island_tblget_min_ageget_missing_speciesget_num_phylo_usedget_speciesget_sse_tip_statesget_statusis_back_colonisationis_duplicate_colonistis_identical_island_tblisland_colonistisland_tblmulti_extract_island_speciesmulti_island_tblplot_colonisationplot_performanceplot_phylodrm_island_colonistrm_multi_missing_speciesselect_endemicity_statussensitivityset_branching_times<-set_clade_name<-set_clade_type<-set_col_max_age<-set_col_time<-set_extracted_species<-set_island_tbl<-set_min_age<-set_missing_species<-set_num_phylo_used<-set_species<-set_status<-sse_states_to_endemicitytranslate_statusunique_island_generawrite_biogeobears_inputwrite_newick_filewrite_phylip_biogeo_file

Dependencies:ade4apeaplotaskpassBHcastorcliclusterGenerationcodacodetoolscolorspacecombinatcpp11crayoncurlDAISIEDDDDEoptimdeSolvedigestdoParalleldplyrexpmfansifarverfastmatchforeachfsgenericsggfunggplot2ggplotifyggtreegluegridGraphicsgtablehmshttrigraphisobanditeratorsjsonlitelabelinglatticelazyevallifecyclemagrittrmapsMASSMatrixmgcvmimemnormtmunsellnaturalsortnlmenumDerivopenssloptimParallelpatchworkphangornphylobasephytoolspillarpixmappkgconfigplyrpracmaprettyunitsprogresspurrrquadprogR6RColorBrewerRcppRcppArmadilloRcppEigenreshape2rlangrnclRNeXMLRSpectrascalesscatterplot3dspSparseMstringistringrsubplexsystensortestittibbletidyrtidyselecttidytreetreeioutf8uuidvctrsviridisLitewithrXMLxml2yulab.utils

DAISIEprep Tutorial

Rendered fromTutorial.Rmdusingknitr::rmarkdownon Nov 16 2024.

Last update: 2023-04-11
Started: 2022-01-13

Performance

Rendered fromPerformance.Rmdusingknitr::rmarkdownon Nov 16 2024.

Last update: 2023-04-24
Started: 2022-03-15

Sensitivity

Rendered fromSensitivity.Rmdusingknitr::rmarkdownon Nov 16 2024.

Last update: 2023-04-11
Started: 2023-01-16

Readme and manuals

Help Manual

Help pageTopics
Fits a model of ancestral state reconstruction of island presenceadd_asr_node_states
Adds an island colonists (can be either a singleton lineage or an island clade) to the island community (island_tbl).add_island_colonist
Adds a specified number of missing species to an existing island_tbl at the colonist specified by the species_to_add_to argument given. The species given is located within the island_tbl data and missing species are assigned. This is to be used after 'extract_island_species()' to input missing species.add_missing_species
Calculates the number of missing species to be assigned to each island clade in the island_tbl object and assigns the missing species to them. In the case that multiple genera are in an island clade and each have missing species the number of missing species is summed. Currently the missing species are assigned to the genus that first matches with the missing species table, however a more biologically or stochastic assignment is in development.add_multi_missing_species
Add an outgroup species to a given phylogeny.add_outgroup
Checks whether all species given in the descendants vector are the same species.all_descendants_conspecific
All possible endemicity statusesall_endemicity_status
Detects any cases where a non-endemic species or species not present on the island has likely been on the island given its ancestral state reconstruction indicating ancestral presence on the island and so is likely a back colonisation from the island to the mainland (or potentially different island). This function is useful if using extraction_method = "min" in 'DAISIEprep::extract_island_species()' as it may brake up a single colonist into multiple colonists because of back-colonisation.any_back_colonisation
Checks whether the phylogeny has an outgroup that is not present on the island. This is critical when extracting data from the phylogeny so the stem age (colonisation time) is correct.any_outgroup
Checks whether there are any species in the phylogeny that have multiple tips (i.e. multiple subspecies per species) and whether any of those tips are paraphyletic (i.e. are their subspecies more distantly related to each other than to other subspecies or species).any_polyphyly
Converts the 'Island_tbl' class to a data frame in the format of a DAISIE data table (see DAISIE R package for details). This can then be input into 'DAISIEprep::create_daisie_data()' function which creates the list input into the DAISIE ML models.as_daisie_datatable
Performance analysis of the extract_island_species() function Uses system.time() for timing for reasons explained here: https://radfordneal.wordpress.com/2014/02/02/inaccurate-results-from-microbenchmark/ # nolintbenchmark
Takes an existing instance of an 'Island_tbl' class and bind the information from the instance of an 'Island_colonist' class to itbind_colonist_to_tbl
Checks the validity of the Island_colonist classcheck_island_colonist
Checks the validity of the Island_tbl classcheck_island_tbl
Checks the validity of the Multi_island_tbl classcheck_multi_island_tbl
Checks whether \linkS4class{phylo4d} object conforms to the requirements of the DAISIEprep package. If the function does not return anything the data is ready to be used, if an error is returned the data requires some pre-processing before DAISIEprep can be usedcheck_phylo_data
Reads in the checklist of all species on an island, including those that are not in the phylogeny (represented by NA) and counts the number of species missing from the phylogeny each genuscount_missing_species
This is a wrapper function for DAISIE::DAISIE_dataprep(). It allows the final DAISIE data structure to be produced from within DAISIEprep. For detailed documentation see the help documentation in the DAISIE package (?DAISIE::DAISIE_dataprep).create_daisie_data
Creates a data frame with the endemicity status (either 'endemic', 'nonendemic', 'not_present') of every species in the phylogeny using a phylogeny and a data frame of the island species and their endemicity (either 'endemic' or 'nonendemic') provided.create_endemicity_status
Creates phylod objects.create_test_phylod
Documentation for function in the DAISIEprep packagedefault_params_doc
Convert endemicity to SSE statesendemicity_to_sse_states
Extracts an island clade based on the ancestral state reconstruction of the species presence on the island, therefore this clade can contain non-endemic species as well as endemic species.extract_asr_clade
Extract ancestral state probabilities from BioGeoBEARS outputextract_biogeobears_ancestral_states_probs
Creates a name for a clade depending on whether all the species of the clade have the same genus name or whether the clade is composed of multiple genera, in which case it will create a unique clade name by concatinating the genus namesextract_clade_name
Extracts the information for an endemic clade (i.e. more than one species on the island more closely related to each other than other mainland species) from a phylogeny (specifically 'phylo4d' object from 'phylobase' package) and stores it in an 'Island_colonist' classextract_endemic_clade
Extracts the information for an endemic species from a phylogeny (specifically 'phylo4d' object from 'phylobase' package) and stores it in in an 'Island_colonist' classextract_endemic_singleton
Extracts the colonisation, diversification, and endemicty data from phylogenetic and endemicity data and stores it in an 'Island_tbl' objectextract_island_species
Extracts the information for a species (endemic or non-endemic) which has multiple tips in the phylogeny (i.e. more than one sample per species) from a phylogeny (specifically 'phylo4d' object from 'phylobase' package) and stores it in an 'Island_colonist' classextract_multi_tip_species
Extracts the information for a non-endemic species from a phylogeny (specifically 'phylo4d' object from 'phylobase' package) and stores it in in an 'island_colonist' classextract_nonendemic
Extracts the colonisation, diversification, and endemicty data from phylogenetic and endemicity data and stores it in an 'Island_tbl' object using the "asr" algorithm that extract island species given their ancestral states of either island presence or absence.extract_species_asr
Extracts the colonisation, diversification, and endemicty data from phylogenetic and endemicity data and stores it in an 'Island_tbl' object using the "min" algorithm that extract island species as the shortest time to the present.extract_species_min
Extracts the stem age from the phylogeny when the a species is known to belong to a genus but is not itself in the phylogeny and there are members of the same genus are in the phylogeny. The stem age can either be for the genus (or several genera) in the tree ('stem = "genus"') or use an extraction algorithm to find the stem of when the species colonised the island (stem = "island_presence), either 'min' or 'asr' as in extract_island_species(). When 'stem = "island_presence"' the reconstructed node states are used to determine the stem age.extract_stem_age
Extracts the stem age from the phylogeny when the a species is known to belong to a genus but is not itself in the phylogeny and there are members of the same genus are in the phylogeny using the 'asr' extraction methodextract_stem_age_asr
Extracts the stem age from the phylogeny when the a species is known to belong to a genus but is not itself in the phylogeny and there are members of the same genus are in the phylogenyextract_stem_age_genus
Extracts the stem age from the phylogeny when the a species is known to belong to a genus but is not itself in the phylogeny and there are members of the same genus are in the phylogeny using the 'min' extraction methodextract_stem_age_min
Accessor functions for the data (slots) in objects of the 'Island_colonist' classget_branching_times get_branching_times,Island_colonist-method get_clade_name get_clade_name,Island_colonist-method get_clade_type get_clade_type,Island_colonist-method get_col_max_age get_col_max_age,Island_colonist-method get_col_time get_col_time,Island_colonist-method get_min_age get_min_age,Island_colonist-method get_missing_species get_missing_species,Island_colonist-method get_species get_species,Island_colonist-method get_status get_status,Island_colonist-method set_branching_times<- set_branching_times<-,Island_colonist-method set_clade_name<- set_clade_name<-,Island_colonist-method set_clade_type<- set_clade_type<-,Island_colonist-method set_col_max_age<- set_col_max_age<-,Island_colonist-method set_col_time<- set_col_time<-,Island_colonist-method set_min_age<- set_min_age<-,Island_colonist-method set_missing_species<- set_missing_species<-,Island_colonist-method set_species<- set_species<-,Island_colonist-method set_status<- set_status<-,Island_colonist-method
Accessor functions for the data (slots) in objects of the 'Island_tbl' classget_extracted_species get_extracted_species,Island_tbl-method get_island_tbl get_island_tbl,Island_tbl-method get_num_phylo_used get_num_phylo_used,Island_tbl-method set_extracted_species<- set_extracted_species<-,Island_tbl-method set_island_tbl<- set_island_tbl<-,Island_tbl-method set_num_phylo_used<- set_num_phylo_used<-,Island_tbl-method
Extract tip states from a phylod objectget_sse_tip_states
Checks whether species has undergone back-colonisation fromis_back_colonisation
Determines if colonist has already been stored in 'Island_tbl' class. This is used to stop endemic clades from being stored multiple times in the island table by checking if the endemicity status and branching times are identical.is_duplicate_colonist
Checks whether two 'Island_tbl' objects are identical. If they are different comparisons are made to report which components of the 'Island_tbls' are different.is_identical_island_tbl
Constructor for Island_colonistisland_colonist
Defines the 'island_tbl' class which is used when extracting information from the phylogenetic and island data to be used for constructing a 'daisie_data_tbl'Island_colonist-class
Constructor function for 'Island_tbl' classisland_tbl
Defines the 'island_tbl' class which is used when extracting information from the phylogenetic and island data to be used for constructing a 'daisie_data_tbl'Island_tbl-class
Extracts the colonisation, diversification, and endemicty data from multiple 'phylod' ('phylo4d' class from 'phylobase') objects (composed of phylogenetic and endemicity data) and stores each in an 'Island_tbl' object which are stored in a 'Multi_island_tbl' object.multi_extract_island_species
Constructor function for 'Multi_island_tbl' classmulti_island_tbl
Defines the 'Multi_island_tbl' class which is multiple 'Island_tbl's.Multi_island_tbl-class
Plots a dot plot (cleveland dot plot when include_crown_age = TRUE) of the stem and potentially crown ages of a community of island colonists.plot_colonisation
Plots performance results for a grouping variable (prob_on_island or prob_endemic).plot_performance
Plots the phylogenetic tree and its associated tip and/or node dataplot_phylod
Removes an island colonist from an 'Island_tbl' objectrm_island_colonist
Loops through the genera that have missing species and removes the ones that are found in the missing genus list which have phylogenetic data. This is useful when wanting to know which missing species have not been assigned to the island_tbl using 'add_multi_missing_species()'.rm_multi_missing_species
Rounds numbers using the round up method, rather than the round to the nearest even number method used by the base function 'round'.round_up
Select endemicity status from ancestral states probabilitiesselect_endemicity_status
Runs a sensitivity analysis to test the influences of changing the data on the parameter estimates for the DAISIE maximum likelihood inference modelsensitivity
Convert SSE states back to endemicity statussse_states_to_endemicity
Takes a string of the various ways the island species status can be and returns a uniform all lower-case string of the same status to make handling statuses easier in other functiontranslate_status
Determines the unique endemic genera that are included in the island clades contained within the island_tbl object and stores them as a list with each genus only occuring once in the first island clade it appears inunique_island_genera
Write input files for BioGeoBEARSwrite_biogeobears_input
Write tree input file for BioGeoBEARSwrite_newick_file
Write biogeography input file for BioGeoBEARSwrite_phylip_biogeo_file