a = load('lung.dat'); b = max(a,[],2) - min(a,[],2); indexf = find(b > 1.0); m = median(a,2); indexm = find(m > 6.5); ind = intersect(indexf, indexm); ind = intersect(ind,63:length(a)); %remove 62 controls data = a(ind,:); data = data'; %samples in rows and gene in columns; save data.txt -ascii -tabs data; import dataframe.*; des = TextArray('h133+.genedescriptors','\t','na',0); filtered = des.selectRowsm(ind); filtered.save('filtered.des',false,false,true); txt2mat('filtered.des'); ClinInfo = TextArray('Lung_fixed.clinical.txt','\t', 'NaN', 1); %celltype response CellType = ClinInfo.columnm('CellType'); A = find(CellType == 'A'); type = zeros(1,91); type(A) = 1; Type = TextArray(type,[],[],'#'); Type.save('type.txt',false,false,true); %weight: use all samples weight = ones(1,91); Weight = TextArray(weight,[],[],'#'); Weight.save('weight.txt',false,false,true); %survival time clindata = ClinInfo.data; survivaltime = clindata(:,7); SurvTime = TextArray(survivaltime,[],[]); SurvTime.save('survtime.txt',false,false,true); %censorship censor = clindata(:,8); %translate: 1->0 for censored, 3->1 for observed c1 = find(censor == 1); c3 = find(censor == 3); censor(c1) = 0; censor(c3) = 1; Censor = TextArray(censor,[],[],'#'); Censor.save('censor.txt',false,false,true);