Conduct.SOWH_2v3: Conduct.SOWH_2v3: function to conduct the SOWH_1 STAR test...

View source: R/Conduct.SOWH_2v3.R

Conduct.SOWH_2v3R Documentation

Conduct.SOWH_2v3: function to conduct the SOWH_1 STAR test given two distinct species topologies and a set of input gene trees

Description

This function returns a list containing p-values of the SOWH_1 STAR test

Usage

Conduct.SOWH_2v3(
  handle.SpeciesTree_1,
  handle.InputGeneTrees,
  numeric.NumberOfReps,
  string.PathDir
)

Arguments

handle.SpeciesTree_1

Phylogenetic tree defining the first species topology

numeric.NumberOfReps

Number of bootstrap replicates to analyze

string.PathDir

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

handle.GeneTrees

Phylo object containing a list of the input gene trees

Value

List Returns a list containing (1) vector.Null_BS_Delta_Stat, (2) numeric.pValue, and (3) numeric.Delta_Observed

Examples

#'


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

#################################
# Generate example species trees #
#################################
handle.SpeciesTreeX1 <- read.tree(text = "(A:1.0,(B:0.5,(C:1.0,D:1.0):1.5):0.5);")
handle.SpeciesTreeX1$edge.length <- handle.SpeciesTreeX1$edge.length * 1
handle.SpeciesTreeX2 <- read.tree(text = "(C:1.0,(B:0.5,(A:1.0,D:1.0):1.5):0.5);")



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


################################
# Conduct SOWH_2 STAR test for S #
################################
Conduct.SOWH_2v3(handle.SpeciesTree_1 = handle.SpeciesTreeX2,
              handle.InputGeneTrees = handle.Simulated_GeneTrees,
              numeric.NumberOfReps = 100,
              string.PathDir = '~/Desktop/')




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