Example program for retrieving search parameter 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 searchParameters(resfile)
30
31
32def searchParameters(resfile) :
33 """
34 Display parameters from the ms_searchparams object.
35 The values come from the parameters and the masses sections of the file.
36 """
37
38 params = resfile.params()
39 fmt = "%-20s: %s"
40
41 print("Search parameters from ms_searchparams")
42 print("=========================================")
43 print(fmt % ("License" , params.getLICENSE()))
44 print(fmt % ("Search title" , params.getCOM()))
45 print(fmt % ("SEG mass" , params.getSEG()))
46 print(fmt % ("Peptide tol" , params.getTOL()))
47 print(fmt % ("Peptide tol units" , params.getTOLU()))
48 print(fmt % ("Fragment tol" , params.getITOL()))
49 print(fmt % ("Fragment tol units" , params.getITOLU()))
50 print(fmt % ("Missed cleavages" , params.getPFA()))
51 print(fmt % ("Database" , params.getDB()))
52 print(fmt % ("Static mods" , params.getMODS()))
53 print(fmt % ("Average/monoisotopic", params.getMASS()))
54 print(fmt % ("Enzyme" , params.getCLE()))
55 print(fmt % ("Raw data file name" , params.getFILENAME()))
56 print(fmt % ("Input data" , params.getQUE()))
57 print(fmt % ("Type of search" , params.getSEARCH()))
58 print(fmt % ("User name" , params.getUSERNAME()))
59 print(fmt % ("User email" , params.getUSEREMAIL()))
60 print(fmt % ("Charge state" , params.getCHARGE()))
61 print(fmt % ("Repeat search file" , params.getINTERMEDIATE()))
62 print(fmt % ("Num hits to display" , params.getREPORT()))
63 print(fmt % ("Show overview" , params.getOVERVIEW()))
64 print(fmt % ("Data file format" , params.getFORMAT()))
65 print(fmt % ("Form version" , params.getFORMVER()))
66 print(fmt % ("Variable mods" , params.getIT_MODS()))
67
68 for i in range(12) :
69 print(fmt % ( "User%02d" % i, params.getUSERField(i)))
70
71 print(fmt % ("Precursor mass" , params.getPRECURSOR()))
72 print(fmt % ("Taxonomy filter" , params.getTAXONOMY()))
73 print(fmt % ("Type of report" , params.getREPTYPE()))
74 print(fmt % ("Accessions to search", params.getACCESSION()))
75 print(fmt % ("Subcluster used" , params.getSUBCLUSTER()))
76 print(fmt % ("ICAT search?" , params.getICAT()))
77 print(fmt % ("Instrument type" , params.getINSTRUMENT()))
78 print(fmt % ("Error tolerant?" , params.getERRORTOLERANT()))
79 print(fmt % ("Rules (ions series)" , params.getRULES()))
80
81 for ch in range(ord('A'), 1 + ord('Z')) :
82 print(fmt % ("Residue " + chr(ch), params.getResidueMass(chr(ch))))
83
84 print(fmt % ("C terminus mass" , params.getCTermMass()))
85 print(fmt % ("N terminus mass" , params.getNTermMass()))
86 print(fmt % ("Mass of hydrogen", params.getHydrogenMass()))
87 print(fmt % ("Mass of oxygen" , params.getOxygenMass()))
88 print(fmt % ("Mass of carbon" , params.getCarbonMass()))
89 print(fmt % ("Mass of nitrogen", params.getNitrogenMass()))
90 print(fmt % ("Mass of electron", params.getElectronMass()))
91
92 i = 1
93 while params.getVarModsName(i) :
94 print(fmt % ("Variable mod name" , params.getVarModsName(i)))
95 print(fmt % ("Variable mod delta" , params.getVarModsDelta(i)))
96 print(fmt % ("Variable mod neutral", params.getVarModsNeutralLoss(i)))
97 i += 1
98
99 print(" ")
100
101
102if __name__ == "__main__" :
103 sys.exit(main())
104
105
106"""
107
108Running the program as
109
110python resfile_params.pl F981123.dat
111
112will give the following output under Mascot Server 2.3:
113
114
115Search parameters from ms_searchparams
116=========================================
117License : Licensed to: Matrix Science Internal use only - Frill, (4 processors).
118Search title : MS/MS Example
119SEG mass : -1
120Peptide tol : 0.2
121Peptide tol units : Da
122Fragment tol : 0.2
123Fragment tol units : Da
124Missed cleavages : 1
125Database : SwissProt
126Static mods :
127Average/monoisotopic: Monoisotopic
128Enzyme : Trypsin
129Raw data file name : C:\Auto MSMS output\Sample 1.pkl
130Input data :
131Type of search : MIS
132User name :
133User email :
134Charge state : 2+
135Repeat search file : ../data/F981123.dat
136Num hits to display : 0
137Show overview : False
138Data file format : Mascot generic
139Form version : 1.01
140Variable mods : Oxidation (M)
141User00 :
142User01 :
143User02 :
144User03 :
145User04 :
146User05 :
147User06 :
148User07 :
149User08 :
150User09 :
151User10 :
152User11 :
153Precursor mass : 0.0
154Taxonomy filter : All entries
155Type of report : Peptide
156Accessions to search:
157Subcluster used : -1
158ICAT search? : False
159Instrument type : ESI-QUAD-TOF
160Error tolerant? : False
161Rules (ions series) : 1,2,8,9,10,13,14,15
162Residue A : 71.037114
163Residue B : 114.53494
164Residue C : 103.009185
165Residue D : 115.026943
166Residue E : 129.042593
167Residue F : 147.068414
168Residue G : 57.021464
169Residue H : 137.058912
170Residue I : 113.084064
171Residue J : 0.0
172Residue K : 128.094963
173Residue L : 113.084064
174Residue M : 131.040485
175Residue N : 114.042927
176Residue O : 0.0
177Residue P : 97.052764
178Residue Q : 128.058578
179Residue R : 156.101111
180Residue S : 87.032028
181Residue T : 101.047679
182Residue U : 150.95363
183Residue V : 99.068414
184Residue W : 186.079313
185Residue X : 111.0
186Residue Y : 163.063329
187Residue Z : 128.55059
188C terminus mass : 17.00274
189N terminus mass : 1.007825
190Mass of hydrogen : 1.007825
191Mass of oxygen : 15.994915
192Mass of carbon : 12.0
193Mass of nitrogen : 14.003074
194Mass of electron : 0.000549
195Variable mod name : Oxidation (M)
196Variable mod delta : 15.994919
197Variable mod neutral: 0.0
198
199
200"""
201