Skip to content

Scale bar for tree using phangorn and phyloseq #33

@AMFBio

Description

@AMFBio

Hi there,

I'm trying to get a scale bar for my phlyogenetic tree.

I’m using the instructions found in this tutorial: https://f1000research.com/articles/5-1492/v2

After I process my sequences and run the alignment, my script is as follows:

phang.align <- phyDat(as(alignment, "matrix"), type="DNA")
dm <- dist.ml(phang.align)
treeNJ <- NJ(dm)
fit = pml(treeNJ, data=phang.align)
negative edges length changed to 0!
fitGTR <- update(fit, k=4, inv=0.2)
fitGTR <- optim.pml(fitGTR, model="GTR", optInv=TRUE, optGamma=TRUE, rearrangement = "stochastic", control = pml.control (trace = 0))

I combine this into my phyloseq object, then I filter and prune my data set to give me the new phyloseq object: test15_2

I plot this tree using:

plot_tree(test15_2, color="Species", ladderize="left", label.tips=labeltips)

But I’m unsure of how to add the scale bar in here?

Any help would be appreciated.

Cheers,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions