Matrix Science header

resfile_input.pl

Example program for retrieving input spectrum data.

#!/usr/local/bin/perl
##############################################################################
# file: resfile_input.pl                                                     #
# 'msparser' toolkit                                                         #
# Test harness / example code                                                #
##############################################################################
# COPYRIGHT NOTICE                                                           #
# Copyright 1998-2010 Matrix Science Limited  All Rights Reserved.           #
#                                                                            #
##############################################################################
#     $Source: /vol/cvsroot/parser/examples/test_perl/resfile_input.pl,v $ #
#     $Author: villek $ #
#       $Date: 2010/08/31 08:48:07 $ #
#   $Revision: 1.4 $ #
# $NoKeywords::                                                            $ #
##############################################################################
use strict;
##############################################################################

use msparser;

if (!defined($ARGV[0])) { die "Must specify results filename as parameter"; }

my $file = new msparser::ms_mascotresfile($ARGV[0]);

if ($file->isValid) {
    inputData($file);
}


##############################################################################
#  inputData                                                                 # 
#  - parameter 0  ms_mascotresfile                                           #
#  Display input data                                                        # 
##############################################################################
sub inputData {
    my ($resfile) = @_;

    # display input data via inputquery get functions
    for my $i (1 .. 1) {
        # replace 1 .. 1 with 1 .. $resfile->getNumQueries() to get all input
        # data.

        print "Input data for query number ", $i      ,    "\n";
        print "=========================================", "\n";

        my $q = new msparser::ms_inputquery($resfile, $i);
        my $fmt = "    %-16s: %s\n";

        printf $fmt, "title"       , $q->getStringTitle(1);
        printf $fmt, "mass_min"    , $q->getMassMin();
        printf $fmt, "mass_max"    , $q->getMassMax();
        printf $fmt, "int_min"     , $q->getIntMin();
        printf $fmt, "int_max"     , $q->getIntMax();
        printf $fmt, "num_vals"    , $q->getNumVals();
        printf $fmt, "num_used1"   , $q->getNumUsed();
        printf $fmt, "ions1"       , $q->getStringIons1();
        printf $fmt, "ions2"       , $q->getStringIons2();
        printf $fmt, "ions3"       , $q->getStringIons3();
        printf $fmt, "peptol"      , $q->getPepTol();
        printf $fmt, "peptol units", $q->getPepTolUnits();
        printf $fmt, "peptol str"  , $q->getPepTolString();
        printf $fmt, "repeat srch" , $resfile->getRepeatSearchString($i);

        my $num_peaks = $q->getNumberOfPeaks(1);
        for my $j (1 .. $num_peaks) {
            print $q->getPeakMass(1, $j), ", ", $q->getPeakIntensity(1, $j), "\n";
        }        
    }

    print "\n\n";
}



=pod

Running the program as

perl -I../bin resfile_input.pl ../data/F981123.dat

will give the following output under Mascot Server 2.3:

Input data for query number 1
=========================================
    title           : 
    mass_min        : 72.09
    mass_max        : 1711.52
    int_min         : 1.103
    int_max         : 80.7
    num_vals        : 425
    num_used1       : 0
    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
    ions2           : 
    ions3           : 
    peptol          : 0
    peptol units    : 
    peptol str      : 
    repeat srch     : 497.265612 from(498.272888,1+) query(1)
