Make a chart from two tables

3 ビュー (過去 30 日間)
Jose Mendoza Garcia
Jose Mendoza Garcia 2022 年 10 月 6 日
編集済み: Yash 2023 年 8 月 29 日
I have two arrays that look like this. The other one has every gene name with an additional T. What i want to do is create a new array where row 1 and 2 are gene 1 from the first and second table. Then what i want to do is make a t test. Again id like to do this for all genes. Please help!!!
  2 件のコメント
Jose Mendoza Garcia
Jose Mendoza Garcia 2022 年 10 月 7 日
is this possible to do on matlab?
Walter Roberson
Walter Roberson 2022 年 10 月 7 日

サインインしてコメントする。

回答 (1 件)

Yash
Yash 2023 年 8 月 29 日
編集済み: Yash 2023 年 8 月 29 日
Hi Jose,
I think that you want the gene names with and without the additional T in consecutive rows.
For this you can follow these steps:
  1. Sort both the tables (As there is only an additional T, corresponding genes will be in the same row.).
  2. Now pick one row from each of the tables alternatively and create the third table.
Please see the code below:
% tumorexpression is T1 in your case
T1= table({'TSPAN6';'TNMD';'DPM1';'SCYL3';'C1orf112'},...
[2.5842; 0 ; 2.9005; 2.1092; 1.6231],...
'VariableNames',{'GENE_ID','Data'});
% Table with an additional T (It wont affect if T is at the end)
T2= table({'TDPM1';'TTNMD';'TC1orf112';'TSCYL3';'TTSPAN6'},...
[2.69; 0 ; 3.97; 2.5443; 1.6231],...
'VariableNames',{'GENE_ID','Data'});
T3 = table();
T1_sorted = sortrows(T1, 'GENE_ID');
T2_sorted = sortrows(T2, 'GENE_ID');
for i=1:size(T1)
T3 = [T3;T1_sorted(i,:)];
T3 = [T3;T2_sorted(i,:)];
end
T3
T3 = 10×2 table
GENE_ID Data _____________ ______ {'C1orf112' } 1.6231 {'TC1orf112'} 3.97 {'DPM1' } 2.9005 {'TDPM1' } 2.69 {'SCYL3' } 2.1092 {'TSCYL3' } 2.5443 {'TNMD' } 0 {'TTNMD' } 0 {'TSPAN6' } 2.5842 {'TTSPAN6' } 1.6231

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by