emmakopp1 / phylogeny_trust

This project aims to validate (or invalidate) a phylogenetic tree estimation.
0 stars 0 forks source link

temps de calcul 01_Import.R #27

Open emmakopp1 opened 1 month ago

emmakopp1 commented 1 month ago

Dans le fichier 01_Import.R, j'ai modifié la fonction get_tip_ages pour calculer aussi l'âge des fossils (d(v) sur PLM).

get_tip_ages <- function(phylo) { ntips <- Ntip(phylo[[1]]) map_df(1:(length(phylo)), function(i) { ages <- node.depth.edgelength(phylo[[i]])[1:ntips] depth <- rep(distRoot(phylo[[i]])[[1]],ntips) - ages tibble(tree = i, tip = phylo[[i]]$tip.label, age = ages, depth = depth) }) }

Cela correspond à la nouvelle variable depth. Mais en faisant tourner le fichier je me rends compte que cela prend des heures. Est-ce normal ?