157.096962, 23.72
185.16, 26.69
286.134951, 80.7
385.21, 13.49
480.27, 4.363
129.102412, 18.84
187.07, 22.51
354.189124, 13.57
399.246727, 9.489
482.140542, 3.205
130.110251, 9.257
258.132661, 15.93
357.21, 13.57
443.81, 6.256
481.21, 3.182
136.07, 7.387
213.139215, 13.84
371.204929, 11.24
459.28, 6.216
489.23377, 3.157
147.117662, 6.333
229.12, 9.72
326.133204, 5.268
423.125582, 4.262
483.115, 2.205
159.08, 5.222
240.13, 7.562
298.11, 5.231
444.168974, 3.247
474.3, 1.103
158.09, 4.301
270.18, 7.432
324.17, 5.17
411.2, 3.23
475.27, 1.103
86.11, 3.276
175.11, 7.308
312.150879, 4.235
463.265712, 3.205
476.7, 1.103
102.06, 3.276
241.085275, 5.361
293.11, 4.178
445.81, 3.182
478.18, 1.103
115.088725, 3.255
243.139772, 4.378
353.155308, 4.149
401.15, 3.138
486.88, 1.103
72.09, 2.174
76.4, 1.103
84.075, 2.111
87.11, 1.103
88.1, 1.103
98.06, 1.103
103.06, 1.103
105.07, 1.103
116.07, 1.103
117.11, 1.103
118.4, 1.103
120.09, 2.205
126.07, 1.103
127.09, 1.103
128.09, 2.103
131.085, 2.118
132.09, 1.103
135.8, 1.103
137.08, 1.103
138.07, 1.103
139.09, 1.103
140.15, 2.174
141.06, 2.174
143.12, 2.174
146.08, 1.103
152.06, 1.103
155.07, 2.205
156.1, 1.103
159.45, 1.103
165.08, 2.136
166.11, 1.103
167.11, 1.103
169.71, 1.103
170.45, 1.103
171.09, 1.103
173.12, 2.174
177.09, 1.103
178.08, 1.103
181.16, 1.103
182.03, 1.103
183.11, 2.174
183.93, 1.103
186.131024, 4.374
188.07, 1.103
188.76, 1.103
189.07, 1.103
190.065, 2.103
191.3, 1.103
197.13, 1.103
199.18, 1.103
200.08, 1.103
201.1, 3.138
202.11, 2.091
203.08, 2.174
203.61, 1.103
211.14, 4.189
212.115, 2.103
212.49, 1.103
214.985, 2.205
216.11, 2.103
217.1, 1.103
218.08, 1.103
219.09, 2.103
223.09, 3.154
224.13, 1.103
225.13, 1.103
227.17, 1.103
227.88, 1.103
228.17, 2.136
229.76, 1.103
231.95, 1.103
233.13, 1.103
234.43, 1.103
235.08, 2.103
236.59, 1.103
238.08, 4.332
239.139997, 3.131
242.17, 2.205
244.09, 2.136
244.43, 2.091
245.165685, 3.205
246.16, 2.197
247.11, 2.102
248.145, 2.118
249.11, 2.136
250.08, 1.103
251.16, 1.103
253.1, 1.103
254.13, 1.103
255.165, 2.22
256.17, 1.103
257.06, 1.103
259.15, 2.197
260, 1.103
260.49, 1.103
262.11, 1.103
265.12, 1.103
266.13, 2.159
266.95, 1.103
267.21, 1.103
268.12, 3.214
269.09, 1.103
271.15, 2.136
272.17, 2.103
274.12, 1.103
275.03, 1.103
276.175, 2.22
278.19, 1.103
279.72, 2.205
281.12, 1.103
283.07, 1.103
284.11, 1.103
285.07, 1.103
287.14, 3.296
287.78, 1.103
288.09, 2.103
290.13, 1.103
294.11, 2.174
295.15, 3.114
295.73, 1.103
297.18, 2.136
300.16, 3.143
302.07, 1.103
303.16, 1.103
303.59, 1.103
304.6, 1.103
305.13, 1.103
306.14, 3.182
307.05, 1.103
308.15, 2.174
308.49, 1.103
312.61, 1.103
312.88, 1.103
314.12, 1.103
316.085, 2.111
317.15, 3.183
318.14, 1.103
320.14, 1.103
322.149731, 3.255
323.034482, 3.149
327.02, 1.103
328.02, 1.103
331.14, 2.091
332.165, 2.103
333.14, 1.103
335.5, 1.103
336.19, 1.103
337.03, 2.118
338.62, 1.103
338.94, 1.103
339.2, 3.261
341.21, 2.103
342.18, 1.103
342.8, 1.103
343.225, 2.111
343.8, 1.103
344.15, 2.174
346.01, 1.103
347.66, 1.103
348.2, 2.197
349.8, 1.103
350.11, 2.118
351.13, 3.276
352.13, 2.136
353.91, 1.103
354.47, 1.103
355.193955, 3.376
358.2, 1.103
359.21, 2.174
359.91, 1.103
360.47, 1.103
361.08, 1.103
362.19, 1.103
363.04, 1.103
364.08, 1.103
366.12, 1.103
367.15, 1.103
368.33, 1.103
368.73, 1.103
369.23, 3.15
369.82, 1.103
370.177065, 3.279
373.13, 2.197
374.055, 2.217
374.51, 2.205
376.04, 1.103
377.04, 1.103
380.16, 2.103
382.18, 3.102
383.115, 2.209
385.89, 2.205
386.37, 1.103
387.17, 3.114
387.68, 2.217
388.05, 1.103
389.62, 1.103
390.19, 1.103
390.61, 1.103
394.26, 1.103
395.18, 1.103
396.14, 2.205
397.98, 1.103
400.165, 2.209
403.21, 1.103
404.15, 1.103
404.47, 1.103
410.165, 2.111
411.55, 1.103
413.24, 1.103
414.08, 1.103
415, 1.103
416.19, 1.103
416.83, 1.103
417.23, 1.103
417.76, 1.103
418.285, 2.111
418.68, 1.103
420.65, 1.103
421.17, 2.136
422.58, 1.103
425.215, 2.103
425.69, 1.103
426.22, 3.125
428.14, 2.155
428.65, 1.103
430.26, 1.103
430.995, 2.205
433.2, 1.103
433.69, 1.103
435, 1.103
435.26, 1.103
437.18, 1.103
438.71, 2.174
439.23, 1.103
440.21, 1.103
442.19, 1.103
443.12, 1.103
444.68, 1.103
445.12, 1.103
449.11, 1.103
450.71, 1.103
452.15, 2.209
453.24, 3.12
454.2, 1.103
454.7, 1.103
458.31, 1.103
460.29, 1.103
461.25, 1.103
461.83, 1.103
462.195, 2.103
463.85, 1.103
464.25, 1.103
467.18, 2.174
470.21, 1.103
471.12, 1.103
489.7, 1.103
493.2, 1.103
494.2, 1.103
505.2, 1.103
508.17, 2.197
508.84, 1.103
509.2, 2.103
511.45, 1.103
522.17, 2.197
523.19, 1.103
524.15, 2.174
527.16, 1.103
528.41, 2.19
529.28, 1.103
530.23, 1.103
531.25, 1.103
533.13, 1.103
533.67, 1.103
536.72, 1.103
537.24, 1.103
538.08, 1.103
538.45, 1.103
540.22, 1.103
545.21, 2.174
545.49, 1.103
546.25, 1.103
547.35, 1.103
550.75, 2.205
558.07, 1.103
561.36, 1.103
562.2, 1.103
563.33, 1.103
568.23, 1.103
571.29, 3.136
573.01, 1.103
575.41, 1.103
580.24, 1.103
581.26, 1.103
585.16, 1.103
588.38, 1.103
590.12, 1.103
599.45, 1.103
605.21, 2.197
607.285, 4.499
608.27, 3.143
613.33, 2.103
614.33, 1.103
617.32, 1.103
621.23, 1.103
622.31, 1.103
625.32, 3.23
626.21, 1.103
633.275, 2.205
640.35, 1.103
642.22, 1.103
644.28, 1.103
646.25, 1.103
648.39, 1.103
651.335, 2.103
653.36, 2.136
658.3, 1.103
662.32, 1.103
663.8, 1.103
668.275, 2.209
674.37, 1.103
676.09, 1.103
677.35, 1.103
678.07, 1.103
683.37, 1.103
684.92, 1.103
685.38, 2.091
686.39, 1.103
701.41, 1.103
702.38, 7.387
703.42, 3.12
707.36, 1.103
713.34, 1.103
718.37, 2.197
720.4, 1.103
724.18, 1.103
728.39, 1.103
734.38, 1.103
735.43, 1.103
736.36, 1.103
737.31, 1.103
741.07, 1.103
745.48, 1.103
747.29, 1.103
748.32, 1.103
754.358237, 6.383
755.37, 2.136
760.49, 1.103
765.36, 1.103
767.5, 1.103
770.37, 1.103
775.23, 1.103
778.49, 1.103
792.36, 1.103
796.42, 1.103
801.38, 1.103
814.39, 2.118
815.39, 1.103
816.41, 1.103
820.47, 1.103
825.35, 1.103
841.51, 1.103
848.45, 1.103
883.45, 1.103
884.47, 1.103
896.41, 1.103
907.42, 1.103
908.43, 1.103
916.38, 1.103
1074.3, 1.103
1092.6, 1.103
1164.3, 1.103
1231.54, 1.103
1397.69, 1.103
1660.4, 1.103
1711.52, 1.103


=cut

Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:50