Open David-Peede opened 2 years ago
UPDATE: I did some digging around the eaton-lab/sptree-chapter page to try to nail down what was the latest version of ipcoal
that worked which seems to be version 0.1.0, unfortunately only versions 0.1.4 and 0.1.5 are available on GitHub and reverting back to version 0.1.4 gave me the same error as above... As a last attempt, I tried to use the code that is currently in this repo via:
%pip install git+git://github.com/pmckenz1/ipcoal.git
but unfortunately when I now run:
# Generate a random tree with 8 tips and height of 1M generations.
tree1 = toytree.rtree.unittree(8, treeheight=1e6, seed=123)
# Initialize a model object given a species tree and Ne setting.
model = ipcoal.Model(tree=tree1, Ne=1e5, debug)
I get this new error message:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_20742/2875736.py in <module>
1 # Initialize a model object given a species tree and Ne setting.
----> 2 model = ipcoal.Model(tree=tree1, Ne=1e5)
~/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/site-packages/ipcoal/Model.py in __init__(self, tree, Ne, admixture_edges, admixture_type, nsamples, mut, recomb, recomb_map, seed, seed_mutations, substitution_model, debug, **kwargs)
240 The demography model renames populations according to their
241 toytree idx label with an 'n' prefix. This is required since
--> 242 msp has very strict pop naming conventions. Thus, here I
243 rename the pops (tree tips) to match those names. The final
244 outputs will be converted back to the tip names on the tree.
~/Applications/JupyterLab.app/Contents/Resources/jlab_server/lib/python3.8/site-packages/ipcoal/Model.py in _get_demography(self)
560 single 'locus'.
561 start: (int)
--> 562 Slice start position of sequence array to draw. Default=0.
563 end: (int)
564 Slice end position of sequence array to draw. Default=end.
TypeError: unhashable type: 'MassMigration'
which makes even less sense to me since in Model.py
all of that text is just the description of the Model
class.
Hi, I hit the same error like you, and I adjusted the ipcoal/model.py according to the comment https://github.com/pmckenz1/ipcoal/commit/ba8d9c00e8760e3c86c18385fe7912663374c8bf?diff=split, and fixed it successfully. Maybe you can have a try.
any updates?
Hi Patrick and Dr. Eaton,
I was running through the documentation and I came across an error with
Model.py
which I naively think is due to premsprime v 1.+
syntax not properly working. Here is how to recreate my error:Additionally, when I run this on the binder from the documentation I get the same exact error. What is weird is that looking through the code for Model.py I can't seem to find where this issue is, which is why I am reaching out because I naively think the code base is totally up to date with the latest
msprime
code. Any help would be greatly appreciated!-Dave