Skip to main content

nexusmaker - Nexus file maker for language phylogenies

Project description

NexusMaker

Simply Generate Nexus Files

from nexusmaker import NexusMaker, Record


data = [
    Record(Language="A", Word="eye", Item="", Cognate="1"),
    Record(Language="A", Word="leg", Item="", Cognate="1"),
    Record(Language="A", Word="arm", Item="", Cognate="1"),
    
    Record(Language="B", Word="eye", Item="", Cognate="1"),
    Record(Language="B", Word="leg", Item="", Cognate="2"),
    Record(Language="B", Word="arm", Item="", Cognate="2"),
    
    Record(Language="C", Word="eye", Item="", Cognate="1"),
    # No ReCord for C 'leg'
    Record(Language="C", Word="arm", Item="", Cognate="3"),

    Record(Language="D", Word="eye", Item="", Cognate="1", loan=True),
    Record(Language="D", Word="leg", Item="", Cognate="1"),
    Record(Language="D", Word="leg", Item="", Cognate="2"),
    Record(Language="D", Word="arm", Item="", Cognate="2,3"),
]

maker = NexusMaker(data)

maker = NexusMakerAscertained(data)  # adds Ascertainment bias character

maker = NexusMakerAscertainedWords(data)  # adds Ascertainment character per word
nex = maker.make()
maker.write(nex, filename="output.nex")


Version History:

  • 2.0.4: add unique_ids parameter
  • 2.0.3: handle CLDF datasets
  • 2.0.2: add tool to filter combining cognates
  • 2.0.1: minor bugfixes.
  • 2.0: major refactor of testing and other components.
  • 1.5: do more validation of cognate sets to detect possibly broken combined cognate sets.
  • 1.4: normalise order of cognates (i.e. so 1,54 == 54,1).
  • 1.3: handle cognates of form '1a'.
  • 1.2: initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexusmaker-2.0.5.tar.gz (20.0 kB view hashes)

Uploaded Source

Built Distribution

nexusmaker-2.0.5-py2.py3-none-any.whl (25.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page