-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotIntensityResolutionBin.json
56 lines (56 loc) · 1.85 KB
/
plotIntensityResolutionBin.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
{
"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('/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"
}