Optimize.NetworkSearch: Optimize.NetworkSearch: function to find the ML network...

View source: R/Optimize.NetworkSearch.R

Optimize.NetworkSearchR Documentation

Optimize.NetworkSearch: function to find the ML network topology using PhyloNet

Description

This function returns an optimized network topology and its maximized likelihood

Usage

Optimize.NetworkSearch(
  handle.GeneTrees,
  numeric.MaxReticulations,
  string.PathDir
)

Arguments

handle.GeneTrees

Phylo object containing a list of gene trees

numeric.MaxReticulations

Numeric defining the maximum number of reticulations for PhyloNet search

string.PathDir

String defining the path to a parent directory used for optimizing species tree

numeric.Stells_algorthm

Numeric defining with algorithm of STELLS to use: 0 or 1

Value

handle.Optimized_SpeciesTree Species tree with branch lengths (in coalescent units) that has been optimized with STELLS

numeric.MaximizedLnL Numeric containing the maximum likelihood given the optimized branch lengths of the species tree

Examples



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

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

##########################
# Simulate gene tree set #
##########################
handle.Simulated_GeneTreeSet <- Simulate.GeneTrees_From_SpeciesNetwork(string.SpeciesNetwork = string.SpeciesNetwork,
                                                                       string.PathDir = '~/Desktop/',
                                                                       numeric.NumberOfGeneTrees = 5)

####################################
# Optimize network topology search #
####################################
handle.OptimizedNetwork_Topology <- Optimize.NetworkSearch(handle.GeneTrees = handle.Simulated_GeneTreeSet,
                                                           numeric.MaxReticulations = 1,
                                                           string.PathDir = '~/Desktop/')


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