#!/usr/bin/perl
BEGIN{
push
@INC
, (dirname $0).
'/../../lib'
;
}
eval
{
InSilicoSpectro::init();
my
$test
=
shift
;
if
(
$test
== 1){
my
%spectrum
;
my
$peptide
= new InSilicoSpectro::InSilico::Peptide(
sequence
=>
'HCMSKPQMLR'
,
modif
=>
'::Cys_CAM::::::Oxidation:::'
);
getFragmentMasses(
pept
=>
$peptide
,
fragTypes
=>[
'b'
,
'a'
,
'b-NH3*'
,
'b-H2O*'
,
'b++'
,
'y'
,
'y-NH3*'
,
'y-H2O*'
,
'y++'
,
'immo'
],
spectrum
=>\
%spectrum
);
my
$pd
= new InSilicoSpectro::Spectra::PeakDescriptor([
'mass'
,
'intensity'
]);
my
$expSpectrum
= new InSilicoSpectro::Spectra::ExpSpectrum(
spectrum
=>[[87,1000],[87.5, 100],[330.6,1000], [429, 800], [435, 200], [488, 900], [551, 750], [727, 200]],
peakDescriptor
=>
$pd
);
matchSpectrumClosest(
spectrum
=>\
%spectrum
,
expSpectrum
=>
$expSpectrum
);
my
$theoSpectrum
= new InSilicoSpectro::InSilico::MSMSTheoSpectrum(
theoSpectrum
=>\
%spectrum
,
massType
=>getMassType(),
tol
=>10000,
minTol
=>2);
my
$len
=
$theoSpectrum
->getPeptideLength();
print
"matchSpectrumCLosest for $peptide ("
,modifToString(
$peptide
->modif(),
$len
),
")\nFragments:\n"
;
foreach
(
$theoSpectrum
->getTermIons()){
print
"$_\n"
;
}
foreach
(
$theoSpectrum
->getInternIons()){
print
"$_\n"
;
}
}
if
(
$test
== 2){
my
%spectrum
;
my
$peptide
= new InSilicoSpectro::InSilico::Peptide(
sequence
=>
'HCMSKPQMLR'
,
modif
=>
'::Cys_CAM::::::Oxidation:::'
);
my
$pd
= new InSilicoSpectro::Spectra::PeakDescriptor([
'mass'
,
'intensity'
]);
my
$expSpectrum
= new InSilicoSpectro::Spectra::ExpSpectrum(
spectrum
=>[[87,1000],[87.5, 100],[330.6,1000], [429, 800], [435, 200], [488, 900], [551, 750], [727, 200]],
peakDescriptor
=>
$pd
);
matchSpectrumGreedy(
pept
=>
$peptide
,
fragTypes
=>[
'b'
,
'a'
,
'b-NH3*'
,
'b-H2O*'
,
'b++'
,
'y'
,
'y-NH3*'
,
'y-H2O*'
,
'y++'
,
'immo'
],
spectrum
=>\
%spectrum
,
expSpectrum
=>
$expSpectrum
,
tol
=>10000,
minTol
=>2);
my
$theoSpectrum
= new InSilicoSpectro::InSilico::MSMSTheoSpectrum(
theoSpectrum
=>\
%spectrum
,
massType
=>getMassType());
my
$len
=
$theoSpectrum
->getPeptideLength();
print
"matchSpectrumGreedy for $peptide ("
,modifToString(
$peptide
->modif(),
$len
),
")\nNo order given => returns the most intense peak in the mass window; see the impact on the first y++\ntol = 10000 ppm, minTol = 2 Da\nFragments:\n"
;
foreach
(
$theoSpectrum
->getTermIons()){
print
"$_\n"
;
}
foreach
(
$theoSpectrum
->getInternIons()){
print
"$_\n"
;
}
}
if
(
$test
== 3){
my
%spectrum
;
my
$peptide
= new InSilicoSpectro::InSilico::Peptide(
sequence
=>
'HCMSKPQMLR'
,
modif
=>
'::Cys_CAM::::::Oxidation:::'
);
my
$pd
= new InSilicoSpectro::Spectra::PeakDescriptor([
'mass'
,
'intensity'
]);
my
$expSpectrum
= new InSilicoSpectro::Spectra::ExpSpectrum(
spectrum
=>[[87,1000],[87.5, 100],[330.6,1000], [429, 800], [435, 200], [488, 900], [551, 750], [727, 200]],
peakDescriptor
=>
$pd
);
matchSpectrumGreedy(
pept
=>
$peptide
,
fragTypes
=>[
'b'
,
'a'
,
'b-NH3*'
,
'b-H2O*'
,
'b++'
,
'y'
,
'y-NH3*'
,
'y-H2O*'
,
'y++'
,
'immo'
],
spectrum
=>\
%spectrum
,
expSpectrum
=>
$expSpectrum
,
tol
=>10000,
minTol
=>2,
order
=>[
'immo'
,
'y'
,
'b'
,
'y++'
,
'b-NH3*'
,
'b-H2O*'
,
'b++'
,
'y-NH3*'
,
'y-H2O*'
,
'z'
]);
my
$theoSpectrum
= new InSilicoSpectro::InSilico::MSMSTheoSpectrum(
theoSpectrum
=>\
%spectrum
,
massType
=>getMassType());
my
$len
=
$theoSpectrum
->getPeptideLength();
print
"matchSpectrumGreedy for $peptide ("
,modifToString(
$peptide
->modif(),
$len
),
")\nOrder given => each peak is used once only; see the impact on the first y++ and immo(L)\ntol = 10000 ppm, minTol = 2 Da\nFragments:\n"
;
foreach
(
$theoSpectrum
->getTermIons()){
print
"$_\n"
;
}
foreach
(
$theoSpectrum
->getInternIons()){
print
"$_\n"
;
}
}
};
if
($@){
carp($@);
}