-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenetic-Code-Scales_of_Amino-Acids.m
80 lines (66 loc) · 6.77 KB
/
Genetic-Code-Scales_of_Amino-Acids.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
(* ::Package:: *)
(************************************************************************)
(* This file was generated automatically by the Mathematica front end. *)
(* It contains Initialization cells from a Notebook file, which *)
(* typically will have the same name as this file except ending in *)
(* ".nb" instead of ".m". *)
(* *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs. Doing so is equivalent *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end. *)
(* *)
(* DO NOT EDIT THIS FILE. This entire file is regenerated *)
(* automatically each time the parent Notebook file is saved in the *)
(* Mathematica front end. Any changes you make to this file will be *)
(* overwritten. *)
(************************************************************************)
(* ::Input::Initialization:: *)
Get[StringJoin[NotebookDirectory[],"GeneticCodeScales.wl"]];
Manipulate[ Switch[swicher,"Principal Components",
PC3D[protein,MC,DistTest,boots,samplingsize,weigths,OpW,min,max,med,mean,space,NPBoot,psize,plabels,variance,textsize,fsize, popa,csize,opa,size,binning,1],
"Mutation Frequency",
PC3D[protein,MC,DistTest,boots,samplingsize,weigths,OpW,min,max,med,mean,space,NPBoot,psize,plabels,variance,textsize,fsize, popa,csize,opa,size,binning,2],
"Nonlinear regression",
PC3D[protein,MC,DistTest,boots,samplingsize,weigths,OpW,min,max,med,mean,space,NPBoot,psize,plabels,variance,textsize,fsize, popa,csize,opa,size,binning,3]],
{{swicher, "Principal Components", Row[{Framed[Style["PCA of Genetic Code Cubes",FontSize-> 14,FontFamily->"Times",Bold]],Style[" Analysis",Bold]}]}, { "Principal Components","Mutation Frequency","Nonlinear regression"},ControlPlacement->Top,ImageSize->{300,22}},
{{protein,"ATM/BRCA1-2/P53",Style["Protein",FontWeight->Bold]},{"ATM/BRCA1-2/P53", "BRCA2 repeat","Oxaloacetate decarboxylase \[Gamma]","P53 DNA-binding domain","PSII BNR repeats domain","Influenza HA","HIV ENV","HIV GAG" },ControlType->PopupMenu},
Delimiter,
(*** First & third base weight element control ****)
Style["Base weights control",Underlined,FontWeight->Bold],
(*weights*)
Grid[{{"","first base","second base","third base"},{"Weight 1",PopupMenu[Dynamic[w11],w,ImageSize->{58,22}],PopupMenu[Dynamic[w12],w,ImageSize->{58,22}],
PopupMenu[Dynamic[w13],w,ImageSize->{58,22}]},{"Weight 2",PopupMenu[Dynamic[w21],w,ImageSize->{58,22}],PopupMenu[Dynamic[w22],w,ImageSize->{58,22}],
PopupMenu[Dynamic[w23],w,ImageSize->{58,22}]}},Frame->All],
{{OpW,False,Style["Optimal weights?",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
Delimiter,
Row[{Style[" Set of Cubes ",FontWeight->Bold],PopupMenu[Dynamic[GC],gc,ImageSize->{84,30}]}],
{{space,1,Style["Space, \!\(\*SuperscriptBox[\(\[DoubleStruckCapitalZ]\), \(3\)]\)(1) or \!\(\*SuperscriptBox[\(\[DoubleStruckCapitalR]\), \(3\)]\) (2)",FontWeight->Bold]},{1,2},ControlType->PopupMenu,ImageSize->{60,20},ControlPlacement->Left},
{{min,True,Style["Min codon norm",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{max,True,Style["Max codon norm",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{med,True,Style["Median codon norm",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{mean,True,Style["Mean codon norm",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
Delimiter,
{{binning,Automatic,Style["Histogram binning",FontWeight->Bold]},Flatten[{Automatic,"Sturges","Scott","FreedmanDiaconis","Knuth","Wand",Range[3,120,1]}],ControlType->PopupMenu,ImageSize->{120,22},ControlPlacement->Left},
{{psize,0.01,Style["Point size",FontWeight->Bold]},Range[0.01,0.2,0.01],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},
{{fsize,12,Style["Label font size",FontWeight->Bold]},Range[1,50,1],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},{{textsize,12,Style["Text font size",FontWeight->Bold]},Range[1,50,1],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},
{{plabels,False,Style["Point labels",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{variance,False,Style["PC variance %",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{csize,0.05,Style["Centroide size",FontWeight->Bold]},Range[0.01,0.2,0.01],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},
{{popa,0.5,Style["Plane opacity",FontWeight->Bold]},Range[0.01,1,0.01],ControlType->Slider,ImageSize->{60,10},ControlPlacement->Left},
{{opa,0.8,Style["Centroide opacity",FontWeight->Bold]},Range[0.01,1,0.01],ControlType->Slider,ImageSize->{60,10},ControlPlacement->Left},
{{size,500,Style["Image size",FontWeight->Bold]},Range[300,1000,50],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},
{{weigths,True,Style["Two base weigths",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
Style[ "Box Ratios",FontWeight->Bold],
Grid[{{PopupMenu[Dynamic[b1],br,ImageSize->{50,20}],PopupMenu[Dynamic[b2],br,ImageSize->{50,20}],PopupMenu[Dynamic[b3],br,ImageSize->{50,20}]}},Frame->All],
Delimiter,
{{MC,False,Style["Monte Carlo KS-test",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{DistTest,"Kolmogorov-Smirnov",Style["Distribution test",FontWeight->Bold]},{"Kolmogorov-Smirnov","Kuiper" },ControlType->PopupMenu},
{{boots,1000,Style["No. bootstrap samplings",FontWeight->Bold]},Range[50,3000,50],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},
{{NPBoot,True,Style["Non-parametric Bootstrap?",FontWeight->Bold]},{True,False},ControlType->Checkbox,ImageSize->{18,18},ControlPlacement->Left},
{{samplingsize,200,Style["Bootstrap sample size",FontWeight->Bold]},Append[Range[50,300,10],Length[delta]],ControlType->PopupMenu,ImageSize->{60,22},ControlPlacement->Left},
Delimiter,
Button["Export Tables",ExportTables=Mod[ExportTables+1,2]],
ControlPlacement->Left,
SaveDefinitions->True,TrackedSymbols:>{GC,protein,MC,DistTest,weigths,space,boots,samplingsize,delta,boot,bootf,a0,b0,delta0,binning,w11,w12,w13,w21,w22,w23,b1,b2,b3,min,max,med,mean,popa,plabels,fsize,psize,csize,opa,size,swicher,deltaDist1,deltaDist2,delta,p,\[ScriptCapitalD],var,nlm,nlm1, nlm2,variance,ExportTables,encoding}
]