Example #1
0
     $pepvalid = $pep->validateSequence($sequence) ? 'true' : 'false';
 }
 if ($nterminus !== '') {
     $pep->NTerminus = $nterminus;
 }
 if ($cterminus !== '') {
     $pep->CTerminus = $cterminus;
 }
 if ($pepvalid === 'true') {
     if ($cterminus !== '') {
         $ctermmass = strval($pep->getCTerminusMass('monoisotopic'));
     }
     if ($nterminus !== '') {
         $ntermmass = strval($pep->getNTerminusMass('monoisotopic'));
     }
     $mec = $pep->getMec();
     $pepmass = strval($pep->getMass('monoisotopic'));
     $pepmcr2 = strval($pep->getTheoreticalMCR('monoisotopic', 2));
     $pepmcr3 = strval($pep->getTheoreticalMCR('monoisotopic', 3));
     $pepmcr4 = strval($pep->getTheoreticalMCR('monoisotopic', 4));
     if (!is_numeric($iccharge)) {
         $iccharge = '2';
     }
     //-- IonCalculator --
     $ic = new IonCalculator(array('peptide' => $pep, 'maxcharge' => intval($iccharge), 'weighttype' => 'monoisotopic', 'neutralloss' => array('H2O', 'NH3'), 'customtemplate' => '{ion}{index} {charge}+ {flag}'));
     $arrIcRes = array();
     foreach ($arrIons as $ion) {
         $arrIcRes += $ic->calculateIon($ion);
     }
     //-- Spectrum --
     $validSpec = false;