clld / glottolog3

glottolog2 re-implemented as CLLD app
MIT License
110 stars 27 forks source link

any clues why the newick format from pyglottolog doesn't read well into R? #101

Closed HedvigS closed 5 years ago

HedvigS commented 5 years ago

Does anyone have any ideas as to why I'm getting two different results when reading in these two Glottolog newick files into R:

  1. tree_glottolog_newick.txt -file
  2. a file I created by saving the output from runningglottolog newick ural1272

The first one reads in just fine with ape::read.tree(), but the second reads in as entirely empty. No error messages though, it's just that the variable is NULL.

I'm trying to teach myself to use pyglottolog, with help from @chrzyki . I thought I'd just render a newick file and see how it goes, just as a simple practice example. I can't really understand why this isn't working. Are there different dialects of newick/new hampshire tree formatting employed? Am I doing something else wrong?

I know that you're not responsible for the ape package in R, naturally. But, if anyone has any clues to what would be different about these two files I'd be very grateful.

xrotwang commented 5 years ago

Does the latter tree end with semicolon?

Hedvig Skirgård notifications@github.com schrieb am Fr., 5. Okt. 2018, 12:08:

Does anyone have any ideas as to why I'm getting two different results when reading in these two Glottolog newick files into R:

  1. tree_glottolog_newick.txt https://cdstar.shh.mpg.de/bitstreams/EAEA0-E7DE-FA06-8817-0/tree_glottolog_newick.txt -file
  2. a file I created by saving the output from runningglottolog newick ural1272

The first one reads in just fine with ape::read.tree() https://www.rdocumentation.org/packages/ape/versions/5.2/topics/read.tree, but the second reads in as entirely empty. No error messages though, it's just that the variable is NULL.

I'm trying to teach myself to use pyglottolog, with help from @chrzyki https://github.com/chrzyki . I thought I'd just render a newick file and see how it goes, just as a simple practice example. I can't really understand why this isn't working. Are there different dialects of newick/new hampshire tree formatting employed? Am I doing something else wrong?

I know that you're not responsible for the ape package in R, naturally. But, if anyone has any clues to what would be different about these two files I'd be very grateful.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clld/glottolog3/issues/101, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1HKAxj7nXaNa1ELY0sDQpF8jIEFJ3_ks5uhy9_gaJpZM4XJ7si .

SimonGreenhill commented 5 years ago

I think it's this problem

SimonGreenhill commented 5 years ago

Actually, no, it's just the semi-colon :)

xrotwang commented 5 years ago

So, all good? If not, that should have been an issue in clld/glottolog anyway 😉

Simon J Greenhill notifications@github.com schrieb am Fr., 5. Okt. 2018, 13:00:

Actually, no, it's just the semi-colon :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/clld/glottolog3/issues/101#issuecomment-427326081, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1HKGvnCi5ofW1GLfHiK_ItzAVOq57yks5uhzvkgaJpZM4XJ7si .

HedvigS commented 5 years ago

Aha, it does not! Added one, and now it reads in just fine. Thanks @xrotwang

What's the reason it wasn't there before?

HedvigS commented 5 years ago

Should I expect to have to add one in each time, or will something else change?

SimonGreenhill commented 5 years ago

every time.

HedvigS commented 5 years ago

Right, okay. I'll just do a pipe where I read it in as a text file, add a semi-colon and then read it in as a tree with ape. Or just read in this file or the d-place versions. I guess that since the parentheses must balance, the semi-colon is technically superfluous. But, it's still the expected format.

The pyglottolog tools (besides newick), I think, are meant for a user group that isn't me. Now that I understand this one, I think that's basically it for me when it comes to pyglottolog.

HedvigS commented 2 years ago

The trees in newick format that are downloadable from the website still lack a semicolon at the end.

Example: https://glottolog.org/resource/languoid/id/mixt1422.newick.txt

HedvigS commented 2 years ago

If this is the set-up continusly, maybe it can be described somewhere? Others are having the same issue.

xrotwang commented 2 years ago

fixed now

HedvigS commented 2 years ago

Thanks