Example program for retrieving input spectrum data.
1
2
17
18import msparser
19import sys
20
21def main() :
22 if len(sys.argv) < 2 :
23 print("Must specify results filename as parameter")
24 return 1
25
26 resfile = msparser.ms_mascotresfilebase.createResfile(sys.argv[1])
27
28 if resfile.isValid() :
29 inputData(resfile)
30
31
32def inputData(resfile) :
33
34 for i in range(1, 2) :
35
36
37
38 print("Input data for query number %d" % i)
39 print("=========================================")
40
41 q = msparser.ms_inputquery(resfile, i)
42 fmt = " %-16s: %s"
43
44 print(fmt % ("title" , q.getStringTitle(True)))
45 print(fmt % ("mass_min" , q.getMassMin()))
46 print(fmt % ("mass_max" , q.getMassMax()))
47 print(fmt % ("int_min" , q.getIntMin()))
48 print(fmt % ("int_max" , q.getIntMax()))
49 print(fmt % ("num_vals" , q.getNumVals()))
50 print(fmt % ("num_used1" , q.getNumUsed()))
51 print(fmt % ("ions1" , q.getStringIons1()))
52 print(fmt % ("ions2" , q.getStringIons2()))
53 print(fmt % ("ions3" , q.getStringIons3()))
54 print(fmt % ("peptol" , q.getPepTol()))
55 print(fmt % ("peptol units", q.getPepTolUnits()))
56 print(fmt % ("peptol str" , q.getPepTolString()))
57 print(fmt % ("repeat srch" , resfile.getRepeatSearchString(i)))
58
59 num_peaks = q.getNumberOfPeaks(1)
60 for j in range (1, 1+ num_peaks) :
61 print("%f, %f" % (q.getPeakMass(1, j), q.getPeakIntensity(1, j)))
62
63 print(" ")
64
65
66
67if __name__ == "__main__" :
68 sys.exit(main())
69
70
71"""
72
73Running the program as
74
75python resfile_input.pl F981123.dat
76
77will give the following output under Mascot Server 2.3:
78
79
80Input data for query number 1
81=========================================
82 title :
83 mass_min : 72.09
84 mass_max : 1711.52
85 int_min : 1.103
86 int_max : 80.7
87 num_vals : 425
88 num_used1 : 0
89 ions1 : 157.096962:23.72,185.160000:26.69,286.134951:80.7,385.210000:13.49,480.270000:4.363,129.102412:18.84,187.070000:22.51,354.189124:13.57,399.246727:9.489,482.140542:3.205,130.110251:9.257,258.132661:15.93,357.210000:13.57,443.810000:6.256,481.210000:3.182,136.070000:7.387,213.139215:13.84,371.204929:11.24,459.280000:6.216,489.233770:3.157,147.117662:6.333,229.120000:9.72,326.133204:5.268,423.125582:4.262,483.115000:2.205,159.080000:5.222,240.130000:7.562,298.110000:5.231,444.168974:3.247,474.300000:1.103,158.090000:4.301,270.180000:7.432,324.170000:5.17,411.200000:3.23,475.270000:1.103,86.110000:3.276,175.110000:7.308,312.150879:4.235,463.265712:3.205,476.700000:1.103,102.060000:3.276,241.085275:5.361,293.110000:4.178,445.810000:3.182,478.180000:1.103,115.088725:3.255,243.139772:4.378,353.155308:4.149,401.150000:3.138,486.880000:1.103,72.090000:2.174,76.400000:1.103,84.075000:2.111,87.110000:1.103,88.100000:1.103,98.060000:1.103,103.060000:1.103,105.070000:1.103,116.070000:1.103,117.110000:1.103,118.400000:1.103,120.090000:2.205,126.070000:1.103,127.090000:1.103,128.090000:2.103,131.085000:2.118,132.090000:1.103,135.800000:1.103,137.080000:1.103,138.070000:1.103,139.090000:1.103,140.150000:2.174,141.060000:2.174,143.120000:2.174,146.080000:1.103,152.060000:1.103,155.070000:2.205,156.100000:1.103,159.450000:1.103,165.080000:2.136,166.110000:1.103,167.110000:1.103,169.710000:1.103,170.450000:1.103,171.090000:1.103,173.120000:2.174,177.090000:1.103,178.080000:1.103,181.160000:1.103,182.030000:1.103,183.110000:2.174,183.930000:1.103,186.131024:4.374,188.070000:1.103,188.760000:1.103,189.070000:1.103,190.065000:2.103,191.300000:1.103,197.130000:1.103,199.180000:1.103,200.080000:1.103,201.100000:3.138,202.110000:2.091,203.080000:2.174,203.610000:1.103,211.140000:4.189,212.115000:2.103,212.490000:1.103,214.985000:2.205,216.110000:2.103,217.100000:1.103,218.080000:1.103,219.090000:2.103,223.090000:3.154,224.130000:1.103,225.130000:1.103,227.170000:1.103,227.880000:1.103,228.170000:2.136,229.760000:1.103,231.950000:1.103,233.130000:1.103,234.430000:1.103,235.080000:2.103,236.590000:1.103,238.080000:4.332,239.139997:3.131,242.170000:2.205,244.090000:2.136,244.430000:2.091,245.165685:3.205,246.160000:2.197,247.110000:2.102,248.145000:2.118,249.110000:2.136,250.080000:1.103,251.160000:1.103,253.100000:1.103,254.130000:1.103,255.165000:2.22,256.170000:1.103,257.060000:1.103,259.150000:2.197,260.000000:1.103,260.490000:1.103,262.110000:1.103,265.120000:1.103,266.130000:2.159,266.950000:1.103,267.210000:1.103,268.120000:3.214,269.090000:1.103,271.150000:2.136,272.170000:2.103,274.120000:1.103,275.030000:1.103,276.175000:2.22,278.190000:1.103,279.720000:2.205,281.120000:1.103,283.070000:1.103,284.110000:1.103,285.070000:1.103,287.140000:3.296,287.780000:1.103,288.090000:2.103,290.130000:1.103,294.110000:2.174,295.150000:3.114,295.730000:1.103,297.180000:2.136,300.160000:3.143,302.070000:1.103,303.160000:1.103,303.590000:1.103,304.600000:1.103,305.130000:1.103,306.140000:3.182,307.050000:1.103,308.150000:2.174,308.490000:1.103,312.610000:1.103,312.880000:1.103,314.120000:1.103,316.085000:2.111,317.150000:3.183,318.140000:1.103,320.140000:1.103,322.149731:3.255,323.034482:3.149,327.020000:1.103,328.020000:1.103,331.140000:2.091,332.165000:2.103,333.140000:1.103,335.500000:1.103,336.190000:1.103,337.030000:2.118,338.620000:1.103,338.940000:1.103,339.200000:3.261,341.210000:2.103,342.180000:1.103,342.800000:1.103,343.225000:2.111,343.800000:1.103,344.150000:2.174,346.010000:1.103,347.660000:1.103,348.200000:2.197,349.800000:1.103,350.110000:2.118,351.130000:3.276,352.130000:2.136,353.910000:1.103,354.470000:1.103,355.193955:3.376,358.200000:1.103,359.210000:2.174,359.910000:1.103,360.470000:1.103,361.080000:1.103,362.190000:1.103,363.040000:1.103,364.080000:1.103,366.120000:1.103,367.150000:1.103,368.330000:1.103,368.730000:1.103,369.230000:3.15,369.820000:1.103,370.177065:3.279,373.130000:2.197,374.055000:2.217,374.510000:2.205,376.040000:1.103,377.040000:1.103,380.160000:2.103,382.180000:3.102,383.115000:2.209,385.890000:2.205,386.370000:1.103,387.170000:3.114,387.680000:2.217,388.050000:1.103,389.620000:1.103,390.190000:1.103,390.610000:1.103,394.260000:1.103,395.180000:1.103,396.140000:2.205,397.980000:1.103,400.165000:2.209,403.210000:1.103,404.150000:1.103,404.470000:1.103,410.165000:2.111,411.550000:1.103,413.240000:1.103,414.080000:1.103,415.000000:1.103,416.190000:1.103,416.830000:1.103,417.230000:1.103,417.760000:1.103,418.285000:2.111,418.680000:1.103,420.650000:1.103,421.170000:2.136,422.580000:1.103,425.215000:2.103,425.690000:1.103,426.220000:3.125,428.140000:2.155,428.650000:1.103,430.260000:1.103,430.995000:2.205,433.200000:1.103,433.690000:1.103,435.000000:1.103,435.260000:1.103,437.180000:1.103,438.710000:2.174,439.230000:1.103,440.210000:1.103,442.190000:1.103,443.120000:1.103,444.680000:1.103,445.120000:1.103,449.110000:1.103,450.710000:1.103,452.150000:2.209,453.240000:3.12,454.200000:1.103,454.700000:1.103,458.310000:1.103,460.290000:1.103,461.250000:1.103,461.830000:1.103,462.195000:2.103,463.850000:1.103,464.250000:1.103,467.180000:2.174,470.210000:1.103,471.120000:1.103,489.700000:1.103,493.200000:1.103,494.200000:1.103,505.200000:1.103,508.170000:2.197,508.840000:1.103,509.200000:2.103,511.450000:1.103,522.170000:2.197,523.190000:1.103,524.150000:2.174,527.160000:1.103,528.410000:2.19,529.280000:1.103,530.230000:1.103,531.250000:1.103,533.130000:1.103,533.670000:1.103,536.720000:1.103,537.240000:1.103,538.080000:1.103,538.450000:1.103,540.220000:1.103,545.210000:2.174,545.490000:1.103,546.250000:1.103,547.350000:1.103,550.750000:2.205,558.070000:1.103,561.360000:1.103,562.200000:1.103,563.330000:1.103,568.230000:1.103,571.290000:3.136,573.010000:1.103,575.410000:1.103,580.240000:1.103,581.260000:1.103,585.160000:1.103,588.380000:1.103,590.120000:1.103,599.450000:1.103,605.210000:2.197,607.285000:4.499,608.270000:3.143,613.330000:2.103,614.330000:1.103,617.320000:1.103,621.230000:1.103,622.310000:1.103,625.320000:3.23,626.210000:1.103,633.275000:2.205,640.350000:1.103,642.220000:1.103,644.280000:1.103,646.250000:1.103,648.390000:1.103,651.335000:2.103,653.360000:2.136,658.300000:1.103,662.320000:1.103,663.800000:1.103,668.275000:2.209,674.370000:1.103,676.090000:1.103,677.350000:1.103,678.070000:1.103,683.370000:1.103,684.920000:1.103,685.380000:2.091,686.390000:1.103,701.410000:1.103,702.380000:7.387,703.420000:3.12,707.360000:1.103,713.340000:1.103,718.370000:2.197,720.400000:1.103,724.180000:1.103,728.390000:1.103,734.380000:1.103,735.430000:1.103,736.360000:1.103,737.310000:1.103,741.070000:1.103,745.480000:1.103,747.290000:1.103,748.320000:1.103,754.358237:6.383,755.370000:2.136,760.490000:1.103,765.360000:1.103,767.500000:1.103,770.370000:1.103,775.230000:1.103,778.490000:1.103,792.360000:1.103,796.420000:1.103,801.380000:1.103,814.390000:2.118,815.390000:1.103,816.410000:1.103,820.470000:1.103,825.350000:1.103,841.510000:1.103,848.450000:1.103,883.450000:1.103,884.470000:1.103,896.410000:1.103,907.420000:1.103,908.430000:1.103,916.380000:1.103,1074.300000:1.103,1092.600000:1.103,1164.300000:1.103,1231.540000:1.103,1397.690000:1.103,1660.400000:1.103,1711.520000:1.103
90 ions2 :
91 ions3 :
92 peptol : 0.0
93 peptol units :
94 peptol str :
95 repeat srch : 497.265612 from(498.272888,1+) query(1)
96157.096962, 23.720000
97185.160000, 26.690000
98286.134951, 80.700000
99385.210000, 13.490000
100480.270000, 4.363000
101129.102412, 18.840000
102187.070000, 22.510000
103354.189124, 13.570000
104399.246727, 9.489000
105482.140542, 3.205000
106130.110251, 9.257000
107258.132661, 15.930000
108357.210000, 13.570000
109443.810000, 6.256000
110481.210000, 3.182000
111136.070000, 7.387000
112213.139215, 13.840000
113371.204929, 11.240000
114459.280000, 6.216000
115489.233770, 3.157000
116147.117662, 6.333000
117229.120000, 9.720000
118326.133204, 5.268000
119423.125582, 4.262000
120483.115000, 2.205000
121159.080000, 5.222000
122240.130000, 7.562000
123298.110000, 5.231000
124444.168974, 3.247000
125474.300000, 1.103000
126158.090000, 4.301000
127270.180000, 7.432000
128324.170000, 5.170000
129411.200000, 3.230000
130475.270000, 1.103000
13186.110000, 3.276000
132175.110000, 7.308000
133312.150879, 4.235000
134463.265712, 3.205000
135476.700000, 1.103000
136102.060000, 3.276000
137241.085275, 5.361000
138293.110000, 4.178000
139445.810000, 3.182000
140478.180000, 1.103000
141115.088725, 3.255000
142243.139772, 4.378000
143353.155308, 4.149000
144401.150000, 3.138000
145486.880000, 1.103000
14672.090000, 2.174000
14776.400000, 1.103000
14884.075000, 2.111000
14987.110000, 1.103000
15088.100000, 1.103000
15198.060000, 1.103000
152103.060000, 1.103000
153105.070000, 1.103000
154116.070000, 1.103000
155117.110000, 1.103000
156118.400000, 1.103000
157120.090000, 2.205000
158126.070000, 1.103000
159127.090000, 1.103000
160128.090000, 2.103000
161131.085000, 2.118000
162132.090000, 1.103000
163135.800000, 1.103000
164137.080000, 1.103000
165138.070000, 1.103000
166139.090000, 1.103000
167140.150000, 2.174000
168141.060000, 2.174000
169143.120000, 2.174000
170146.080000, 1.103000
171152.060000, 1.103000
172155.070000, 2.205000
173156.100000, 1.103000
174159.450000, 1.103000
175165.080000, 2.136000
176166.110000, 1.103000
177167.110000, 1.103000
178169.710000, 1.103000
179170.450000, 1.103000
180171.090000, 1.103000
181173.120000, 2.174000
182177.090000, 1.103000
183178.080000, 1.103000
184181.160000, 1.103000
185182.030000, 1.103000
186183.110000, 2.174000
187183.930000, 1.103000
188186.131024, 4.374000
189188.070000, 1.103000
190188.760000, 1.103000
191189.070000, 1.103000
192190.065000, 2.103000
193191.300000, 1.103000
194197.130000, 1.103000
195199.180000, 1.103000
196200.080000, 1.103000
197201.100000, 3.138000
198202.110000, 2.091000
199203.080000, 2.174000
200203.610000, 1.103000
201211.140000, 4.189000
202212.115000, 2.103000
203212.490000, 1.103000
204214.985000, 2.205000
205216.110000, 2.103000
206217.100000, 1.103000
207218.080000, 1.103000
208219.090000, 2.103000
209223.090000, 3.154000
210224.130000, 1.103000
211225.130000, 1.103000
212227.170000, 1.103000
213227.880000, 1.103000
214228.170000, 2.136000
215229.760000, 1.103000
216231.950000, 1.103000
217233.130000, 1.103000
218234.430000, 1.103000
219235.080000, 2.103000
220236.590000, 1.103000
221238.080000, 4.332000
222239.139997, 3.131000
223242.170000, 2.205000
224244.090000, 2.136000
225244.430000, 2.091000
226245.165685, 3.205000
227246.160000, 2.197000
228247.110000, 2.102000
229248.145000, 2.118000
230249.110000, 2.136000
231250.080000, 1.103000
232251.160000, 1.103000
233253.100000, 1.103000
234254.130000, 1.103000
235255.165000, 2.220000
236256.170000, 1.103000
237257.060000, 1.103000
238259.150000, 2.197000
239260.000000, 1.103000
240260.490000, 1.103000
241262.110000, 1.103000
242265.120000, 1.103000
243266.130000, 2.159000
244266.950000, 1.103000
245267.210000, 1.103000
246268.120000, 3.214000
247269.090000, 1.103000
248271.150000, 2.136000
249272.170000, 2.103000
250274.120000, 1.103000
251275.030000, 1.103000
252276.175000, 2.220000
253278.190000, 1.103000
254279.720000, 2.205000
255281.120000, 1.103000
256283.070000, 1.103000
257284.110000, 1.103000
258285.070000, 1.103000
259287.140000, 3.296000
260287.780000, 1.103000
261288.090000, 2.103000
262290.130000, 1.103000
263294.110000, 2.174000
264295.150000, 3.114000
265295.730000, 1.103000
266297.180000, 2.136000
267300.160000, 3.143000
268302.070000, 1.103000
269303.160000, 1.103000
270303.590000, 1.103000
271304.600000, 1.103000
272305.130000, 1.103000
273306.140000, 3.182000
274307.050000, 1.103000
275308.150000, 2.174000
276308.490000, 1.103000
277312.610000, 1.103000
278312.880000, 1.103000
279314.120000, 1.103000
280316.085000, 2.111000
281317.150000, 3.183000
282318.140000, 1.103000
283320.140000, 1.103000
284322.149731, 3.255000
285323.034482, 3.149000
286327.020000, 1.103000
287328.020000, 1.103000
288331.140000, 2.091000
289332.165000, 2.103000
290333.140000, 1.103000
291335.500000, 1.103000
292336.190000, 1.103000
293337.030000, 2.118000
294338.620000, 1.103000
295338.940000, 1.103000
296339.200000, 3.261000
297341.210000, 2.103000
298342.180000, 1.103000
299342.800000, 1.103000
300343.225000, 2.111000
301343.800000, 1.103000
302344.150000, 2.174000
303346.010000, 1.103000
304347.660000, 1.103000
305348.200000, 2.197000
306349.800000, 1.103000
307350.110000, 2.118000
308351.130000, 3.276000
309352.130000, 2.136000
310353.910000, 1.103000
311354.470000, 1.103000
312355.193955, 3.376000
313358.200000, 1.103000
314359.210000, 2.174000
315359.910000, 1.103000
316360.470000, 1.103000
317361.080000, 1.103000
318362.190000, 1.103000
319363.040000, 1.103000
320364.080000, 1.103000
321366.120000, 1.103000
322367.150000, 1.103000
323368.330000, 1.103000
324368.730000, 1.103000
325369.230000, 3.150000
326369.820000, 1.103000
327370.177065, 3.279000
328373.130000, 2.197000
329374.055000, 2.217000
330374.510000, 2.205000
331376.040000, 1.103000
332377.040000, 1.103000
333380.160000, 2.103000
334382.180000, 3.102000
335383.115000, 2.209000
336385.890000, 2.205000
337386.370000, 1.103000
338387.170000, 3.114000
339387.680000, 2.217000
340388.050000, 1.103000
341389.620000, 1.103000
342390.190000, 1.103000
343390.610000, 1.103000
344394.260000, 1.103000
345395.180000, 1.103000
346396.140000, 2.205000
347397.980000, 1.103000
348400.165000, 2.209000
349403.210000, 1.103000
350404.150000, 1.103000
351404.470000, 1.103000
352410.165000, 2.111000
353411.550000, 1.103000
354413.240000, 1.103000
355414.080000, 1.103000
356415.000000, 1.103000
357416.190000, 1.103000
358416.830000, 1.103000
359417.230000, 1.103000
360417.760000, 1.103000
361418.285000, 2.111000
362418.680000, 1.103000
363420.650000, 1.103000
364421.170000, 2.136000
365422.580000, 1.103000
366425.215000, 2.103000
367425.690000, 1.103000
368426.220000, 3.125000
369428.140000, 2.155000
370428.650000, 1.103000
371430.260000, 1.103000
372430.995000, 2.205000
373433.200000, 1.103000
374433.690000, 1.103000
375435.000000, 1.103000
376435.260000, 1.103000
377437.180000, 1.103000
378438.710000, 2.174000
379439.230000, 1.103000
380440.210000, 1.103000
381442.190000, 1.103000
382443.120000, 1.103000
383444.680000, 1.103000
384445.120000, 1.103000
385449.110000, 1.103000
386450.710000, 1.103000
387452.150000, 2.209000
388453.240000, 3.120000
389454.200000, 1.103000
390454.700000, 1.103000
391458.310000, 1.103000
392460.290000, 1.103000
393461.250000, 1.103000
394461.830000, 1.103000
395462.195000, 2.103000
396463.850000, 1.103000
397464.250000, 1.103000
398467.180000, 2.174000
399470.210000, 1.103000
400471.120000, 1.103000
401489.700000, 1.103000
402493.200000, 1.103000
403494.200000, 1.103000
404505.200000, 1.103000
405508.170000, 2.197000
406508.840000, 1.103000
407509.200000, 2.103000
408511.450000, 1.103000
409522.170000, 2.197000
410523.190000, 1.103000
411524.150000, 2.174000
412527.160000, 1.103000
413528.410000, 2.190000
414529.280000, 1.103000
415530.230000, 1.103000
416531.250000, 1.103000
417533.130000, 1.103000
418533.670000, 1.103000
419536.720000, 1.103000
420537.240000, 1.103000
421538.080000, 1.103000
422538.450000, 1.103000
423540.220000, 1.103000
424545.210000, 2.174000
425545.490000, 1.103000
426546.250000, 1.103000
427547.350000, 1.103000
428550.750000, 2.205000
429558.070000, 1.103000
430561.360000, 1.103000
431562.200000, 1.103000
432563.330000, 1.103000
433568.230000, 1.103000
434571.290000, 3.136000
435573.010000, 1.103000
436575.410000, 1.103000
437580.240000, 1.103000
438581.260000, 1.103000
439585.160000, 1.103000
440588.380000, 1.103000
441590.120000, 1.103000
442599.450000, 1.103000
443605.210000, 2.197000
444607.285000, 4.499000
445608.270000, 3.143000
446613.330000, 2.103000
447614.330000, 1.103000
448617.320000, 1.103000
449621.230000, 1.103000
450622.310000, 1.103000
451625.320000, 3.230000
452626.210000, 1.103000
453633.275000, 2.205000
454640.350000, 1.103000
455642.220000, 1.103000
456644.280000, 1.103000
457646.250000, 1.103000
458648.390000, 1.103000
459651.335000, 2.103000
460653.360000, 2.136000
461658.300000, 1.103000
462662.320000, 1.103000
463663.800000, 1.103000
464668.275000, 2.209000
465674.370000, 1.103000
466676.090000, 1.103000
467677.350000, 1.103000
468678.070000, 1.103000
469683.370000, 1.103000
470684.920000, 1.103000
471685.380000, 2.091000
472686.390000, 1.103000
473701.410000, 1.103000
474702.380000, 7.387000
475703.420000, 3.120000
476707.360000, 1.103000
477713.340000, 1.103000
478718.370000, 2.197000
479720.400000, 1.103000
480724.180000, 1.103000
481728.390000, 1.103000
482734.380000, 1.103000
483735.430000, 1.103000
484736.360000, 1.103000
485737.310000, 1.103000
486741.070000, 1.103000
487745.480000, 1.103000
488747.290000, 1.103000
489748.320000, 1.103000
490754.358237, 6.383000
491755.370000, 2.136000
492760.490000, 1.103000
493765.360000, 1.103000
494767.500000, 1.103000
495770.370000, 1.103000
496775.230000, 1.103000
497778.490000, 1.103000
498792.360000, 1.103000
499796.420000, 1.103000
500801.380000, 1.103000
501814.390000, 2.118000
502815.390000, 1.103000
503816.410000, 1.103000
504820.470000, 1.103000
505825.350000, 1.103000
506841.510000, 1.103000
507848.450000, 1.103000
508883.450000, 1.103000
509884.470000, 1.103000
510896.410000, 1.103000
511907.420000, 1.103000
512908.430000, 1.103000
513916.380000, 1.103000
5141074.300000, 1.103000
5151092.600000, 1.103000
5161164.300000, 1.103000
5171231.540000, 1.103000
5181397.690000, 1.103000
5191660.400000, 1.103000
5201711.520000, 1.103000
521
522
523"""
524