Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception: Simple_json.Undefined_key("n_cats") #376

Open
yifeng-evo opened this issue Jan 18, 2023 · 2 comments
Open

Uncaught exception: Simple_json.Undefined_key("n_cats") #376

yifeng-evo opened this issue Jan 18, 2023 · 2 comments

Comments

@yifeng-evo
Copy link

Hello,

I built a refpkg with taxtastic, but when I run with pplacer -c refpkg alignments.sto, I saw an error message

Uncaught exception: Simple_json.Undefined_key("n_cats")
Fatal error: exception Simple_json.Undefined_key("n_cats")

Could you please let me know how I can solve this? Thank you!

@maherrl
Copy link

maherrl commented Dec 22, 2023

I also had this error. Any idea what is causing it?

@hwells-biotia
Copy link

Hi,
I had the same error and just figured it out so I wanted to share in case more people find this issue. I think phyml made a slight change to their stats output which is not recognized by taxit when it parses your tree stats file. In your tree stats file from phyml, find this section:

. Discrete gamma model: 		Yes
  - Number of classes: 			4
  - Gamma shape parameter: 		0.686

The problem is that "Number of classes" used to say "Number of categories". Change the word "classes" to "categories" in your stats file, re-run taxit, and try pplacer again. It should work.

Alternatively, if you don't wish to rerun taxit, you could also just manually edit the phylo_model{some_hash}.json file in the refpkg folder. In the section for the gamma parameter, add the n_cats variable manually (the default for phyml is 4):

    "gamma": {
        "n_cats": 4,
        "alpha": 0.686
    },

Hope this helps,
Heather

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants