View source: R/Optimize.Network.R
Optimize.Network | R Documentation |
This function returns a species network (string) with branch lengths amd hybyridization edges that have been optimized using the MSC and the PhyloNet algorithm
Optimize.Network(string.SpeciesNetwork, handle.GeneTrees, string.PathDir)
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 |
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
################ # 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/')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.