Example #1
0
} else {
    print 'FALSE<br />';
}
// ###### NAKED PEPTIDE ######
$pep = new Peptide();
$pep->Sequence = 'HGYIGEFEYVDDHR';
$pep->NTerminus = 'H';
$pep->CTerminus = 'OH';
print '<br><h1>Testing naked peptide</h1>';
print 'Peptide: ' . $pep->Sequence . '<br />';
print 'N-Terminus: ' . $pep->NTerminus . '<br />';
print 'C-Terminus: ' . $pep->CTerminus . '<br />';
print '<h3>Masses monoisotopic</h3>';
print 'Mass C-Terminus: ' . strval($pep->getCTerminusMass('monoisotopic')) . '<br />';
print 'Mass N-Terminus: ' . strval($pep->getNTerminusMass('monoisotopic')) . '<br />';
print 'Peptide mass: ' . strval($pep->getMass('monoisotopic')) . '<br />';
print 'Calculated MCR 2: ' . strval($pep->getTheoreticalMCR('monoisotopic', 2)) . '<br />';
print '<h3>Masses average</h3>';
print 'Mass C-Terminus: ' . strval($pep->getCTerminusMass('average')) . '<br />';
print 'Mass N-Terminus: ' . strval($pep->getNTerminusMass('average')) . '<br />';
print 'Peptide mass: ' . strval($pep->getMass('average')) . '<br />';
print 'Calculated MCR 3: ' . strval($pep->getTheoreticalMCR('monoisotopic', 3)) . '<br />';
$modpep = new ModifiedPeptide();
$modpep->Sequence = 'ITLLEELQEKTEEDEENKPSVIEK';
$modpep->NTerminus = 'H';
$modpep->CTerminus = 'OH';
$objMod1 = array('accession' => 21, 'position' => 1);
print '<h1>Testing phosphat modification</h1>';
print 'Peptide: ' . $modpep->Sequence . '<br />';
print 'N-Terminus: ' . $modpep->NTerminus . '<br />';
print 'C-Terminus: ' . $modpep->CTerminus . '<br />';
Example #2
0
 }
 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;
     if ($spectrum !== '') {