Closed kguidonimartins closed 5 years ago
thanks @kguidonimartins for the issue
There's a few issues
The underlying phylocom C library is not controlled by us; it doesn't error particularly well, so we don't have good error messages about what went wrong. having said that, we can try to help with things we know about:
pushed up a change now, reinstall remotes::install_github("ropensci/phylocomr")
, restart R, and try again, should warn now about the missing root node age, and then when you fix that it should work
Hi @sckott , many thanks for your time
I just changed the argument storedtree = "zanne2014"
to storedtree = "R20120829"
and that worked.
if (!require("phylocomr")) install.packages("phylocomr")
#> Loading required package: phylocomr
if (!require("brranching")) install.packages("brranching")
#> Loading required package: brranching
#>
#> Attaching package: 'brranching'
#> The following object is masked from 'package:phylocomr':
#>
#> phylomatic
if (!require("ape")) install.packages("ape")
#> Loading required package: ape
ages <- read.table(
"https://gist.githubusercontent.com/kguidonimartins/47fe769de6ba0d194157afd8e52c3bb7/raw/c436728c90fcb6df5745b05a1ed87902273cb675/ages_for_issue.txt",
header = TRUE,
stringsAsFactors = FALSE
)
str(ages)
#> 'data.frame': 176 obs. of 2 variables:
#> $ V1: chr "euphyllophyte" "seedplants" "angiosperm" "nym2ast" ...
#> $ V2: int 400 325 179 171 165 161 147 137 127 121 ...
spp <- read.table(
"https://gist.githubusercontent.com/kguidonimartins/47fe769de6ba0d194157afd8e52c3bb7/raw/c9eb1072c10916ae6781a5a346901d82899e6bb6/species_for_issue.txt",
header = TRUE,
stringsAsFactors = FALSE
)
str(spp)
#> 'data.frame': 182 obs. of 1 variable:
#> $ spp_names: chr "Acer campestre" "Acer negundo" "Acer pseudoplatanus" "Acer rubrum" ...
phylomatic_tree <- brranching::phylomatic(taxa = spp$spp_names, storedtree = "R20120829", outformat = "newick")
#> NOTE: 1 taxa not matched: NA/cynodon/cynodon_dactylon, ];
ape::write.tree(phylomatic_tree, "phylomatic_tree")
phylomatic_tree <- ape::read.tree("phylomatic_tree")
class(phylomatic_tree)
#> [1] "phylo"
phylocomr::ph_bladj(ages = ages, phylo = phylomatic_tree)
#> [1] "((((pinus_sylvestris:81.250000,pinus_taeda:81.250000,pinus_banksiana:81.250000,pinus_pinaster:81.250000,pinus_resinosa:81.250000,pinus_strobus:81.250000)pinus:81.250000,pseudotsuga_menziesii:162.500000,(picea_abies:81.250000,picea_mariana:81.250000)picea:81.250000)pinaceae:81.250000,juniperus_communis:243.750000)pinales:81.250000,((((((((euonymus_europaeus:113.642426,(sapium_glandulosum:81.000000,((calophyllum_longifolium:27.000000,hypericum_perforatum:27.000000):27.000000,garcinia_madruno:54.000000):27.000000,(populus_nigra:40.500000,populus_tremuloides:40.500000)populus:40.500000)malpighiales:32.642426)celastrales_to_malpighiales:32.642426,((((fagus_grandifolia:34.000000,(quercus_alba:17.000000,quercus_robur:17.000000,quercus_rubra:17.000000)quercus:17.000000)fagaceae:32.714142,(((betula_papyrifera:16.678535,betula_populifolia:16.678535,betula_alleghaniensis:16.678535,betula_pendula:16.678535)betula:16.678535,(alnus_glutinosa:16.678535,alnus_incana:16.678535):16.678535)betuloideae:16.678535,((carpinus_betulus:16.678535,carpinus_caroliniana:16.678535)carpinus:16.678535,corylus_avellana:33.357071)coryloideae:16.678535):16.678535):32.714142,((((prunus_spinosa:15.666667,prunus_virginiana:15.666667,prunus_avium:15.666667,prunus_emarginata:15.666667,prunus_serotina:15.666667)prunus:15.666667,(sorbus_aucuparia:15.666667,crataegus_monogyna:15.666667)pyrinae:15.666667):15.666667,sanguisorba_minor:47.000000,geum_urbanum:47.000000,filipendula_vulgaris:47.000000,(potentilla_argentea:23.500000,potentilla_intermedia:23.500000)potentilla:23.500000,fragaria_vesca:47.000000,rosa_canina:47.000000,rubus_idaeus:47.000000)rosaceae:29.000000,(((trema_micrantha:19.000000,urtica_dioica:19.000000):19.000000,ulmus_americana:38.000000):19.000000,rhamnus_cathartica:57.000000):19.000000)rosales:23.428284):23.428284,(((((((trifolium_dubium:8.000000,trifolium_hirtum:8.000000,trifolium_hybridum:8.000000,trifolium_incarnatum:8.000000,trifolium_pratense:8.000000,trifolium_repens:8.000000)trifolium:8.000000,lathyrus_pratensis:16.000000):8.000000,((medicago_lupulina:8.000000,medicago_minima:8.000000,medicago_polymorpha:8.000000,medicago_sativa:8.000000)medicago:8.000000,melilotus_officinalis:16.000000):8.000000):8.000000,astragalus_glycyphyllos:32.000000):8.000000,(robinia_pseudoacacia:20.000000,lotus_corniculatus:20.000000):20.000000):8.000000,ulex_europaeus:48.000000):8.000000,vicia_sativa:56.000000,cercis_canadensis:56.000000)fabaceae:66.856567):23.428284):32.642426,(((spondias_mombin:82.809090,((acer_campestre:27.603029,acer_negundo:27.603029,acer_pseudoplatanus:27.603029,acer_rubrum:27.603029,acer_saccharum:27.603029)acer:27.603029,cedrela_odorata:55.206059):27.603031):27.603027,(((alyssum_alyssoides:24.000000,(brassica_oleracea:12.000000,brassica_rapa:12.000000)brassica:12.000000,arabis_glabra:24.000000,(lepidium_campestre:12.000000,lepidium_virginicum:12.000000)lepidium:12.000000,sinapis_arvensis:24.000000,descurainia_sophia:24.000000)brassicaceae:24.103027,reseda_luteola:48.103027):24.103027,(tilia_americana:34.000000,ceiba_pentandra:34.000000)malvaceae:38.206055)malvales_to_brassicales:38.206062):38.206062,((terminalia_amazonia:88.000000,(epilobium_angustifolium:44.000000,epilobium_ciliatum:44.000000)epilobium:44.000000)myrtales:30.309090,geranium_dissectum:118.309090):30.309090)malvids:30.309097):30.309082,liquidambar_styraciflua:209.236359):30.309097,(((((((((plantago_lanceolata:45.212124,(veronica_arvensis:22.606062,veronica_beccabunga:22.606062,veronica_chamaedrys:22.606062,veronica_officinalis:22.606062,veronica_persica:22.606062)veronica:22.606062)plantaginaceae:22.606060,((spathodea_campanulata:38.000000,tabebuia_heterophylla:38.000000,tecoma_stans:38.000000,jacaranda_copaia:38.000000)bignoniaceae:14.909092,(mimulus_guttatus:39.681820,((salvia_pratensis:13.227273,thymus_vulgaris:13.227273):13.227273,prunella_vulgaris:26.454546):13.227274):13.227272):14.909092):14.909088,(fraxinus_americana:41.363636,fraxinus_excelsior:41.363636)fraxinus:41.363636):14.909096,(solanum_dulcamara:48.818184,capsicum_annuum:48.818184):48.818184):14.909088,((galium_album:35.500000,galium_aparine:35.500000,galium_mollugo:35.500000,galium_verum:35.500000)galium:35.500000,asclepias_syriaca:71.000000)gentianales:41.545456,cordia_alliodora:112.545456):41.545456,(((((sambucus_nigra:57.000000,viburnum_lantana:57.000000)adoxaceae:24.000000,symphoricarpos_albus:81.000000)dipsacales:15.181816,(heracleum_sphondylium:33.000000,daucus_carota:33.000000,foeniculum_vulgare:33.000000)apiaceae:63.181816):15.181816,(((((helianthus_annuus:22.000000,((solidago_canadensis:7.333333,conyza_canadensis:7.333333):7.333333,achillea_millefolium:14.666667):7.333333):7.333334,(leontodon_hispidus:14.666667,sonchus_oleraceus:14.666667):14.666667):7.333334,(((centaurea_scabiosa:9.166667,centaurea_solstitialis:9.166667,centaurea_jacea:9.166667)centaurea:9.166667,cirsium_arvense:18.333334):9.166666,carlina_vulgaris:27.500000):9.166668):7.333333,lactuca_serriola:44.000000,(senecio_sylvaticus:22.000000,senecio_vulgaris:22.000000)senecio:22.000000)asteraceae:46.000000,(campanula_medium:45.000000,campanula_rapunculoides:45.000000)campanula:45.000000)asterales:21.363632):21.363632,ilex_aquifolium:132.727264)campanulids:21.363647):21.363632,(anagallis_arvensis:87.727272,calluna_vulgaris:87.727272):87.727272)ericales_to_asterales:21.363632,(cornus_florida:98.409088,cornus_sanguinea:98.409088)cornus:98.409088)asterids:21.363647,(((rumex_acetosella:14.000000,rumex_crispus:14.000000,rumex_obtusifolius:14.000000,rumex_acetosa:14.000000)rumex:14.000000,persicaria_maculosa:28.000000,polygonum_aviculare:28.000000)polygonaceae:56.000000,((stellaria_media:34.333332,holosteum_umbellatum:34.333332,(cerastium_arvense:17.166666,cerastium_fontanum:17.166666,cerastium_glomeratum:17.166666,cerastium_tomentosum:17.166666)cerastium:17.166666,(silene_nutans:17.166666,silene_vulgaris:17.166666)silene:17.166666)caryophyllaceae:17.166668,(amaranthus_retroflexus:19.000000,(chenopodium_album:9.500000,chenopodium_rubrum:9.500000,chenopodium_vulvaria:9.500000)chenopodium:9.500000)amaranthaceae:32.500000):32.500000)caryophyllales:134.181824):21.363632):21.363632,(((ranunculus_acris:65.000000,helleborus_foetidus:65.000000)ranunculaceae:65.303040,berberis_vulgaris:130.303040):65.303024,papaver_rhoeas:195.606064):65.303024)eudicots:21.363617,((poa_pratensis:12.000000,(festuca_pratensis:6.000000,festuca_rubra:6.000000)festuca:6.000000,(zea_mays:9.000000,((bromus_hordeaceus:3.000000,bromus_tectorum:3.000000)bromus:3.000000,avena_barbata:6.000000):3.000000):3.000000,anthoxanthum_odoratum:12.000000,hordeum_murinum:12.000000,cynosurus_cristatus:12.000000,dactylis_glomerata:12.000000,phleum_pratense:12.000000,deschampsia_cespitosa:12.000000,alopecurus_pratensis:12.000000,arrhenatherum_elatius:12.000000,koeleria_macrantha:12.000000)poaceae:135.136353,synechanthus_warscewiczianus:147.136353)commelinids:135.136353)poales_to_asterales:21.363647,liriodendron_tulipifera:303.636353)magnoliales_to_asterales:21.363636)seedplants:1.000000;\n"
#> attr(,"ages_file")
#> [1] "/tmp/RtmpD8C8mZ/ages"
#> attr(,"phylo_file")
#> [1] "/tmp/RtmpD8C8mZ/phylo_6c90799289c1"
Created on 2019-11-11 by the reprex package (v0.3.0)
okay, so this is solved for you now? or no?
Yup! Thanks
On Mon, Nov 11, 2019, 17:09 Scott Chamberlain notifications@github.com wrote:
okay, so this is solved for you now? or no?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/phylocomr/issues/25?email_source=notifications&email_token=AB6JBVWYEON2URXUXJONJA3QTG3WFA5CNFSM4JJ3VA2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDX63VY#issuecomment-552594903, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JBVVPRD2SGGIR3YSJZITQTG3WFANCNFSM4JJ3VA2A .
Hi Scott, thanks for your work on
{phylocomr}
and{brranching}
. These packages are amazing!I have some trouble using
phylocomr::ph_bladj
. Specificaly: "Segmentation fault"I filled this issue with the data I have using. Can you help with this?
Created on 2019-11-06 by the reprex package (v0.3.0)
Session info
``` r devtools::session_info() #> ─ Session info ────────────────────────────────────────────────────────── #> setting value #> version R version 3.6.1 (2019-07-05) #> os Ubuntu 16.04.6 LTS #> system x86_64, linux-gnu #> ui X11 #> language en_US #> collate en_US.UTF-8 #> ctype pt_BR.UTF-8 #> tz America/Sao_Paulo #> date 2019-11-06 #> #> ─ Packages ────────────────────────────────────────────────────────────── #> package * version date lib source #> animation 2.6 2018-12-11 [1] CRAN (R 3.6.1) #> ape * 5.3 2019-03-17 [1] CRAN (R 3.6.1) #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.1) #> backports 1.1.5 2019-10-02 [1] CRAN (R 3.6.1) #> bold 0.9.0 2019-06-27 [1] CRAN (R 3.6.1) #> brranching * 0.5.0 2019-07-27 [1] CRAN (R 3.6.1) #> callr 3.3.2 2019-09-22 [1] CRAN (R 3.6.1) #> cli 1.1.0 2019-03-19 [1] CRAN (R 3.6.1) #> clusterGeneration 1.3.4 2015-02-18 [1] CRAN (R 3.6.1) #> coda 0.19-3 2019-07-05 [1] CRAN (R 3.6.1) #> codetools 0.2-16 2018-12-24 [4] CRAN (R 3.5.2) #> combinat 0.0-8 2012-10-29 [1] CRAN (R 3.6.1) #> conditionz 0.1.0 2019-04-24 [1] CRAN (R 3.6.1) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.1) #> crul 0.8.4 2019-08-02 [1] CRAN (R 3.6.1) #> curl 4.2 2019-09-24 [1] CRAN (R 3.6.1) #> data.table 1.12.4 2019-10-03 [1] CRAN (R 3.6.1) #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.1) #> devtools 2.2.1 2019-09-24 [1] CRAN (R 3.6.1) #> digest 0.6.22 2019-10-21 [1] CRAN (R 3.6.1) #> ellipsis 0.3.0 2019-09-20 [1] CRAN (R 3.6.1) #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.1) #> expm 0.999-4 2019-03-21 [1] CRAN (R 3.6.1) #> fastmatch 1.1-0 2017-01-28 [1] CRAN (R 3.6.1) #> foreach 1.4.7 2019-07-27 [1] CRAN (R 3.6.1) #> fs 1.3.1 2019-05-06 [1] CRAN (R 3.6.1) #> glue 1.3.1 2019-03-12 [1] CRAN (R 3.6.1) #> gtools 3.8.1 2018-06-26 [1] CRAN (R 3.6.1) #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.1) #> htmltools 0.4.0 2019-10-04 [1] CRAN (R 3.6.1) #> httpcode 0.2.0 2016-11-14 [1] CRAN (R 3.6.1) #> igraph 1.2.4.1 2019-04-22 [1] CRAN (R 3.6.1) #> iterators 1.0.12 2019-07-26 [1] CRAN (R 3.6.1) #> jsonlite 1.6 2018-12-07 [1] CRAN (R 3.6.1) #> knitr 1.25 2019-09-18 [1] CRAN (R 3.6.1) #> lattice 0.20-38 2018-11-04 [4] CRAN (R 3.5.1) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.1) #> maps 3.3.0 2018-04-03 [1] CRAN (R 3.6.1) #> MASS 7.3-51.4 2019-04-26 [4] CRAN (R 3.6.1) #> Matrix 1.2-17 2019-03-22 [4] CRAN (R 3.6.1) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.1) #> mnormt 1.5-5 2016-10-15 [1] CRAN (R 3.6.1) #> nlme 3.1-141 2019-08-01 [4] CRAN (R 3.6.1) #> numDeriv 2016.8-1.1 2019-06-06 [1] CRAN (R 3.6.1) #> phangorn 2.5.5 2019-06-19 [1] CRAN (R 3.6.1) #> phylocomr * 0.1.4 2019-07-24 [1] CRAN (R 3.6.1) #> phytools 0.6-99 2019-06-18 [1] CRAN (R 3.6.1) #> pkgbuild 1.0.6 2019-10-09 [1] CRAN (R 3.6.1) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.1) #> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.6.1) #> plotrix 3.7-6 2019-06-21 [1] CRAN (R 3.6.1) #> plyr 1.8.4 2016-06-08 [1] CRAN (R 3.6.1) #> prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.6.1) #> processx 3.4.1 2019-07-18 [1] CRAN (R 3.6.1) #> ps 1.3.0 2018-12-21 [1] CRAN (R 3.6.1) #> quadprog 1.5-7 2019-05-06 [1] CRAN (R 3.6.1) #> R6 2.4.0 2019-02-14 [1] CRAN (R 3.6.1) #> Rcpp 1.0.2 2019-07-25 [1] CRAN (R 3.6.1) #> remotes 2.1.0 2019-06-24 [1] CRAN (R 3.6.1) #> reshape 0.8.8 2018-10-23 [1] CRAN (R 3.6.1) #> reshape2 1.4.3 2017-12-11 [1] CRAN (R 3.6.1) #> rlang 0.4.1 2019-10-24 [1] CRAN (R 3.6.1) #> rmarkdown 1.16 2019-10-01 [1] CRAN (R 3.6.1) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.1) #> scatterplot3d 0.3-41 2018-03-14 [1] CRAN (R 3.6.1) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.1) #> stringi 1.4.3 2019-03-12 [1] CRAN (R 3.6.1) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.1) #> sys 3.3 2019-08-21 [1] CRAN (R 3.6.1) #> taxize 0.9.9 2019-10-17 [1] CRAN (R 3.6.1) #> testthat 2.3.0 2019-11-05 [1] CRAN (R 3.6.1) #> triebeard 0.3.0 2016-08-04 [1] CRAN (R 3.6.1) #> urltools 1.7.3 2019-04-14 [1] CRAN (R 3.6.1) #> usethis 1.5.1 2019-07-04 [1] CRAN (R 3.6.1) #> uuid 0.1-2 2015-07-28 [1] CRAN (R 3.6.1) #> withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.1) #> xfun 0.10 2019-10-01 [1] CRAN (R 3.6.1) #> xml2 1.2.2 2019-08-09 [1] CRAN (R 3.6.1) #> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.1) #> zoo 1.8-6 2019-05-28 [1] CRAN (R 3.6.1) #> #> [1] /home/karlo/R/x86_64-pc-linux-gnu-library/3.6 #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library ```