annotate MultiplexCrisprDOE.jl @ 1:4a5c94d1d8bb draft

planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit a920127294bcfcb708881e28144a77a5c10d46d2
author padge
date Wed, 31 Aug 2022 12:13:10 +0000
parents cc0957c46408
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
2 gRNA_frequency_distribution(m,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
3 sd,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
4 l,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
5 u,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
6 n_gRNA_total;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
7 normalize = true,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
8 visualize = false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
9
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
10 Generates vector with frequencies in the combinatorial gRNA/Cas9 construct library for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
11
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
12 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
13 m: the average abundance of the gRNAs (in terms of absolute or relative frequency)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
14 sd: the standard deviation on the gRNA abundances (in terms of absolute or relative frequency)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
15 l: minimal gRNA abundance (in terms of absolute or relative frequency)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
16 u: maximal gRNA abundance (in terms of absolute or relative frequency)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
17 n_gRNA_total: the total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
18 normalize: if set to "true", the gRNA abundances (absolute frequencies) are converted into relative frequencies
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
19 visualize: if set to "true", a histogram of all gRNA abundances is plotted
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
20
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
21 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
22 p_gRNA_freq: vector with frequencies for all gRNAs in the construct library
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
23 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
24 function gRNA_frequency_distribution(m,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
25 sd,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
26 l,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
27 u,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
28 n_gRNA_total;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
29 normalize = true,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
30 visualize = false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
31
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
32 d_gRNA_freq = truncated(Normal(m, sd), l, u) # gRNA frequency distribution
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
33 p_gRNA_freq = collect(rand(d_gRNA_freq, n_gRNA_total)) # sample gRNA frequencies from distribution
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
34
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
35 if normalize # convert into relative frequencies
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
36 p_gRNA_freq /= sum(p_gRNA_freq)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
37 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
38
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
39 if visualize
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
40 return histogram(p_gRNA_freq, label="",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
41 xlabel="Number of reads per gRNA",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
42 linecolor="white",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
43 normalize=:probability,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
44 xtickfontsize=10,ytickfontsize=10,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
45 color=:mediumturquoise, size=(600,350), bins = 25,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
46 ylabel="Relative frequency",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
47 title="gRNA frequency distribution")
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
48 else
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
49 return p_gRNA_freq
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
50 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
51 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
52
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
53 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
54 gRNA_edit_distribution(f_act,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
55 ϵ_edit_act,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
56 ϵ_edit_inact,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
57 sd_act,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
58 n_gRNA_total;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
59 visualize = false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
60
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
61 Generates vector with genome editing efficiencies for all the gRNAs in the experiment.
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
62
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
63 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
64 f_act: fraction of all gRNAs that is active
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
65 ϵ_edit_act: Average genome editing efficiency for active gRNAs - mean of the genome editing efficiency distribution for active gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
66 ϵ_edit_inact: Average genome editing efficiency for inactive gRNAs - mean of the genome editing efficiency distribution for inactive gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
67 sd_act: standard deviation of the genome editing efficiency distributions for active and inactive gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
68 n_gRNA_total: the total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
69 visualize: if set to "true", a histogram of all genome editing efficiency is plotted
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
70
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
71 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
72 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
73 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
74 function gRNA_edit_distribution(f_act, ϵ_edit_act, ϵ_edit_inact, sd_act, n_gRNA_total; visualize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
75 d_act = Binomial(1, f_act) # there is a probability f_act that a gRNA is active
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
76 d_high_act = truncated(Normal(ϵ_edit_act, sd_act), 0.01, 1) # average genome editing efficiency for active gRNAs is equal to ϵ_edit_act
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
77 d_low_act = truncated(Normal(ϵ_edit_inact, sd_act), 0.01, 1) # average genome editing efficiency for inactive gRNAs is equal to ϵ_edit_inact
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
78 p_gRNA_edit = zeros(n_gRNA_total) # initialize vector with genome editing efficiencies for gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
79
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
80 for i in 1:n_gRNA_total
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
81 if rand(d_act, 1) == [1] # gRNA is active
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
82 p_gRNA_edit[i] = rand(d_high_act, 1)[1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
83 else # gRNA is inactive
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
84 p_gRNA_edit[i] = rand(d_low_act, 1)[1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
85 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
86 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
87
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
88 if visualize
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
89 return histogram(p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
90 normalize = :probability,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
91 linecolor = "white",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
92 label="",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
93 color=:turquoise4,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
94 xtickfontsize=10,ytickfontsize=10, xlim = (0, 1),
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
95 xticks=(0:0.1:1),
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
96 bins = 150,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
97 xlabel="gRNA editing efficiency",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
98 ylabel="Relative frequency",
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
99 title="gRNA genome editing effiency distribution")
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
100
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
101 else
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
102 return p_gRNA_edit
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
103 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
104 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
105
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
106 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
107 simulate_Nₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
108 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
109 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
110 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
111 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
112 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
113 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
114 iter = 500)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
115
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
116 Computes the expected value and the standard deviation of the minimal plant library size for full coverage of all single gene knockouts (E[Nx,1] and σ[Nx,1]) using simulation
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
117
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
118 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
119 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
120 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
121 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
122 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
123 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
124 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
125 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
126 iter: number of CRISPR/Cas experiments that are simulated to obtain E[Nₓ₁] and σ[Nₓ₁]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
127
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
128 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
129 E_Nₓ₁: expected value of the plant library size for full coverage of all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
130 sd_Nₓ₁: standard deviation on the plant library size for full coverage of all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
131 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
132 function simulate_Nₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
133 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
134 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
135 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
136 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
137 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
138 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
139 iter = 500)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
140
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
141 @assert x * g == n_gRNA_total
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
142 Nₓ₁_vec = [] #stores number of plants to reach full coverage for each simulated experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
143 for i in 1:iter
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
144 genes_vec = [] # Initialize vector to store single gene knockouts that are observed in plants
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
145 Nₓ₁ = 0
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
146 while genes_vec != collect(1:x) # check if all possible single gene knockouts are present: if no full coverage, sample an additional plant
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
147 Nₓ₁ += 1 # count how many plants must be sampled to observe all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
148
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
149 # sample combinatorial gRNA/Cas9 construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
150 gRNA_indices_construct = findall((rand(Multinomial(r, p_gRNA_freq))) .!= 0)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
151
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
152 # execute mutations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
153 gRNA_indices_mutations = [gRNA for gRNA in gRNA_indices_construct if rand(Binomial(1, p_gRNA_edit[gRNA])) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
154
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
155 # effective gene knockout (loss-of-function) ?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
156 gRNA_indices_KO = [gRNA for gRNA in gRNA_indices_mutations if rand(Binomial(1, ϵ_KO)) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
157
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
158 # which genes are knocked out?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
159 genes_indices_KO = Int.(ceil.(gRNA_indices_KO / g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
160 append!(genes_vec, genes_indices_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
161
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
162 # update vector with observed gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
163 genes_vec = Int.(sort(unique(genes_vec)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
164 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
165 push!(Nₓ₁_vec, Nₓ₁) # add plant library size for full coverage of current experiment to vector
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
166 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
167
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
168 # Calculate expected value and standard deviation
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
169 E_Nₓ₁ = mean(Nₓ₁_vec);
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
170 sd_Nₓ₁ = std(Nₓ₁_vec)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
171
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
172 return E_Nₓ₁, sd_Nₓ₁
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
173 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
174
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
175
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
176 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
177 BioCCP_Nₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
178 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
179 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
180 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
181 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
182 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
183 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
184
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
185 Computes the expected value and the standard deviation of the minimal plant library size for
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
186 full coverage of all single gene knockouts (E[Nx,1] and σ[Nx,1]) using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
187
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
188 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
189 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
190 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
191 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
192 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
193 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
194 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
195 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
196
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
197 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
198 E_Nₓ₁ : expected value of the plant library size for full coverage of all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
199 sd_Nₓ₁ : standard deviation on the plant library size for full coverage of all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
200 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
201 function BioCCP_Nₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
202 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
203 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
204 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
205 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
206 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
207 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
208
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
209 # prepare input for BioCCP functions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
210 p_gRNAs = p_gRNA_freq .* p_gRNA_edit * ϵ_KO # calculate probability for each gRNA to induce effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
211 p_genes = [sum(p_gRNAs[i:i+g-1]) for i in 1:g:n_gRNA_total] # obtain probability of single gene knockout by summing up probability of all corresponding gRNAs to induce effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
212
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
213 # Apply BioCCP functions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
214 E_Nₓ₁ = expectation_minsamplesize(x; p=p_genes, r=r, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
215 sd_Nₓ₁ = std_minsamplesize(x; p=p_genes, r=r, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
216
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
217 return E_Nₓ₁, sd_Nₓ₁
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
218 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
219
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
220
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
221 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
222 simulate_Nₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
223 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
224 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
225 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
226 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
227 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
228 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
229 iter=500)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
230
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
231 Computes the expected value and the standard deviation of the minimal plant library size for full coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
232 in a multiplex CRISPR/Cas experiment (E[Nx,2] and σ[Nx,2]) using simulation
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
233
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
234 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
235 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
236 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
237 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
238 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
239 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
240 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
241 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
242 iter: number of CRISPR/Cas experiments that are simulated to obtain E[Nₓ₂] and σ[Nₓ₂]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
243
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
244 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
245 E_Nₓ₂ : expected value of the plant library size for full coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
246 sd_Nₓ₂ : standard deviation on the plant library size for full coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
247 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
248 function simulate_Nₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
249 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
250 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
251 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
252 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
253 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
254 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
255 iter = 500)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
256
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
257 @assert x * g == n_gRNA_total
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
258 Nₓ₂_vec = [] #stores number of plants to reach full coverage of all pairwise combinations of gene knockouts for each simulated experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
259
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
260 for i in 1:iter
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
261 X_interactions_count = zeros(x, x) # Initialize matrix to count pairwise interactions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
262 Nₓ₂ = 0
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
263 while X_interactions_count != ones(x, x) # check if all pairwise combinations are present
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
264 Nₓ₂ += 1 # count how many plants must be sampled to fill pairwise interaction matrix
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
265
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
266 # sample combinatorial gRNA/Cas9 construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
267 gRNA_indices_construct = findall((rand(Multinomial(r, p_gRNA_freq))) .!= 0)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
268
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
269 # execute mutations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
270 gRNA_indices_mutations = [gRNA for gRNA in gRNA_indices_construct if rand(Binomial(1, p_gRNA_edit[gRNA])) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
271
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
272 # effective gene knockout (loss-of-function) ?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
273 gRNA_indices_KO = [gRNA for gRNA in gRNA_indices_mutations if rand(Binomial(1, ϵ_KO)) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
274
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
275 # which genes are knocked out?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
276 genes_indices_KO = Int.(ceil.(gRNA_indices_KO / g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
277
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
278 # which pairwise combinations are present?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
279 interactions = collect(combinations(genes_indices_KO, 2))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
280
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
281 # Store represented combinations in matrix
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
282 for interaction in interactions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
283 j = interaction[1]; k = interaction[2]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
284 X_interactions_count[j,k] = 1; X_interactions_count[k,j] = 1; X_interactions_count[j,j] = 1; X_interactions_count[k,k] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
285 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
286 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
287
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
288 push!(Nₓ₂_vec, Nₓ₂)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
289 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
290
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
291 # Calculate expected value and standard deviation
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
292 E_Nₓ₂ = mean(Nₓ₂_vec)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
293 sd_Nₓ₂ = std(Nₓ₂_vec)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
294
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
295 return E_Nₓ₂, sd_Nₓ₂
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
296 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
297
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
298 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
299 BioCCP_Nₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
300 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
301 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
302 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
303 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
304 p_gRNA_edit, ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
305
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
306 Computes the expected value and the standard deviation of the minimal plant library size for full coverage of all pairwise combinations of gene knockouts in a multiplex CRISPR/Cas experiment (E[Nx,2] and σ[Nx,2]) using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
307
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
308 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
309 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
310 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
311 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
312 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
313 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
314 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
315 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
316
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
317 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
318 E_Nₓ₂: expected value of the plant library size for full coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
319 sd_Nₓ₂: standard deviation on the plant library size for full coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
320 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
321 function BioCCP_Nₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
322 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
323 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
324 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
325 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
326 p_gRNA_edit, ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
327
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
328 # how many pairwise combinations of gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
329 ind_combinations_gRNA = collect(combinations(1:n_gRNA_total, 2))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
330 n_combinations_gRNA = length(ind_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
331
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
332 # calculate probability and activity of gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
333 p_combinations_gRNA_library = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
334 p_combinations_gRNA_act = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
335 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
336 p_combinations_gRNA_library[i] = p_gRNA_freq[ind_combinations_gRNA[i][1]] * p_gRNA_freq[ind_combinations_gRNA[i][2]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
337 p_combinations_gRNA_act[i] = p_gRNA_edit[ind_combinations_gRNA[i][1]] * p_gRNA_edit[ind_combinations_gRNA[i][2]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
338 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
339
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
340 # normalize probability gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
341 p_combinations_gRNA_library /= sum(p_combinations_gRNA_library)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
342
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
343 # select pairwise gRNA combinations of which each component codes for different gene (goal is to study combinations of knockouts in different genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
344 p_combinations_gRNA_library_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
345 p_combinations_gRNA_act_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
346 ind_combinations_gRNA_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
347 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
348 if ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][2]/g)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
349 push!(p_combinations_gRNA_library_interest, p_combinations_gRNA_library[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
350 push!(p_combinations_gRNA_act_interest, p_combinations_gRNA_act[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
351 push!(ind_combinations_gRNA_interest, ind_combinations_gRNA[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
352 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
353 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
354
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
355 n_combinations_gRNA_interest = length(p_combinations_gRNA_library_interest)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
356 p_combinations_gRNA = p_combinations_gRNA_library_interest .* p_combinations_gRNA_act_interest * ϵ_KO^2
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
357
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
358 # sum up probabilities or gRNA combinations for corresponding gene knockout combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
359 p_genes_matrix = zeros(x, x)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
360 for i in 1:n_combinations_gRNA_interest
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
361 gene1 = Int(ceil(ind_combinations_gRNA_interest[i][1]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
362 gene2 = Int(ceil(ind_combinations_gRNA_interest[i][2]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
363 p_genes_matrix[gene1, gene2] += p_combinations_gRNA[i]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
364 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
365 p_genes = collect([p_genes_matrix[i, j] for j in 2:size(p_genes_matrix, 1) for i in 1:j-1])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
366 n_combinations_genes = length(p_genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
367 combinations_pp = length(collect(combinations(1:r, 2)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
368
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
369 # Apply BioCCP functions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
370 E_Nₓ₂ = expectation_minsamplesize(n_combinations_genes; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
371 sd_Nₓ₂ = std_minsamplesize(n_combinations_genes; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
372
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
373 return E_Nₓ₂, sd_Nₓ₂
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
374 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
375
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
376 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
377 simulate_Nₓ₂_countKOs(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
378 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
379 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
380 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
381 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
382 p_gRNA_edit, ϵ_KO; iter=100000)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
383
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
384 Counts the number of knockouts per plant in the experiment.
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
385
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
386 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
387 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
388 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
389 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
390 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
391 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
392 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
393 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
394 iter: number of plants that are sampled
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
395
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
396 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
397 n_KOs_vec: vector with the number of knockouts for each plant
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
398 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
399 function simulate_Nₓ₂_countKOs(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
400 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
401 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
402 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
403 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
404 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
405 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
406 iter = 100000)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
407
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
408 @assert x * g == n_gRNA_total
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
409
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
410 n_KOs_vec = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
411
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
412 for j in 1:iter
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
413 # sample combinatorial gRNA/Cas9 construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
414 gRNA_indices_construct = findall((rand(Multinomial(r, p_gRNA_freq))) .!= 0)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
415
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
416 # execute mutations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
417 gRNA_indices_mutations = [gRNA for gRNA in gRNA_indices_construct if rand(Binomial(1, p_gRNA_edit[gRNA])) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
418
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
419 # effective gene knockout (loss-of-function) ?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
420 gRNA_indices_KO = [gRNA for gRNA in gRNA_indices_mutations if rand(Binomial(1, ϵ_KO)) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
421
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
422 # which genes are knocked out?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
423 genes_indices_KO = Int.(ceil.(gRNA_indices_KO / g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
424
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
425 push!(n_KOs_vec, length(unique((genes_indices_KO))))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
426 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
427
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
428 return n_KOs_vec
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
429 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
430
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
431 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
432 simulate_Nₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
433 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
434 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
435 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
436 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
437 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
438 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
439 iter=500)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
440
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
441 Computes the expected value and the standard deviation of the minimal plant library size for full coverage of all triple combinations of gene knockouts in
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
442 a multiplex CRISPR/Cas experiment (E[Nx,3] and σ[Nx,3]) using simulation
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
443
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
444 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
445 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
446 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
447 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
448 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
449 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
450 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
451 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
452 iter: number of CRISPR/Cas experiments that are simulated to obtain E[Nₓ₃] and σ[Nₓ₃]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
453
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
454 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
455 E_Nₓ₃: expecteded value of the plant library size for full coverage of all triple combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
456 sd_Nₓ₃: standard deviation on the plant library size for full coverage of all triple combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
457 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
458 function simulate_Nₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
459 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
460 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
461 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
462 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
463 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
464 ϵ_KO;
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
465 iter = 500)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
466
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
467 @assert x * g == n_gRNA_total
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
468
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
469 Nₓ₃_vec = [] # stores number of plants required for each experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
470
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
471 for i in 1:iter
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
472 # println("got till here")
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
473 X_interactions_count = zeros(x, x, x) # Initialize matrix to count triple interactions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
474 # println(X_interactions_count)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
475 # println(ones(x, x, x))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
476 Nₓ₃ = 0
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
477
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
478 while X_interactions_count != ones(x, x, x) # check if all triple combinations are present
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
479 Nₓ₃ += 1 # count how many plants must be sampled to fill triple interaction matrix
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
480
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
481 # sample combinatorial gRNA/Cas9 construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
482 gRNA_indices_construct = findall((rand(Multinomial(r, p_gRNA_freq))) .!= 0)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
483
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
484 # execute mutations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
485 gRNA_indices_mutations = [gRNA for gRNA in gRNA_indices_construct if rand(Binomial(1, p_gRNA_edit[gRNA])) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
486
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
487 # effective gene knockout (loss-of-function) ?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
488 gRNA_indices_KO = [gRNA for gRNA in gRNA_indices_mutations if rand(Binomial(1, ϵ_KO)) == 1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
489
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
490 # which genes are knocked out?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
491 genes_indices_KO = Int.(ceil.(gRNA_indices_KO / g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
492
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
493 # which triple combinations are present?
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
494 interactions = collect(combinations(genes_indices_KO, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
495
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
496 # Store represented triple combinations in 3D-matrix
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
497 for interaction in interactions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
498 j = interaction[1]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
499 k = interaction[2]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
500 l = interaction[3]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
501 X_interactions_count[j,k,l] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
502 X_interactions_count[k,j,l] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
503 X_interactions_count[l,j,k] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
504 X_interactions_count[l,k,j] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
505 X_interactions_count[j,l,k] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
506 X_interactions_count[k,l,j] = 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
507
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
508 X_interactions_count[:,l,l] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
509 X_interactions_count[:,k,k] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
510 X_interactions_count[:,j,j] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
511 X_interactions_count[l,:,l] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
512 X_interactions_count[k,:,k] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
513 X_interactions_count[j,:,j] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
514
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
515 X_interactions_count[j,j,:] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
516 X_interactions_count[k,k,:] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
517 X_interactions_count[l,l,:] .= 1
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
518 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
519 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
520 push!(Nₓ₃_vec, Nₓ₃)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
521 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
522
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
523 # calculate expected value and standard deviation
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
524 E_Nₓ₃ = mean(Nₓ₃_vec); sd_Nₓ₃ = std(Nₓ₃_vec)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
525
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
526 return E_Nₓ₃, sd_Nₓ₃
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
527 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
528
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
529
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
530 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
531 BioCCP_Nₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
532 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
533 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
534 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
535 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
536 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
537 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
538
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
539 Computes the expected value and the standard deviation of the minimal plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
540 for full coverage of all triple combinations of gene knockouts in a multiplex CRISPR/Cas experiment (E[Nx,3] and σ[Nx,3]) using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
541
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
542 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
543 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
544 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
545 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
546 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
547 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
548 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
549 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
550
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
551 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
552 E_Nₓ₃: expecteded value of the plant library size for full coverage of all triple combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
553 sd_Nₓ₃: standard deviation on the plant library size for full coverage of all triple combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
554 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
555 function BioCCP_Nₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
556 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
557 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
558 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
559 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
560 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
561 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
562
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
563 # how many triple combinations of gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
564 ind_combinations_gRNA = collect(combinations(1:n_gRNA_total, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
565 n_combinations_gRNA = length(ind_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
566
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
567 # calculate probability and activity of triple gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
568 p_combinations_gRNA_library = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
569 p_combinations_gRNA_act = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
570 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
571 p_combinations_gRNA_library[i] = p_gRNA_freq[ind_combinations_gRNA[i][1]] * p_gRNA_freq[ind_combinations_gRNA[i][2]] * p_gRNA_freq[ind_combinations_gRNA[i][3]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
572 p_combinations_gRNA_act[i] = p_gRNA_edit[ind_combinations_gRNA[i][1]] * p_gRNA_edit[ind_combinations_gRNA[i][2]] * p_gRNA_edit[ind_combinations_gRNA[i][3]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
573 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
574
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
575 # normalize probability gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
576 p_combinations_gRNA_library /= sum(p_combinations_gRNA_library)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
577
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
578 # select triple gRNA combinations of which each component codes for different gene (goal is to study combinations of knockouts in different genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
579 p_combinations_gRNA_library_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
580 p_combinations_gRNA_act_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
581 ind_combinations_gRNA_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
582 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
583 if ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][2]/g) && ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][3]/g) && ceil(ind_combinations_gRNA[i][3]/g) != ceil(ind_combinations_gRNA[i][2]/g)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
584 push!(p_combinations_gRNA_library_interest, p_combinations_gRNA_library[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
585 push!(p_combinations_gRNA_act_interest, p_combinations_gRNA_act[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
586 push!(ind_combinations_gRNA_interest, ind_combinations_gRNA[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
587 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
588 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
589
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
590 n_combinations_gRNA_interest = length(p_combinations_gRNA_library_interest)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
591 p_combinations_gRNA = p_combinations_gRNA_library_interest .* p_combinations_gRNA_act_interest * ϵ_KO^3
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
592
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
593 # sum up probabilities or gRNA combinations for corresponding gene knockout combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
594 p_genes_matrix = zeros(x, x, x)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
595 for i in 1:n_combinations_gRNA_interest
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
596 gene1 = Int(ceil(ind_combinations_gRNA_interest[i][1]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
597 gene2 = Int(ceil(ind_combinations_gRNA_interest[i][2]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
598 gene3 = Int(ceil(ind_combinations_gRNA_interest[i][3]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
599 p_genes_matrix[gene1, gene2, gene3] += p_combinations_gRNA[i]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
600 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
601
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
602 combinations_genes = collect(combinations(1:x, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
603 p_genes = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
604 for combination in combinations_genes
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
605 push!(p_genes, p_genes_matrix[combination[1], combination[2], combination[3]])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
606 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
607
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
608 n_combinations_genes = length(p_genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
609 combinations_pp = length(collect(combinations(1:r, 3)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
610
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
611 # apply BioCCP functions
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
612 E_Nₓ₃ = expectation_minsamplesize(n_combinations_genes; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
613 sd_Nₓ₃ = std_minsamplesize(n_combinations_genes; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
614
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
615 return E_Nₓ₃, sd_Nₓ₃
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
616 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
617
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
618 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
619 BioCCP_Pₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
620 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
621 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
622 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
623 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
624 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
625 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
626 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
627
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
628 Computes the probability of full coverage of all single gene knockouts (Px,1) for an experiment with given plant library size using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
629
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
630 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
631 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
632 N: plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
633 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
634 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
635 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
636 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
637 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
638 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
639
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
640 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
641 Pₓ₁: probability of full coverage of all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
642
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
643 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
644 function BioCCP_Pₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
645 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
646 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
647 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
648 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
649 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
650 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
651 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
652
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
653 # prepare input
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
654 p_gRNAs = p_gRNA_freq .* p_gRNA_edit * ϵ_KO
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
655 p_genes = [sum(p_gRNAs[i:i+g-1]) for i in 1:g:n_gRNA_total]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
656
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
657 # apply BioCCP function
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
658 Pₓ₁ = success_probability(x, N; p=p_genes, r=r, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
659
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
660 return Pₓ₁
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
661 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
662
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
663 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
664 BioCCP_γₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
665 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
666 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
667 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
668 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
669 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
670 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
671 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
672
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
673 Computes the expected coverage of all single gene knockouts (Px,1) for an experiment with given plant library size using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
674
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
675 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
676 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
677 N: plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
678 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
679 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
680 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
681 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
682 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
683 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
684
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
685 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
686 γₓ₁: expected coverage of all single gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
687 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
688 function BioCCP_γₓ₁(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
689 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
690 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
691 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
692 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
693 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
694 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
695 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
696
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
697 p_gRNAs = p_gRNA_freq .* p_gRNA_edit * ϵ_KO
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
698 p_genes = [sum(p_gRNAs[i:i+g-1]) for i in 1:g:n_gRNA_total]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
699
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
700 # Apply BioCCP function
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
701 γₓ₁ = expectation_fraction_collected(x, N; p=p_genes, r=r, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
702
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
703 return γₓ₁
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
704 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
705
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
706
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
707 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
708 BioCCP_Pₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
709 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
710 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
711 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
712 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
713 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
714 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
715 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
716
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
717 Computes the probability of full coverage of all pairwise combinations of gene knockouts (Px,2) for an experiment with given plant library size using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
718
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
719 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
720 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
721 N: plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
722 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
723 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
724 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
725 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
726 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
727 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
728
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
729 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
730 Pₓ₂: probability of full coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
731 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
732 function BioCCP_Pₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
733 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
734 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
735 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
736 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
737 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
738 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
739 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
740
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
741 # how many pairwise combinations of gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
742 ind_combinations_gRNA = collect(combinations(1:n_gRNA_total, 2))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
743 n_combinations_gRNA = length(ind_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
744
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
745 # calculate probability and activity of gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
746 p_combinations_gRNA_library = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
747 p_combinations_gRNA_act = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
748 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
749 p_combinations_gRNA_library[i] = p_gRNA_freq[ind_combinations_gRNA[i][1]] * p_gRNA_freq[ind_combinations_gRNA[i][2]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
750 p_combinations_gRNA_act[i] = p_gRNA_edit[ind_combinations_gRNA[i][1]] * p_gRNA_edit[ind_combinations_gRNA[i][2]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
751 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
752
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
753 # normalize probability gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
754 p_combinations_gRNA_library /= sum(p_combinations_gRNA_library)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
755
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
756 # select pairwise gRNA combinations of which each component codes for different gene (goal is to study combinations of knockouts in different genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
757 p_combinations_gRNA_library_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
758 p_combinations_gRNA_act_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
759 ind_combinations_gRNA_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
760 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
761 if ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][2]/g)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
762 push!(p_combinations_gRNA_library_interest, p_combinations_gRNA_library[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
763 push!(p_combinations_gRNA_act_interest, p_combinations_gRNA_act[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
764 push!(ind_combinations_gRNA_interest, ind_combinations_gRNA[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
765 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
766 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
767
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
768 n_combinations_gRNA_interest = length(p_combinations_gRNA_library_interest)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
769 p_combinations_gRNA = p_combinations_gRNA_library_interest .* p_combinations_gRNA_act_interest * ϵ_KO^2
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
770
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
771 # sum up probabilities or gRNA combinations for corresponding gene knockout combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
772 p_genes_matrix = zeros(x, x)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
773 for i in 1:n_combinations_gRNA_interest
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
774 gene1 = Int(ceil(ind_combinations_gRNA_interest[i][1]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
775 gene2 = Int(ceil(ind_combinations_gRNA_interest[i][2]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
776 p_genes_matrix[gene1, gene2] += p_combinations_gRNA[i]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
777 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
778
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
779 p_genes = collect([p_genes_matrix[i, j] for j in 2:size(p_genes_matrix, 1) for i in 1:j-1])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
780 n_combinations_genes = length(p_genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
781 combinations_pp = length(collect(combinations(1:r, 2)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
782
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
783 # Apply BioCCP function
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
784 Pₓ₂ = success_probability(n_combinations_genes, N; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
785
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
786 return Pₓ₂
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
787 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
788
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
789 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
790 BioCCP_γₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
791 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
792 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
793 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
794 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
795 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
796 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
797 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
798
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
799 Computes the expected coverage of all pairwise combinations of gene knockouts (γx,2) for an experiment with given plant library size using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
800
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
801 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
802 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
803 N: plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
804 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
805 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
806 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
807 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
808 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
809 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
810
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
811 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
812 γₓ₂: expected coverage of all pairwise combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
813 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
814 function BioCCP_γₓ₂(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
815 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
816 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
817 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
818 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
819 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
820 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
821 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
822
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
823 # how many pairwise combinations of gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
824 ind_combinations_gRNA = collect(combinations(1:n_gRNA_total, 2))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
825 n_combinations_gRNA = length(ind_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
826
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
827 # calculate probability and activity of gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
828 p_combinations_gRNA_library = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
829 p_combinations_gRNA_act = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
830 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
831 p_combinations_gRNA_library[i] = p_gRNA_freq[ind_combinations_gRNA[i][1]] * p_gRNA_freq[ind_combinations_gRNA[i][2]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
832 p_combinations_gRNA_act[i] = p_gRNA_edit[ind_combinations_gRNA[i][1]] * p_gRNA_edit[ind_combinations_gRNA[i][2]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
833 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
834
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
835 # normalize probability gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
836 p_combinations_gRNA_library /= sum(p_combinations_gRNA_library)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
837
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
838 # select pairwise gRNA combinations of which each component codes for different gene (goal is to study combinations of knockouts in different genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
839 p_combinations_gRNA_library_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
840 p_combinations_gRNA_act_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
841 ind_combinations_gRNA_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
842 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
843 if ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][2]/g)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
844 push!(p_combinations_gRNA_library_interest, p_combinations_gRNA_library[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
845 push!(p_combinations_gRNA_act_interest, p_combinations_gRNA_act[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
846 push!(ind_combinations_gRNA_interest, ind_combinations_gRNA[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
847 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
848 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
849
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
850 n_combinations_gRNA_interest = length(p_combinations_gRNA_library_interest)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
851 p_combinations_gRNA = p_combinations_gRNA_library_interest .* p_combinations_gRNA_act_interest * ϵ_KO^2
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
852
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
853 # sum up probabilities or gRNA combinations for corresponding gene knockout combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
854 p_genes_matrix = zeros(x, x)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
855 for i in 1:n_combinations_gRNA_interest
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
856 gene1 = Int(ceil(ind_combinations_gRNA_interest[i][1]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
857 gene2 = Int(ceil(ind_combinations_gRNA_interest[i][2]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
858 p_genes_matrix[gene1, gene2] += p_combinations_gRNA[i]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
859 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
860
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
861 p_genes = collect([p_genes_matrix[i, j] for j in 2:size(p_genes_matrix, 1) for i in 1:j-1])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
862 n_combinations_genes = length(p_genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
863 combinations_pp = length(collect(combinations(1:r, 2)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
864
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
865 # Apply BioCCP function
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
866 γₓ₂ = expectation_fraction_collected(n_combinations_genes, N; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
867
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
868 return γₓ₂
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
869 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
870
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
871
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
872 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
873 BioCCP_γₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
874 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
875 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
876 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
877 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
878 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
879 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
880 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
881
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
882 Computes the expected coverage of all triple combinations of gene knockouts (γx,3) for an experiment with given plant library size using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
883
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
884 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
885 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
886 N: plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
887 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
888 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
889 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
890 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
891 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
892 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
893
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
894 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
895 γₓ₃: expected coverage of all triple combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
896 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
897 function BioCCP_γₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
898 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
899 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
900 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
901 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
902 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
903 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
904 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
905
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
906 # how many triple combinations of gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
907 ind_combinations_gRNA = collect(combinations(1:n_gRNA_total, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
908 n_combinations_gRNA = length(ind_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
909
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
910 # calculate probability and activity of triple gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
911 p_combinations_gRNA_library = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
912 p_combinations_gRNA_act = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
913 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
914 p_combinations_gRNA_library[i] = p_gRNA_freq[ind_combinations_gRNA[i][1]] * p_gRNA_freq[ind_combinations_gRNA[i][2]] * p_gRNA_freq[ind_combinations_gRNA[i][3]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
915 p_combinations_gRNA_act[i] = p_gRNA_edit[ind_combinations_gRNA[i][1]] * p_gRNA_edit[ind_combinations_gRNA[i][2]] * p_gRNA_edit[ind_combinations_gRNA[i][3]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
916 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
917
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
918 # normalize probability gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
919 p_combinations_gRNA_library /= sum(p_combinations_gRNA_library)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
920
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
921 # select triple gRNA combinations of which each component codes for different gene (goal is to study combinations of knockouts in different genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
922 p_combinations_gRNA_library_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
923 p_combinations_gRNA_act_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
924 ind_combinations_gRNA_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
925 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
926 if ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][2]/g) && ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][3]/g) && ceil(ind_combinations_gRNA[i][3]/g) != ceil(ind_combinations_gRNA[i][2]/g)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
927 push!(p_combinations_gRNA_library_interest, p_combinations_gRNA_library[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
928 push!(p_combinations_gRNA_act_interest, p_combinations_gRNA_act[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
929 push!(ind_combinations_gRNA_interest, ind_combinations_gRNA[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
930 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
931 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
932
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
933 n_combinations_gRNA_interest = length(p_combinations_gRNA_library_interest)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
934 p_combinations_gRNA = p_combinations_gRNA_library_interest .* p_combinations_gRNA_act_interest * ϵ_KO^3
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
935
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
936 # sum up probabilities or gRNA combinations for corresponding gene knockout combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
937 p_genes_matrix = zeros(x, x, x)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
938 for i in 1:n_combinations_gRNA_interest
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
939 gene1 = Int(ceil(ind_combinations_gRNA_interest[i][1]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
940 gene2 = Int(ceil(ind_combinations_gRNA_interest[i][2]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
941 gene3 = Int(ceil(ind_combinations_gRNA_interest[i][3]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
942 p_genes_matrix[gene1, gene2, gene3] += p_combinations_gRNA[i]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
943 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
944
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
945 combinations_genes = collect(combinations(1:x, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
946 p_genes = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
947 for combination in combinations_genes
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
948 push!(p_genes, p_genes_matrix[combination[1], combination[2], combination[3]])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
949 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
950
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
951 n_combinations_genes = length(p_genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
952 combinations_pp = length(collect(combinations(1:r, 3)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
953
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
954 # Apply BioCCP function
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
955 γₓ₃ = expectation_fraction_collected(n_combinations_genes, N; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
956
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
957 return γₓ₃
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
958 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
959
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
960 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
961 BioCCP_Pₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
962 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
963 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
964 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
965 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
966 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
967 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
968 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
969
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
970 Computes the probability of full coverage of all triple combinations of gene knockouts (Px,3) for an experiment with given plant library size using BioCCP
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
971
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
972 ***INPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
973 x: number of target genes in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
974 N: plant library size
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
975 g: number of gRNAs designed per target gene
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
976 r: number of gRNA sequences per combinatorial gRNA/Cas construct
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
977 n_gRNA_total: total number of gRNAs in the experiment
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
978 p_gRNA_freq: vector with relative frequencies for all gRNAs in the construct library (normalized!)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
979 p_gRNA_edit: vector with genome editing efficiencies for all gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
980 ϵ_KO: global knockout efficiency; fraction of mutations leading to effective gene knockout
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
981
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
982 ***OUTPUT***
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
983 Pₓ₃: probability of full coverage of all triple combinations of gene knockouts
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
984 """
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
985 function BioCCP_Pₓ₃(x,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
986 N,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
987 g,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
988 r,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
989 n_gRNA_total,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
990 p_gRNA_freq,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
991 p_gRNA_edit,
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
992 ϵ_KO)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
993
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
994 # how many triple combinations of gRNAs
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
995 ind_combinations_gRNA = collect(combinations(1:n_gRNA_total, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
996 n_combinations_gRNA = length(ind_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
997
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
998 # calculate probability and activity of triple gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
999 p_combinations_gRNA_library = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1000 p_combinations_gRNA_act = zeros(n_combinations_gRNA)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1001 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1002 p_combinations_gRNA_library[i] = p_gRNA_freq[ind_combinations_gRNA[i][1]] * p_gRNA_freq[ind_combinations_gRNA[i][2]] * p_gRNA_freq[ind_combinations_gRNA[i][3]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1003 p_combinations_gRNA_act[i] = p_gRNA_edit[ind_combinations_gRNA[i][1]] * p_gRNA_edit[ind_combinations_gRNA[i][2]] * p_gRNA_edit[ind_combinations_gRNA[i][3]]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1004 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1005
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1006 # normalize probability gRNA combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1007 p_combinations_gRNA_library /= sum(p_combinations_gRNA_library)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1008
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1009 # select triple gRNA combinations of which each component codes for different gene (goal is to study combinations of knockouts in different genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1010 p_combinations_gRNA_library_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1011 p_combinations_gRNA_act_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1012 ind_combinations_gRNA_interest = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1013 for i in 1:n_combinations_gRNA
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1014 if ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][2]/g) && ceil(ind_combinations_gRNA[i][1]/g) != ceil(ind_combinations_gRNA[i][3]/g) && ceil(ind_combinations_gRNA[i][3]/g) != ceil(ind_combinations_gRNA[i][2]/g)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1015 push!(p_combinations_gRNA_library_interest, p_combinations_gRNA_library[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1016 push!(p_combinations_gRNA_act_interest, p_combinations_gRNA_act[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1017 push!(ind_combinations_gRNA_interest, ind_combinations_gRNA[i])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1018 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1019 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1020
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1021 n_combinations_gRNA_interest = length(p_combinations_gRNA_library_interest)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1022 p_combinations_gRNA = p_combinations_gRNA_library_interest .* p_combinations_gRNA_act_interest * ϵ_KO^3
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1023
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1024 # sum up probabilities or gRNA combinations for corresponding gene knockout combinations
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1025 p_genes_matrix = zeros(x, x, x)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1026 for i in 1:n_combinations_gRNA_interest
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1027 gene1 = Int(ceil(ind_combinations_gRNA_interest[i][1]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1028 gene2 = Int(ceil(ind_combinations_gRNA_interest[i][2]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1029 gene3 = Int(ceil(ind_combinations_gRNA_interest[i][3]/g))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1030 p_genes_matrix[gene1, gene2, gene3] += p_combinations_gRNA[i]
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1031 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1032
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1033 combinations_genes = collect(combinations(1:x, 3))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1034 p_genes = []
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1035 for combination in combinations_genes
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1036 push!(p_genes, p_genes_matrix[combination[1], combination[2], combination[3]])
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1037 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1038
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1039 n_combinations_genes = length(p_genes)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1040 combinations_pp = length(collect(combinations(1:r, 3)))
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1041
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1042 # Apply BioCCP function
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1043 Pₓ₃ = success_probability(n_combinations_genes, N; p=p_genes, r=combinations_pp, normalize=false)
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1044
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1045 return Pₓ₃
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1046 end
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1047
cc0957c46408 "planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
padge
parents:
diff changeset
1048