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

Birdtree.org phylogenetic trees #107

Open
bwegsche opened this issue Jul 1, 2021 · 6 comments
Open

Birdtree.org phylogenetic trees #107

bwegsche opened this issue Jul 1, 2021 · 6 comments

Comments

@bwegsche
Copy link

bwegsche commented Jul 1, 2021

Hello,

I'm working on a joint species distribution model for birds in a Canadian watershed.
We have defined a model including YData, XData and TrData following the workflow outlined in the Statistical Ecology website.
When I try to include phylogenetic infromation, however, I run into problems.

m = Hmsc(Y=YData, XData = XData, XFormula=XFormula,

  •      TrData = TrData, TrFormula = TrFormula,phyloTree = phyloTree,
    
  •      distr="probit", studyDesign=studyDesign,
    
  •      ranLevels=list(site_id=rL))
    

Error in corM[hM$spNames, hM$spNames] : subscript out of bounds

I assume the species names of the tree and the YData are not matching.

I'm using phylogenetic trees downloaded from the birdtree.org website similar as in the Tikhonov et al (2019) paper. When I compare the format of the phylogenetic tree in the example Rscript from your website to our tree there are some differences. Ours is in the nexus format and includes a list of 100 trees, whereas in the template script there is a single tree in the parenthic format (.tree ending). I tried running our script using a arbitrarily chosen tree (1 out of the 100 tree list) but I only get the error stated above. What was your strategy when you used birdtree.org as a data source and how do I have to format the data to use it in Hmsc? Unfortunately I'm not very familiar working with phylogenetic trees, so any guidance is highly appreciated. Is there an obvious mistake that you can already identify in my description.

Please let me know if you need further information.

Best regards,
Bernhard

@ovaskain
Copy link
Collaborator

ovaskain commented Jul 3, 2021 via email

@bwegsche
Copy link
Author

bwegsche commented Jul 5, 2021 via email

@andburch
Copy link

andburch commented Jul 5, 2021

Quick question, @bwegsche : did you end up making a consensus tree from the multiple Birdtree phylogenies or were you able to to use the multi-tree in the HMSC model?

@bwegsche
Copy link
Author

bwegsche commented Jul 6, 2021

Hi @andburch ,

I'm not sure if this is a valid approach but I just selected for now one of the 100 trees as input in Hmsc. If you use the consensus function of the ape R package to create a consensus tree, you get an error message in Hmsc because branch length information is missing. If you use one randomly chosen tree the code works fine. Are you running into the same or similar problem?

@ovaskain
Copy link
Collaborator

ovaskain commented Jul 6, 2021 via email

@andburch
Copy link

andburch commented Jul 7, 2021

I'm not sure how theoretically sound this is, but you can also use the consensus.edge() function in phytools to make a consensus MRC tree with branch lengths. It'll definitely take a bit of time to run, but that's what I'm doing. [If I'm horribly misguided, let me know!]

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

3 participants