function [all_p] = survival1()
clc;
clear all;
all_value=[];

 %source_dir = 'C:\Users\jps\Desktop\plots_sorvival';
 %dest_dir = 'C:\Users\jps\Desktop\miRNA_result\Clinical data\Cl_results\P_value_std';
 %source_files = dir(fullfile(source_dir, '*.xlsx'));
%jps-----------------------------------------------------------------------------------
 %for l = 1:length(source_files)
%jps-----------------------------------------------------------------------------------
    %[data1, str1] = xlsread(fullfile(source_dir,source_files(l).name),'miRNA_selected');
[data1, str1] = xlsread('data/combined_44.xlsx');
 
%[data1, str1] = xlsread('C:\Users\jps\Desktop\Clinical data\miRNA\THCA_tumor_miRNA.xlsx','Sheet1');
[n d]=size(data1);
points=data1(:,1:d-1);
tcl=data1(:,d);
points_all=zeros(n,1);

%jps-----------------------------------------------------------------------------------
%  [data2, str2] = xlsread(fullfile(source_dir,source_files(l).name),'miRNA_nolog_nml');
%  [n2 d2]=size(data2);
%  tcl2=data2(:,d2);
%jps-----------------------------------------------------------------------------------


% for i=1:d-1
% points_all = points_all+ points(:,i);
% end

for i=1:d-1
points_all = points(:,i);

colmn_median = median(points_all);

inx_down=find(points_all >= colmn_median);
inx_up=find(points_all < colmn_median);

%[data_cl, str_cl] = xlsread('C:\Users\jps\Desktop\Clinical data\clinical_updated\THCA_cl_update.xlsx','Sheet1');
[data_cl, str_cl] = xlsread('data/combined_44.xlsx', 'Clinical');

low_risk=data_cl(inx_down,:);
high_risk=data_cl(inx_up,:);

low_exp=points_all(inx_down,:);
high_exp=points_all(inx_up,:);
exp_all=[high_exp;low_exp];

Days=[high_risk(:,3);low_risk(:,3)];
status=[high_risk(:,1);low_risk(:,1)];
% [b,logL,H,stats] = coxphfit(log2(exp_all(:,1)),Days,'Censoring',status);
% cox_coeff=stats.beta;
% cox_pvalue=stats.p;
% cox_data=[cox_coeff,cox_pvalue];
% %miRNA=source_files(l).name;

[HR,p]=logrank(low_risk(:,2:3),high_risk(:,2:3));
% p=logrank_Fan(low_risk(:,2:3),high_risk(:,2:3));
 all_p(i,:)=p;
 %all_value(i,:)=[cox_data,p];
 [Y,I] = sort(all_p);

 %all_value(i,:)=[cox_data,HR,p];
% %print(h,'miRNA','-dpdf','-r0');


strings = char(str1(1,(i+1)));
%eval(['print -dpdf ' num2str(strings) '.pdf']);
eval(['print -depsc2 -painters ' num2str(strings) '.eps']);





end


% colmn=str1(1,2:size(str1,2));
% xlswrite('C:\Users\USER1\Desktop\miRNA_result\Clinical data\Cl_results\Cl_results.xlsx',all_value,'THCA','B2'); 
% xlswrite('C:\Users\USER1\Desktop\miRNA_result\Clinical data\Cl_results\Cl_results.xlsx',colmn','THCA','A2'); 

%jps
% nw_data=data1(:,I);
% nw_data=[nw_data,tcl];
% colmn_nw=str1(1,I+1);
% row_nw=str1(:,1);
%jps

% xlswrite(fullfile(dest_dir,source_files(l).name),nw_data,'pVal_tmr','B2');
% xlswrite(fullfile(dest_dir,source_files(l).name),colmn_nw,'pVal_tmr','B1');
% xlswrite(fullfile(dest_dir,source_files(l).name),row_nw,'pVal_tmr','A1');
% xlswrite(fullfile(dest_dir,source_files(l).name),colmn_nw','pValue','A2');
% xlswrite(fullfile(dest_dir,source_files(l).name),Y,'pValue','B2');
% xlswrite(fullfile(dest_dir,source_files(l).name),I,'pValue','C2');
% 
% nw_data_normal=data2(:,I);
% nw_data_normal=[nw_data_normal,tcl2];
% row_nw_normal=str2(:,1);
% xlswrite(fullfile(dest_dir,source_files(l).name),nw_data_normal,'pVal_nml','B2');
% xlswrite(fullfile(dest_dir,source_files(l).name),colmn_nw,'pVal_nml','B1');
% xlswrite(fullfile(dest_dir,source_files(l).name),row_nw_normal,'pVal_nml','A1');


end
