mairplot throws uimenu error
조회 수: 27 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
dpb
2025년 11월 9일 19:36
편집: dpb
2025년 11월 10일 15:55
%type mairplot.m
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Bioinformatics Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!