MATLAB Answers

0

"Too many input arguments" error while running clustergram (Bioinformatics toolbox)

Asked by Tim Sinioja on 31 Jan 2019
Latest activity Commented on by Tim Sinioja on 1 Feb 2019
Hi there,
I cannot run the clustergram using Bioinformatics toolbox 4.11 in Matlab R2018b. Even the simplest example from Matlab
load filteredyeastdata
cgo = clustergram(yeastvalues(1:30,:),'Standardize','Row')
Results in errors:
Error using clustergram>computeDendrogram (line 1279)
Encountered error while computing hierarchical clusters: Too many input arguments.
Error in clustergram/computeClusters (line 909)
[Z1, H1, ~, perm1] = computeDendrogram(data,...
Error in clustergram (line 413)
computeClusters(obj);
I tried to reset the path to the default as it was suggested here https://se.mathworks.com/matlabcentral/answers/336524-error-using-clustergram-function Which didn't help.
I also tried to reinstall the Bioinformatic toolbox without any success neither. I wonder what can be the problem and if there are any other ways to run clustered heatmap in Matlab? Thanks for answering.

  0 Comments

Sign in to comment.

1 Answer

Answer by Arthur Goldsipe on 31 Jan 2019
 Accepted Answer

I suspect there is a function in your installation that is "shadowing" some other MATLAB function used by clustergram. I would try to diagnose the problem using the debugger. For example, if you type dbstop if caught at the MATLAB prompt before running your code, you should stop in the debugger at the point where the error occurs. (After you're done, you might want to type dbclear if caught to turn off this feature.)
At the point where the error occurs, you can see what function is getting called. I would then make sure you're using the expected MATLAB function by using the which command. For example, if the line of code is calling a function linkage, enter which linkage at the command prompt, and check that the output points to a function located in your MATLAB installation directory rather than in some other folder. If that's still the case, take a look at the contents of that function file to see if it has been modified.
If you identify the conflict, would you mind sharing the details here? Since other customers have seen similar problems, I'd like to know if there's some relatively common confict we should be aware of.

  3 Comments

Hi Arthur,
Thanks for answering. dbstop if caught stopped at line with function called "dendrogram". After running which command, the path showed that it is installed in PLS_Toolbox_87 subfolder in Matlab's folder (I installed PLS_toolbox previously because I need that). Is there a way to redirect the dendrogram function to Bioinformatics toolbox instead of a PLS_toolbox?
There is no way to make both dendrogram functions available at the same time, except to rename one of them. Ideally, the PLS Toolbox should be updated so that their function names do not conflict with any core MATLAB function names. You could always do that rename yourself, if you want to keep using both at the same time.
My recommendation is that whenever you install a non-MathWorks toolbox like this, you make sure the folder gets added to the end of the path. MATLAB calls the first function it finds on the path, so this ensures MathWorks functions are called rather than any functions from other non-MathWorks toolboxes.
I don't use the dendrogram function in PLS_toolbox, so I just moved all PLS_toolbox subfolders to the bottom using "set path" and it seems like clustergram is working now. I just hope that there are no functions in PLS_toolbox that I use having the same name in MatLab. Thanks again.

Sign in to comment.