Lefse LDA Error "variable 36 appears to be constant within groups"

I have 4 different groups named as group_1, group_2, group_3, and group_4. 6 samples in each group. The input data was a text file obtained from picrust 2 pathway abundance feature table. I encountered the following error;

"/galaxy_venv/local/lib/python2.7/site-packages/rpy2/rinterface/init.py:185: RRuntimeWarning: Error in lda.default(x, grouping, …) :
variable 36 appears to be constant within groups

warnings.warn(x, RRuntimeWarning)
Traceback (most recent call last):
File “/shed_tools/testtoolshed.g2.bx.psu.edu/repos/george-weingart/lefse/a6284ef17bf3/lefse/run_lefse.py”, line 89, in
if params[‘rank_tec’] == ‘lda’: lda_res,lda_res_th = test_lda_r(cls,feats,class_sl,params[‘n_boots’],params[‘f_boots’],params[‘lda_abs_th’],0.0000000001,params[‘nlogs’])
File “/export/shed_tools/testtoolshed.g2.bx.psu.edu/repos/george-weingart/lefse/a6284ef17bf3/lefse/lefse.py”, line 189, in test_lda_r
z = robjects.r(‘z ← suppressWarnings(lda(as.formula(’+f+‘),data=sub_d,tol=’+str(tol_min)+‘))’)
File “/galaxy_venv/local/lib/python2.7/site-packages/rpy2/robjects/init.py”, line 359, in call
res = self.eval(p)
File “/galaxy_venv/local/lib/python2.7/site-packages/rpy2/robjects/functions.py”, line 178, in call
return super(SignatureTranslatedFunction, self).call(*args, **kwargs)
File “/galaxy_venv/local/lib/python2.7/site-packages/rpy2/robjects/functions.py”, line 106, in call
res = super(Function, self).call(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error in lda.default(x, grouping, …) :
variable 36 appears to be constant within groups"

Any suggestions will be appreciated!
Thanks

Hi @Ishanmanandhar

Tools sourced from the Test Toolshed may have technical problems and produce weird errors.

Install and use tools from the Main Toolshed here instead: https://toolshed.g2.bx.psu.edu/

If you run into problems at your own server, try running the same data through the same tool/same tool version at a public usegalaxy.* server to compare. That will help to isolate usage problems from technical/configuration problems (bugs). You can also first try an internet search using content from an error report if it seems to be produced by the underlying tool itself (unrelated to the Galaxy wrapper). Most tools, including this one, have a lot of discussion at the different public bioinformatics forums, and that discussion is usually helpful even if it is based on running the tool line command instead of Galaxy.

Example: the immediate problem is probably similar to the one reported in this Lefse forum Q&A: I can't see why I am getting this error in lefse in conda? - LEfSe - The bioBakery help forum.

That was found with a search using this part of the error message “Error in lda.default” + lefse. You can also do that same search to find more Q&A, at that same tool dedicated forum hosted by the tool authors, or just in general. That finds Q&A specific to this tool, if it exists, whether run in Galaxy or not.

What to try: Fix your input data to be compatible/understood by the underlying tool. If that produces an error that has not been discussed at a public forum, then you can try updating the Galaxy tool to be a stable version and proceed from there with troubleshooting via comparisons with public servers running that same tool. If the problem can be reproduced at a public site, you can use that as an example to get more troubleshooting help at this forum. Sometimes sharing the error message is enough, other times including a share a link to the history and noting the datasets involved is better.

FAQ with more advice: Understanding-input-error-messages

Hope that helps!

1 Like

Thank you so much for your help. I am still trying to fix the error.