-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with read.nexus.data and write.nexus.data #42
Comments
How useful is phylobase's readNexus()? |
Phylobase uses NCL for that. This is great on the one hand (using a known reference parser implementation rather than reinventing one), but getting NCL to compile and the package to link to is has been a repeated source of trouble, so I'm hesitant about recommending it. |
@rvosa Thanks for reminding me about the phylobase version, certainly sounds like a promising alternative for R users to extract character data. As @hlapp says, we didn't want to introduce a hard dependency on phylobase since it occasionally disappears from CRAN due to complications from the NCL, but in this context we could add it to our SUGGESTS or ENHANCES list instead and merely point to it as a way R users can extract character data in the nexus format. Unfortunately I haven't had any luck parsing my example nexus character file that a I downloaded from the MorphoBank repo. Though this is not really an RNeXML issue, I thought showing the serializing of character data from MorphoBank into NeXML might be a good example. |
By the way, you could also pipe the nexus through the nexus2nexml web On Tue, Nov 26, 2013 at 12:48 AM, Carl Boettiger
Dr. Rutger A. Vos |
@rvosa That's a great idea. Um, can you point me to the nexus2nexml web service endpoint and documentation? Not seeing a link to it on the nexml.org homepage... |
@hlapp Thanks for the heads up. I don't think this is a core function RNeXML, as we're obviously focused on the nexml side and there are already the two nexus parsers available for R already; it's just a pity that they aren't as robust as one might hope (but that's part of the motivation for nexml after all). I guess we can just point users to phylobase::readNexus() for reading in nexus character data. As far as I can tell, ape::read.nexus is the popular solution for reading in nexus phylogenies in R, which we can then write out to nexml. As I've speculated in #44, I think most R users read in comparative trait data from csv/excel formats instead of nexus anyway, so I don't see this as getting heavy use. |
You can POST a file to http://nexml.org/nexml/phylows/nex2xml (parameter Dr. Rutger A. Vos |
Cool that seems to work, but it doesn't seem to be able to parse this morphobank nexus file: https://github.com/ropensci/RNeXML/blob/master/inst/examples/mbank_X962_11-22-2013_1534.nex probably something weird with the file since none of the parsers can do anything with it. |
Yup, it's probably the way the charlabels/statelabels construct is used. Dr. Rutger A. Vos |
phylobase hasn't been booted off CRAN for quite some time now, and developers have responded fairly quickly (at least compared to many phylogenetics CRAN packages) in the past when it has been booted. That said, C++ code in R (the NCL) does introduce another point of failure, with the benefit being NCL's flexible Nexus handling. I'd personally go with phylobase for reading nexus files rather than creating another parser. |
Might imagine a user would want to extract character data that comes in nexus format (used by http://www.morphobank.org/, for instance) into NeXML.
Unfortunately, though ape provides
read.nexus.data
, the function is extraordinarily limited. For instance, it cannot handle spaces in species names or sequences, and appears to return only a list of elements named by taxa without any metadata about the traits themselves, at least in reading in my hand-edited nexus matrix from morpho. read.nexus.data also fails to read in (after a minute of cpu effort) even the example nexus file produced by ape's ownwrite.nexus.data
...Guessing these ape functions are not widely used. Perhaps there's a better alternative pipeline for getting the nexus data into NeXML that we can wrap?
The text was updated successfully, but these errors were encountered: