Skip to content

edmondac/teiphy

 
 

Repository files navigation

license badge testing badge coverage badge docs badge black badge git3moji badge iqtree badge raxml badge mrbayes badge stemma badge joss badge

A Python package for converting TEI XML collations to NEXUS and other formats.

Textual scholars have been using phylogenetics to analyze manuscript traditions since the early 1990s. Many standard phylogenetic software packages accept as input the NEXUS file format. The teiphy program takes a collation of texts encoded using the Text Encoding Initiative (TEI) guidelines and converts it to a NEXUS format so that it can be used for phylogenetic analysis. It can also convert to other formats as well.

Installation

The software can be installed using pip:

pip install teiphy

Alternatively, you can install the package by cloning this repository and installing it with poetry:

git clone https://github.com/jjmccollum/teiphy.git
cd teiphy
poetry install

Once the package is installed, you can run all unit tests via the command

poetry run pytest

Usage

To use the software, run the teiphy command line tool:

teiphy <input TEI XML> <output file>

teiphy can export to NEXUS, Hennig86 (TNT), PHYLIP (in the relaxed form used by RAxML), FASTA, CSV, TSV, Excel and STEMMA formats. teiphy will try to infer the file format to export to from the extension of the output file. Accepted file extensions are: ".nex", ".nexus", ".nxs", ".ph", ".phy", ".fa", ".fasta", ".tnt", ".csv", ".tsv", ".xlsx".

To explicitly say which format you wish to export to, use the --format option. For example:

teiphy <input TEI XML> <output file> --format nexus

For more information about the other options, see the help with:

teiphy --help

Or see the documentation with explanations about advanced usage.

The software can also be used in Python directly. See API Reference in the documentation for more information.

Credits

teiphy was designed by Joey McCollum (Australian Catholic University) and Robert Turnbull (University of Melbourne). We received additional help from Stephen C. Carlson (Australian Catholic University).

If you use this software, please cite the forthcoming paper.

About

A Python package for converting TEI XML collations to NEXUS and other formats

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.8%
  • Shell 0.2%