zlib_compression

13 views
Skip to first unread message

Raman Lawal

unread,
Nov 30, 2020, 12:20:50 PM11/30/20
to msprime-users
Hello,

I am using the command-line option of the msprime to run some simulation but was getting some error. Please do note that i installed it through conda

I ran the below command 
where 6 is the sample size and 
treeoutput is the output file to which the tree will be stored.

<msp simulate -N 1000 6 treeoutput>

It returned the below error 

"TypeError: dump() got an unexpected keyword argument 'zlib_compression'"

I found that there is likely an update to this issue in GitHub (https://github.com/tskit-dev/msprime) but there is no instruction on how to install the program from Github, perhaps I could try GitHub version.

I will appreciate any help to solve this issue. Please do also note that I have ensured the Zlib is installed from conda.

Lawal

Jerome Kelleher

unread,
Dec 1, 2020, 10:50:33 AM12/1/20
to msprim...@googlegroups.com
Hi Lawal,

This is a bug introduced in the most recent release of tskit - we'll fix
it and push out a release ASAP.

https://github.com/tskit-dev/tskit/issues/1067

Thanks for the report!

Cheers,
Jerome
> --
> You received this message because you are subscribed to the Google
> Groups "msprime-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to msprime-user...@googlegroups.com
> <mailto:msprime-user...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/msprime-users/59ddbd89-abe3-4946-b4f6-901801134dcan%40googlegroups.com
> <https://groups.google.com/d/msgid/msprime-users/59ddbd89-abe3-4946-b4f6-901801134dcan%40googlegroups.com?utm_medium=email&utm_source=footer>.

Akinyanju Lawal

unread,
Dec 1, 2020, 10:56:53 AM12/1/20
to Jerome Kelleher, msprim...@googlegroups.com
Dear Jerome,

Thank you very much for your response. Is there a quick work-around with the fix as I am attending to a review comment on my paper?

Alternatively, I have been trying to use the code from the tutorial as below but does not print to the screen for me. Is there a way I can make this save it into a file. I tried to introduce additional option in the second code far below but still did not save for me. Could you help me look into this code. Thank you.

import msprime
tree_sequence = msprime.simulate(sample_size=6, Ne=1000, length=1e4, recombination_rate=2e-8)
for tree in tree_sequence.trees():
print("-" * 20)
print("tree {}: interval = {}".format(tree.index, tree.interval))
print(tree.draw(format="unicode"))

import msprime
my_file=open("treefile", "w")
tree_sequence = msprime.simulate(sample_size=6, Ne=1000, length=1e4, recombination_rate=2e-8)
for tree in tree_sequence.trees():
print("-" * 20)
print("tree {}: interval = {}".format(tree.index, tree.interval))
print(tree.draw(format="unicode"))
my_file.write(tree.draw(format="unicode")
my_file.close()
You received this message because you are subscribed to a topic in the Google Groups "msprime-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/msprime-users/UqGZVPZpROA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to msprime-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/msprime-users/adbfbfa5-c65a-1ebf-da0c-ade78d9fe772%40ndm.ox.ac.uk.


Jerome Kelleher

unread,
Dec 1, 2020, 12:13:56 PM12/1/20
to Akinyanju Lawal, msprim...@googlegroups.com
Hi Lawal,

If you're using the Python API there should be no problem:

tree_sequence = msprime.simulate(sample_size=6, Ne=1000, length=1e4,
recombination_rate=2e-8)
tree_sequence.dump("simulation.trees")

Another quick fix is to downgrade your version of tskit:

python3 -m pip install tskit==0.3.2

(of if you're using conda, make sure it's version 0.3.2 you install)

The zlib_compression option doesn't actually do anything (or hasn't for
a couple of years) and it was an oversight that we forgot the parameter
is still used in the msprime ``msp`` CLI.

Apologies for the disruption!

Cheers,
Jerome

Akinyanju Lawal

unread,
Dec 1, 2020, 1:26:10 PM12/1/20
to Jerome Kelleher, msprim...@googlegroups.com
Thank you, Jerome. Downgrading the tskit to 0.32 solve the problem.

Akinyanju Lawal (PhD)
Postdoctoral Associate | Dumont Lab
The Jackson Laboratory
600 Main Street
Bar Harbor, 04609 ME, US
raman...@jax.org | www.jax.org <http://www.jax.org/>

The Jackson Laboratory: Leading the search for tomorrow's cures

Jerome Kelleher

unread,
Dec 2, 2020, 6:40:33 AM12/2/20
to msprim...@googlegroups.com
Hi all,

Just a quick note that this has now been resolved by a bugfix release of
tskit. You can upgrade with

python3 -m pip install tskit --upgrade

or via conda (the package is currently building).

Apologies for the disruption.

Cheers,
Jerome
Reply all
Reply to author
Forward
0 new messages