Re: [R-sig-phylo] REST API CIPRES

2017-05-08 Thread François Michonneau
Hi Andreas,

  I've started a package a while back here:
https://github.com/fmichonneau/cipresr but I haven't had a chance to
finish it.

  It is functional but only supports RAxML and BEAST at this time.

  I'm glad to help if you have any questions trying to get it working,
and I'd be happy to review your contributions to the code.

  Cheers,
  -- François

On Mon, May 8, 2017 at 6:24 AM, Andreas Kolter
 wrote:
> Dear list members,
> I was wondering if somebody already tried (or knows somebody who did) using
> R to access CIPRES using the RESTful API? I think it's a great solution for
> people with limited resources.
> https://www.phylo.org/restusers/docs/guide.html#SampleCode
> Best wishes,
> Andreas
>
> ___
> 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/

___
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/

Re: [R-sig-phylo] Bug in ape?

2017-04-28 Thread François Michonneau
Hi Simon and others,

  I ran into the same problems a few days ago and I suspect it's
related to changes associated with R 3.4.0. Re-installing ape solved
the issue for me.

  Cheers,
  -- François

On Wed, Apr 26, 2017 at 11:01 PM, Simon Blomberg  wrote:
> False alarm. I cleared my workspace and re-started R and the problem has
> gone away. I'm curious to know how it occurred but I'm happy that it has
> been resolved. We now return you to your scheduled R programming...
>
> Cheers,
>
> Simon.
>
>
>
> On 27/04/17 12:44, Simon Blomberg wrote:
>>
>> Hi Emmanuel and other list members.
>>
>> I am having some problems creating and working with trees (phylo objects)
>> in ape. Has anyone else seen this error? The following code reproduces the
>> errors:
>>
>> library(ape)
>> tr1 <- rtree(10)
>>
>> plot(tr1)
>>
>> Error in .reorder_ape(x, order, index.only, length(x$tip.label), io) :
>>   object 'neworder_phylo' not found
>>
>> tr2 <- rcoal(10)
>>
>> Error in .reorder_ape(x, order, index.only, length(x$tip.label), io) :
>>   object 'neworder_phylo' not found
>>
>> tr3 <- read.tree(text="((a, b), (c, d));")
>>
>> compute.brlen(tr3)
>>
>> Error in .reorder_ape(x, order, index.only, length(x$tip.label), io) :
>>   object 'neworder_phylo' not found
>>
>> ## All have the same traceback:
>>
>> > traceback()
>> 4: .reorder_ape(x, order, index.only, length(x$tip.label), io)
>> 3: reorder.phylo(phy, "postorder")
>> 2: reorder(phy, "postorder")
>> 1: compute.brlen(tr3)
>>
>> > sessionInfo()
>>
>> R version 3.4.0 (2017-04-21)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: Ubuntu 17.04
>>
>> Matrix products: default
>> BLAS: /usr/lib/openblas-base/libblas.so.3
>> LAPACK: /usr/lib/libopenblasp-r0.2.19.so
>>
>> locale:
>>  [1] LC_CTYPE=en_AU.UTF-8   LC_NUMERIC=C
>>  [3] LC_TIME=en_AU.UTF-8LC_COLLATE=en_AU.UTF-8
>>  [5] LC_MONETARY=en_AU.UTF-8LC_MESSAGES=en_AU.UTF-8
>>  [7] LC_PAPER=en_AU.UTF-8   LC_NAME=C
>>  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats graphics  grDevices utils datasets  methods base
>>
>> other attached packages:
>> [1] ape_4.1
>>
>> loaded via a namespace (and not attached):
>>  [1] Rcpp_0.12.10 magrittr_1.5 splines_3.4.0 MASS_7.3-47
>>  [5] munsell_0.4.3colorspace_1.3-2 lattice_0.20-35 minqa_1.2.4
>>  [9] stringr_1.2.0glmmADMB_0.8.3.3 plyr_1.8.4 tcltk_3.4.0
>> [13] tools_3.4.0  parallel_3.4.0   nnet_7.3-12 grid_3.4.0
>> [17] nlme_3.1-131 gtable_0.2.0 coda_0.19-1 fortunes_1.5-4
>> [21] lme4_1.1-13  lazyeval_0.2.0   tibble_1.3.0 Matrix_1.2-8
>> [25] R2admb_0.7.15nloptr_1.0.4 ggplot2_2.2.1 effects_3.1-2
>> [29] stringi_1.1.5compiler_3.4.0   scales_0.4.1
>>
>> I am not getting the error on two other machines with the same OS and (as
>> far as I can tell) the same setup. Any help would be greatly appreciated!
>>
>> Cheers,
>>
>> Simon.
>>
>
> --
> Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat.
> Senior Lecturer and Consultant Statistician
> School of Biological Sciences
> The University of Queensland
> St. Lucia Queensland 4072
> Australia
> T: +61 7 3365 2506
> email: S.Blomberg1_at_uq.edu.au
> http://www.evolutionarystatistics.org
>
> Policies:
> 1.  I will NOT analyse your data for you.
> 2.  Your deadline is your problem.
>
> Basically, I'm not interested in doing research and
> I never have been. I'm interested in understanding,
> which is quite a different thing. And often to
> understand something you have to work it out for
> yourself because no one else has done it.
> - David Blackwell
>
> ___
> 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/

___
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/

Re: [R-sig-phylo] Amniote Phylogenetic Tree

2017-01-13 Thread François Michonneau
Hi Sergio,

  You might find what you want within the Open Tree of Life
(http://tree.opentreeoflife.org/) whose content can be accessed from R
with the rotl package
(https://cran.r-project.org/web/packages/rotl/index.html)

  Cheers,
  -- François

On Fri, Jan 13, 2017 at 7:04 AM, Sergio Ferreira Cardoso
 wrote:
> Hello all,
>
> Do you know of any database where one can obtain a good phylogeny of the
> Amniota (in NEXUS or NEWICK file)?
> Thank you.
>
> Best regards,
> Sérgio.
>
> --
> Com os melhores cumprimentos,
> Sérgio Ferreira Cardoso.
>
> 
>
> Best regards,
> Sérgio Ferreira Cardoso
>
>
>
>
> MSc. Paleontology
> Museu da Lourinhã, GEAL.
> LATR/IST/CTN - Campus Tecnológico e Nuclear.
>
> Lisboa, Portugal
>
> [[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/

___
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/

Re: [R-sig-phylo] Looking for beta users for rotl (an R package to access the Open Tree of Life)

2015-06-18 Thread François Michonneau
sorry, I just realized there was a typo in my previous email. To be
able to use the vignette you need to specify install_github that the
vignette needs to be build. So the first set of instructions from the
initial email should be:

install.packages(c("devtools", "rncl"))
devtools::install_github("fmichonneau/rotl", build_vignette=TRUE)


Thanks,
  -- François

On Thu, Jun 18, 2015 at 10:18 AM, François Michonneau
 wrote:
> Hello all,
>
>   The Open Tree of Life project (https://tree.opentreeoflife.org/)
> aims at synthesizing current knowledge of the tree of life by
> combining taxonomic information and published studies. The project
> provides APIs that allow users to interact with the services
> associated with the project. For instance, it can retrieve the
> phylogenetic tree for a given set of taxa.
>
>   With David Winter and Joseph Brown, we have written an R package
> that interacts with the APIs to work with the trees and the other
> services they provide. We are almost ready to submit to CRAN, but
> before doing so I'd greatly appreciate feedback from users willing to
> give it a try.
>
>   To install it, type:
>
> install.packages(c("devtools", "rncl"))
> devtools::install_github("fmichonneau/rotl")
>
>   To get started I encourage you to read the vignette:
>
> library(rotl)
> vignette("how-to-use-rotl", package = "rotl")
>
>   Please send any feedback to me directly by email, or preferably by
> opening an issue on GitHub: https://github.com/fmichonneau/rotl/issues
>
>   Thanks!
>   -- François

___
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/

[R-sig-phylo] Looking for beta users for rotl (an R package to access the Open Tree of Life)

2015-06-18 Thread François Michonneau
Hello all,

  The Open Tree of Life project (https://tree.opentreeoflife.org/)
aims at synthesizing current knowledge of the tree of life by
combining taxonomic information and published studies. The project
provides APIs that allow users to interact with the services
associated with the project. For instance, it can retrieve the
phylogenetic tree for a given set of taxa.

  With David Winter and Joseph Brown, we have written an R package
that interacts with the APIs to work with the trees and the other
services they provide. We are almost ready to submit to CRAN, but
before doing so I'd greatly appreciate feedback from users willing to
give it a try.

  To install it, type:

install.packages(c("devtools", "rncl"))
devtools::install_github("fmichonneau/rotl")

  To get started I encourage you to read the vignette:

library(rotl)
vignette("how-to-use-rotl", package = "rotl")

  Please send any feedback to me directly by email, or preferably by
opening an issue on GitHub: https://github.com/fmichonneau/rotl/issues

  Thanks!
  -- François

___
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/

Re: [R-sig-phylo] Stuck with Phylomatic tree!

2015-03-04 Thread François Michonneau
Hi Alexandre,

  rncl only imports data from NEXUS and Newick files in R. The object
returned by read_newick_phylo is of class phylo. I haven't tested but
if you change the line 90 in the script you included in your email
from

tree <- read.tree(trees)

to

tree <- read_newick_phylo(trees)

the rest of the script should work.

  Cheers,
  -- François

On Wed, Mar 4, 2015 at 2:28 PM, Alexandre F. Souza
 wrote:
> Hi François,
>
>Thank you for the information!
>
>It worked nicely. Is it possible to adjuste node ages in rncl? I tried to
> use the
>
> AdjBrLens function that is availabe at
> (https://gist.github.com/sckott/938313#file-bladjing_twomethods-r) but it
> crashed. It uses phylocom anyway, since phylocom could not read my tree it
> would not work through a function that invokes it from within R.
>
>   Sincerely,
>
>   Alexandre
>
>
> 2015-03-04 11:55 GMT-03:00 François Michonneau
> :
>
>> Hi Alexandre,
>>
>>   I can read the file using the package rncl:
>>
>> library(rncl)
>> tre <- rncl::read_newick_phylo(file="test.tre")
>>
>> where test.tre is a file that contains the tree string you put in the
>> email. The function returns a tree in ape's phylo format (with the
>> singleton nodes removed).
>>
>>   cheers,
>>   -- François
>>
>> On Tue, Mar 3, 2015 at 7:27 PM, Alexandre F. Souza
>>  wrote:
>> > Dear friends,
>> >
>> >I am trying to adjust the leghts of a tree I created using 113 tree
>> > species in Phylomatic using the bladj function in Phylocom.
>> > Unfortunately,
>> > the program crashes when I use the tree without the final note about the
>> > impossibility of matching four of the species (when I exclude the final
>> > note), or produces an empty output file when I use the newick file with
>> > the
>> > final note.
>> >
>> >I tried to open it directly in R using the read.newick() function
>> > written by Liam J. Revell (
>> > http://www.phytools.org/read.newick/v0.4/read.newick.R) since the tree
>> > probably has single nodes. However, it did not work and produced an
>> > eternal
>> > loop I guess (working simbol never turned off).
>> >
>> >I plan to use the tree in further ecological analysis and the steps
>> > would be to adjust ages with Phylocom, then cut off single nodes in R
>> > and
>> > then to proceed with analyses. I am, however, stuck.
>> >
>> >Could you plase help me? I am new to phylogenetic analyses so I
>> > apologize if I be repetitive, but I could not find an answer searching
>> > previous correspondence. What should I do? Is there a way to produce a
>> > tree
>> > directly in R?
>> >
>> >Here is the newick tree, in case you may find it useful to take a
>> > look.
>> >
>> >Thank you very much in advance,
>> >
>> >Alexandre
>> >
>> > acacia_bonariensis)acacia,inga_vera)inga)inga_alliance))ingeae)mimosoids),dalbergia_frutescens)dalbergia,(machaerium_glabrum,machaerium_paraguariense,machaerium_stipitatum)machaerium))dalbergia_group))dalbergieae)),lonchocarpus_campestris,lonchocarpus_nitidus)lonchocarpusmillettioidspapilionoideaefabaceae))fabales,((celtis_iguanaea)celtis)ulmaceae),(((scutia_buxifolia)scutia)))rhamnoids)rhamnaceae))),(((prunus_myrtifolia)prunus)amygdaleae)))spiraeoideae))rosaceae)rosales)),banara_parviflora,banara_tomentosa)banara,(casearia_decandra,casearia_obliqua,casearia_sylvestris)casearia,(xylosma_pseudosalzmannii,xylosma_tweedianum)xylosma)salicaceae))),(((sapium_glandulatum)sapium,(sebastiania_brasiliensis,sebastiania_commersoniana)sebastiania,(stillingia_oppositifolia)stillingia)euphorbiaceae))malpighiales,((lamanonia_ternata)lamanonia),(weinmania_paulliniifolia)weinmania)cunoniaceae)))oxalidales),(((maytenus_aquifolia,maytenus_evonymoides)maytenus)celastraceae)celastrales)celastrales_to_malpighiales))fabids,((allophylus_edulis)allophylus,(cupania_vernalis)cupania,(matayba_elaeagnoides)matayba)sapindaceae,(((cedrela_fissilis)cedrelaswietenioideae)meliaceae,((helietta_apiculata)helietta,(pilocarpus_pennatifolius)pilocarpus,(zanthoxylum_fagara)zanthoxylum)rutaceae,((picramnia_parvifolia)picramnia)simaroubaceae)),lithraea_brasiliensis)lithraea)anacardiaceae)sapindales,(((luehea_divaricata)luehea)malvaceae)))malvales)malvales_to_brassicales)huerteales_to_brassicales))),(((calyptranthes_concinna)calyptranthes))myrciagroup,(((myrcia

Re: [R-sig-phylo] Stuck with Phylomatic tree!

2015-03-04 Thread François Michonneau
Hi Alexandre,

  I can read the file using the package rncl:

library(rncl)
tre <- rncl::read_newick_phylo(file="test.tre")

where test.tre is a file that contains the tree string you put in the
email. The function returns a tree in ape's phylo format (with the
singleton nodes removed).

  cheers,
  -- François

On Tue, Mar 3, 2015 at 7:27 PM, Alexandre F. Souza
 wrote:
> Dear friends,
>
>I am trying to adjust the leghts of a tree I created using 113 tree
> species in Phylomatic using the bladj function in Phylocom. Unfortunately,
> the program crashes when I use the tree without the final note about the
> impossibility of matching four of the species (when I exclude the final
> note), or produces an empty output file when I use the newick file with the
> final note.
>
>I tried to open it directly in R using the read.newick() function
> written by Liam J. Revell (
> http://www.phytools.org/read.newick/v0.4/read.newick.R) since the tree
> probably has single nodes. However, it did not work and produced an eternal
> loop I guess (working simbol never turned off).
>
>I plan to use the tree in further ecological analysis and the steps
> would be to adjust ages with Phylocom, then cut off single nodes in R and
> then to proceed with analyses. I am, however, stuck.
>
>Could you plase help me? I am new to phylogenetic analyses so I
> apologize if I be repetitive, but I could not find an answer searching
> previous correspondence. What should I do? Is there a way to produce a tree
> directly in R?
>
>Here is the newick tree, in case you may find it useful to take a look.
>
>Thank you very much in advance,
>
>Alexandre
> acacia_bonariensis)acacia,inga_vera)inga)inga_alliance))ingeae)mimosoids),dalbergia_frutescens)dalbergia,(machaerium_glabrum,machaerium_paraguariense,machaerium_stipitatum)machaerium))dalbergia_group))dalbergieae)),lonchocarpus_campestris,lonchocarpus_nitidus)lonchocarpusmillettioidspapilionoideaefabaceae))fabales,((celtis_iguanaea)celtis)ulmaceae),(((scutia_buxifolia)scutia)))rhamnoids)rhamnaceae))),(((prunus_myrtifolia)prunus)amygdaleae)))spiraeoideae))rosaceae)rosales)),banara_parviflora,banara_tomentosa)banara,(casearia_decandra,casearia_obliqua,casearia_sylvestris)casearia,(xylosma_pseudosalzmannii,xylosma_tweedianum)xylosma)salicaceae))),(((sapium_glandulatum)sapium,(sebastiania_brasiliensis,sebastiania_commersoniana)sebastiania,(stillingia_oppositifolia)stillingia)euphorbiaceae))malpighiales,((lamanonia_ternata)lamanonia),(weinmania_paulliniifolia)weinmania)cunoniaceae)))oxalidales),(((maytenus_aquifolia,maytenus_evonymoides)maytenus)celastraceae)celastrales)celastrales_to_malpighiales))fabids,((allophylus_edulis)allophylus,(cupania_vernalis)cupania,(matayba_elaeagnoides)matayba)sapindaceae,(((cedrela_fissilis)cedrelaswietenioideae)meliaceae,((helietta_apiculata)helietta,(pilocarpus_pennatifolius)pilocarpus,(zanthoxylum_fagara)zanthoxylum)rutaceae,((picramnia_parvifolia)picramnia)simaroubaceae)),lithraea_brasiliensis)lithraea)anacardiaceae)sapindales,(((luehea_divaricata)luehea)malvaceae)))malvales)malvales_to_brassicales)huerteales_to_brassicales))),(((calyptranthes_concinna)calyptranthes))myrciagroup,(((myrciaria_delicatula,myrciaria_floribunda,myrciaria_tenella)myrciaria,(((siphoneugena_reitzii)siphoneugena)))pliniagroup)),((myrceugenia_cucullata,myrceugenia_miersiana,myrceugenia_myrcioides,myrceugenia_oxysepala)myrceugenia)myrceugeniagroup),(((campomanesia__rhombea,campomanesia_xanthocarpa)campomanesia),acca_sellowiana,myrrhinium_atropurpureum)))pimentagroup,((eugenia_involucrata,eugenia_pluriflora,eugenia_psidiiflora,eugenia_uruguayensis)eugenia,(myrcianthes_gigantea,myrcianthes_pungens)myrcianthes)eugeniagroup))),blepharocalyx_salicifolius)))myrteae)myrteaestem))),(myrcia_arborescens,myrcia_bombycina,myrcia_lajeana,myrcia_oligantha)myrcia)myrtaceaemyrtales))malvids))rosids),(cestrum_sp)cestrum))cestreae)))cestroideae),((solanum_pabstii,solanum_pseudoquina,solanum_sanctae-catharinae,solanum_sp)solanum)solaneae)))solanoideaesolanaceae))solanales,citharexylum_myrianthum)citharexylum,(duranta_vestita)duranta)verbenaceae),(((tabebuia_umbellata)tabebuia)bignoniaceae)),(((cunila_incisa)cunila)lamiaceae)lamiales),coussarea_contracta)coussarea)rubioideae)rubiaceae,strychnos_brasiliensis)strychnos)loganiaceae)))gentianales),((citronella_gongonha,citronella_paniculata)citronella)icacinaceae)lamiids,(((dasyphyllum_spinescens,dasyphyllum_tomentosum)dasyphyllum)),vernonia_discolor)vernoniaasteraceae)asterales,(oreopanax_fulvus)oreopanax)araliaceae)apiales))),(ilex_brevicuspis,ilex_dumosa,ilex_microdonta,ilex_paraguariensis,ilex_sp)ilex)aquifoliaceae)))aquifolial

