Mercurial > repos > padge > mcdoe
comparison report.jmd @ 0:cc0957c46408 draft
"planemo upload for repository https://github.com/kirstvh/MultiplexCrisprDOE commit b6c1b1860eee82b06ed4a592d1f9eee6886be318-dirty"
author | padge |
---|---|
date | Thu, 12 May 2022 17:39:18 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc0957c46408 |
---|---|
1 --- | |
2 title: MultiplexCrisprDOE | |
3 --- | |
4 | |
5 <!-- this setup dependencies, but doesn't appear in the generated document --> | |
6 ```julia; echo = false; results = "hidden" | |
7 using Pkg | |
8 "Plots" ∉ keys(Pkg.project().dependencies) && Pkg.add("Plots") | |
9 #"DSP" ∉ keys(Pkg.project().dependencies) && Pkg.add("DSP") | |
10 #"Images" ∉ keys(Pkg.project().dependencies) && Pkg.add("Images") | |
11 "DataStructures" ∉ keys(Pkg.project().dependencies) && Pkg.add("DataStructures") | |
12 "PrettyTables" ∉ keys(Pkg.project().dependencies) && Pkg.add("PrettyTables") | |
13 "DataFrames" ∉ keys(Pkg.project().dependencies) && Pkg.add("DataFrames") | |
14 "Latexify" ∉ keys(Pkg.project().dependencies) && Pkg.add("Latexify") | |
15 ``` | |
16 ## Tool | |
17 | |
18 * **Method:** `j println(WEAVE_ARGS.tool_info["method"])` | |
19 | |
20 * **Description:** `j println(WEAVE_ARGS.tool_info["description"])` | |
21 | |
22 * **Mode:** `j println(WEAVE_ARGS.tool_info["mode"])` | |
23 | |
24 * **Mode description:** `j println(WEAVE_ARGS.tool_info["mode_description"])` | |
25 | |
26 ## Variables | |
27 | |
28 ```julia; echo = false | |
29 using DataFrames | |
30 using PrettyTables | |
31 df = DataFrame("Argument" => collect(keys(WEAVE_ARGS.args_info)), "Value" => collect(values(WEAVE_ARGS.args_info))) | |
32 #pt = pretty_table(df, nosubheader=true; alignment=:l) | |
33 ``` | |
34 | |
35 ```julia; echo = false | |
36 using Plots | |
37 if haskey(WEAVE_ARGS.grna_dict,"p_gRNA_reads") | |
38 h1 = histogram(WEAVE_ARGS.grna_dict["p_gRNA_reads"], label="", | |
39 xlabel="Number of reads per gRNA", | |
40 linecolor="white", | |
41 normalize=:probability, | |
42 xtickfontsize=10,ytickfontsize=10, | |
43 color=:mediumturquoise, size=(600,350), bins = 25, | |
44 ylabel="Relative frequency", | |
45 title="gRNA frequency distribution") | |
46 display(h1) | |
47 end | |
48 ``` | |
49 | |
50 ```julia; echo = false | |
51 using Plots | |
52 if haskey(WEAVE_ARGS.grna_dict,"p_gRNA_edit") | |
53 h2 = histogram(WEAVE_ARGS.grna_dict["p_gRNA_edit"], | |
54 normalize = :probability, | |
55 linecolor = "white", | |
56 label="", | |
57 color=:turquoise4, | |
58 xtickfontsize=10,ytickfontsize=10, xlim = (0, 1), | |
59 xticks=(0:0.1:1), | |
60 bins = 150, | |
61 xlabel="gRNA editing efficiency", | |
62 ylabel="Relative frequency", | |
63 title="gRNA genome editing effiency distribution") | |
64 display(h2) | |
65 end | |
66 ``` | |
67 | |
68 ```julia; echo = false | |
69 using Plots | |
70 if haskey(WEAVE_ARGS.output,"output file") | |
71 println("Output written to:") | |
72 println(WEAVE_ARGS.output["output file"]) | |
73 elseif haskey(WEAVE_ARGS.output,"E_sim") | |
74 E_sim = WEAVE_ARGS.output["E_sim"] | |
75 sd_sim = WEAVE_ARGS.output["sd_sim"] | |
76 k = WEAVE_ARGS.args_info["# of gRNAs / combi gRNA/Cas construct"] | |
77 x = WEAVE_ARGS.args_info["# of target genes in the experiment"] | |
78 println("**How many plants need to be included in the plant library (on average) to obtain full coverage of all k-combinations of gene knockouts?**") | |
79 println("On average, ", Int(ceil(E_sim)), " plants need to be sampled at random to observe all ", k, "-combinations of ", x, " gene knockouts. Standard deviation = ", Int(ceil(sd_sim)), " plants") | |
80 elseif haskey(WEAVE_ARGS.output,"P_sim") | |
81 p = plot(WEAVE_ARGS.output["pls"], WEAVE_ARGS.output["P_sim"], label="Pₓ₂", | |
82 title="Probability of full combinatorial coverage with respect to plant library size", | |
83 xlabel="N", ylabel="Pₓₖ", | |
84 xticks = (0:500:50000, string.(0:500:50000)), | |
85 size=(900,400), color=:turquoise4, linewidth=2) | |
86 hline!([0.95], linestyle=:dash, color=:grey, label="Pₓₖ = 0.95", legend=:bottomright) | |
87 display(p) | |
88 println("At a given number of plants, what is the probability that all pairwise combinations of gene knockouts are observed?") | |
89 println("N_95_P: ", WEAVE_ARGS.output["N_95_P"]) | |
90 elseif haskey(WEAVE_ARGS.output,"E_cov") | |
91 p = plot(WEAVE_ARGS.output["pls"], WEAVE_ARGS.output["E_cov"], | |
92 label="E[γₓ₂]", title="Expected combinatorial coverage w.r.t. plant library size", | |
93 xlabel="N", ylabel="E[γₓₖ]", | |
94 xticks = (0:500:50000, string.(0:500:50000)), | |
95 size=(800,400), color=:turquoise4, linewidth=2) | |
96 hline!([0.95], linestyle=:dash, color=:grey, label="E[γₓₖ] = 0.95", legend=:bottomright) | |
97 display(p) | |
98 println("At a given number of plants, what is the expected coverage of pairwise gene knockout combinations?") | |
99 println("N_95: ", WEAVE_ARGS.output["N_95"]) | |
100 end | |
101 ``` | |
102 |