Source of file MascotSearchParameters.php
Size: 8,688 Bytes - Last Modified: 2019-05-10T12:24:09+01:00
src/Search/Parameters/MascotSearchParameters.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
Covered by 1 test(s):
77
Covered by 1 test(s):
78
Covered by 1 test(s):
79
Covered by 1 test(s):
80
Covered by 1 test(s):
81
Covered by 1 test(s):
82838485
Covered by 1 test(s):
86
Covered by 1 test(s):
87888990
Covered by 1 test(s):
9192939495
Covered by 1 test(s):
96
Covered by 1 test(s):
979899100
Covered by 1 test(s):
101102103104105106
Covered by 2 test(s):
107
Covered by 2 test(s):
108
Covered by 2 test(s):
109
Covered by 1 test(s):
110
Covered by 1 test(s):
111
Covered by 1 test(s):
112
Covered by 1 test(s):
113
Covered by 1 test(s):
114115116117118
Covered by 1 test(s):
119120121122123
Covered by 1 test(s):
124
Covered by 1 test(s):
125126127128
Covered by 1 test(s):
129130131132133
Covered by 1 test(s):
134
Covered by 1 test(s):
135136137138
Covered by 1 test(s):
139140141142143
Covered by 1 test(s):
144
Covered by 1 test(s):
145146147148
Covered by 1 test(s):
149150151152153
Covered by 1 test(s):
154155156157158
Covered by 1 test(s):
159160161162163
Covered by 1 test(s):
164
Covered by 1 test(s):
165166167168
Covered by 1 test(s):
169170171172173
Covered by 1 test(s):
174
Covered by 1 test(s):
175176177178
Covered by 1 test(s):
179180181182183184185186187188189190
Covered by 1 test(s):
191
Covered by 1 test(s):
192193194195196197198199200
Covered by 1 test(s):
201202203204205206
Covered by 1 test(s):
207
Covered by 1 test(s):
208209210211
Covered by 1 test(s):
212213214215216217
Covered by 1 test(s):
218
Covered by 1 test(s):
219220221222
Covered by 1 test(s):
223224225226227
Covered by 2 test(s):
228
Covered by 1 test(s):
229230231
Covered by 1 test(s):
232
Covered by 1 test(s):
233234235236
Covered by 1 test(s):
237238239240241
Covered by 1 test(s):
242
Covered by 1 test(s):
243244245246
Covered by 1 test(s):
247248249250251252
Covered by 2 test(s):
253
Covered by 2 test(s):
254
Covered by 2 test(s):
255
Covered by 2 test(s):
256
Covered by 2 test(s):
257
Covered by 2 test(s):
258
Covered by 2 test(s):
259
Covered by 2 test(s):
260
Covered by 2 test(s):
261
Covered by 1 test(s):
262
Covered by 1 test(s):
263
Covered by 1 test(s):
264
Covered by 1 test(s):
265
Covered by 1 test(s):
266
Covered by 1 test(s):
267268269270
Covered by 1 test(s):
271272273274275276277278279280281282283
Covered by 2 test(s):
284
Covered by 1 test(s):
285286287
Covered by 1 test(s):
288
Covered by 1 test(s):
289290291292
Covered by 1 test(s):
293294295296297298
Covered by 2 test(s):
299
Covered by 2 test(s):
300
Covered by 2 test(s):
301
Covered by 2 test(s):
302
Covered by 2 test(s):
303
Covered by 2 test(s):
304
Covered by 2 test(s):
305
Covered by 2 test(s):
306
Covered by 2 test(s):
307
Covered by 2 test(s):
308
Covered by 2 test(s):
309
Covered by 2 test(s):
310
Covered by 2 test(s):
311
Covered by 2 test(s):
312
Covered by 1 test(s):
313
Covered by 1 test(s):
314
Covered by 1 test(s):
315
Covered by 1 test(s):
316
Covered by 1 test(s):
317
Covered by 1 test(s):
318319320321
Covered by 1 test(s):
322323324325326327
Covered by 1 test(s):
328
Covered by 1 test(s):
329330331332
Covered by 1 test(s):
333334335336337338
Covered by 2 test(s):
339
Covered by 2 test(s):
340
Covered by 1 test(s):
341
Covered by 1 test(s):
342
Covered by 1 test(s):
343
Covered by 1 test(s):
344
Covered by 1 test(s):
345346347348349
Covered by 1 test(s):
350351352353354
Covered by 1 test(s):
355
Covered by 1 test(s):
356357358
Covered by 1 test(s):
359
Covered by 1 test(s):
360361
| <?php /** * Copyright 2016 University of Liverpool * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace pgb_liv\php_ms\Search\Parameters; use pgb_liv\php_ms\Core\Tolerance; /** * Encapsulation class for Mascot search parameters * * @author Andrew Collins */ class MascotSearchParameters extends AbstractSearchParameters implements SearchParametersInterface { const UNIT_PPM = 'ppm'; const MASS_MONO = 'Monoisotopic'; const MASS_AVG = 'Average'; private $formVersion = '1.01'; private $intermediate = ''; private $searchType = 'MIS'; private $peak = 'AUTO'; private $repType = 'peptide'; private $errTolRepeat = 0; private $isShowAllModsEnabled = ''; private $userName; private $userMail; private $title; private $quantitation = 'None'; private $taxonomy = 'All Entries'; private $peptideIsotopeError = 0; private $charge = '2+'; private $mass = 'Monoisotopic'; private $fileFormat = 'Mascot generic'; private $precursor; private $instrument = 'Default'; private $report = 'Auto'; public function __construct() { // Set defaults $this->setEnzyme('Trypsin'); $this->setMissedCleavageCount(1); $this->setPrecursorTolerance(new Tolerance(1.2, Tolerance::DA)); $this->setFragmentTolerance(new Tolerance(0.6, Tolerance::DA)); $this->setDecoyEnabled(true); } public function setIntermediate($intermediate) { $this->intermediate = $intermediate; } public function getIntermediate() { return $this->intermediate; } public function setFormVersion($formVersion) { $this->formVersion = $formVersion; } public function getFormVersion() { return $this->formVersion; } public function setSearchType($searchType) { switch ($searchType) { case 'MIS': case 'SQ': case 'PMF': $this->searchType = $searchType; return; default: throw new \InvalidArgumentException('Unknown search type: ' . $searchType); } } public function getSearchType() { return $this->searchType; } public function setRepType($repType) { $this->repType = $repType; } public function getRepType() { return $this->repType; } public function setErrorTolerantRepeat($repeat) { $this->errTolRepeat = $repeat; } public function getErrorTolerantRepeat() { return $this->errTolRepeat; } public function setPeak($peak) { $this->peak = $peak; } public function getPeak() { return $this->peak; } public function setShowAllModsEnabled($bool) { return $this->isShowAllModsEnabled = $bool; } public function isShowAllModsEnabled() { return $this->isShowAllModsEnabled; } public function setUserName($userName) { $this->userName = $userName; } public function getUserName() { return $this->userName; } public function setUserMail($mail) { $this->userMail = $mail; } public function getUserMail() { return $this->userMail; } /** * A text string which will be printed at the top of results report pages. * Can be left blank. * * @param string $title * Text string for title */ public function setTitle($title) { $this->title = $title; } /** * A text string which will be printed at the top of results report pages. * * @return string */ public function getTitle() { return $this->title; } public function setQuantitation($quantitationMethod) { // TODO: Validate quantitation $this->quantitation = $quantitationMethod; } public function getQuantitation() { return $this->quantitation; } public function setTaxonomy($taxonomy) { // TODO: Validate taxonomy $this->taxonomy = $taxonomy; } public function getTaxonomy() { return $this->taxonomy; } public function setPeptideIsotopeError($peptideIsotopeError) { if (! is_int($peptideIsotopeError) || $peptideIsotopeError < 0 || $peptideIsotopeError > 2) { throw new \InvalidArgumentException('Argument 1 must be an integer value between 0 and 2'); } $this->peptideIsotopeError = $peptideIsotopeError; } public function getPeptideIsotopeError() { return $this->peptideIsotopeError; } public function setCharge($charge) { $this->charge = $charge; } public function getCharge() { return $this->charge; } public function setFileFormat($fileFormat) { switch ($fileFormat) { case 'Mascot generic': case 'Sequest (.DTA)': case 'Finnigan (.ASC)': case 'Micromass (.PKL)': case 'PerSeptive (.PKS)': case 'Sciex API III': case 'Bruker (.XML)': case 'mzData (.XML)': case 'mzML (.mzML)': $this->fileFormat = $fileFormat; break; default: throw new \InvalidArgumentException('Argument 1 must specify a known file format'); } } public function getFileFormat() { return $this->fileFormat; } /** * Certain data file formats, SCIEX API III, PerSeptive (.PKS), and Bruker (.XML), do not include m/z information for the precursor peptide. * For these formats only, the Precursor field is used to specify the m/z value of the parent peptide. The charge state is defined by the setting of the * Peptide Charge field. * * @param float $precursorMass * Precursor mass value */ public function setPrecursor($precursorMass) { if ((! is_float($precursorMass) && ! is_int($precursorMass)) || $precursorMass < 0) { throw new \InvalidArgumentException('Argument 1 must be a float or integer value greater than 0'); } $this->precursor = $precursorMass; } public function getPrecursor() { return $this->precursor; } public function setInstrument($instrument) { switch ($instrument) { case 'Default': case 'ESI-QUAD-TOF': case 'MALDI-TOF-PSD': case 'ESI-TRAP': case 'ESI-QUAD': case 'ESI-FTICR': case 'MALDI-TOF-TOF': case 'ESI-4SECTOR': case 'FTMS-ECD': case 'ETD-TRAP': case 'MALDI-QUAD-TOF': case 'MALDI-QIT-TOF': case 'MALDI-ISD': case 'CID+ETD': $this->instrument = $instrument; break; default: throw new \InvalidArgumentException('Argument 1 must specify a known instrument type'); } } public function getInstrument() { return $this->instrument; } public function setReport($top) { // TODO: Validiate Report top limit $this->report = $top; } public function getReport() { return $this->report; } public function setMassType($massType) { switch ($massType) { case MascotSearchParameters::MASS_MONO: case MascotSearchParameters::MASS_AVG: $this->mass = $massType; return; default: throw new \InvalidArgumentException('Mass type must be either monoistopic or average'); } } public function getMassType() { return $this->mass; } public function setMissedCleavageCount($maxCleave) { if (! is_int($maxCleave) || $maxCleave < 0 || $maxCleave > 9) { throw new \InvalidArgumentException('Argument 1 must be an unsigned integer between 0 and 9'); } parent::setMissedCleavageCount($maxCleave); } } |