Skip to content

TripL distance calculation with n random trees #147

@Jigyasa3

Description

@Jigyasa3

Hey @ArtPoon lab

Thank you again for all the help in my previous issue. I am interested in examining if the TripL distance between two trees is significantly different from a set of random trees. I was using the rmtree() function in ape() R package to generate random trees, and was wondering if the current way of using TripL() is correct? Any suggestions would be helpful!

code used-

Ptree1 <- read.tree("hosttree-treponemacog0016.nwk")
d<-data.frame(label=Ptree1$tip.label)
nRep=10
randomtrees<-rmtree(nRep, nrow(d), rooted = TRUE, tip.label = Ptree1$tip.label, br = runif) ##generate a random rooted tree with branch lengths
randomDists<-sapply(randomtrees,TripL,x=Ptree1)
##expectedCID <- mean(randomDists)


dist12 <- TripL(Ptree1, Ptree2) ##TripL on two original trees
##comparing the random and original tree distances
nThisSimilar <- sum(randomDists < dist12)
pValue <- nThisSimilar / nRep

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions