Conduct.KH_2N: Conduct.KH_2N: function to conduct the KH_2N STAR test given...

View source: R/Conduct.KH_2N.R

Conduct.KH_2NR Documentation

Conduct.KH_2N: function to conduct the KH_2N STAR test given two distinct species topologies (one or both are networks) and a set of input gene trees

Description

This function returns a list containing p-values of the KH_2N STAR test for two input species tree topologies

Usage

Conduct.KH_2N(
  string.SpeciesNetwork1,
  string.SpeciesNetwork2,
  handle.InputGeneTrees,
  numeric.NumberOfReps,
  string.PathDir
)

Arguments

string.SpeciesNetwork1

String defining the first species topology (can be network or bifurcating)

string.SpeciesNetwork2

String defining the first species topology (can be network or bifurcating)

numeric.NumberOfReps

Number of bootstrap replicates to analyze

string.PathDir

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

handle.GeneTrees

Phylo object containing a list of the input gene trees

Value

List Returns a list containing (1) twosided pvalue, (2) upper p-values, (3) lower p-values, and (4) a vector of the bootstrapped test statistics delta

Examples



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

####################################
# Generate example species network #
####################################
string.SpeciesNetwork <- "(((((C:1.0,D:1.0):1)#H1:0::0.25,A:1.0):2,B:1.0):2,#H1:0::0.75);"
string.SpeciesNetwork_2 <- "((A:1,B:1):1,(C:1,D:1):1);"


####################################################
# Simlate a set of gene trees for this species tree #
#####################################################
handle.SimulatedGeneTrees <- Simulate.GeneTrees_From_SpeciesNetwork(string.SpeciesNetwork = string.SpeciesNetwork,
                                                                    string.PathDir = '~/Desktop/',
                                                                    numeric.NumberOfGeneTrees = 5)

Conduct.KH_2N(string.SpeciesNetwork1 = string.SpeciesNetwork,
              string.SpeciesNetwork2 = string.SpeciesNetwork_2,
              handle.InputGeneTrees = handle.SimulatedGeneTrees,
              numeric.NumberOfReps = 3,
              string.PathDir = '~/Desktop/')


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