Example #1
0
 * 
 * Customized tests for PhProt peptide and modified peptide
 * @author Robert Schmidt <*****@*****.**>
 * @version 0.1
 * @package mpimp.phprot
 */
include_once '../PhProt.php';
$pp = new PhProt();
$pp->using('base');
$pp->using('peptide');
$pep = new Peptide();
// ###### VALIDATION ######
print '<h1>Testing validation</h1>';
$seq = 'HGYIGEFEYVDDHR';
print 'Peptide: ' . $seq . '<br />';
if ($pep->validateSequence($seq) === true) {
    print 'TRUE<br />';
} else {
    print 'FALSE<br />';
}
$seq = 'HXGYIGEFEYVDDHR';
print 'Peptide: ' . $seq . '<br />';
if ($pep->validateSequence($seq) === true) {
    print 'TRUE<br />';
} else {
    print 'FALSE<br />';
}
$seq = 'HGYIGEF4EYVDDHR';
print 'Peptide: ' . $seq . '<br />';
if ($pep->validateSequence($seq) === true) {
    print 'TRUE<br />';
Example #2
0
 $mod5acc = array_key_exists('mod5acc', $_POST) ? $_POST['mod5acc'] : '';
 $mod1pos = array_key_exists('mod1pos', $_POST) ? $_POST['mod1pos'] : '';
 $mod2pos = array_key_exists('mod2pos', $_POST) ? $_POST['mod2pos'] : '';
 $mod3pos = array_key_exists('mod3pos', $_POST) ? $_POST['mod3pos'] : '';
 $mod4pos = array_key_exists('mod4pos', $_POST) ? $_POST['mod4pos'] : '';
 $mod5pos = array_key_exists('mod5pos', $_POST) ? $_POST['mod5pos'] : '';
 $arrIons = array_key_exists('ioncalc', $_POST) ? $_POST['ioncalc'] : '';
 $iccharge = array_key_exists('iccharge', $_POST) ? $_POST['iccharge'] : '';
 $spectrum = array_key_exists('spectrum', $_POST) ? $_POST['spectrum'] : '';
 if ($ismodified === 'true') {
     $pep = new ModifiedPeptide();
     $pepvalid = $pep->setModifiedSequence($sequence) ? 'true' : 'false';
 } else {
     $pep = new Peptide();
     $pep->Sequence = $sequence;
     $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();