Conduct.SH_2: Conduct.SH_2: function to conduct the SH_2 STAR test given a...

View source: R/Conduct.SH_2.R

Conduct.SH_2R Documentation

Conduct.SH_2: function to conduct the SH_2 STAR test given a set of input (all plausible, including the ML) species topologies using the RELL method

Description

This function returns a list containing p-values of the SH_2 STAR test for a set of input topologies

Usage

Conduct.SH_2(
  handle.SpeciesTopologies,
  handle.InputGeneTrees,
  numeric.NumberOfReps,
  string.PathDir
)

Arguments

handle.SpeciesTopologies

List of class multiPhylo containing the plausible topologies to be tested

numeric.NumberOfReps

Number of bootstrap replicates to analyze

string.PathDir

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

handle.GeneTrees

Phylo object containing a list of the input gene trees

Value

List Returns a list containing (1) matrix.Change_Delta_BS_Results, (2) vector.Pvalues, and (3) vector.Observed_Delta_ML.

Examples




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

#################################
# Generate example species trees #
#################################
handle.SpeciesTree1 <- read.tree(text = "(A:1.0,(B:0.5,(C:1.0,D:1.0):1.5):0.5);")
handle.SpeciesTree1$edge.length <- handle.SpeciesTree1$edge.length * 0.1
handle.SpeciesTree2 <- read.tree(text = "(C:1.0,(B:0.5,(A:1.0,D:1.0):1.5):0.5);")
handle.SpeciesTree3 <- read.tree(text = "(D:1.0,(B:0.5,(A:1.0,C:1.0):1.5):0.5);")
handle.SpeciesTopologies <- list()
class(handle.SpeciesTopologies) <- "multiPhylo"
handle.SpeciesTopologies[[1]] <- handle.SpeciesTree3
handle.SpeciesTopologies[[2]] <- handle.SpeciesTree2
handle.SpeciesTopologies[[3]] <- handle.SpeciesTree1



#################################################
# Simlate a set of gene trees for species tree1 #
#################################################
handle.Simulated_GeneTrees <- Simulate.GeneTrees_From_SpeciesTree(handle.SpeciesTree = handle.SpeciesTree1,
                                                                  string.PathDir = '~/Desktop/',
                                                                  numeric.NumberOfGeneTrees = 100)

################################
# Conduct SH_2 STAR test for S #
################################
Conduct.SH_2(handle.SpeciesTopologies = handle.SpeciesTopologies,
             handle.InputGeneTrees = handle.Simulated_GeneTrees,
             numeric.NumberOfReps = 1000,
             string.PathDir = '~/Desktop/')



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