Skip to content

Text dump of individuals table does not include parents column #1828

@hyanwong

Description

@hyanwong

The text output of the individuals table does not include the new parent column, i.e. ts.dump_text(individuals=XXX) does not dump parents:

import io
import tskit
import sys

individuals = """\
flags       location     parents
0           0.5,1.2      -1,-1
0           1.0,3.4      0,-1
0           3.5,6.3      0,1
0           0.5          -1,-1
0           0.5,0.5      2,3
"""

nodes = """\
is_sample   individual   time
1           0            0.0
1           0            0.0
0           -1           2.0
0           -1           3.0
"""
edges = """\
left   right   parent  child
0.0    7.0     2       0
0.0    7.0     2       1
7.0    10.0    3       0
7.0    10.0    3       1
"""

ts = tskit.load_text(
    individuals=io.StringIO(individuals),
    nodes=io.StringIO(nodes),
    edges=io.StringIO(edges),
    strict=False
)

ts.dump_text(individuals=sys.stdout)  # no parent column

Metadata

Metadata

Assignees

No one assigned

    Labels

    Python APIIssue is about the Python APIbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions