{"id":19644855,"url":"https://github.com/uscbiostats/rphyloxml","last_synced_at":"2026-06-15T05:33:08.855Z","repository":{"id":93430424,"uuid":"114052241","full_name":"USCbiostats/rphyloxml","owner":"USCbiostats","description":"Read and write phyloXML files in R","archived":false,"fork":false,"pushed_at":"2020-10-26T20:25:49.000Z","size":295,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-05-31T12:11:53.512Z","etag":null,"topics":["phylogenetics","phyloxml","r","rpackage","xml"],"latest_commit_sha":null,"homepage":"https://uscbiostats.github.io/rphyloxml/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/USCbiostats.png","metadata":{"files":{"readme":"README.Rmd","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-13T00:05:17.000Z","updated_at":"2020-10-26T20:25:52.000Z","dependencies_parsed_at":"2023-03-13T01:52:30.166Z","dependency_job_id":null,"html_url":"https://github.com/USCbiostats/rphyloxml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/USCbiostats/rphyloxml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCbiostats%2Frphyloxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCbiostats%2Frphyloxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCbiostats%2Frphyloxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCbiostats%2Frphyloxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USCbiostats","download_url":"https://codeload.github.com/USCbiostats/rphyloxml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USCbiostats%2Frphyloxml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34349925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phylogenetics","phyloxml","r","rpackage","xml"],"created_at":"2024-11-11T14:30:21.201Z","updated_at":"2026-06-15T05:33:08.836Z","avatar_url":"https://github.com/USCbiostats.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n[![Travis build status](https://travis-ci.org/USCbiostats/rphyloxml.svg?branch=master)](https://travis-ci.org/USCbiostats/rphyloxml) \n[![Build status](https://ci.appveyor.com/api/projects/status/3pp6ue80rcaj4py5/branch/master?svg=true)](https://ci.appveyor.com/project/gvegayon/rphyloxml/branch/master) \n[![Coverage status](https://codecov.io/gh/USCBiostats/rphyloxml/branch/master/graph/badge.svg)](https://codecov.io/github/USCBiostats/rphyloxml?branch=master)\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n# rphyloxml\n\nrphyloxml provides access to the [phyloXML](http://www.phyloxml.org) file format. For now, the only functions that are implemented in the package are:\n\n- `write_phyloxml`: A method to coerce `phylo` objects from the `ape` package as phyloXML (XML) documents.\n- `read_phyloxml`: A method to read phyloXML documents into R. It returns a data frame with the structure of the tree and a nested list with each nodes' annotations.\n- `validate_phyloxml`: A wrapper of `xml2::xml_validate`, which allows validating a phyloXML doc using the phyloxml.xsd schema (see [here](http://www.phyloxml.org/1.20/phyloxml.xsd))\n\nThis package has been motivated to be used with the javascript library [jsPhyloSVG](http://www.jsphylosvg.org), for which we are currently developing an R package with the same name that provides an htmlwidget [here](https://uscbiostats.github.com/jsPhyloSVG).\n\n## Installation\n\nYou can install rphyloxml from github with:\n\n```{r gh-installation, eval = FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"USCBiostats/rphyloxml\")\n```\n\n## Writing phyloXML files\n\nIn the following example, we create a random tree using the rtree function from the ape package, and later on coerce it into a phyloXML document using `write_phyloxml`.\n\n```{r random-tree}\nlibrary(ape)\nlibrary(rphyloxml)\nset.seed(12)\n\nx \u003c- rtree(3)\nx\n```\n\n```{r coercion}\nz \u003c- write_phyloxml(x)\nz\n```\n\nYou can get a \"nicer\" view of it by doing the following:\n\n```{r nice}\ncat(as.character(z))\n```\n\nAnd to store the document, you just need to use `xml2` (which is what powers the package) as follows:\n\n```r\nxml2::write_xml(z, \"mynicetree.xml\")\n```\n\n\n## Reading XML files\n\nWe will read the file [amphibian_tree_of_life_Frost_DR_2006.xml](http://www.phyloxml.org/examples/amphibian_tree_of_life_Frost_DR_2006.xml) available in both the package and the phyloxml website.\n\n```{r example-read}\n# Reading from the package files\nfn \u003c- system.file(\"phyloxml/amphibian_tree_of_life_Frost_DR_2006.xml\", package=\"rphyloxml\")\nxmltree \u003c- read_phyloxml(fn)\n\nstr(xmltree, 4)\n```\n\n\n\n```{r example-read-coerce}\n# We can coerce this into a mulitphylo list\n(apetree \u003c- phyloxml2phylo(xmltree))[[1]]\n```\n\n```{r example-plot-read}\nplot(apetree, cex=.25)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuscbiostats%2Frphyloxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuscbiostats%2Frphyloxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuscbiostats%2Frphyloxml/lists"}