How to import data from MAIRplot to workspace using code?

조회 수: 3 (최근 30일)
Mohammad Naser
Mohammad Naser 2023년 8월 7일
댓글: Mohammad Naser 2023년 8월 25일
I'm using the MAIRplot in Matlab to differentiate between up-regulated and down-regulated genes. I can export these populations manually using the Export button. I want to run it for multiple data files and store the list in the workspace using code. Any suggestion?
  댓글 수: 1
Mohammad Naser
Mohammad Naser 2023년 8월 25일
Thanks @Kausthub yes, that's exactly what I was looking for. And thanks for the additional code.

댓글을 달려면 로그인하십시오.

채택된 답변

Kausthub
Kausthub 2023년 8월 23일
Hi Mohammad Naser,
I understand that you are looking for a way to store the up-regulated and down-regulated genes in the workspace using code rather than using the “Export” button since you are dealing with multiple data files.
A possible solution to the issue you are facing would be to utilize the outputs of the mairplot() function.
[Intensity, Ratio, H] = mairplot(DataX, DataY)
mairplot() has Ratio as one of the return values from which we can calculate the up-regulated and down regulated genes. Up-regulated genes have ratio greater than threshold and down-regulated genes has ratio lesser than negative of the threshold.
% Calculate threshold from Fold Change
threshold = log2(FoldChange); % threshold = 1; when foldChange = 2
% Find the respective indices
upIdx = ratio > threshold; % upIdx = ratio > 1; when foldChange = 2
downIdx = ratio < -threshold; % downIdx = ratio < -1; when foldChange = 2
diffIdx = upIdx | downIdx;
upIndices = find(upIdx);
downIndices = find(downIdx);
diffIndices = find(diffIdx);
% Find the respective labels
upLabels = maStruct.Names(upIdx);
downLabels = maStruct.Names(downIdx);
diffLabels = maStruct.Names(diffIdx);
Please refer to the following MATLAB documentation to know more about “mairplot” function
I hope this helps!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Bioinformatics Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by