emmanuelparadis / ape

Analysis of Phylogenetics and Evolution
https://emmanuelparadis.github.io/
GNU General Public License v2.0
53 stars 11 forks source link

Preserve Multiple Node Labels When Using drop.tip() #79

Closed simone-says closed 1 year ago

simone-says commented 1 year ago

I can't seem to find a way to keep multiple node labels. Is there a way to change my Newick file so it preserves multiple labels or is there a different way to prune my tree? This is a time tree from treePL with branch lengths and divergence time estimates. It stores BLs as node.label attribute and divergence times as edge.length

E.g.,

((((Alligator_mississippiensis:247.000000,Gallus_gallus:247.000000)0.0:13.208018,Chrysemys_picta:260.208018)0.5652703018918337:9.634239,(Sphenodon_punctatus:238.000000,(Dibamus_bouretti:210.000000,((Correlophus_ciliatus:167.025468,(Eublepharis_macularius:126.990743,((Paroedura_picta:55.482422,(Gekko_japonicus:27.715439,Gekko_badenii:27.715439)1.1642182432072183:27.766983)0.9477173979815781:38.433578,(Gonatodes_ferrugineus:61.425966,(Sphaerodactylus_notatus:36.664874,(Sphaerodactylus_nicholsi:17.904572,Sphaerodactylus_townsendi:17.904572)

emmanuelparadis commented 1 year ago

Can you give an example of what ape does, and explain what you expect instead?

simone-says commented 1 year ago

I got it working! I think the tree file I was reading in had two nodes with 3 labels and the rest had 2, probably some formatting error from a different program. Fixed that and it works as expected, thank you!