-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfitting_probabilities.R
More file actions
56 lines (44 loc) · 2.04 KB
/
fitting_probabilities.R
File metadata and controls
56 lines (44 loc) · 2.04 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
fitting_probabilities=function(mut_mat,
signatures,
ind_prior_knowledge,
nboot=2,
initial_cutoff=0.2,
cutoff_remove=0.2,
cutoff_add=0.1,
cutoff_cs=0.01,
noise="Gaussian",
num_ite=2,
n_ite=10)
{
# First initialization
print("Vote 1")
crible=sparse_filter(mut_mat=mut_mat,
signatures=signatures,
ind_prior_knowledge=ind_prior_knowledge,
nboot=nboot,
initial_cutoff=initial_cutoff,
cutoff_add=cutoff_add,
cutoff_remove=cutoff_remove,
cutoff_cs=cutoff_cs,
noise=noise,
num_ite=num_ite)
for(i in seq(1,n_ite-1)){
# Estimate the active signatures for several iterations
print(paste("##### Vote",toString(i)))
crible=crible+sparse_filter(mut_mat=mut_mat,
signatures=signatures,
ind_prior_knowledge=ind_prior_knowledge,
nboot=nboot,
initial_cutoff=initial_cutoff,
cutoff_add=cutoff_add,
cutoff_remove=cutoff_remove,
cutoff_cs=cutoff_cs,
noise=noise,
num_ite=num_ite)
}
# For a signature, the activity probability is equal to the frequence of votes
fitting_probabilities=crible/n_ite
colnames(fitting_probabilities)=colnames(mut_mat)
rownames(fitting_probabilities)=colnames(signatures)
return(fitting_probabilities)
}