jjmccollum / teiphy

A Python package for converting TEI XML collations to NEXUS, BEAST 2.7 XML, and other formats
MIT License
11 stars 3 forks source link

Add `--long-table` option for tabular output #58

Closed jjmccollum closed 1 year ago

jjmccollum commented 1 year ago

Per the latest comments on https://github.com/openjournals/joss-reviews/issues/4879, it would be convenient to add a --long-table option for generating tabular output formats (NumPy, Pandas DataFrame, CSV, TSV, Excel) not in state frequency form, but in the form of a long table of value tuples, as follows:

Taxon,Character,State,Value
UBS,B10K1V1U24-26,0,εν εφεσω
P46,B10K1V1U24-26,1,om.
01,B10K1V1U24-26,1,om.
02,B10K1V1U24-26,0,εν εφεσω
03,B10K1V1U24-26,1,om.
04,B10K1V1U24-26,?,
UBS,B10K1V6U22-26,0,εν τω ηγαπημενω
P46,B10K1V6U22-26,0,εν τω ηγαπημενω
01,B10K1V6U22-26,0,εν τω ηγαπημενω
02,B10K1V6U22-26,0,εν τω ηγαπημενω
03,B10K1V6U22-26,0,εν τω ηγαπημενω
04,B10K1V6U22-26,1,εν τω ηγαπημενω υιω αυτου

This change should be made on the code-revision branch.