Re: [R-sig-phylo] phytools read.newick fails to read edge lengths

2015-02-18 Thread François Michonneau
Hi Lev,

  I recently released a package that is robust to reading trees that
includes singletons by relying on the NEXUS class library. It can read
newick files.

  The package is on CRAN here:
http://cran.r-project.org/web/packages/rncl/index.html after
installation:

library(rncl)
read_newick_phylo(file="tree.tre")

  Cheers,
  -- François



On Tue, Feb 17, 2015 at 2:19 PM, Yampolsky, Lev  wrote:
> Dear Colleagues,
>
> I need to remove singleton nodes from a tree; trying to do it by this script:
>
> require(phytools)
> source("read.newick.R")
> tree<-read.newick(file="tree,tre")
> tree<-collapse.singles(tree)
> plotTree(tree,type="fan")
>
> (https://stat.ethz.ch/pipermail/r-sig-phylo/2013-June/002783.html)
>
> read.newick.R returns warnings that look like this:
> 1: In getEdgeLength(text, i) : NAs introduced by coercion
> (and then the same for every node).
> And of course the resulting tree has 0 edge lengths.
>
> Anyone has any idea why this may be happening?
>
> Thank you very much in advance,
>
> Lev Yampolsky
>
> ___
> 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/

___
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/

Re: [R-sig-phylo] Problems running function "as" of phylobase package

2014-11-12 Thread François Michonneau
Thanks Rich for the clarification! Some of these design decisions remain
puzzling And, yes if possible I also recommend using Dirk's little r.

Fabricia, I use phylobase with Rscript too and fixed the issue (phylobase
now depends on methods) a while back but didn't realize it wasn't part of
0.6.8. It will be part of the next version (probably released in January)
but you can get form github: https://github.com/fmichonneau/phylobase

  Cheers,
  -- François




On Wed, Nov 12, 2014 at 6:23 AM, Rich FitzJohn 
wrote:

> Hi Fabricia, François, list,
>
> Rscript does not load the methods package.  I believe this is so it's
> creators can feast upon the sweat and tears of innocent souls, or for
> giving people on R-help reason to chastise people for not reading the
> entire manual.  There's a lame of a claim about time savings in ?Rscript,
> but I don't believe it, considering that not loading it renders about 50%
> of the R ecosystem unusable.
>
> I believe that Dirk Eddelbuettel's "little r" (
> http://dirk.eddelbuettel.com/code/littler.html) scripting front end does
> not suffer this insane design decision (and is apparently faster than
> Rscript too).  I tend to preemptively load it in scripts meant to be run
> with Rscript.
>
> Cheers,
> Rich
>
> Not at all bitter.  Well, perhaps a bit.
>
>
> On 12 November 2014 22:13, Fabricia Nascimento 
> wrote:
>
>> Hi François,
>>
>> Thanks! I am using R version 3.0.3 and the phylobase version 0.6.8.
>> Adding "library(methods)" in my script does make it work when using
>> Rscript command. If I remove this line, the script does not work.
>> However, this is not necessary in RStudio.
>>
>> Thanks again!
>> Fabricia.
>>
>>
>> On 11/9/14 7:30 PM, François Michonneau wrote:
>> >
>> > Hi Fabricia,
>> >
>> >   Which version of phylobase and R are you using?
>> >
>> >   During the execution of your script, do you see the message:
>> > "Loading required package: methods"
>> >
>> >   A quick workaround should be  to add "library(methods)" to your
>> > script but it shouldn't be needed.
>> >
>> >   Thanks,
>> >   -- François
>> >
>> >
>> > On Sun, Nov 9, 2014 at 10:49 AM, Fabricia Nascimento
>> > mailto:nasciment...@yahoo.com.br>> wrote:
>> >
>> > Hi,
>> >
>> > I wrote a script in R that works totally fine without any errors
>> > when I
>> > use RStudio.
>> > I want to run the same script but in a terminal using Rscript. But
>> > when
>> > I try this I get the following error message: /Error in FUN(newX[,
>> i],
>> > ...) : could not find function "as"/
>> >
>> > I believe the error is caused because the "as" function exists in
>> both
>> > /methods/ and /phylobase/ packages. And somehow when running the
>> > script
>> > direct from a terminal using Rscript is gets a conflict and the
>> script
>> > does not know which "as" function it should use.
>> >
>> > Does anyone know what I should do for my script to work in the
>> > terminal
>> > using Rscript? It appears that using "library(phylobase)" is not
>> > enough.
>> >
>> > Thanks very much!
>> >
>> > Fabricia.
>> >
>> > --
>> > --
>> > Fabricia F. Nascimento, Ph.D.
>> > Postdoctoral Fellow
>> > The National Evolutionary Synthesis Center
>> > Durham, NC
>> > USA
>> >
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > ___
>> > R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> > <mailto: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/
>> >
>> >
>>
>> --
>> --
>> Fabricia F. Nascimento, Ph.D.
>> Postdoctoral Fellow
>> The National Evolutionary Synthesis Center
>> Durham, NC
>> USA
>>
>>
>> [[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/
>>
>
>

[[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/

Re: [R-sig-phylo] Problems running function "as" of phylobase package

2014-11-09 Thread François Michonneau
Hi Fabricia,

  Which version of phylobase and R are you using?

  During the execution of your script, do you see the message: "Loading
required package: methods"

  A quick workaround should be  to add "library(methods)" to your script
but it shouldn't be needed.

  Thanks,
  -- François


On Sun, Nov 9, 2014 at 10:49 AM, Fabricia Nascimento <
nasciment...@yahoo.com.br> wrote:

> Hi,
>
> I wrote a script in R that works totally fine without any errors when I
> use RStudio.
> I want to run the same script but in a terminal using Rscript. But when
> I try this I get the following error message: /Error in FUN(newX[, i],
> ...) : could not find function "as"/
>
> I believe the error is caused because the "as" function exists in both
> /methods/ and /phylobase/ packages. And somehow when running the script
> direct from a terminal using Rscript is gets a conflict and the script
> does not know which "as" function it should use.
>
> Does anyone know what I should do for my script to work in the terminal
> using Rscript? It appears that using "library(phylobase)" is not enough.
>
> Thanks very much!
>
> Fabricia.
>
> --
> --
> Fabricia F. Nascimento, Ph.D.
> Postdoctoral Fellow
> The National Evolutionary Synthesis Center
> Durham, NC
> USA
>
>
> [[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/
>

[[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/

Re: [R-sig-phylo] Replacement of Phybase - species tree from gene trees

2014-11-05 Thread François Michonneau
phybase 1.2 and 1.3 are both missing a NAMESPACE file which is required for
R versions above 3.0.0 and therefore can't be installed.

The latest archived version of phybase on CRAN (1.1) can however be
installed: http://cran.r-project.org/src/contrib/Archive/phybase/

Personally I would advise against using archived packages, in particular if
alternatives are available, as it reduces significantly the chances of
making your analyses reproducible in the near future.

It might also be worth contacting the author of the package to see if he
has plans to restart the development of his package.

  Cheers,
  -- François


On Wed, Nov 5, 2014 at 10:48 AM, Vojtěch Zeisek  wrote:

> Dne St 5. listopadu 2014 13:39:49 jste napsal(a):
> > Hi I installed and used 1.3 recently (under Ubuntu 14.04). I am no expert
> > and I can help you further but I wanted to assure you the package is
> > working fine. I am currently using RStudio and this interface sometimes
> > makes installing packages easier.
>
> Interesting. Which version was it? I've got more general error, I'd say, it
> seems like some problem with original archive...
>
> > I couldn't compile mp-est which is another option for spp trees.
>
> I didn't find package of that name (BioC, CRAN, R-Forge), do You, please,
> have
> some reference?
>
> > best
> >
> > Andrés
>
> Thank You,
> Vojtěch
>
> > 2014-11-05 13:03 GMT-02:00 Vojtěch Zeisek :
> > > Hello,
> > > I'm looking for approaches how to get a species tree from set of gene
> > > trees. I
> > > was looking at Phybase package https://code.google.com/p/phybase/ but
> it
> > > seems
> > > to be abandoned and when I tried to install it, I ended up with error:
> > > install.packages("~/stazene/phybase_1.3.tar.gz", repos=NULL,
> > > type="source")
> > > Installing package into
> ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1’
> > > (as ‘lib’ is unspecified)
> > > * installing *source* package ‘phybase’ ...
> > > ERROR: a 'NAMESPACE' file is required
> > > * removing ‘/home/vojta/R/x86_64-suse-linux-gnu-library/3.1/phybase’
> > > Warning in install.packages :
> > >   installation of package ‘/home/vojta/stazene/phybase_1.3.tar.gz’ had
> > >   non-
> > > zero exit status
> > > I'm working on Linux. Well, I have gene trees (in multiPhylo object). I
> > > tried
> > > superTree, densiTree and speciesTree from phangorn. Those are looking
> very
> > > well, but I'd like to try some coalescence based approach. I was
> looking
> > > at
> > > coalSpeciesTree from phangorn, but I don't know how to supply that X
> > > phyDat
> > > object - my gene trees have all same tips and species are same in all
> > > trees.
> > > How to define it? Or is there any other better approach how to get
> species
> > > tree out of gene trees?
> > > Sincerely,
> > > Vojtěch
> --
> Vojtěch Zeisek
> http://trapa.cz/en/
>
> Department of Botany, Faculty of Science
> Charles University in Prague
> Benátská 2, Prague, 12801, CZ
> http://botany.natur.cuni.cz/en/
>
> Institute of Botany, Academy of Science
> Zámek 1, Průhonice, 25243, CZ
> http://www.ibot.cas.cz/en/
>
> Czech Republic
>
> ___
> 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/
>

[[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/

Re: [R-sig-phylo] Extracting sister groups

2014-10-23 Thread François Michonneau
HI Kevin,

  If I understand correctly what you're trying to do, you'll first need to
collapse some of your tips to create clades, a proportion of which will
have the trait. You'll then be able to use this new tree to generate the
data.frame needed by the functions you mentioned in your original post.

  Depending on what you're trying to do, you may not want to lose this
phylogenetic information. Maybe a different approach, such as using BiSSE
in the diversitree package might be more appropriate?

  Cheers,
  -- François

On Thu, Oct 23, 2014 at 10:27 AM, Arbuckle, Kevin <
k.arbuc...@liverpool.ac.uk> wrote:

>  Hi François,
>
> Thank you kindly for your offer of help. The code below will simulate a
> phylogeny ("tree") and a dataframe ("trait") with one binary trait for 100
> species. The format is representative of the data I am using for my
> analyses so should serve as a test case. Hopefully this helps, let me know
> if there's any other information I can provide.
>
>
>
> library(ape)
> library(phytools)
> tree<-rtree(100)
> tran<-matrix(c(-1,1,1,-1),2,2)
> rownames(tran)<-c("0","1")
> colnames(tran)<-c("0","1")
> phy<-sim.history(tree,tran)
> trait<-data.frame(sp=tree$tip.label,bt=getStates(phy,type="tips"))
> rownames(trait)<-tree$tip.label
>
> Cheers,
>
>
>
> Kev
>
>
>  --
> *From:* François Michonneau [francois.michonn...@gmail.com]
> *Sent:* 23 October 2014 14:54
> *To:* Arbuckle, Kevin
> *Subject:* Re: [R-sig-phylo] Extracting sister groups
>
>
>  Hi Kevin,
>
>We should be able to help you but it would be much easier if you
> provided us with a small data set that illustrate the format of your
> current dataset. How is your trait currently stored? and how is it
> associated with the tips in your tree?
>
>Cheers,
>-- François
>
> On Thu, Oct 23, 2014 at 6:23 AM, Arbuckle, Kevin <
> k.arbuc...@liverpool.ac.uk> wrote:
>
>> Hi everyone,
>>
>>
>>
>> I am attempting to run sister group analyses as one way to look at the
>> effect of a binary trait on diversification. Two of the functions from ape
>> that I'm looking at are diversity.contrast.test and richness.yule.test, but
>> both have the same limitation. They require the data to be input as a
>> dataframe of two columns, one with the number of species in clades that
>> have the trait of interest, and the other with the number of species in the
>> respective sister clades that don't have the trait. The issue is that I am
>> working with a very large tree, and so extracting and entering such
>> information by hand is not really feasible.
>>
>>
>>
>> I am therefore looking for a function which extracts all sister clades
>> that differ in the presence vs absence of the trait, and ideally is capable
>> of generating a dataframe of the appropriate format for the above functions
>> automatically. It seems that a function to do this should exist already,
>> but as I can't seem to find anything I would appreciate some help
>> (hopefully someone will know of such a function that already exists).
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Kevin Arbuckle
>>
>> [[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/
>>
>
>

[[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/

Re: [R-sig-phylo] Trying to read a tree with numerical node labels, but without edge length

2014-08-29 Thread François Michonneau
Hi Daniel,

  You may want to try to change the options with phylobase:

phylobase.options(allow.duplicated.labels="ok")

and then try reading your tree.

  Feel free to send me your tree if needed.

  cheers,
  -- François


On Fri, Aug 29, 2014 at 10:42 PM, Daniel Rafael Miranda-Esquivel <
dmiran...@gmail.com> wrote:

> Dear all,
>
> I tried to read a tree like this:
>
> #NEXUS
> begin trees ;
> tree tagged_tree = [&U]
> (A,(B,(C,D)60)100);
>
> end ;
>
> using read.nexus; while figtree reads it, ape refuses, telling that
> there is an error:
>
> Error in start:end : NA/NaN argument
>
> I tried readNexus in phylobase, but there is a problem reading the
> labels (in the real tree, not in this example), as the program
> complains that a label is duplicated.
>
>
> I will be grateful for any tip to solve this problem,
>
>
> All the best,
>
>
> Daniel
>
> ___
> 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/
>

[[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/

Re: [R-sig-phylo] Can't load a tree with multitomies into 'ape'

2014-08-15 Thread François Michonneau
Hi Anna,

  I can read your tree using the package phylobase:

tr <- readNexus(file="IndTree.nex")

  If you need it in the phylo format to use with other functions in ape,
you can convert it with:

as(tr, "phylo")

  cheers,
  -- François


On Fri, Aug 15, 2014 at 9:56 AM, Anna Bastian 
wrote:

>  Dear list members,
>
>
>
> I am trying to read a tree into R (‘ape’ package). I downloaded the latest
> versions.
>
>
>
> The tree has many polytomies and that might be the problem.
>
> It contains ten species and each species contains of a different number of
> individuals (those are the polytomies).
>
> I attached it here.
>
>
>
> I tried read.nexus
>
> …and get: Error in trees[[i]] : subscript out of bounds
>
>
>
> I tried read.tree #using a newick format for the tree)
>
> …and get: Error in if (tp[3] != "") obj$node.label <- tp[3] :
>
>   missing value where TRUE/FALSE needed
>
>
>
> I came across a “Robust Newick tree reader” by Liam Revell and tied the
> code he provides (http://www.phytools.org/read.newick/v0.5/read.newick.R)
> but I can’t make it work.
>
>
>
>
>
> Can somebody get the tree into R?
>
>
>
> Please let me know if you know what’s wrong
>
>
>
> Thanks a lot
>
>
>
> Anna
>
>
>
>
>
> ** * * * * * * * * * * *
>
>  *University of Cape Town*
> *Animal Evolution and Systematics Group*
>
> Department of Biological Sciences
> Room 3.32
>
> Tel: +27 (0)21 6502405
>
> Fax: +27 (0)21 6502718
>
>
>  --
> UNIVERSITY OF CAPE TOWN
>
> This e-mail is subject to the UCT ICT policies and e-mail disclaimer
> published on our website at
> http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27
> 21 650 9111. This e-mail is intended only for the person(s) to whom it is
> addressed. If the e-mail has reached you in error, please notify the
> author. If you are not the intended recipient of the e-mail you may not
> use, disclose, copy, redirect or print the content. If this e-mail is not
> related to the business of UCT it is sent by the sender in the sender's
> individual capacity.
>
> ___
> 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/
>

[[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/

Re: [R-sig-phylo] Distances from nods to the root.

2014-05-20 Thread François Michonneau
Hi Alexey,

  The package phylobase allows you to do this either for all the tips, or
any/all nodes of your tree:

library(phylobase)
data(geospiza)
## for the tips
depthTips(geospiza)
## for one node
nodeDepth(geospiza, 16)
## for all internal nodes
nodeDepth(geospiza, nodeId(geospiza, "internal"))

  Cheers,
  -- François

[[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/

Re: [R-sig-phylo] Reading sets of multiple DNA sequence alignments

2014-03-13 Thread François Michonneau
Hi Fabricia,

  I have a package in development on github (
https://github.com/fmichonneau/seqManagement) that happens to include a
function that does what you are looking for: it splits this kind of files
to produce one file per alignment. You want to look at the function called
splitMultiAlignments.

  Don't hesitate to let me know if you need help to make it run.

  Cheers,
  -- François






On Thu, Mar 13, 2014 at 12:56 PM, Fabricia Nascimento <
nasciment...@yahoo.com.br> wrote:

>
> Hi,
>
> I am new to R and I am
> trying to read a file containing sets of multiple sequence alignments as in
> the example below. The difference is that for my files, each set of
> sequences
> may contain up to 50 sequences of 10,000bp each.
>
>
> Example:
>
>  5 10
> Seq0 ATCGTTATTA
> Seq1 AGCGTTATTA
> Seq15ATCCTTATTA
> Seq20ATCGATATTA
> Seq30ATCGTAATTA
>  5 10
> Seq1 ATCGTTATTA
> Seq2 ATCGTTATTA
> Seq4 ATCCTTATTA
> Seq5ATCGTTGTTA
> Seq7ATCGTTACCA
>  5 10
> Seq1 ATCGTTATTA
> Seq2 ATTGTTATTA
> Seq4 ATCGTTATTA
> Seq19AACGTTATTA
> Seq2 ATCGAAATTA
>
>
> I did try to use read.dna
> from the ape package. Although it seems to read the whole file, I don’t
> know
> how to access the individual multiple alignments and create a NJ tree for
> each
> of these alignments.
>
> I would appreciate very much
> if someone knows of any function that can do that. Or whether I will need
> to
> pre-process my files first.
> I will need to create a NJ
> tree for each set of alignment and then I will use the apTreeshape package
> in R
> to calculate index for tree shape.
>
> Thanks very much in advance!
> Fabricia.
> [[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/
>

[[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/

Re: [R-sig-phylo] Fwd: Fwd: phyloxml

2014-03-07 Thread François Michonneau
Hi all,

  Does anybody know if the the latest version of NCL support the phyloxml
format? I know that there was a google summer of code project to implement
it but I don't know if it was completed and integrated into NCL. If it's
the case, I'd be happy to update phylobase so these trees can be imported
in R directly.

  Ondřej, a few years ago, I used a small phyloxml tree I got from the tree
of life website in R by first opening it with one of the editor that
support the format and then exporting it in Nexus format so that it could
be imported with read.nexus from ape or with readNexus from phylobase.

  Cheers,
  -- François



On Fri, Mar 7, 2014 at 1:45 PM, Hilmar Lapp  wrote:

> -- Forwarded message --
> From: Christian Zmasek 
> Date: Fri, Mar 7, 2014 at 1:40 PM
> Subject: Re: Fwd: [R-sig-phylo] phyloxml
> To: Hilmar Lapp , "onmik...@gmail.com" <
> onmik...@gmail.com>
> Cc: "onmik...@gmail.com" 
>
>
> Hilmar, Ondřej:
>
> Unfortunately I am not aware of any package to do this either.
>
> Chris
>
>
>   --
>  *From:* Hilmar Lapp 
>
> *Sent:* Friday, March 7, 2014 6:57 AM
> *Subject:* Fwd: [R-sig-phylo] phyloxml
>
> Hi Chris - just in case you're not on this list and haven't seen this. I'm
> not aware of any package that supports the function the sender is asking
> about, but perhaps you're aware of something.
>
>   -hilmar
>
> -- Forwarded message --
> From: *Ondřej Mikula* 
> Date: Thu, Mar 6, 2014 at 11:43 PM
> Subject: [R-sig-phylo] phyloxml
> To: "r-sig-phylo@r-project.org" 
>
>
> Dear all,
> are you aware of any routine importing phylogenetic trees in .phyloxml
> format into R?
> Best wishes,
> Ondřej
>
> --
> Ondřej Mikula
>
> Institute of Animal Physiology and Genetics
> Academy of Sciences of the Czech Republic
> Veveri 97, 60200 Brno, Czech Republic
>
> Institute of Vertebrate Biology
> Academy of Sciences of the Czech Republic
> Studenec 122, 67502 Konesin, Czech Republic
>
> [[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/
>
>
>
> --
> Hilmar Lapp -:- informatics.nescent.org/wiki -:- lappland.io
>
>
>
>
>
>
> --
> Hilmar Lapp -:- informatics.nescent.org/wiki -:- lappland.io
>
> [[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/
>

[[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/

Re: [R-sig-phylo] Jane input file

2014-02-19 Thread François Michonneau
Hi Sean,

  It's possible to add brackets but not with using ape. It's a case of
string manipulation. Regular expressions are your friend here:

a <- '((Host a:4,Host b:4):2,(Host c:4, (Host d:4, Host e:4):4):3):1;'
b <-  gsub("([0-9])", "[\\1]", a)
cat(b, file="JaneInput.tre", sep="\n")

  The regular expression I used here assume that all numbers in your tree
string are branch lengths (no bootstrap values, or no numbers in your
species names). If it's not the case you'll need to build a more elaborate
expression.

  Cheers,
  -- François




On Wed, Feb 19, 2014 at 12:51 PM, Sean Downey  wrote:

> I am trying to write an input file for a cophylogeny analysis with Jane.
> Jane deviates from the Newick standard and required brackets around edge
> length. E.g.,
>
> t<-((Host a:[4],Host b:[4]):[2],(Host c:[4], (Host d:[4], Host
> e:[4]):[4]):[3]):[1];
>
> Is there a simple way to add those brackets.The following does not work
> because write.tree expected numeric edge.lengths:
>
>
> a<-'((Host a:4,Host b:4):2,(Host c:4, (Host d:4, Host e:4):4):3):1;'
> b<-read.tree(text=t)
> c<-paste('[',b$edge.length,']',sep='')
> class(b$edge.length) #numeric
> b$edge.length<-c
> class(b$edge.length) #character
> write.tree(b)
> #Error in sprintf(f.d, phy$edge.length[i]) :
> # invalid format '%.10g'; use format %s for character objects
>
> Thanks much,
> Sean
>
> --
> Dr. Sean S. Downey
> Assistant Professor
> Anthropology Department
> University of Maryland
> 1106 Woods Hall
> College Park, MD 20742
> s...@codexdata.com 
> http://www.anth.umd.edu/facultyprofile/Downey/Sean
> Office: 301-405-1427
>
> Students wanted: Applications due annually on Dec 15.
> http://terpconnect.umd.edu/~sdowney2/Sean_Downey/Opportunities.html <
> http://terpconnect.umd.edu/%7Esdowney2/Sean_Downey/Opportunities.html>
> http://www.anth.umd.edu/content/graduate-admissions
>
> ___
> 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-ph...@r-project.org/
>

[[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/

Re: [R-sig-phylo] write.tree doesn't respect scipen

2013-12-07 Thread François Michonneau
Hi Rosemary,

  From my understanding, it's normal that write.tree doesn't follow the
scipen option. This option controls the scientific notation in the R
terminal. write.tree() actually uses the function 'sprintf' to format the
numbers.

  As currently written, I don't think it's possible change this aspect of
the behavior of write.tree() (it is however possible to change the
precision with the 'digits' argument). I'm attaching a modified version of
the function that deals with this to force using the fixed point decimal
notation. After sourcing it, you'll need to run (included in the bottom of
the file):

> assignInNamespace(".write.tree2", .write.tree2, "ape")

as it's a hidden function. The following gives me properly formatted file.

tr <- read.tree(text="((A,B):2e-6,C);")
tr$edge.length <- tr$edge.length/1

write.tree(tr, file="testTree.phy")
system("cat testTree.phy")

  Cheers,
  -- François


On Sat, Dec 7, 2013 at 2:42 PM, Rosemary McCloskey
wrote:

> Hello all,
>
> I have a workflow which involves getting some phylogenetic trees from
> program A, doing some processing (including scaling down the branch
> lengths) with ape, and then using the resulting trees as input to program
> B. The scaling sometimes results in scientific notation in the branch
> lengths (eg. 2.789e-05) which program B doesn't accept. I have tried to get
> rid of these by using the scipen option in R, but it doesn't affect the
> output of write.tree.
>
> options(scipen=999)
> t <- read.tree("test.nwk")
> t$edge.length <- t$edge.length/10.
> t$edge.length   # shows "correct" format, eg. 0.2789
> write.tree(t)  # still has scientific notation, eg. 2.789e-05
>
> Right now I am using a short bash script after the fact to find and replace
> the scientific notation. I also realize there is probably a way to do this
> within R, using grep and so forth. I was just wondering if there is a
> better way within ape itself.
>
> Thanks a lot,
>
> Rosemary McCloskey
>
> [[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/
>


modified.write.tree2.R
Description: Binary data
___
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/

Re: [R-sig-phylo] Find common ancestor of multiple taxa

2013-05-09 Thread François Michonneau
Hi Nick,

  You can look into the function MRCA() in the package phylobase, it does
what you describe. For instance:
> library(phylobase)
> data(geospiza)
> MRCA(geospiza, 1:5)
N21
  21

  Cheers,
  -- François


On Thu, May 9, 2013 at 11:24 AM, Nicholas Crouch  wrote:

> Hi All,
>
> The 'mrca' function in Ape provides a method for finding the common
> ancestor of a pair of taxa. What I would like have not found is a function
> where you can pass a (long) list of tips from a phylogeny and find the node
> which represents the common ancestor to all these tips.
>
> Does such a function exist? Or could the 'mrca' function be expanded to
> loop over all the taxa within a list a somehow boil down to what is the
> common ancestor that way?
>
> Thanks,
>
> Nick
>
> [[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/
>

[[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/

Re: [R-sig-phylo] [Phylobase-devl] phylobase::descendants issue

2013-04-29 Thread François Michonneau
Hi all,

  I just submitted to R-forge a patch to fix this issue. It came from a
recent change to ape. If you notice something weird or have any question,
let us know.

  Cheers,
  -- François


On Sat, Apr 27, 2013 at 5:10 PM, Ben Bolker  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>   Thanks for the heads-up.  I or one of the other phylobase developers
> will try to take a look ...
>
>   cheers
> Ben Bolker
>
>
> On 13-04-26 06:50 PM, Nick Matzke wrote:
> > Hi all,
> >
> > Not sure if this is a bug, but I noticed weird behavior when
> > loading a tree with APE and then converting to phylo4 to do
> > descendants() -- not all the tips are produced.
> >
> > Example:
> >
> >
> > library(ape) library(phylobase)
> >
> > trstr =
> >
> "P_hawaiiensis_WaikamoiL1:0.9656850499,P_mauiensis_Eke:0.9656850499):0.7086257935,(P_fauriei2:1.230218511,P_hathewayi_1:1.230218511):0.4440923324):0.1767115552,(P_kaduana_PuuKukuiAS:1.851022399,P_mauiensis_PepeAS:1.851022399):0.0008897862802):0.3347375986,P_kaduana_HawaiiLoa:2.185759997):0.302349378,(P_greenwelliae07:1.131363255,P_greenwelliae907:1.131363255):1.35674612):1.689170274,P_mariniana_MauiNui:1.994011054,P_hawaiiensis_Makaopuhi:1.994011054):0.7328279804,P_mariniana_Oahu:2.726839034):0.2574151709,P_mariniana_Kokee2:2.984254205):0.4601084855,P_wawraeDL7428:3.444362691):0.732916959):0.7345185743,(P_grandiflora_Kal2:2.479300491,P_hobdyi_Kuia:2.479300491):2.432497733):0.2873119899,((P_hexandra_K1:2.363984189,P_hexandra_M:2.363984189):0.4630447802,P_hexandra_Oahu:2.826939991):2.372081244);"
> >
> >
> >
> > # Load tree tr = read.tree(file="", text=trstr) tr
> >
> > # Convert to phylo4 tr4 = as(tr, "phylo4")
> >
> > # Find root (node 20) rootnode = nodeId(tr4, type="root") rootnode
> >
> > # Only 3 tips! (there should be 19) tipnames = descendants(phy=tr4,
> > node=rootnode, type="tips") tipnames
> >
> >
> >
> >
> > The problem is here in descendants():
> >
> > if (phy@order == "preorder") { edge <- phy@edge } else { edge <-
> > reorder(phy, order = "preorder")@edge } ancestor <-
> > as.integer(edge[, 1]) descendant <- as.integer(edge[, 2]) isDes <-
> > .Call("descendants", node, ancestor, descendant)
> >
> > ...it works if I force phy@order to "cladewise" or "unknown"
> >
> >
> > library(ape) library(phylobase)
> >
> > trstr =
> >
> "P_hawaiiensis_WaikamoiL1:0.9656850499,P_mauiensis_Eke:0.9656850499):0.7086257935,(P_fauriei2:1.230218511,P_hathewayi_1:1.230218511):0.4440923324):0.1767115552,(P_kaduana_PuuKukuiAS:1.851022399,P_mauiensis_PepeAS:1.851022399):0.0008897862802):0.3347375986,P_kaduana_HawaiiLoa:2.185759997):0.302349378,(P_greenwelliae07:1.131363255,P_greenwelliae907:1.131363255):1.35674612):1.689170274,P_mariniana_MauiNui:1.994011054,P_hawaiiensis_Makaopuhi:1.994011054):0.7328279804,P_mariniana_Oahu:2.726839034):0.2574151709,P_mariniana_Kokee2:2.984254205):0.4601084855,P_wawraeDL7428:3.444362691):0.732916959):0.7345185743,(P_grandiflora_Kal2:2.479300491,P_hobdyi_Kuia:2.479300491):2.432497733):0.2873119899,((P_hexandra_K1:2.363984189,P_hexandra_M:2.363984189):0.4630447802,P_hexandra_Oahu:2.826939991):2.372081244);"
> >
> >
> >
> > # Load tree tr = read.tree(file="", text=trstr) tr
> >
> > # Convert to phylo4 tr4 = as(tr, "phylo4")
> >
> > # Looks like by default the tree is called "preorder" tr4@order
> >
> > # It works if I do this: tr4@order = "cladewise"
> >
> > # Find root (node 20) rootnode = nodeId(tr4, type="root") rootnode
> >
> > # Now this works tipnames = descendants(phy=tr4, node=rootnode,
> > type="tips") tipnames
> >
> >
> >
> >
> > # This also works:
> >
> > # Load tree tr = read.tree(file="", text=trstr) tr
> >
> > # Convert to phylo4 tr4 = as(tr, "phylo4")
> >
> > # Looks like by default the tree is called "preorder" tr4@order
> >
> > # It works if I do this: tr4@order = "unknown"
> >
> > # Find root (node 20) rootnode = nodeId(tr4, type="root") rootnode
> >
> > # Now this works tipnames = descendants(phy=tr4, node=rootnode,
> > type="tips") tipnames
> >
> >
> > ...so at least there's a workaround...
> >
> > Cheers, Nick
> >
> >
> >
> ph
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJRfD6oAAoJEOCV5YRblxUHwC0IAKFRYnR1RoYqxVf2GFQxc03R
> HQAo5/N01tWBsTKZ7c4KdIk9HIhANu3F9v0trtwutUNXs/V7v3oa8QZFI9CC4Plk
> 2HIAox/rgwrX7yhlmKPf21KTMiiM5zHxtlCF63tkGCnwi/v/xf8IbFyqTd9ZH9NG
> 0xoeQTrhOLp8Lu0ARVWc1Ie01ujV+RXgJvv9RTJEhDSqeRKsYb46qhh4eFHjd4bE
> qB/9P40Z4RUhV2gMXRkaPDWGWzXUhLrl1qvdPgSJ/5yQgns+g0I007452SALv3yV
> mQ13Nkd/9Ze0mGUC2KjxlBiVmyDWWQQvKbJlA9eTHxZv3DPZgyg5YwiBDgf3Tsk=
> =L06Y
> -END PGP SIGNATURE-
> ___
> Phylobase-devl mailing list
> phylobase-d...@lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/phylobase-devl
>

[[alternative HTML version deleted]]

___
R-sig-phylo 

Re: [R-sig-phylo] problem installing phylobase package

2013-02-04 Thread François Michonneau
Hi Marc,

  Can you provide me with some more information about your system (output
of R.version, the versions of Rcpp, and of phylobase you are trying to
install)?

  Thanks,
  -- François


On Mon, Feb 4, 2013 at 6:56 AM, Marc Octavo  wrote:

> Hi all,
>
> I'm trying to install the phylobase package without succes. I've got an
> error message:
>
> nxspublicblocks.cpp:686:6: error: ‘Rcerr’ is not a member of ‘Rcpp’
>
> These are all messages :
>
> * installing *source* package ‘phylobase’ ...
> ** package ‘phylobase’ successfully unpacked and MD5 sums checked
> ** libs
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c GetNCL.cpp
> -o GetNCL.o
> gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c ancestors.c
> -o ancestors.o
> gcc -std=gnu99 -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> descendants.c -o descendants.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsassumptionsblock.cpp -o nxsassumptionsblock.o
> nxsassumptionsblock.cpp: In member function ‘void
> NxsAssumptionsBlock::HandleTypeSet(NxsToken&)’:
> nxsassumptionsblock.cpp:1344:107: warning: converting ‘false’ to pointer
> type ‘bool*’ [-Wconversion-null]
> nxsassumptionsblock.cpp: In member function ‘void
> NxsAssumptionsBlock::HandleCodeSet(NxsToken&)’:
> nxsassumptionsblock.cpp:1654:121: warning: converting ‘false’ to pointer
> type ‘bool*’ [-Wconversion-null]
> nxsassumptionsblock.cpp: In member function ‘void
> NxsAssumptionsBlock::HandleCodonPosSet(NxsToken&)’:
> nxsassumptionsblock.cpp:1688:117: warning: converting ‘false’ to pointer
> type ‘bool*’ [-Wconversion-null]
> nxsassumptionsblock.cpp: In member function ‘void
> NxsAssumptionsBlock::HandleCharPartition(NxsToken&)’:
> nxsassumptionsblock.cpp:1821:113: warning: converting ‘false’ to pointer
> type ‘bool*’ [-Wconversion-null]
> nxsassumptionsblock.cpp: In member function ‘void
> NxsAssumptionsBlock::HandleCharSet(NxsToken&)’:
> nxsassumptionsblock.cpp:1846:107: warning: converting ‘false’ to pointer
> type ‘bool*’ [-Wconversion-null]
> nxsassumptionsblock.cpp: In member function ‘void
> NxsAssumptionsBlock::HandleExSet(NxsToken&)’:
> nxsassumptionsblock.cpp:1893:105: warning: converting ‘false’ to pointer
> type ‘bool*’ [-Wconversion-null]
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsblock.cpp -o nxsblock.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxscharactersblock.cpp -o nxscharactersblock.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxscxxdiscretematrix.cpp -o nxscxxdiscretematrix.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsdatablock.cpp -o nxsdatablock.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsdistancedatum.cpp -o nxsdistancedatum.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsdistancesblock.cpp -o nxsdistancesblock.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsemptyblock.cpp -o nxsemptyblock.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsexception.cpp -o nxsexception.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxsmultiformat.cpp -o nxsmultiformat.o
> g++ -I/usr/local/lib64/R/include -DNDEBUG -I. -DHAVE_INTTYPES_H
> -DASSERTS_TO_EXCEPTIONS -I/usr/local/include
> -I"/usr/local/lib64/R/library/Rcpp/include"   -fpic  -g -O2  -c
> nxspubli

Re: [R-sig-phylo] Plotting a MrBayes tree in R

2012-04-02 Thread François Michonneau
Hello Barnabas,

  Did you try the function ladderize in the ape package?

  Cheers,
   -- François


On Mon, Apr 2, 2012 at 09:11, Barnabas Daru  wrote:

> Dear All,
>
>
>
> I write to enquire about how to plot a MrBayes tree in R.
>
> Whenever I get the .con file from a MrBayes run and try to plot a tree in
> R, it normally produce the tree upside down and the branches don't align
> well as you would get using PAUP so that there's very little space to map
> the PP values.
>
> Also some of the outgroups come out in the middle while the same .con file
> will open nicely in PAUP and produce a ladderized cladogram.
>
>
>
> I will be very glad if you have any R code to enable me produce a nice
> MrBayes tree in R especially a right-ladderized cladogram.
>
>
>
> Thanks
>
>
>
> Barnabas
>
>
>  \-/
>   /\
>  /--|
>  /---/ Barnabas Daru
>  |--/  PhD Student,
>  \-/   African Centre for DNA Barcoding,
>  /\University of Johannesburg,
> /--\   PO Box 524, Auckland Park, 2006,
> |---\  South Africa.
>  \---\ Lab: +27 11 559 3477
>  \--| Mobile: +277 3818 9583
>   \-/ Website: http://acdb.co.za/index.php?page=mr-barnabas-h-daru
>   /\
>  /--\
>
> #…if you can think it, you can do it.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>[[alternative HTML version deleted]]
>
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] function to insert missing tips in a clade

2012-01-19 Thread François Michonneau
Hi Robin,

  Please find below a function I wrote that does what you want. Let me
know if you have any questions, if you find any bugs or if you have
any suggestions to make it better.

  Cheers,
   -- François

##' Graft unsampled taxa onto a tree by simulating random trees.
##'
##' Based on a data frame containing the number of species at the tip
of a phylogeny,
##' this function will generate random phylogenies for each group of
missing species
##' and graft them onto the tree. They are not grafted directly at the
tip of the existing
##' tree. Instead a random fraction of the existing branch length is
removed and the
##' simulated tree, representing the missing taxa, is scaled to have
the same depth (length)
##' as the fraction that is removed. In the end, an ultrametric tree
with the same depth (length)
##' as the original object is generated.
##' @title Graft unsample taxa onto a tree.
##' @param tr a phylogenetic tree stored as a \code{phylo} object.
##' @param listSp a single-column data frame which contains the number
of species unsampled
##' at each tip. The labels of the tree \code{tr} and the row names of
\code{listSp} need to
##' match.
##' @return a phylogenetic tree stored as a \code{phylo} object. The
tips for which species have
##' been added too are appended a number (starting at 1) for each clade.
##' @author François Michonneau
##' @examples
##' tr <- rcoal(10)
##' listSp <- data.frame(sp=sample(1:10), row.names=tr$tip.label)
##' trWithGraft <- graftMissingTaxa(tr, listSp)
##' par(mfrow=c(1,2))
##' plot(tr)
##' plot(trWithGraft)
graftMissingTaxa <- function(tr, listSp) {

  if (class(tr) != "phylo") stop("\'tr\' must be an object of class \'phylo\'")
  if (!is.ultrametric(tr))
warning("This function is intended to be used on ultrametric trees.")

  spToAdd <- subset(listSp, listSp[,1] > 1)

  for (i in 1:nrow(spToAdd)) {
trP4 <- as(tr, "phylo4")
tipToAdd <- spToAdd[i,1]
tipName <- rownames(spToAdd)[i]
rTr <- as(rcoal(tipToAdd), "phylo4")   # draw random tree (coal to
be ultrametric)
tipLabels(rTr) <- paste(tipName, 1:tipToAdd, sep="_")
distToTip <- edgeLength(trP4, getNode(trP4, tipName))
newDist <- runif(1) * distToTip
totalDist <- distToTip - newDist
edgeLength(rTr) <- edgeLength(rTr) * totalDist /
sumEdgeLength(rTr, ancestors(rTr, 1, "ALL"))
edgeLength(trP4)[getEdge(trP4, tipName)] <- unname(newDist)
tr <- bind.tree(as(trP4, "phylo"), as(rTr, "phylo"),
match(tipName, tr$tip.label))
  }
  stopifnot(is.ultrametric(tr))
  tr
}



On Wed, Jan 18, 2012 at 11:41, Velzen, Robin van  wrote:
> Dear all,
>
> I wish to do various lineage diversification analyses which assume complete 
> sampling. My sampling is not complete but I do know the likely clade 
> membership of the missing tips. As far as I know two different approaches to 
> inserting these tips have been proposed: I. A skeletal tree approach 
> collapsing the under sampled clades and randomly resolving them with the 
> complete number of tips (FitzJohn, Maddison & Otto (2009) Syst Biol 58: 
> 595-611). II. An expanded tree approach where missing tips are randomly 
> inserted with equal probability along the branches belonging to its likely 
> clade (e.g. Day, Cotton & Barraclough (2008) PLoS ONE 3(3): e1730). The first 
> approach is straightforward to implement (it is implemented in the 
> diversitree package).  I find the second more challenging, however, and hope 
> you can help me improve the solution I have found so far.
>
> Basically what I want to do is randomly insert a number of missing taxa to a 
> specified clade in a tree. Below you can find a "work in progress" simple 
> function that relies on the ape and phylobase packages:
>
> library(ape)
> library(phylobase)
>
> tree<-compute.brlen(read.tree(text="(t1,((t2,t3),((t6,(t4,t5)),((t7,t8),(t9,t10);"))
> clade<-c("t4", "t5","t6")
>
> insert.tips<-function(tree,clade,n){
>   T<-tree
>   for (i in 1:n){
>     T4<-phylo4(T)
>     nodes<-descendants(T4,MRCA(T4,clade), type="all")
>     insertnode<-sample(nodes, 1, prob=T$edge.length[match(nodes,T$edge[,2])])
>     insertnodelength<-T$edge.length[match(insertnode,T$edge[,2]) ]
>     insertposition<-runif(1, min=0, max=insertnodelength)
>     new.tip<-compute.brlen(stree(1, tip.label = "z"),
> min(dist.nodes(T)[insertnode,1:length(T$tip.label)])+insertposition)
>     T<-(bind.tree(T,new.tip,where=insertnode, position=insertposition ) )
>     T$tip.label<-make.unique(T$tip.label, s

Re: [R-sig-phylo] problem updating phylobase

2011-10-29 Thread François Michonneau

Hi Nick,

  Could you please report if you also get this problem with the latest
version of Rcpp? 

  Thanks,
  -- François

On Fri, 2011-10-28 at 16:58 -0700, Nick Matzke wrote:
> Hi all,
> 
> I've had phylobase installed and functioning for awhile, but 
> I get a weird error while installing phylobase 0.6.2, 
> despite the fact that it looks like all the files compile 
> successfully and something weird happens while building 
> phylobase.so.
> 
> Any advice would be *much* appreciated...
> 
> Install attempt:
> ==
> mws2:~/Desktop/downloads nick$ R CMD INSTALL 
> ~/Desktop/downloads/phylobase_0.6.2
> 
> Loading ~/.Rprofile...
> 
> Currently viewed PATH:
> 
> /opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/soylatte16-i386/bin:/Applications/muscle:/Applications/dssp:/opt/local/include:/Library/Frameworks/GDAL.framework/Programs:/Library/Frameworks/PROJ.framework/Programs:/sw/include/wx-2.8:/Library/Frameworks/PROJ.framework/Programs:_njm:/opt/git/bin:/Users/nick/gtk/inst/bin:/Users/nick/bin:/usr/local/mysql/bin:/opt/local/bin:/opt/local/sbin:/bioinformatics/ncbi_execs/sap:/bioinformatics/ncbi_execs/tcoffee565/bin:/usr/local/ActivePerl-5.10/bin:/bioinformatics/ncbi_execs/bin:/Users/nick:/bioinformatics:/bioinformatics/ncbi_execs/ncbi_tools/:/bioinformatics/pythonstuff/soylatte16-i386-1.0.3/bin:/bioinformatics/diva_mac:/usr/texbin/usr/ebiotools/staden/macosx-bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ebiotools/ncbi/bin:/usr/ebiotools/bin:/usr/local/bin:/usr/texbin:/usr/X11R6/bin:/usr/texbin:/Applications/dssp:/Library/Frameworks/PROJ.framework/:/Library/Frameworks/PROJ.
> 
> framework/Programs:/Library/Frameworks/PROJ.framework/Versions/4.6/Headers:/Library/Frameworks/GDAL.framework/Versions/1.6/Programs
> 
> * installing to library ‘/Users/nick/Library/R/2.10/library’
> 
> * installing *source* package ‘phylobase’ ...
> 
> ** libs
> 
> ** arch - i386
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c GetNCL.cpp -o GetNCL.o
> 
> gcc -arch i386 -std=gnu99 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c ancestors.c -o ancestors.o
> 
> gcc -arch i386 -std=gnu99 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c descendants.c -o descendants.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c nxsassumptionsblock.cpp -o 
> nxsassumptionsblock.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c nxsblock.cpp -o nxsblock.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c nxscharactersblock.cpp -o 
> nxscharactersblock.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c nxscxxdiscretematrix.cpp -o 
> nxscxxdiscretematrix.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c nxsdatablock.cpp -o nxsdatablock.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R.framework/Resources/library/Rcpp/include" 
>-fPIC  -g -O2 -c nxsdistancedatum.cpp -o nxsdistancedatum.o
> 
> g++ -arch i386 
> -I/Library/Frameworks/R.framework/Resources/include 
> -I/Library/Frameworks/R.framework/Resources/include/i386 -I. 
> -DHAVE_INTTYPES_H -I/usr/local/include 
> -I"/Library/Frameworks/R

Re: [R-sig-phylo] reading nexus file from treebase?

2011-03-24 Thread François Michonneau
Hi Scott,

  Which version of phylobase are you using and which architecture? I can
read the file on my machine.

  Cheers,
  -- François


On Thu, Mar 24, 2011 at 12:39, Scott Chamberlain wrote:

> Hello,
>
> I can't get read.nexus (ape) or readNexus (phylobase) to read nexus files
> downloaded from treebase with URLs parsed from xml files. I can't manually
> edit each file as I want to read a lot of these files. Is there an easy fix?
> One of the files is copied below.
>
> Thanks!
> Scott Chamberlain
> Rice University, EEB Dept.
>
>
>
>
> #NEXUS
>
> [!This data set was downloaded from TreeBASE, a relational database of
> phylogenetic knowledge. TreeBASE has been supported by the NSF, Harvard
> University, Yale University, SDSC and UC Davis. Please do not remove this
> acknowledgment from the Nexus file.
>
>
> Downloaded on March 24, 2011; 16:32 GMT
>
> TreeBASE (cc) 1994-2008
>
> Study reference:
> Brown R., & Yang Z. 2010. Bayesian Dating of Shallow Phylogenies with a
> Relaxed Clock.
> Systematic Biology, 59(2): 119-131.
>
> TreeBASE Study URI:
> http://purl.org/phylo/treebase/phylows/study/TB2:S10165]
>
> BEGIN TAXA;
> TITLE M4787;
> DIMENSIONS NTAX=16;
> TAXLABELS
> Chalcides_coeruleopunctatus_E2806.20
> Chalcides_coeruleopunctatus_E2806.22
> Chalcides_manueli_E2506.1
> Chalcides_mionecton_mionecton_E2506.10
> Chalcides_mionecton_mionecton_E2506.12
> Chalcides_mionecton_trifasciatus_E2506.18
> Chalcides_polylepis_E14124.1
> Chalcides_polylepis_E14124.2
> Chalcides_polylepis_E2506.21
> Chalcides_sexlineatus_bistriatus_E2806.6
> Chalcides_sexlineatus_sexlineatus_E2806.8
> Chalcides_simonyi_E3007.2
> Chalcides_sphenopsiformis_E8121.26
> Chalcides_sphenopsiformis_E8121.27
> Chalcides_viridanus_E2806.10
> Chalcides_viridanus_E2806.14
> ;
> END;
>
> BEGIN TREES;
> TITLE Tb10793;
> LINK TAXA = M4787;
> TREE Fig._3c = [&R]
> ((Chalcides_sphenopsiformis_E8121.26,Chalcides_sphenopsiformis_E8121.27),(((Chalcides_viridanus_E2806.10,Chalcides_viridanus_E2806.14),((Chalcides_sexlineatus_bistriatus_E2806.6,Chalcides_sexlineatus_sexlineatus_E2806.8),(Chalcides_coeruleopunctatus_E2806.22,Chalcides_coeruleopunctatus_E2806.20))),(Chalcides_simonyi_E3007.2,((Chalcides_mionecton_trifasciatus_E2506.18,(Chalcides_mionecton_mionecton_E2506.12,Chalcides_mionecton_mionecton_E2506.10)),(Chalcides_manueli_E2506.1,(Chalcides_polylepis_E14124.1,(Chalcides_polylepis_E14124.2,Chalcides_polylepis_E2506.21)));
> [! TreeBASE tree URI:
> http://purl.org/phylo/treebase/phylows/tree/TB2:Tr6136]
>
>
> END;
>
>
>[[alternative HTML version deleted]]
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] NEVERMIND -read.tree and read.nexus error

2011-02-21 Thread François Michonneau
The package phylobase uses NCL to parse Newick files which provides some
information when a non-valid file is being imported. It's not perfect, but
it will at least give you an idea of the part that is not correctly
formated.

  -- François


On Sun, Feb 20, 2011 at 22:31, Ben Bolker  wrote:

>  On the other hand, if anyone has any ideas about a paranoid and
> verbose Newick file-checker that gives verbose output about what
> precisely might be wrong/non-conforming in a Newick file ("lint for
> Newick" for the old-fashioned programmers) to help track this sort of
> thing down, that would be probably be very helpful to many on the list ...
>
>
> On 11-02-20 06:59 PM, James Meadow wrote:
> > List administrator - Do not post this question.  I picked through the nwk
> > file again and found a single misplaced space!  it is now fixed.
> >
> > Sorry about that,
> > James
> >
> > On Sun, Feb 20, 2011 at 4:44 PM, James Meadow 
> wrote:
> >
> >> Hello,
> >>
> >> I have seen this error reported in the help list, but the suggestions do
> >> not fix my problem. I am using a very recent version of ape, and I have
> also
> >> tried the patch given here:
> >> https://svn.mpl.ird.fr/ape/dev/ape/R/read.nexus.R
> >>
> >> I am trying to read.tree a large (>300 taxa) nwk tree, and I continue to
> >> get this error:
> >>
> >>> pltr<-read.tree("plant_all_1.nwk")
> >>   # There is apparently two root edges in your file: cannot read tree
> file.
> >>   # Reading Newick file aborted at tree no.1
> >>
> >> I have tried it with .nex, and .nwk and both give the same error.  I can
> >> open this file in any other tree viewer (like FigTree and Mega...) with
> no
> >> problem, and the root is clearly separated.  I have looked through the
> .nwk
> >> file but cannot find where there might be a problem.  I have also tried
> >> removing the first and last ( ) and the tree will read, but then
> plotting
> >> the tree gives this error:
> >>
> >>   # Error in plot.phylo(pltree) :
> >>   # there are single (non-splitting) nodes in your tree; you may need to
> >> use collapse.singles()
> >>   # Calls: plot -> plot.phylo
> >>
> >> and collapse.singles() doesn't fix it.  I have tried to simulate smaller
> >> trees to get the error, but I can't seem to reproduce the situation.
>  Does
> >> ape have some sort of upper limit on tree size?
> >>
> >> The nwk file is attached.
> >>
> >> I apologise in advance if I am missing something simple.
> >>
> >> As a sidenote, I have been using ape and other r-phylo packages for only
> a
> >> short time, and I have all but abandoned most other phylo software in
> the
> >> process - very nice job developing these packages and to EP for a
> terrific
> >> book!  My dissertation is indebted to you.
> >>
> >> Thank you,
> >> James
> >>
> >>
> >>
> >>
> >> --
> >> James Meadow
> >> Land Resources and Environmental Sciences
> >> Montana State University
> >> (406) 370-7157
> >> jfmea...@gmail.com
> >>
> >
> >
> >
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] problem with bind.tree() in ape 2.6-2

2011-02-10 Thread François Michonneau

Hi Andrew,

  The example you provide works fine for me. I also use ape 2.6-2 (with
R 2.12.1). Can you give another example?

  Cheers,
  -- François

On Thu, 2011-02-10 at 13:41 -0600, Andrew Barr wrote:
> Hi all,
> 
> I am getting an error that I do not understand when trying to combine
> two trees.  More specifically, my goal is to insert a single taxon
> into an existing tree.  The problem that I am getting is illustrated
> as follows
> 
> ###
> library(ape)
> 
> tr1<-read.tree(text="(B:6.0,(A:5.0,C:3.0,E:4.0):5.0,D:11.0);")
> tr2<-read.tree(text="(A1:.5);")
> 
> result<-bind.tree(x=tr1,y=tr2,where=1,pos=.5)
> 
> ###
> 
> The resulting error message is "Error in y$edge[, 1] : incorrect
> number of dimensions".   But tr2 definitely has a column 1, so
> y$edge[, 1] should have no problem evaluating.
> 
> Any help would be greatly appreciated
> 
> Andrew Barr
> University of Texas at Austin
> 
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] reading trees from Tree of Life Web Project

2010-11-04 Thread François Michonneau

Hello Andy,

  As far as I know there is no support for the phyloXML format in R yet.
There might be better ways of doing it and I'd love to hear about them
but what I did was to use archeopteryx:
http://phylosoft.org/archaeopteryx/

and then go in File > Read tree from Tree of Life, enter the node
identifier and save the tree in the Nexus/Newick format so that you can
load it in R with ape or phylobase.

  Cheers,
  -- François

On Thu, 2010-11-04 at 19:41 -0300, Andy Rominger wrote:
> Dear list,
> 
> Has anybody come across a way to read-in a tree in the "ToL Response Format"
> or in treeML format--both XML formats?  I should be more specific: by
> read-in I mean convert into some useful R class (e.g. ape's phylo).  Forgive
> me if I have missed an obvious function in one of the many packages.
> 
> Here are two example outputs that I would like to be able to use:
> ToL Response Format
> http://tolweb.org/onlinecontributors/app?service=external&page=xml/TreeStructureService&node_id=26391&optype=0
> 
> treeML
> http://tolweb.org/onlinecontributors/app?service=external&page=xml/TreeStructureService&node_id=26391&optype=1
> 
> If no function exists, I could imagine using scan() and then somehow
> converting the XML to a Newick format, or perhaps an "edge" matrix as used
> by phylo?  There is probably a more elegant method!
> 
> All suggestions are most appreciated!  Thanks for the help--
> Andy Rominger
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Name nodes according to distance from root

2010-10-04 Thread François Michonneau

Hello Ulrik,

  If your tree is ultrametric, you may look into the function
branching.times in ape. You could potentially use it to rank your nodes
depending on their age.

  Also, the package phylobase provides functions to manipulate node
labels easily. It also provides functions to convert between the phylo
tree format and the phylo4 tree format.

  Cheers,
  -- François

On Sun, 2010-10-03 at 16:34 +0200, Ulrik Stervbo wrote:
> Dear list,
> 
> I would like to name nodes in my tree, depending on the distance from the
> root, so that the root is 0, the node closest to the root is 1, and the node
> farthest from the root is n
> 
> How do I achieve this? I suspect something with edge.length, but are not
> sure how to go about it. The final aim is to analyse the composition of the
> tips in all possible subtrees.
> 
> My tree have 1920 nodes, and I used the midpoint rooting function given by
> Klaus Schliep to this list on 02 Sep 2010.
> 
> I have just recently begun using R and ape, and may have missed something in
> the help-pages.
> 
> Thanks in advance,
> Ulrik
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] New phylobase release

2010-07-28 Thread François Michonneau

Hello,

  A new beta release of phylobase (0.6.1) is now available on CRAN.

  This release brings much improved support of NEXUS files. In
particular it's now possible to import both Standard and Continuous
datatypes. Issues involving special characters in species names should
also be resolved. This is made possible by using the latest version of
the Nexus Class Library (NCL) [1] and a total rewrite of the interface
between NCL and phylobase.

  Among other main modifications, there is now global options that allow
users to modify the behavior of the validator.

  Compilations issues on Mac and Windows should also be fixed.

  The full NEWS can be found at:
http://cran.r-project.org/web/packages/phylobase/NEWS

  If you haven't heard of phylobase, it's a package that allows storage,
manipulation and plotting of phylogenetic trees and data associated with
them. Vignettes are available in the package to help you getting
started.

  You can use this mailing list or R-forge [2] for any questions,
feature requests, bug reports, etc...

  Cheers,
  -- François 

[1] http://phylo.bio.ku.edu/ncldocs/v2.1/funcdocs/index.html
[2] http://r-forge.r-project.org/projects/phylobase/



signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] phylobase question

2010-07-06 Thread François Michonneau

Hi Conrad,

  It's a "technical" bug. It's a constraint based on the way we parsed
the information returned by the Nexus Class Library. The good news is
that I totally rewrote this part of phylobase and that this problem is
gone. The bad news is that I'm currently doing field work, the new
interface still needs a little bit of polishing and I won't be able to
commit all these changes until mid August.

  For now, my advice would be to temporarily change your species names
to not have underscores, or wait until the next release of phylobase...
I'll announce it on the r-sig-phylo mailing list.

  Cheers,
  -- François 

On Tue, 2010-07-06 at 16:53 -0400, Conrad Stack wrote:
> Hello fellows,
> 
> I'm wondering if anyone else is experiencing this "problem" with phylobase:
> 
> When I use the method readNexus(nexfile, type="data") on a nexus file with a
> CHARACTERS block like this
> 
> > 
> > CHARSTATELABELS
> > 1 pc1,
> > 2 pc2 ;
> > MATRIX
> > Bolbometopon_muricatum   -4.027008942 -0.609567435
> > Calotomus_carolinus  1.730007826 7.129571846
> > 
> >
> 
> the readNexus method returns a data.frame like this:
> 
> >  pc1pc2
> > Bolbometoponmuricatum -4.027009  -0.609567
> > Calotomuscarolinus 1.730008   7.129572
> > 
> >
> 
> It seems to be stripping the taxa names of the '_' character.  Is this an
> illegal character in nexus taxa formatting?  Or a bug in phylobase?
> 
> Thanks!
> Conrad
> 
> 


signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] extracting information about n-order nodes

2010-05-13 Thread François Michonneau

Hi Eric,

  The package phylobase [1] provides the function descendants and
ancestors which for a given node returns the nodes for all the
descendants or ancestors. So it will allow you to determine the order of
your nodes based on the number of descendants or ancestors which are
associated with them.

  Furthermore, if you import your tree as a NEXUS file, phylobase can
store bootstrap value supports as data with their associated node number
as row names. You'll need to use:

tr <- readNexus(yourFile, check.node.labels="asdata")

and use the function tdata to retrieve your support values:

tdata(tr, "internal")

  Let me know if you have any questions.

  Cheers,
  -- François 

[1] install.packages("phylobase", repos="http://r-forge.r-project.org";)

On Thu, 2010-05-13 at 09:25 -0500, Eric Pante wrote:
> Dear listers,
> 
> I would like to extract bootstrap support values for all nodes of a  
> specific order. I other terms, I want to get a vector of bootstrap  
> support values for 1st order nodes, then 2nd order nodes, etc... I  
> would like to assess the effect of adding genes to resolving deep  
> phylogenetic relationships. Any hint would be very appreciated!
> 
> Best regards, eric
> 
> Eric Pante
> 
> Department of Biology
> University of Louisiana at Lafayette
> P.O. Box 42451, Lafayette, LA 70504
> Lab: (337) 482-6494
> Web: www.ull.edu/~egp0628
> 
> 
> "On ne force pas la curiosite, on l'eveille ..."
> Daniel Pennac
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] installing apTreeshape

2010-03-23 Thread François Michonneau
Hello Shawn,

  Did you check the manual pages?
http://cran.r-project.org/doc/manuals/R-admin.html#Installing-packages

  Why doesn't install.packages("apTreeshape") work with your system?
Do you get an error message?

  Cheers,
  -- François

On Sat, Mar 13, 2010 at 10:03, Shawn Kuchta
 wrote:
> Hello everyone,
> I am having difficulties installing apTreeshape now that is has been
> archived, and thus isn't available for installation via
> install.packages("apTreeshape").  I am aware that you can download the
> package from: http://cran.r-project.org/src/contrib/Archive/apTreeshape/.
>  But how do you do the installation of the files once they've been
> downloaded?  I suspect this is an easy question, but I'm stumped on it
> anyway.
> Thanks,
> Shawn
>
>
> Date: Thu, 11 Mar 2010 11:47:03 -0500
> From: "Brian O'Meara" 
> To: michael.b...@imag.fr
> Cc: r-sig-phylo , eric.duran...@gmail.com,
> olivier.franc...@imag.fr
> Subject: Re: [R-sig-phylo] apTreeshape
> Message-ID: <5841c739-21f8-43f2-87a9-56104772f...@utk.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
>
> You might consider putting it on R-Forge (
> ).  Phylobase, task views, vegan, and many other packages are there,
>
> and it makes it 1) easy to work together on code (subversion
> repository) 2) easy to for users to install your package while it's in
> development
> (install.packages("packagename",repos="http://R-Forge.R-project.org
> ") ), even for people not comfortable doing an install from source, 3)
> easy to track bugs and requests, and 4) easy to put back on CRAN.
>
> Best,
> Brian
>
> On Mar 10, 2010, at 2:41 PM, michael.b...@imag.fr wrote:
>
> Hi all,
>
> I am one of the contributor to the apTreeshape package.
>
> I know the apTreeshape package is currently moribund, and has been
>
> removed to the cran archive. Can anyone confirm its permanent
>
> decease?
>
> I hope not, we are currently working for his resurrection.
>
>
> Are there any efforts to move some of its functions into other
>
> packages - in particular the implementations of the Delta shift
>
> test and Aldous' Branching topology models?
>
> For the moment, you can download the package at
>
> http://cran.r-project.org/src/contrib/Archive/apTreeshape/
>
>
> Hope this helps,
>
> Feel free to send me an email if you still experience problems with
>
> the package.
>
> Michael Blum
>
>
> --
>
> --
>
> Michael BLUM
>
> Charg? de recherche (CR2 CNRS) (Research Associate)
>
> Tel: +33 (0)4 56 52 00 65
>
> Fax: +33 (0)4 56 52 00 55
>
> michael.b...@imag.fr
>
> http://membres-timc.imag.fr/Michael.Blum/
>
> --
>
>
>
> All the best,
>
> Rich
>
>
>
>
>
> ==
>
> Rich Grenyer, Ph.D.
>
> Research Fellow in Biodiversity Informatics
>
> Centre For Population Biology & Division of Biology
>
> Imperial College London at Silwood Park
>
> Ascot, Berkshire
>
> SL5 7PY
>
> United Kingdom
>
> e: gren...@imperial.ac.uk
>
> t: +44 (0)20 7594 2474
>
> w: http://www.imperial.ac.uk/people/grenyer
>
> ___
>
> R-sig-phylo mailing list
>
> R-sig-phylo@r-project.org
>
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
>
> ___
>
> R-sig-phylo mailing list
>
> R-sig-phylo@r-project.org
>
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
> --
> Brian O'Meara
> http://www.brianomeara.info
> Assistant Prof.
> Dept. Ecology & Evolutionary Biology
> U. of Tennessee, Knoxville
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
>

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Merging multiPhylo objects

2010-02-12 Thread François Michonneau
Hi Dave,

  Maybe this example will help you:

> foo <- vector("list", 2) #create an empty list of 2 elements
> class(foo) <- "multiPhylo" #make this list a multiPhylo object
> foo[[1]] <- rtree(10) #put a random tree with 10 tips in the first slot of 
> the list
> foo[[2]] <- rtree(10) #put another random tree in the second slot
> foo[[3]] <- rtree(10) #here you add another tree to your mutlPhylo object
> foo
3 phylogenetic trees

  Cheers,
  -- François


On Fri, Feb 12, 2010 at 12:43, David Williams
 wrote:
> Hi
>
> How can separate phylo objects be combined or added to an already existing
> multiPhylo object? Using 'c()' loses attributes and various attempts with
> as.list() failed as well. I resorted to writing to a tree file with
> 'append=T' then reading from that file into a multiPhylo object but
> presumably there is a quicker way.
>
> thanks
>
> DaveW
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Editing names of DNAbin object

2010-02-08 Thread François Michonneau
Hi Wade,

If I understood your problem correctly, maybe the example below will help
you.

> library(ape)
> foo <- vector("list", 2)
> foo[[1]] <- "ATACTACTATATT"
> foo[[2]] <- "ATTTCCATTATGT"
> names(foo) <- c("seq1", "seq2")
> foo <- as.DNAbin(foo)
> names(foo)
[1] "seq1" "seq2"
> names(foo) <- c("SeqA", "SeqB")
> names(foo)
[1] "SeqA" "SeqB"

In your case you'll probably just need something like:
names(dat) <- tmp.names

Cheers,
  -- François


On Mon, Feb 8, 2010 at 17:35, Wade Wall  wrote:

> Hi all,
>
> Sorry for the rather trivial question, but I have a DNAbin object that
> consists of 378 rows (samples) and I want to edit (replace) the names with
> object tmp.names that is the same length as names(dat), where dat is the
> DNAbin object.  However, try as I might, I cannot accomplish this.  I can
> extract the names, but can't edit.
>
> Any help would be appreciated.
>
> Wade
>
>[[alternative HTML version deleted]]
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Deleting taxa in a batch

2009-12-16 Thread François Michonneau
Hi Frank,

  I think you have a typo in your command. On a fake example, it works
for me (i.e., no error message) if I type:

sapply(x, function(x) drop.tip(x, "Gonyosoma_oxycephalum"), simplify =
TRUE, USE.NAMES = TRUE)

  However, usually I use the function lapply when I have to make
operation on multiple operations, something like:

lapply(foo, function(bar) drop.tip(bar, "foobar"))

  Cheers,
  -- François

On Wed, Dec 16, 2009 at 23:29, Frank Burbrink
 wrote:
> Hello All,
>
> I have a probably very easy question to answer.  I have uploaded a batch of 
> 2,000 trees (in phylip format) via the command "x<-read.tree(file=x.txt")  
> The file "x" confirms that I have loaded 2,000 phylogenetic trees.  When I 
> try to drop a taxon from all trees using the command:
>
> sapply(x, drop.tip(x2,"Gonyosoma_oxycephalum"), simplify = TRUE, USE.NAMES = 
> TRUE)
>
> I receive the error:
>
>
> Error in drop.tip(x, "Gonyosoma_oxycephalum") :
>  object "phy" is not of class "phylo"
>
> Any easy fix for deleting taxa from a batch of trees?
>
> Thanks a million!
>
> Frank
>
> --
> NEW EMAIL ADDRESS:
> frank.burbr...@csi.cuny.edu
> ***
> Frank T. Burbrink, Ph.D.
> Associate Professor
> Biology Department
> 6S-143
> 2800 Victory Blvd.
> College of Staten Island/CUNY
> Staten Island, New York 10314
> E-Mail:frank.burbr...@csi.cuny.edu
> Phone:718-982-3961
> Web Page: http://scholar.library.csi.cuny.edu/~fburbrink/
> ***
>
> 
> Think green before you print this email.
>
>        [[alternative HTML version deleted]]
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] adding scale-bar to a tree using add.scale.bar()

2009-11-23 Thread François Michonneau
Hi Avril,

  I think your problem comes from the fact that you're using
coordinate values that are too small to be displayed. The first edge
(from the bottom) is at the value 1. If you use

add.scale.bar(x=0, y=.9)

  then the bar appears  just below the first edge.

  In general, if you want to find appropriate coordinates on a plot
you can use the function locator(). For instance, if you type:

locator(1)

you can then click where you want to put your scale bar, and R will
return the coordinates.

  Hope this helps,
  -- François

On Tue, Nov 24, 2009 at 01:07, Coghlan, Avril  wrote:
> Dear R-sig-phylo list,
>
> I have used the R Ape library to build a phylogenetic tree, and would
> like to plot it, and put a scale-bar on the plot.
>
> I find that when I use the add.scale.bar() function (from Ape) to add a
> scale-bar to the plot, it always adds it at the same place, on top of
> the bottom branch of the tree.
>
> I would prefer to put the scale-bar somewhere else, as if it is plotted
> on top of a branch of the tree, it is hard to see the scale-bar.
>
> I saved my tree as a Newick format file "aspm.tre", here is the contents
> of the file:
> (Q1L925_DAN:0.3329930049,(ASPM_MOUSE:0.1903413133,(((ASPM_HUMAN:0.032540
> 61214,ASPM_PANTR:0.0309131):0.1024089698,ASPM_CANFA:0.1387680587):0.
> 02024375954,(ASPM_BOVIN:0.06796926756,ASPM_SHEEP:0.07012606839):0.099986
> 70218):0.018381292):0);
>
> Here is what I typed in R to try to make the picture of the tree with
> the scale bar:
>> library("ape")
>> mytree <- read.tree("aspm.tre")
>> plot.phylo(mytree)
>> add.scale.bar(x = 0.003, y=0.4)
> Whatever value I give add.scale.bar() as x=..., y=... , it always plots
> the scale-bar on top of the lowest branch of the tree.
> I am not sure why this is.
>
> I am not sure if I am doing something wrong (probably!), or if this is
> due to some small bug.
> I will be very grateful for any advice, as I am new to using Ape (which
> I find extremely nice so far)
>
> Regards,
> Avril
>
> Avril Coghlan
> University College Cork
> Ireland
>
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] convert edge list to phylo object

2009-07-15 Thread François Michonneau
Hi Chris

  I might be missing your point but I think your object 'x' is different
from your object 'y'.

  'x' is a tree with 4 tips whereas 'y' has 7 tips. Indeed, in x the
tips are only the nodes from 5 to 7.

  Currently, I don't think there is any easy way to convert an arbitrary
matrix of edges to a phylo object in R. Indeed, the matrix of edges
needs to follow some requirements that you can find here:
http://ape.mpl.ird.fr/misc/FormatTreeR_28July2008.pdf

  Cheers,
  -- François


On Wed, 2009-07-15 at 08:00 -0600, Christopher Stubben wrote:
> Hi again.  Does anyone know a way to convert an edge list (adjacency
> list with child-parent ids) into a phylo object in R?  This would be
> something like the NCBI taxonomy tree format (no cycles in graph)  
> 
> x<-data.frame(name=LETTERS[1:7] , id=1:7,  parent=c(NA, 1,2,1,2,3,3))
> 
> For this small example, I can figure out the Newick format and noticed
> that edges in a phylo object are nearly identical (just the root node is
> missing from y$edge below, c(NA, 5)), so hopefully there's a way to get
> from edges to a phylo class.
> 
> y<-read.tree(text="(A,(B,(C,D)E)F)G;")
> y$edge
> 
> Thanks again,
> 
> Chris


signature.asc
Description: This is a digitally signed message part
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Problem converting phylo to phylo4

2009-03-26 Thread François Michonneau
I think the problem comes from the fact there are node labels associated
with the tree which aren't unique. However, I am not sure they come
from. I'm going to try to investigate this.

> xx$node.label[1:10]
 [1]0  800  800  800 -143 -145  800 -147 -124  800


On Thu, 2009-03-26 at 17:24 +0100, Birgit Lemcke wrote:
> Sorry for delay
> 
> #NEXUS
> 
> BEGIN TREES;
> TRANSLATE
> 1 A1,
> 2 B1,
> 3 C1,
> 4 D1,
> 5 E1,
> 6 F1,
> 7 G1,
> 8 A2,
> 9 B2,
> 10C2,
> 11D2,
> 12E2,
> 13F2,
> 14G2,
> 15A3,
> 16B3,
> 17C3,
> 18D3,
> 19E3,
> 20F3,
> 21G3,
> 22A4,
> 23B4,
> 24C4,
> 25D4,
> 26E4,
> 27F4,
> 28G4,
> 29A5,
> 30B5,
> 31C5,
> 32D5,
> 33E5,
> 34F5,
> 35G5,
> 36A6,
> 37B6,
> 38C6,
> 39D6,
> 40E6,
> 41F6,
> 42G6,
> 43A7,
> 44B7,
> 45C7,
> 46D7,
> 47E7,
> 48F7,
> 49G7,
> 50A8,
> 51B8,
> 52C8,
> 53D8,
> 54E8,
> 55F8,
> 56G8,
> 57A9,
> 58B9,
> 59C9,
> 60D9,
> 61E9,
> 62F9,
> 63G9,,
> 64A10,
> 65B10,
> 66C10,
> 67D10,
> 68E10,
> 69F10,
> 70G10,
> 71A11,
> 72B11,
> 73C11,
> 74D11,
> 75E11,
> 76F11,,
> 77G11,
> 78A12,
> 79B12,
> 80C12,
> 81D12,
> 82E12,
> 83F12,
> 84G12,
> 85A13,
> 86B13,
> 87C13,
> 88D13,
> 89E13,
> 90F13,
> 91G13,
> 92A14,
> 93B14,
> 94C14,
> 95D14,
> 96E14,
> 97F14,
> 98G14,
> 99A15,
> 100   B15,
> 101   C15,
> 102   D15,
> 103   E15,
> 104   F15,
> 105   G15,
> 106   A16,
> 107   B16,
> 108   C16,
> 109   D16,
> 110   E16,
> 111   F16,
> 112   G16,
> 113   A17,
> 114   B17,
> 115   C17,
> 116   D17,
> 117   E17,
> 118   F17,
> 119   G17,
> 120   A18,
> 121   B18,
> 122   C18,
> 123   D18,
> 124   E18,
> 125   F18,
> 126   G18,
> 127   A19,
> 128   B19,
> 129   C19,
> 130   D19,
> 131   E19,
> 132   F19,
> 133   G19,
> 134   A20,
> 135   B20,
> 136   C20,
> 137   D20,
> 138   E20,
> 139   F20,
> 140   G20,
> 141   A21,
> 142   B21,
> 143   C21,
> 144   D21,
> 145   E21,
> 146   F21,
> 147   G21,
> 148   A22,
> 149   B22,
> 150   C22,
> 151   D22,
> 152   E22,
> 153   F22,
> 154   G22,
> 155   A23,
> 156   B23,
> 157   C23,
> 158   D23,
> 159   E23,
> 160   F23,
> 161   G23,
> 162   A24,
> 163   B24,
> 164   C24,
> 165   D24,
> 166   E24,
> 167   F24,
> 168   G24,
> 169   A25,
> 170   B25,
> 171   C25,
> 172   D25,
> 173   E25,
> 174   F25,
> 175   G25,
> 176   A26,
> 177   B26,
> 178   C26,
> 179   D26,
> 180   E26,
> 181   F26,
> 182   G26,
> 183   A27,
> 184   B27,
> 185   C27,
> 186   D27,
> 187   E27,
> 188   F27,
> 189   G27,
> 190   A28,
> 191   B28,
> 192   C28,
> 193   D28,
> 194   E28,
> 195   F28,
> 196   G28,
> 197   A29,
> 198   B29,
> 199   C29,
> 200   D29,
> 201   E29,
> 202   F29,
> 203   G29,
> 204   A30,
> 205   B30,
> 206   C30,
> 207   D30,
> 208   E30,
> 209   F30,
> 210   G30,
> 211   A31,
> 212   B31,
> 213   C31,
> 214   D31,
> 215   E31,
> 216   F31,
> 217   G31,
> 218   A32,
> 219   B32,
> 220   C32,
> 221   D32,
> 222   E32,
> 223   F32,
> 224   G32,
> 225   A33,
> 226   B33,
> 227   C33,
> 228   D33,
> 229   E33,
> 230   F33,
> 231   G33,
> 232   A34,
> 233   B34,
> 234   C34,
> 235   D34,
> 236   E34,
> 237   F34,
> 238   G34,
> 239   A35,
> 240   B35,
> 241   C35,
> 242   D35,
> 243   E35,
> 244   F35,
> 245   G35,
> 246   A36,
> 247   B36,
> 248   C36,
> 249   D36,
> 250   E36,
> 251   F36,
> 252   G36,
> 253   A37,
> 254   B37,
> 255   C37,
> 256   D37,
> 257   E37,
> 258   F37,
> 259   G37,
> 260   A38,
> 261   B38,
> 262   C38,
> 263   D38,
> 264   E38,
> 265   F38,
> 266   G38,
> 267   A39,
> 268   B39,
> 269   C39,
> 270   D39,
> 271   E39,
> 272   F39,
> 273   G39,
> 274   A40,
> 275   B40,
> 276   C40,
> 277   D40,
> 278   E40,
> 279   F40,
> 280   G40,
> 281   A41,
> 282   B41,
> 283   C41,
> 284   D41,
> 285   E41,
> 286   F41,
> 287   G41,
> 288   A42,
> 289   B42,
> 290   C42,
> 291   D42,
> 292   E42,
> 293   F42,
> 294   G42
> 295   A43,
> 296   B43,
> 297   C43
> ;
>   TREE*   UNTITLED=   [&U]
> (1:1.59817,2:1.006277,((3:0.47532, 
> (((4:0.303187,5:0.467075)0.55:0.05429,6:0.308146)0.57:0.048197, 
> ((7:0.037968,8:0.021628)1.00:0.031288,9:0.020411)1.00:0.032744,10:0. 
> 043919)1.00:0.252762, 
> (11:0.027608,12:0.044733)0.99:0.026067,13:0.065287)1.00:0.066574,14: 
> 0.106568)1.00:0.107914, 
> (15:0.105115,16:0.089327)1.00:0.188324)0.80:0.021326, 
> (17:0.0312,18:0.057643)1.00:0.290396)1.00:0.07772)0.76:0.018211, 
> (((19:0.081283,20:0.138276)1.00:0.086272, 
> (21:0.053736,22:0.051966)1.00:0.18265)1.00:0.067709, 
> (23:0.184311,24:0.149428)1.00:0.123983)1.00:0.085978)0.53:0.023951,25:0. 
> 290673)1.00:0.072385)1.00:0.080507)1.00:0.52372, 
> 26:0.086045,27:0.087528)1.00:0.139608, 
> (((28:0.07058,29:0.167229)1.00:0.054195,30:0

Re: [R-sig-phylo] problems when defining nodes with nodelabel()

2008-09-11 Thread François Michonneau
Hi Sam

Do you want to do something like that?

data(woodmouse)
tr <- nj(dist.dna(woodmouse))
nj.boot <- boot.phylo(tr, woodmouse, function(xx) nj(dist.dna(xx)))
tr.boot <- tr
tr.boot$node.labels <- nj.boot
disp <- numeric(length(nj.boot))
disp[tr.boot$node.labels >= 50] <-
  tr.boot$node.labels[tr.boot$node.labels >= 50]
disp[tr.boot$node.labels < 50] <- NA
plot(tr.boot)
nodelabels(disp)

Let me know if you were thinking about something else.

Cheers,
   François


On Thu, 2008-09-11 at 16:18 +1200, Sam Brown wrote:
> Gidday everybody
> 
> I've been playing around with ape's neighbour joining tree capabilities and 
> have come across the following when doing bootstrapping. When I want to 
> restrict the displayed values to those over 50%, I have been unable to define 
> the nodes they should go on.
> 
> Sample code to illustrate:
> 
> tree<-rtree(11)
> plot(tree, type="phylogram", show.tip.label=F, use.edge.length=F)
> 
> nodelabels(c(4:1))
> #Cycles the values 4:1 over all nodes
> 
> nodelabels(,c(1:4))
> #Labels tips 1:4 with their respective number
> 
> nodelabels(c(4:1),c(4:1),bg="yellow")
> #Reverses the numbers on the tips only.
> 
> What's going on? Can I get it to have the first four nodes labeled from 1:4?
> 
> I am using R 2.7.0 on Windows NT. 
> 
> Thanks in advance
> 
> Sam
> 
> Samuel Brown
> Postgraduate Student
> Bio-Protection and Ecology Division
> Lincoln University
> PO Box 84
> Lincoln 7647
> Canterbury
> New Zealand
> 
> 
> _
> Find singles in your area with Match.
> 
> channel%2Findex%2Easpx%3Ftrackingid%3D1043416&_r=WL_EMAL_TAG&_m=EXT
>   [[alternative HTML version deleted]]
> 
> ___
> R-sig-phylo mailing list
> R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo