Conduct.SpeciesTopoTestR: Conduct.SpeciesTopoTestR: function to conduct an array of...

View source: R/Conduct.SpeciesTopoTestR.R

Conduct.SpeciesTopoTestRR Documentation

Conduct.SpeciesTopoTestR: function to conduct an array of different likelihood-based tests of species topologies

Description

This function returns a list containing the results of a topology test

Usage

Conduct.SpeciesTopoTestR(
  handle.Topologies2Test,
  handle.GeneTrees,
  numeric.NumberOfReps,
  string.Test,
  numeric.Algorithm,
  boo.Networks,
  string.PathDir,
  numeric.MaxReticulations
)

Arguments

handle.Topologies2Test

List of topologies to be tested. Use format "multiPhylo" for bifurcating topologies, and a standard list for networks (each network is just a string)

handle.GeneTrees

Phylo object containing a list of the input gene trees

numeric.NumberOfReps

Number of bootstrap replicates to analyze

string.Test

String defining the test to run, can be "KH", "SH", "SOWH"

numeric.Algorithm

Numeric specifiying the algorithm KH (1, 2 or 3), SH (1 or 2), SOWH (1 or 2)

boo.Networks

Boolien specifiying whether the input topologies include networks (True) or not (False)

string.PathDir

String defining the path to a parent directory used for conduct KH_1 STAR test

numeric.MaxReticulations

Number of maximum reticulating edges. Only used for the SOWH test with network topologies

Value

List Returns a list containing p-values and details for the assumed topology test

Examples



################
# Load depends #
################
library(SpeciesTopoTestR)
library(ape)

########################################################
# Define species topologies for simulation and testing #
########################################################
handle.SpeciesTree1 <- read.tree(text = "(A:3,(B:2,(C:1,D:1):1):1);")
handle.SpeciesTree2 <- read.tree(text = "(A:3,(D:2,(C:1,B:1):1):1);")


##########################
# Simulate gene tree set #
##########################
handle.Simulated_GeneTrees_T1 <- Simulate.GeneTrees_From_SpeciesTree(handle.SpeciesTree = handle.SpeciesTree1,
                                                                     string.PathDir = '~/Desktop/',
                                                                     numeric.NumberOfGeneTrees = 3)

########################
# Run SpeciesTopoTestR #
########################
handle.SpeciesTopologies <- list()
class(handle.SpeciesTopologies) <- "multiPhylo"
handle.SpeciesTopologies[[1]] <- handle.SpeciesTree1
handle.SpeciesTopologies[[2]] <- handle.SpeciesTree2

list.SpeciesTopologies <- list()
list.SpeciesTopologies[[1]] <- write.tree(phy = handle.SpeciesTree1, file = "")
list.SpeciesTopologies[[2]] <- write.tree(phy = handle.SpeciesTree2, file = "")


Conduct.SpeciesTopoTestR(handle.Topologies2Test = list.SpeciesTopologies,
                         handle.GeneTrees = handle.Simulated_GeneTrees_T1,
                         numeric.NumberOfReps = 3,
                         string.Test = "SOWH",
                         numeric.Algorithm = 2,
                         boo.Networks = T,
                         string.PathDir = '~/Desktop/',
                         numeric.MaxReticulations = 1)


radamsRHA/SpeciesTopoTestR documentation built on Sept. 5, 2022, 7:37 p.m.