예제 #1
0
파일: index.php 프로젝트: robschmidt/XProt
 $mod15n = array_key_exists('mod15n', $_POST) ? $_POST['mod15n'] : '';
 $mod1acc = array_key_exists('mod1acc', $_POST) ? $_POST['mod1acc'] : '';
 $mod2acc = array_key_exists('mod2acc', $_POST) ? $_POST['mod2acc'] : '';
 $mod3acc = array_key_exists('mod3acc', $_POST) ? $_POST['mod3acc'] : '';
 $mod4acc = array_key_exists('mod4acc', $_POST) ? $_POST['mod4acc'] : '';
 $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'));
예제 #2
0
print 'Peptide mass: ' . strval($modpep->getMass('monoisotopic')) . '<br />';
print 'Calculated MCR 2: ' . strval($modpep->getTheoreticalMCR('monoisotopic', 2)) . '<br />';
$modpep = new ModifiedPeptide();
$modpep->setModifiedSequence('LSN(pS)GDAKVR');
$modpep->NTerminus = 'H';
$modpep->CTerminus = 'OH';
print '<h3>Test for ' . $modpep->Sequence . ' with Phosphosite</h3>';
print 'Mass C-Terminus: ' . strval($modpep->getCTerminusMass('monoisotopic')) . '<br />';
print 'Mass N-Terminus: ' . strval($modpep->getNTerminusMass('monoisotopic')) . '<br />';
print 'Peptide mass: ' . strval($modpep->getMass('monoisotopic')) . '<br />';
print 'Calculated MCR 2: ' . strval($modpep->getTheoreticalMCR('monoisotopic', 2)) . '<br />';
$modpep = new ModifiedPeptide();
$modpep->setModifiedSequence('(pS)YTNLLDLASGNFPVMGR');
$modpep->NTerminus = 'H';
$modpep->CTerminus = 'OH';
print '<h3>Test for ' . $modpep->Sequence . ' with Phosphosite</h3>';
print 'Mass C-Terminus: ' . strval($modpep->getCTerminusMass('monoisotopic')) . '<br />';
print 'Mass N-Terminus: ' . strval($modpep->getNTerminusMass('monoisotopic')) . '<br />';
print 'Peptide mass: ' . strval($modpep->getMass('monoisotopic')) . '<br />';
print 'Calculated MCR 2: ' . strval($modpep->getTheoreticalMCR('monoisotopic', 2)) . '<br />';
$modpep = new ModifiedPeptide();
$modpep->setModifiedSequence('VNIKAPGD(pS)PNTDGIK');
$modpep->NTerminus = 'H';
$modpep->CTerminus = 'OH';
print '<h3>Test for ' . $modpep->Sequence . ' with Phosphosite</h3>';
print 'Mass C-Terminus: ' . strval($modpep->getCTerminusMass('monoisotopic')) . '<br />';
print 'Mass N-Terminus: ' . strval($modpep->getNTerminusMass('monoisotopic')) . '<br />';
print 'Peptide mass: ' . strval($modpep->getMass('monoisotopic')) . '<br />';
print 'Calculated MCR 2: ' . strval($modpep->getTheoreticalMCR('monoisotopic', 2)) . '<br />';
/* End of file CustomTestsPeptide.php */
/* Location: ./path/CustomTestsPeptide.php */
예제 #3
0
<?php

/**
 * CustomTestsIonCalc.php
 * 
 * Custom tests for the IonCalculator class
 * @author Robert Schmidt <*****@*****.**>
 * @version 0.1
 * @package mpimp.phprot
 * @subpackage 
 */
include_once '../PhProt.php';
$pp = new PhProt();
$pp->using('base');
$pp->using('peptide');
$pep = new ModifiedPeptide();
$pep->Sequence = 'KDEPAEESDGDLGFGLFD';
$pep->NTerminus = 'H';
$pep->CTerminus = 'OH';
$pep->addModification(array('accession' => 21, 'position' => 7));
$strIon = 'b';
$ic = new IonCalculator(array('peptide' => $pep, 'maxcharge' => 3, 'weighttype' => 'monoisotopic', 'neutralloss' => array('H2O', 'NH3'), 'customtemplate' => '{ion}{index}{charge} {flag}'));
print '<h3>Testing</h3>';
print 'Peptide: ' . $pep->Sequence . '<br />';
print '<h3>Result for ' . $strIon . '-Ions</h3>';
print '<table style="border: null">';
$arrResult = $ic->calculateIon($strIon);
for ($i = 0; $i < count($arrResult); $i++) {
    print '<tr><td>' . strval($arrResult[$i]['mass']) . '</td><td>' . $arrResult[$i]['ion'] . strval($arrResult[$i]['index']) . '</td><td>' . strval($arrResult[$i]['charge']) . '</td><td>' . $arrResult[$i]['flag'] . '</td><td>' . $arrResult[$i]['custom'] . '</td></tr>';
}
print '</table>';