forked from OpenMS/OpenMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTutorial_Enzyme.cpp
More file actions
61 lines (47 loc) · 1.7 KB
/
Copy pathTutorial_Enzyme.cpp
File metadata and controls
61 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
// SPDX-License-Identifier: BSD-3-Clause
//
//! [doxygen_snippet_Enzyme]
#include <OpenMS/CHEMISTRY/AASequence.h>
#include <OpenMS/CHEMISTRY/ProteaseDigestion.h>
#include <vector>
#include <iostream>
using namespace OpenMS;
using namespace std;
int main()
{
ProteaseDigestion protease;
// in this example, we don't produce peptides with missed cleavages
protease.setMissedCleavages(0);
// output the number of tryptic peptides (no cut before proline)
protease.setEnzyme("Trypsin");
cout << protease.peptideCount(AASequence::fromString("ACKPDE")) << " "
<< protease.peptideCount(AASequence::fromString("ACRPDEKA"))
<< endl;
// digest C-terminally amidated peptide
vector<AASequence> products;
auto aa_seq = AASequence::fromString("ARCDRE.(Amidated)");
protease.digest(aa_seq, products);
// output digestion products
std::cout << "digesting " << aa_seq.toString() << " into:\n";
for (const AASequence& p : products)
{
cout << "--> " << p.toString() << "\n";
}
cout << endl;
// allow many miss-cleavages
protease.setMissedCleavages(10);
protease.digest(aa_seq, products);
// output digestion products
std::cout << "digesting " << aa_seq.toString() << " with 10 MCs into:\n";
for (const AASequence& p : products)
{
cout << "--> " << p.toString() << "\n";
}
cout << endl;
// verify an infix of a protein is a digestion product:
String peptide = "FFFRAAA";
cout << "Is '" << peptide.prefix(4) << "' a valid digestion product of '" << peptide << "'? "
<< std::boolalpha << protease.isValidProduct(peptide, 0, 4); // yes it is!
}
//! [doxygen_snippet_Enzyme]