-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotIntensityResolutionBinPlus.json
102 lines (102 loc) · 3.45 KB
/
plotIntensityResolutionBinPlus.json
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
"display_name": "plotIntensityResolutionBin",
"metadata": {
"language": "python",
"description": "Miller arrays to plot of bin mean intensity over dstar",
"tags": [
"python","plotIntensityResolutionBin","iotbx","extra crystal symmetry"
],
"code": [
"'''",
"from iotbx.file_reader import any_file",
"import matplotlib.pyplot as plt",
"",
"f = any_file("${1:/Users/blaine/manuscripts/RETkinaseLoxo/ret_blu.mtz}")",
"",
"print(f.file_type)",
"f.show_summary()",
"miller_arrays = f.file_server.miller_arrays",
"iobs = miller_arrays[3]",
"flags = miller_arrays[0]",
"iobs, flags = iobs.common_sets(other=flags)",
"iobsData = iobs.data()",
"list(iobsData[100:110])",
"iobs.show_comprehensive_summary()",
"# iobs.binner()",
"n_bins = ${2:20}",
"binner = iobs.setup_binner(n_bins=n_bins)",
"binner.show_summary()",
"",
"used = list(binner.range_used())",
"selections = [binner.selection(i) for i in used]",
"means = [iobs.select(sel).mean() for sel in selections]",
"",
"from math import log",
"lnmeans = [log(y) for y in means]",
"",
"d_star_power = 1.618034",
"centers = binner.bin_centers(d_star_power)",
"d_centers = list(centers**(-1 / d_star_power))",
"d_centers",
"",
"# plt.ylabel("Natural log of the amplitudes squared")",
"# plt.xlabel(r"$\textrm{d^*}$ in $\textrm{\AA}$")",
"# ax.set_xlim(35, 1.5)",
"# plt.scatter(d_centers,lnmeanss)",
"",
"fig, ax = plt.subplots()",
"ax.scatter(d_centers,lnmeans)",
"ax.set_xlim(${3:8}, ${4:1.5}) # decreasing",
"ax.set_xlabel(r"$d^*$ in $\AA$")",
"ax.set_ylabel("Natural log of the intensities")",
"ax.grid(False)",
"plt.savefig("${5:iobsvsdstar}.pdf")",
"$0'''",
""
"from iotbx.file_reader import any_file",
"import matplotlib.pyplot as plt",
"",
"f = any_file('/Users/blaine/manuscripts/RETkinaseLoxo/ret_blu.mtz')",
"",
"print(f.file_type)",
"f.show_summary()",
"miller_arrays = f.file_server.miller_arrays",
"iobs = miller_arrays[3]",
"flags = miller_arrays[0]",
"iobs, flags = iobs.common_sets(other=flags)",
"iobsData = iobs.data()",
"list(iobsData[100:110])",
"iobs.show_comprehensive_summary()",
"# iobs.binner()",
"n_bins = 20",
"binner = iobs.setup_binner(n_bins=n_bins)",
"binner.show_summary()",
"",
"used = list(binner.range_used())",
"selections = [binner.selection(i) for i in used]",
"means = [iobs.select(sel).mean() for sel in selections]",
"",
"from math import log",
"lnmeans = [log(y) for y in means]",
"",
"d_star_power = 1.618034",
"centers = binner.bin_centers(d_star_power)",
"d_centers = list(centers**(-1 / d_star_power))",
"d_centers",
"",
"# plt.ylabel('Natural log of the amplitudes squared')",
"# plt.xlabel(r'$\textrm{d^*$ in $\textrm{\AA$')",
"# ax.set_xlim(35, 1.5)",
"# plt.scatter(d_centers,lnmeanss)",
"",
"fig, ax = plt.subplots()",
"ax.scatter(d_centers,lnmeans)",
"ax.set_xlim(8, 1.5) # decreasing",
"ax.set_xlabel(r'$d^*$ in $\AA$')",
"ax.set_ylabel('Natural log of the intensities')",
"ax.grid(False)",
"plt.savefig('iobsvsdstar.pdf')"
]
},
"schema_name": "code-snippet"
}