kfuku52 / csubst

Molecular convergence detection
BSD 3-Clause "New" or "Revised" License
25 stars 1 forks source link

--fg_clade_permutation is broken in v1.4.0 #54

Open kfuku52 opened 8 months ago

kfuku52 commented 8 months ago
CSUBST command: csubst analyze --max_arity 3 --threads 4 --alignment_file alignment.fa --rooted_tree_file tree.nwk --iqtree_redo no --fg_exclude_wg no --fg_stem_only no --fg_format 2 --foreground foreground.tsv --exhaustive_until 1 --fg_clade_permutation 10
CSUBST working directory: /Users/kf/Dropbox/repos/csubst/data/GH19_chitinase_tiny
Clade permutation successfully found 10 new branch combinations after 28 trials.
Traceback (most recent call last):
  File "/Users/kf/Dropbox/repos/csubst/csubst/csubst", line 329, in <module>
    args.handler(args)
  File "/Users/kf/Dropbox/repos/csubst/csubst/csubst", line 43, in command_analyze
    main_analyze(g)
  File "/Users/kf/Dropbox/repos/csubst/csubst/main_analyze.py", line 270, in main_analyze
    g,cb = cb_search(g, b, S_tensor, N_tensor, id_combinations, write_cb=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kf/Dropbox/repos/csubst/csubst/main_analyze.py", line 113, in cb_search
    g = foreground.clade_permutation(cb, g)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/kf/Dropbox/repos/csubst/csubst/foreground.py", line 567, in clade_permutation
    obs_value = g['df_cb_stats_main'].loc[is_arity & is_stat_fg,'median_omegaCany2spe_fg_'+trait_name].values[0]
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: index 0 is out of bounds for axis 0 with size 0