Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TripL distance calculation with n random trees #147

Open
Jigyasa3 opened this issue Mar 27, 2021 · 0 comments
Open

TripL distance calculation with n random trees #147

Jigyasa3 opened this issue Mar 27, 2021 · 0 comments

Comments

@Jigyasa3
Copy link

Jigyasa3 commented Mar 27, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant