File: TestUtils.hpp

package info (click to toggle)
libxpertmass 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,908 kB
  • sloc: cpp: 50,586; xml: 2,193; python: 417; ansic: 70; makefile: 33
file content (186 lines) | stat: -rw-r--r-- 6,512 bytes parent folder | download
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/* BEGIN software license
 *
 * MsXpertSuite - mass spectrometry software suite
 * -----------------------------------------------
 * Copyright(C) 2009,...,2024 Filippo Rusconi
 *
 * http://www.msxpertsuite.org
 *
 * This file is part of the MsXpertSuite project.
 *
 * The MsXpertSuite project is the successor of the massXpert project. This
 * project now includes various independent modules:
 *
 * - massXpert, model polymer chemistries and simulate mass spectrometric data;
 * - mineXpert, a powerful TIC chromatogram/mass spectrum viewer/miner;
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * END software license
 */

/////////////////////// Stdlib includes

/////////////////////// Qt includes
#include <QDebug>
#include <QString>
#include <QStringList>
#include <QDomDocument>


/////////////////////// libXpertMassCore includes
#include <libXpertMass/Isotope.hpp>
#include <libXpertMass/PolChemDef.hpp>


/////////////////////// Local includes
#include "tests-config.h"


#pragma once


namespace MsXpS
{
namespace libXpertMassCore
{


class DECLSPEC TestUtils
{
  public:
  TestUtils();
  TestUtils(const QString &pol_chem_def_name, int version);
  virtual ~TestUtils();

  QString m_testsInputDataDir  = QString(TESTS_INPUT_DIR);
  QString m_testsOutputDataDir = QString(TESTS_OUTPUT_DIR);

  QString m_testsInputPolChemDefsDir =
    QString("%1/polymer-chemistry-definitions").arg(m_testsInputDataDir);
  QString m_testsOutputPolChemDefsDir =
    QString("%1/polymer-chemistry-definitions").arg(m_testsOutputDataDir);

  QString m_testsInputPolSeqsDir =
    QString("%1/polymer-sequences").arg(m_testsInputDataDir);
  QString m_testsOutputPolSeqsDir =
    QString("%1/polymer-sequences").arg(m_testsOutputDataDir);

  QString m_polChemDefDirName;
  QString m_polChemDefFileBaseName;
  QString m_polChemDefName;

  PolChemDefSpec m_polChemDefSpec;
  PolChemDefSPtr msp_polChemDef = nullptr;

  QString xml_format_indent_string = " ";

  Isotope m_isotopeC12 =
    Isotope("carbon",
            "C",
            12.0,
            0.989211941850466902614869013632414862513542175292968750000000);
  IsotopeQSPtr msp_isotopeC12 = std::make_shared<Isotope>(m_isotopeC12);

  Isotope m_isotopeC13 =
    Isotope("carbon",
            "C",
            13.0033548352,
            0.010788058149533083507343178553128382191061973571777343750000);
  IsotopeQSPtr msp_isotopeC13 = std::make_shared<Isotope>(m_isotopeC13);

  Isotope m_isotopeN14 =
    Isotope("nitrogen",
            "N",
            14.0030740042,
            0.996358014567941707717579902237048372626304626464843750000000);
  IsotopeQSPtr msp_isotopeN14 = std::make_shared<Isotope>(m_isotopeN14);

  Isotope m_isotopeN15 =
    Isotope("nitrogen",
            "N",
            15.0001088994,
            0.003641985432058271465738386041266494430601596832275390625000);
  IsotopeQSPtr msp_isotopeN15 = std::make_shared<Isotope>(m_isotopeN15);

  std::size_t m_isotopeCount = 0;

  QString m_acetylationFormulaString = "-H2O+CH3COOH";
  QString m_tryptophanFormulaString  = "C11H10N2O1";

  // 157 residues
  QString m_telokinAsMonomerText1Letter =
    "MAMISGMSGRKASGSSPTSPINADKVENEDAFLEEVAEEKPHVKPYFTKTILDMEVVEGSAARFDCKIEGYPDP"
    "EVMWYKDDQPVKESRHFQIDYDEEGNCSLTISEVCGDDDAKYTCKAVNSLGEATCTAELLVETMGKEGEGEGEG"
    "EEDEEEEEE";

  QString m_telokinNtermPeptideAsMonomerText1Letter =
    "MAMISGMSGRKASGSSPTSPINADKV";

  int m_telokinSequenceMonomerCount = 157;

  // 157 residues, 7 spaces
  QString m_telokinAsMonomerText1LetterWithSpaces =
    "MAMISGMSGRKASGSSP TSPINADK "
    "VENEDAFLEEVAEEKPHVKPYFTKTILDMEVVEGSAARFDCKIEGYPDP"
    "EVMWYKDDQPVKESRHFQIDYDEEGNCSL TISEVCGDD DAKYTCKAVNSLG "
    "EATCTA\nELLVETMGKEGEGEGEG"
    "EEDE\tEEEEE";

  // 157 residues
  QString m_telokinAsMonomerText3Letters =
    "MetAlaMetIleSerGlyMetSerGlyArgLysAlaSerGlySerSerProThrSerProIleAsnAlaAspLy"
    "sValGluAsnGluAspAlaPheLeuGluGluValAlaGluGluLysProHisValLysProTyrPheThrLysT"
    "hrIleLeuAspMetGluValValGluGlySerAlaAlaArgPheAspCysLysIleGluGlyTyrProAspPro"
    "GluValMetTrpTyrLysAspAspGlnProValLysGluSerArgHisPheGlnIleAspTyrAspGluGluGl"
    "yAsnCysSerLeuThrIleSerGluValCysGlyAspAspAspAlaLysTyrThrCysLysAlaValAsnSerL"
    "euGlyGluAlaThrCysThrAlaGluLeuLeuValGluThrMetGlyLysGluGlyGluGlyGluGlyGluGly"
    "GluGluAspGluGluGluGluGluGlu";

  QString m_glucoseFormulaString    = QString("C6H12O6");
  QString m_saccharoseFormulaString = QString("C12H22O11");
  QString m_formulaTitle            = "MA dipeptide";

  QString m_actionFormulaStringMetAlaDipeptidyl =
    QString("+C5H11N1O2S1-H2O+C3H7N1O2-H2O");
  QString m_actionFormulaStringMetAlaDipeptidylSpaces =
    QString("+C5 H11 N1\nO2S1-H2O+C3 H7 N1 O2 - H2O");

  //  See the constructor
  QString m_actionFormulaStringMetAlaDipeptidylTitled;

  QString m_naturalIsotopicDataFileName = "light-c-n.dat";
  QString m_manualUserIsotopicDataFileName =
    "one-C14-radioactive-on-glucose-manual-config.dat";

  static void initializeXpertmassLibrary();
  PolChemDefSPtr initializePolChemDef(const QString &pol_chem_def_name,
                                      int version);

  QDomDocument craftFormulaDomDocument(const QStringList &dom_strings);
  QDomDocument craftIonizeruleDomDocument(const QStringList &dom_strings);
  QDomDocument craftMdfDomDocument(const QStringList &dom_strings);
  QDomDocument craftMnmDomDocument(const QStringList &dom_strings);
  QDomDocument craftMonomerDomDocument(const QStringList &dom_strings);
  QDomDocument craftClkDomDocument(const QStringList &dom_strings);
  QDomDocument craftClrDomDocument(const QStringList &dom_strings);
  QDomDocument craftClsDomDocument(const QStringList &dom_strings);
  QDomDocument craftClaDomDocument(const QStringList &dom_strings);
  QDomDocument craftFgrDomDocument(const QStringList &dom_strings);
  QDomDocument craftFgsDomDocument(const QStringList &dom_strings);
};


} // namespace libXpertMassCore
} // namespace MsXpS