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

An error in lefse v1.1.2 #14

Open
liu-congcong opened this issue Sep 26, 2021 · 2 comments
Open

An error in lefse v1.1.2 #14

liu-congcong opened this issue Sep 26, 2021 · 2 comments

Comments

@liu-congcong
Copy link

liu-congcong commented Sep 26, 2021

Hi, thank you for developing the lefse.
An error may be encountered, when run "lefse_plot_res.py" as follows:

lefse_plot_res.py --feature_font_size 8 --format pdf --class_legend_font_size 8 lefse.output lefse.pdf

File "lefse_plot_res.py", line 102, in plot_histo_hor
if len(rr) > params['max_feature_len']: rr = rr[:params['max_feature_len']/2-2]+" [..]"+rr[-params['max_feature_len']/2+2:]
TypeError: slice indices must be integers or None or have an index method

It should be
"if len(rr) > params['max_feature_len']: rr = rr[:int(params['max_feature_len']/2-2)]+" [..]"+rr[int(-params['max_feature_len']/2+2):]"

@Learnerhua
Copy link

I'm afraid you shouldn't change the codes, it'll cause an incorrect result.

@cheinle
Copy link

cheinle commented May 6, 2022

I ran into this similar problem and like you, originally changed the code. However, we also thought this might result in incorrect plotting of the results. We added the option --max_feature_len and this helped (tried out setting around 100 as default is 60). Hope this helps someone!

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