IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Has anyone seen this error before? I don’t have enough Treetime or Python knowledge to dig it TnT This is a build with randomly selected mpox sequences. I’ve seen the same error in step refine instead of fix_tree for other sets of randomly selected sequences.

I’m trying to understand on a high level what may be the cause. For example, are the samples too diverse, or have too many mutations, or mutations that don’t agree with each other that led to this error? I’m not trying to understand for this specific set of samples which sample broke the run.

Input data can be downloaded here: debug_data/treetime at main · danrlu/debug_data · GitHub

treetime 0.9.4
monkeypox/ at 644d07ebe3fa5ded64d27d0964064fb722797c5d · nextstrain/monkeypox · GitHub (current master branch)


This looks like an treetime bug, thanks for reporting @dlu!

I’ve opened an issue on the treetime repo: tt.optimize_tree throws `IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed` · Issue #222 · neherlab/treetime · GitHub

hi @dlu,

there are some samples in your example data that didn’t align properly (these flagged as ‘reverse complemented’). Some of them only have - or N characters. This throws of treetime (though it shouldn’t). bur removing sequences that don’t have any valid characters should solve the issue.


You’re totally right. Let me go digging where things went wrong on my end. Thanks very much!