Optimize.Network: Optimize.Network: function to optimize a species network...

View source: R/Optimize.Network.R

Optimize.NetworkR Documentation

Optimize.Network: function to optimize a species network topology using Phylonet

Description

This function returns a species network (string) with branch lengths amd hybyridization edges that have been optimized using the MSC and the PhyloNet algorithm

Usage

Optimize.Network(string.SpeciesNetwork, handle.GeneTrees, string.PathDir)

Arguments

string.SpeciesNetwork

String of the species network in Rich newick format (can be read by dendroscope)

handle.GeneTrees

Phylo object containing a list of gene trees

string.PathDir

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

Value

string.Optimized_SpeciesNetwork Species network with branch lengths (in coalescent units) and hybridization edge that has been optimized with PhyloNet

numeric.MaximizedLnL Numeric containing the maximum likelihood given the optimized parameters of the species network

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);"

####################################################
# 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 = 10)

###############################################
# Optimize network using simulated gene trees #
###############################################
handle.Optimized_Network <- Optimize.Network(string.SpeciesNetwork = string.SpeciesNetwork,
                                             handle.GeneTrees = handle.SimulatedGeneTrees,
                                             string.PathDir = '~/Desktop/')


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