View source: R/Compute.GeneTree_Likelihoods_SpeciesNetwork.R
Compute.GeneTree_Likelihoods_SpeciesNetwork | R Documentation |
This function returns a vector of gene tree likelihoods given a set of gene trees and a particular species tree (networks included)
Compute.GeneTree_Likelihoods_SpeciesNetwork( 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 of gene trees |
string.PathDir |
String of the path to a parent directory used for simulating gene trees |
vector.GeneTreeProbs Vector of gene tree likelihoods for each gene tree provided
################ # 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 = 100) ############################ # Optimize species network # ############################ handle.Optimized_Network1 <- Optimize.Network(string.SpeciesNetwork = string.SpeciesNetwork, handle.GeneTrees = handle.SimulatedGeneTrees, string.PathDir = '~/Desktop/') ################################################################# # Compute gene tree likelihoods given optimized species network # ################################################################# vector.GeneTreeLikelihoods_SpeciesNetwork <- Compute.GeneTree_Likelihoods_SpeciesNetwork(string.SpeciesNetwork = handle.Optimized_Network1$string.Optimized_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.