Skip to content
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

Nexus: taxa and format #11

Open
PhyloStar opened this issue Jan 4, 2018 · 5 comments
Open

Nexus: taxa and format #11

PhyloStar opened this issue Jan 4, 2018 · 5 comments

Comments

@PhyloStar
Copy link
Owner

When LingPy generates a nexus files, some of the language names have characters such as space, parantheses where MrBayes complains. Another format is the length of the name field in the nexus file. You might want to consider to have a tab separated line such as:
GERMAN\t010101

@LinguList
Copy link
Collaborator

there's a better way for nexus output, but there's a bug for mrbayes, so you'll need to look into that or manually refine (or just ignore mrbayes commands):

In general, I recommend changing language names in the data.

@PhyloStar
Copy link
Owner Author

Okay. I prefer glottolog codes or ASJP style names. Or the length of the name field to be fixed like 40 characters something like PHYLIP is also fine.

@LinguList
Copy link
Collaborator

In fact, I checked, and when using lingpy.convert.strings.pap2nex instead of the simple output, we can add the taxa:

>>> wl = Wordlist('example.tsv')
>>> from lingpy.convert.strings import pap2nex
>>> taxa = [myglottoconverter[t] for t in wl.taxa]
>>> paps = wl.get_paps(ref='cogid/infomapid/whatever', missing="?")
>>> pap2nex(taxa, paps, filename="outputfile")

@LinguList
Copy link
Collaborator

This is the same as wl.output(*) but you can specify the language names.

@PhyloStar
Copy link
Owner Author

Okay. This is great. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants