mairplot throws uimenu error

27 Ansichten (letzte 30 Tage)
Kartik Chandran
Kartik Chandran am 9 Nov. 2025 um 13:48
Bearbeitet: dpb am 10 Nov. 2025 um 15:55
Dear all,
I have been following the rnaseq demo (https://www.mathworks.com/help/bioinfo/ug/identifying-differentially-expressed-genes-from-rna-seq-data.html) to build out a livescript to analyze some differential gene expression data. However, I'm having issues with generating an interactive MA plot using mairplot.
I used a larger version of the attached input data file (data_head.txt) to populate a table (data). I then issued mairplot as follows:
mairplot(data.meanTreated,data.meanUntreated,'Labels',data.sgRNA_ID,'Type','MA');
However, I get the following error:
Error using uimenu
First argument must be a valid parent, such as a Figure or Panel object.
Error in mairplot>resetFigureTools (line 345)
uimenu(hw,'Label','Export to Workspace...','Position',1, 'Callback', @exportDiffResults);
Error in mairplot (line 168)
resetFigureTools(hFig);
I did convert the data.sgRNA_ID table variable from a cell array to strings using
data.sgRNA_ID = string(data.sgRNA_ID)
, but got the same error.
I was able to run the example code (rnaseqdemo.m; attached), including the interactive MA plot.
I was also able to successfully create an MA plot with the following command:
mairplot(data.meanTreated,data.meanUntreated,'Type','MA','Plotonly',true);
Thank you for your help! Let me know if you need more info to help me troubleshoot this.
Best,
Kartik

Antworten (1)

dpb
dpb am 9 Nov. 2025 um 19:36
Bearbeitet: dpb am 10 Nov. 2025 um 15:55
%type mairplot.m
I looked into mairplot and it starts the working part of the function with the following lines--
hFig = figure('Units',units, 'Tag', 'mairplot',... 'Visible', 'off', 'MenuBar', 'figure');
%== Init appdata
appdata = localGetAppData(hFig);
appdata.hfig = hFig;
It creates an ordinary figure handle and then later on tries to modify its menu to add the additional functionality desired.
When you put the code inside a a uifugure instead, then the two figure types are incompatible; as it stands the function will not work in a uifigure environment. That's why it works for you interactively or with the demo code; they're both regular figures.
I don't have the TB to play with interactively and one can't create uifigures here, so not much else can do myself to see about any sort of workaround...you might try creating a panel in your app figure -- but, no, as written you can't pass a parent handle to mairplot so there's not a way to put it there, either.
You may have to make a local copy of the function in your own working directory (renaming it to something like mymairplot.m) and then mung on it to be able to pass in the parent figure of your uifigure instead of it creating one.
ADDENDUM:
This would appear to be worthy of an enhancement submission to extend the functionality to the uifigure environment.

Kategorien

Mehr zu Bioinformatics Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by