Skip to content

I'm getting a LibraryError talking about "non-empty metadata" when processing tree sequences e.g. from Relate #3061

Answered by hyanwong
hyanwong asked this question in Q&A
Discussion options

You must be logged in to vote

Some software, such as Relate, adds metadata to the edges of tree sequence. If you don't need this metadata, the easiest thing is to remove it. As of tskit 0.6.0 and higher, the easiest way is to use the drop_metadata method:

ts = tskit.load("relate_ts.trees")
tables = ts.dump_tables()
tables.edges.drop_metadata()
ts = tables.tree_sequence()
# Do whatever you want with the new `ts`
ts.simplify(range(10))

Replies: 1 comment

Comment options

hyanwong
Nov 21, 2024
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by hyanwong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant