-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvidenceCode.m
32 lines (32 loc) · 1.23 KB
/
EvidenceCode.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function [gnd_w] = EvidenceCode(gnd, gnd_ec, selGOs, Ndata, parentG0s)
% Giving weights to gene-term matrix using evidence codes
% 1 'TAS'
% 0.8 'EXP' 'IDA'
% 0.6 'IPI' 'IMP' 'IGI' 'IEP'
% 0.4 'ISA' 'ISO' 'ISM' 'RCA' 'IGC' 'IBA' 'IBD' 'IKR' 'IRD' 'ISS'
% 0.2 'NAS' 'IC'
% 0.1 'ND' 'IEA'
% % % Coded by Chang Lu ([email protected]), College of Computer and Information Science,
% % % Southwest University.
% % % version 1.0 date:2016-08-07
%%%%%%%%%%
% gnd:the protein-function association matrix
% gnd_ec: evidence codes the protein-function association matrix
% selGOs: the selected GOs vector
% Ndata: the number of genes
% parentG0s: the parents GOs set of the selected GOs
%%%%%%%%%%
ECw=[1 0.8 0.8 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4];
gnd_w=gnd;
for ii=1:Ndata
idxleaf=find(gnd_ec(ii,:)>0);
evidences=gnd_ec(ii,idxleaf);
[value, eviidx]=sort(evidences,2,'descend');
idxleaf=idxleaf(eviidx);
parleaf=parentG0s(idxleaf);
for jj=1:length(idxleaf)
parjjidx=getGOIdx(parleaf{jj},selGOs); %parGOs
gnd_w(ii,idxleaf(jj))=ECw(value(jj));
gnd_w(ii,parjjidx)=ECw(value(jj));
end
end