Dear community,

My problem was apparently solved. The issue was that Bayestraits does not
accept node labels. We need to use tree$node.label <- NULL for "phylo"
objects.

In my case, I have a "multiphylo" object. So, the node labels of a
"multiphylo" object can easily be removed using:

for(i in 1:50){
  frog_newtree_50[[i]]$node.label<-NULL
}

Now, my code works. Thank you all for the help, especially for Dr. Jo
Baker, who solved my problem.

Cheers!

Em ter., 3 de dez. de 2024 às 05:37, Sishuo Wang <sishuo.w...@aol.com>
escreveu:

> Dear Leonardo,
>
> I think Mike's suggestion by running bayestraits mannually is a nice idea.
> also, may i know which version of bayestraits you are using? there could be
> a change in the requirement of the input format in its newest version (v4).
> That said, you might wish to change to bayestraits v3 and see if it works.
> I see others also report a similar problem. Error: Taxa ".." is not
> present in tree 1 / error in BayesTrait v.4
> <https://stackoverflow.com/questions/77398482/error-taxa-is-not-present-in-tree-1-error-in-bayestrait-v-4>.
> Or would you pls mind sharing with everyone here or with me your data so
> that we can take a closer look?
>
> best,
> sishuo
>
>
>
> On Friday, November 29, 2024 at 11:32:42 p.m. GMT+8, Leonardo Matheus
> Servino <leonardomserv...@gmail.com> wrote:
>
>
> Michael,
> I checked and there is no mismatch between the trees and the dataset.
> This is getting too much frustrating for me and for now, I think I'll give
> up on that.
>
> Anyway, I appreciate your help.
>
> Em sex., 29 de nov. de 2024 às 09:43, Michael Zyphur <mzyp...@instats.org>
> escreveu:
>
> > Hi Leonardo
> >
> > There may be a mismatch between the taxa names in your dataset and those
> > in your tree file. The taxa names in your dataset (final_data_bt) must
> > match exactly the names in your tree (frog_newtree_50), meaning no extra
> > space or different capitalizations or special characters/formatting
> > differences. Try this:
> >
> > data_taxa <- final_data_bt[, 1]
> > tree_taxa <- frog_newtree_50$tip.label
> > mismatched_taxa <- setdiff(data_taxa, tree_taxa)
> > print(mismatched_taxa)
> > tree_only_taxa <- setdiff(tree_taxa, data_taxa)
> > print(tree_only_taxa)
> >
> > Hopefully this shows where the issues might be coming from.
> >
> >
> > Best wishes
> >
> > Michael Zyphur
> > Director
> > Institute for Statistical and Data Science
> > *instats.org* <http://instats.org>
> >
> >
> > On Fri, 29 Nov 2024 at 23:20, Leonardo Matheus Servino <
> > leonardomserv...@gmail.com> wrote:
> >
> >> Michael,
> >>
> >> Thank you. Unfortunately I already tried to run in the terminal and got
> >> errors as
> >>
> >> Error: Taxa Phyllomedusa_rohdei is not present in tree 1
> >> Error: Taxa Phyllomedusa_ayeaye is not present in tree 1
> >> Error: Taxa Phyllomedusa_megacephala is not present in tree 1
> >> Error: Taxa Phyllomedusa_azurea is not present in tree 1
> >> Error: Taxa Phyllomedusa_hypochondrialis is not present in tree 1
> >> Error: Taxa Phyllomedusa_nordestina is not present in tree 1
> >> Error: Taxa Agalychnis_dacnicolor is not present in tree 1
> >> Error: Taxa Agalychnis_spurrelli is not present in tree 1
> >> Error: Taxa Agalychnis_saltator is not present in tree 1
> >> Error: Taxa Agalychnis_callidryas is not present in tree 1
> >> Error: Taxa Agalychnis_annae is not present in tree 1
> >> .
> >> .
> >> .
> >>  Basically, the program is not identifying my taxa in the trees. I
> >> exported the data following the data format required and I don't know
> where
> >> is the problem.
> >>
> >> Em sex., 29 de nov. de 2024 às 09:04, Michael Zyphur <
> mzyp...@instats.org>
> >> escreveu:
> >>
> >>> Hi Leonardo
> >>>
> >>> Sorry, it looks like it doesn't support a debug mode - my mistake.
> Maybe
> >>> try manually running BayesTraits. Export the data and tree files:
> >>>
> >>> write.table(final_data_bt, "data.txt", row.names = FALSE, col.names =
> >>> TRUE, quote = FALSE) ape::write.tree(frog_newtree_50, file =
> "tree.txt")
> >>>
> >>> The run it through a terminal or command prompt:
> >>>
> >>> BayesTraits tree.txt data.txt
> >>>
> >>> then you should be able to input your commands manually when prompted.
> >>> If it runs successfully, the issue is with how btw is interfacing with
> >>> BayesTraits. If this doesn't work then maybe try checking the
> BayesTraits
> >>> Path in btw
> >>>
> >>> results_1 <- bayestraits(
> >>>  data = final_data_bt,
> >>>  tree = frog_newtree_50,
> >>>  commands = command_vec1,
> >>>  bt_path = "/full/path/to/BayesTraits"
> >>> )
> >>>
> >>> Replace "/full/path/to/BayesTraits" with the actual path to the
> >>> BayesTraits executable.
> >>>
> >>> Hope this helps!
> >>>
> >>>
> >>> Best wishes
> >>>
> >>> Michael Zyphur
> >>> Director
> >>> Institute for Statistical and Data Science
> >>> *instats.org* <http://instats.org>
> >>>
> >>>
> >>> On Fri, 29 Nov 2024 at 22:00, Leonardo Matheus Servino <
> >>> leonardomserv...@gmail.com> wrote:
> >>>
> >>>> Dear Michael,
> >>>>
> >>>> Thanks for your answer. I tried to run in debug mode, but the console
> >>>> simply gave me another error message:
> >>>>
> >>>> Error in bayestraits(data = final_data_bt, tree = frog_newtree_50,
> commands = command_vec1,  :
> >>>>  unused argument (debug = TRUE)
> >>>>
> >>>>
> >>>> Em qui., 28 de nov. de 2024 às 21:43, Michael Zyphur <
> >>>> mzyp...@instats.org> escreveu:
> >>>>
> >>>>> Hi Leonardo
> >>>>>
> >>>>> The "btw can't find a log file" error is common with the btw package
> >>>>> when the underlying BayesTraits executable fails to run properly or
> save
> >>>>> its output. Assuming that 1) the BayesTraits installation is fine,
> 2) the
> >>>>> file and path permissions are all ok, and 3) your input data format
> is
> >>>>> appropriate given the requirements, then you can try running it in
> debug
> >>>>> mode to troubleshoot the problem with something like:
> >>>>>
> >>>>> results_1 <- bayestraits(
> >>>>>  data = final_data_bt,
> >>>>>  tree = frog_newtree_50,
> >>>>>  commands = command_vec1,
> >>>>>  debug = TRUE
> >>>>> )
> >>>>>
> >>>>> This may provide clues about where the process is failing.
> >>>>>
> >>>>>
> >>>>> Best wishes
> >>>>>
> >>>>> Michael Zyphur
> >>>>> Director
> >>>>> Institute for Statistical and Data Science
> >>>>> *instats.org* <http://instats.org>
> >>>>>
> >>>>>
> >>>>> On Fri, 29 Nov 2024 at 04:50, Leonardo Matheus Servino <
> >>>>> leonardomserv...@gmail.com> wrote:
> >>>>>
> >>>>>> Dear group,
> >>>>>>
> >>>>>> Anyone here is familiar with package btw?I'm trying to perform some
> >>>>>> analysis with my dataset, but I got the following error message:
> >>>>>>
> >>>>>> command_vec1 <- c("3", "2")
> >>>>>>
> >>>>>>
> >>>>>> results_1 <- bayestraits(data = final_data_bt, tree =
> frog_newtree_50,
> >>>>>> commands = command_vec1)
> >>>>>>
> >>>>>> Error in bayestraits(data = final_data_bt, tree = frog_newtree_50,
> >>>>>> commands = command_vec1) :
> >>>>>>  Something went wrong: btw can't find a log file
> >>>>>>
> >>>>>>
> >>>>>> Has anyone here ever faced this error?
> >>>>>>
> >>>>>> Cheers
> >>>>>> --
> >>>>>> Leonardo Matheus Servino
> >>>>>> Pós-graduação em Ecologia
> >>>>>>
> >>>>>> Departamento de Ecologia
> >>>>>> Universidade de São Paulo
> >>>>>> Rua do Matão, Trav. 14, n˚ 101
> >>>>>> Cid. Universitária - São Paulo, SP
> >>>>>> 05508-090
> >>>>>> Brasil
> >>>>>>
> >>>>>> *Lattes <http://lattes.cnpq.br/3993528079964952> - **ResearchGate
> >>>>>> <https://www.researchgate.net/profile/Leonardo_Servino> - ORCID
> >>>>>> <https://orcid.org/0000-0002-6772-376X> - LinkedIn
> >>>>>> <https://www.linkedin.com/in/leonardo-matheus-servino-8379ba1b2>*
> >>>>>>
> >>>>>>        [[alternative HTML version deleted]]
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> >>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> >>>>>> Searchable archive at
> >>>>>> http://www.mail-archive.com/r-sig-phylo@r-project.org/
> >>>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> Leonardo Matheus Servino
> >>>> Pós-graduação em Ecologia
> >>>>
> >>>> Departamento de Ecologia
> >>>> Universidade de São Paulo
> >>>> Rua do Matão, Trav. 14, n˚ 101
> >>>> Cid. Universitária - São Paulo, SP
> >>>> 05508-090
> >>>> Brasil
> >>>>
> >>>> *Lattes <http://lattes.cnpq.br/3993528079964952> - **ResearchGate
> >>>> <https://www.researchgate.net/profile/Leonardo_Servino> - ORCID
> >>>> <https://orcid.org/0000-0002-6772-376X> - LinkedIn
> >>>> <https://www.linkedin.com/in/leonardo-matheus-servino-8379ba1b2>*
> >>>>
> >>>
> >>
> >> --
> >> Leonardo Matheus Servino
> >> Pós-graduação em Ecologia
> >>
> >> Departamento de Ecologia
> >> Universidade de São Paulo
> >> Rua do Matão, Trav. 14, n˚ 101
> >> Cid. Universitária - São Paulo, SP
> >> 05508-090
> >> Brasil
> >>
> >> *Lattes <http://lattes.cnpq.br/3993528079964952> - **ResearchGate
> >> <https://www.researchgate.net/profile/Leonardo_Servino> - ORCID
> >> <https://orcid.org/0000-0002-6772-376X> - LinkedIn
> >> <https://www.linkedin.com/in/leonardo-matheus-servino-8379ba1b2>*
> >>
> >
>
> --
> Leonardo Matheus Servino
> Pós-graduação em Ecologia
>
> Departamento de Ecologia
> Universidade de São Paulo
> Rua do Matão, Trav. 14, n˚ 101
> Cid. Universitária - São Paulo, SP
> 05508-090
> Brasil
>
> *Lattes <http://lattes.cnpq.br/3993528079964952> - **ResearchGate
> <https://www.researchgate.net/profile/Leonardo_Servino> - ORCID
> <https://orcid.org/0000-0002-6772-376X> - LinkedIn
> <https://www.linkedin.com/in/leonardo-matheus-servino-8379ba1b2>*
>
>     [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>


-- 
Leonardo Matheus Servino
Pós-graduação em Ecologia

Departamento de Ecologia
Universidade de São Paulo
Rua do Matão, Trav. 14, n˚ 101
Cid. Universitária - São Paulo, SP
05508-090
Brasil

*Lattes <http://lattes.cnpq.br/3993528079964952> - **ResearchGate
<https://www.researchgate.net/profile/Leonardo_Servino> - ORCID
<https://orcid.org/0000-0002-6772-376X> - LinkedIn
<https://www.linkedin.com/in/leonardo-matheus-servino-8379ba1b2>*

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to