-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c127cd1
commit 4772882
Showing
21 changed files
with
997 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function [reAssignClassall,reAssignClasstop3]=Assignment(kmeandata,regulators,Assign) | ||
%UNTITLED2 Summary of this function goes here | ||
% Detailed explanation goes here | ||
num=unique(kmeandata(:,2)); | ||
moduleall=[]; | ||
moduletop3=[]; | ||
for nummod=1:size(num,1) | ||
%data=kmeandata(find(kmeandata(:,2)==nummod),:); | ||
group_struct=Assign{nummod}; | ||
scoremoduleall=[]; | ||
scoremoduletop3=[]; | ||
for i=1:size(kmeandata,1) | ||
geneID=kmeandata(i,1); | ||
scoreall=0; | ||
scoretop3=[]; | ||
for j=1:size(group_struct,2) | ||
%gene=group_struct(j).data(find(group_struct(j).data(:,1)==geneID),3:end); | ||
gene=kmeandata(find(kmeandata(:,1)==geneID),group_struct(j).conditions); | ||
scrdata=sum(sum(-(gene-group_struct(j).mean).^2/(2*group_struct(j).std^2)-log(group_struct(j).std))); | ||
scoreall=scoreall+scrdata; | ||
scoretop3=[scoretop3;scrdata]; | ||
end; | ||
n=size(scoretop3,1); | ||
scoretop3=sort(scoretop3); | ||
scoremoduleall=[scoremoduleall;kmeandata(i,1:2) scoreall]; | ||
scoremoduletop3=[scoremoduletop3;kmeandata(i,1:2) sum(scoretop3(n-2:n,:))]; | ||
end; | ||
moduleall=[moduleall scoremoduleall(:,3)]; | ||
moduletop3=[moduletop3 scoremoduletop3(:,3)]; | ||
end; | ||
moduleall=[kmeandata(:,1:2) moduleall]; | ||
moduletop3=[kmeandata(:,1:2) moduletop3]; | ||
reAssignClassall=[]; | ||
reAssignClasstop3=[]; | ||
for ii=1:size(kmeandata,1) | ||
reAssignClassall=[reAssignClassall;moduleall(ii,1:2) find(moduleall(ii,:)==max(moduleall(ii,3:end)))-2 moduleall(ii,3:end)]; | ||
reAssignClasstop3=[reAssignClasstop3;moduletop3(ii,1:2) find(moduletop3(ii,:)==max(moduletop3(ii,3:end)))-2 moduletop3(ii,3:end)]; | ||
end; | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
function [Assign]=assignmentgene(data,regulators,Depth) | ||
%UNTITLED Summary of this function goes here | ||
% Detailed explanation goes here | ||
assignmatrixall=[]; | ||
assignmatrixtop3=[]; | ||
num=unique(data(:,2)); | ||
Assign={}; | ||
for i=1:size(num,1) | ||
datamodule=data(find(data(:,2)==num(i)),:); | ||
datamodule=[[1:size(data,2)];datamodule]; | ||
% [scoremoduleall,scoremoduletop3]=treeTraining3Score(datamodule,regulators,Depth) | ||
% assignmatrixall=scoremoduleall; | ||
% assignmatrixtop3=scoremoduletop3; | ||
[tree,treegene,treeMV,group_struct]=treeTraining3(datamodule,regulators,Depth); | ||
Assign{i}=group_struct; | ||
end; | ||
%save Assign Assign; | ||
|
||
% v6=[]; | ||
% left=[]; | ||
% right=[]; | ||
% row={}; | ||
% for num=1:size(matrix,2) %暂时不考虑叶子结点重复出现同一个转录因子的情况 | ||
% if (matrix(5,num)==matrix(5,num+1) & ~isnan(matrix(5,num))) | ||
% row=[row;num]; | ||
% v6=matrix(6,find(matrix(5,:)==matrix(5,num))); | ||
% if(matrix(6,num)==v6[1,1]) | ||
% left=[left;matrix(5,num) matrix(7,num)]; | ||
% elseif(matrix(6,num)!=v6[1,1] & ~isnan(matrix(6,num))) | ||
% right=[right;matrix(5,num) matrix(7,num)]; | ||
% end; | ||
% elseif () | ||
% end; | ||
|
||
|
||
|
||
% number=unique(tree(5,~isnan(tree(5,:)))); | ||
% | ||
% for j=1:size(number,2) | ||
% matrix(7,find(matrix(5,:)==number(1,j))); | ||
% if (number(1,j)>0) | ||
% for i=2:size(data,1) | ||
% gene=data(i,3:end); | ||
% scrdataup=sum(sum(-(geneup-meandataup).^2/(2*vardataup^2)-log(vardataup))); | ||
% scrdatanonup=sum(sum(-(genenonup-meandatanonup).^2/(2*vardatanonup^2)-log(vardatanonup))); | ||
% scoreupall=scrdataup+scrdatanonup; | ||
% end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
function [regulatorID,up_or_down,score]=choosedregulator(data,regulators) | ||
%UNTITLED2 Summary of this function goes here | ||
% Detailed explanation goes here | ||
reg=[]; | ||
MV=[]; | ||
for i=1:size(regulators,1); | ||
[meanvar,regulascore]=scorefunction(data,regulators(i,:)); | ||
reg=[reg;regulascore meanvar]; | ||
|
||
end; | ||
reg=sortrows(reg,4); | ||
regulatorID=reg(end,1); | ||
up_or_down=reg(end,5); | ||
score=reg(end,4); | ||
MV=[regulatorID reg(end,6:end)]; | ||
save MV MV; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function [corrscore]=correlationAnalysis(assign) | ||
corrscore=[]; | ||
for i=1:size(assign,2) | ||
data=[]; | ||
for j=1:size(assign{1,i},2) | ||
data=[data assign{1,i}(1,j).data(2:end,3:end)]; | ||
end; | ||
b=corr(data'); | ||
u=b-eye(size(data',2)); | ||
s=triu(u); | ||
M=sum(sum(s))*2/size(data',2)/(size(data',2)-1); | ||
corrscore=[corrscore;i M]; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function [moduledata]=dataforperl(Assigndata14con7level2) | ||
|
||
moduledata=[]; | ||
for i=1:size(Assigndata14con7level2,2) | ||
i | ||
moduledata=[moduledata;Assigndata14con7level2{1,i}(1,1).data(2:end,1:2)]; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function [tfnet]=draw(DataSy,assign,regulatorid,regulatorname) | ||
tfnet=[]; | ||
[sDataSy]=regulaorderbycon(assign); | ||
[m]=smallcodes(sDataSy,DataSy); | ||
res=getLevelOfReg(assign); | ||
tfnet=picmodule(sDataSy,m,assign,regulatorid,regulatorname,res,DataSy) |
Oops, something went wrong.