/usr/include/OpenMS/ANALYSIS/TARGETED/TargetedExperimentHelper.h is in libopenms-dev 1.11.1-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | // --------------------------------------------------------------------------
// OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universitaet Berlin 2002-2013.
//
// This software is released under a three-clause BSD license:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of any author or any participating institution
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
// For a full list of authors, refer to the file AUTHORS.
// --------------------------------------------------------------------------
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
// INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// --------------------------------------------------------------------------
// $Maintainer: Andreas Bertsch $
// $Authors: Andreas Bertsch $
// --------------------------------------------------------------------------
#ifndef OPENMS_ANALYSIS_TARGETED_TARGETEDEXPERIMENTHELPER_H
#define OPENMS_ANALYSIS_TARGETED_TARGETEDEXPERIMENTHELPER_H
#include <OpenMS/KERNEL/StandardTypes.h>
#include <OpenMS/METADATA/CVTerm.h>
#include <OpenMS/METADATA/CVTermList.h>
#include <boost/numeric/conversion/cast.hpp>
namespace OpenMS
{
/**
@brief This class stores helper structures that are used in multiple
classes of the TargetedExperiment (e.g. ReactionMonitoringTransition and
IncludeExcludeTarget).
*/
namespace TargetedExperimentHelper
{
struct Configuration :
public CVTermList
{
String contact_ref;
String instrument_ref;
std::vector<CVTermList> validations;
Configuration & operator=(const Configuration & rhs)
{
if (this != &rhs)
{
CVTermList::operator=(rhs);
contact_ref = rhs.contact_ref;
instrument_ref = rhs.instrument_ref;
validations = rhs.validations;
}
return *this;
}
};
struct CV
{
CV(const String & new_id, const String & new_fullname, const String & new_version, const String & new_URI) :
id(new_id),
fullname(new_fullname),
version(new_version),
URI(new_URI)
{
}
String id;
String fullname;
String version;
String URI;
bool operator==(const CV & cv) const
{
return id == cv.id &&
fullname == cv.fullname &&
version == cv.version &&
URI == cv.URI;
}
};
struct Protein :
public CVTermList
{
Protein() :
CVTermList()
{
}
String id;
String sequence;
bool operator==(const Protein & rhs) const
{
return CVTermList::operator==(rhs) &&
id == rhs.id &&
sequence == rhs.sequence;
}
Protein & operator=(const Protein & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
id = rhs.id;
sequence = rhs.sequence;
}
return *this;
}
};
class OPENMS_DLLAPI RetentionTime :
public CVTermList
{
public:
RetentionTime() :
CVTermList()
{
}
RetentionTime(const RetentionTime & rhs) :
CVTermList(rhs),
software_ref(rhs.software_ref)
{
}
virtual ~RetentionTime()
{
}
RetentionTime & operator=(const RetentionTime & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
software_ref = rhs.software_ref;
}
return *this;
}
bool operator==(const RetentionTime & rhs) const
{
return CVTermList::operator==(rhs) &&
software_ref == rhs.software_ref;
}
String software_ref;
};
class OPENMS_DLLAPI Compound :
public CVTermList
{
public:
Compound() :
CVTermList()
{
}
Compound(const Compound & rhs) :
CVTermList(rhs),
id(rhs.id),
rts(rhs.rts)
{
}
Compound & operator=(const Compound & rhs)
{
if (this != &rhs)
{
CVTermList::operator=(rhs);
id = rhs.id;
rts = rhs.rts;
}
return *this;
}
bool operator==(const Compound & rhs) const
{
return CVTermList::operator==(rhs) &&
id == rhs.id &&
rts == rhs.rts;
}
String id;
std::vector<RetentionTime> rts;
};
class OPENMS_DLLAPI Peptide :
public CVTermList
{
public:
struct Modification :
public CVTermList
{
DoubleReal avg_mass_delta;
int location;
DoubleReal mono_mass_delta;
};
Peptide() :
CVTermList()
{
charge_ = -1;
peptide_group_label_ = -1;
// we store the actual labels in a static vector which allows us to
// store each label only once.
static std::vector<String> * init_peptide_group_labels_ = 0;
if (init_peptide_group_labels_ == 0)
{
init_peptide_group_labels_ = new std::vector<String>;
}
peptide_group_labels_ = init_peptide_group_labels_;
}
Peptide(const Peptide & rhs) :
CVTermList(rhs),
rts(rhs.rts),
id(rhs.id),
protein_refs(rhs.protein_refs),
evidence(rhs.evidence),
sequence(rhs.sequence),
mods(rhs.mods),
charge_(rhs.charge_),
peptide_group_label_(rhs.peptide_group_label_),
peptide_group_labels_(rhs.peptide_group_labels_)
{
}
Peptide & operator=(const Peptide & rhs)
{
if (this != &rhs)
{
CVTermList::operator=(rhs);
rts = rhs.rts;
id = rhs.id;
protein_refs = rhs.protein_refs;
evidence = rhs.evidence;
sequence = rhs.sequence;
mods = rhs.mods;
charge_ = rhs.charge_;
peptide_group_label_ = rhs.peptide_group_label_;
peptide_group_labels_ = rhs.peptide_group_labels_;
}
return *this;
}
bool operator==(const Peptide & rhs) const
{
return CVTermList::operator==(rhs) &&
rts == rhs.rts &&
id == rhs.id &&
protein_refs == rhs.protein_refs &&
evidence == rhs.evidence &&
sequence == rhs.sequence &&
mods == rhs.mods &&
charge_ == rhs.charge_ &&
peptide_group_label_ == rhs.peptide_group_label_ &&
peptide_group_labels_ == rhs.peptide_group_labels_;
}
void setChargeState(int charge)
{
charge_ = charge;
}
int getChargeState() const
{
return charge_;
}
void setPeptideGroupLabel(const String & label)
{
for (Size i = 0; i < peptide_group_labels_->size(); i++)
{
if ((*peptide_group_labels_)[i] == label)
{
peptide_group_label_ = (Int)i;
return;
}
}
// not found, add it to the list
peptide_group_label_ = (Int)peptide_group_labels_->size();
peptide_group_labels_->push_back(label);
}
String getPeptideGroupLabel() const
{
if (peptide_group_label_ == -1)
{
return "";
}
return (*peptide_group_labels_)[peptide_group_label_];
}
double getRetentionTime() const
{
// some guesstimate which would be the retention time that the user
// would like to have...
if (rts.empty() || rts[0].getCVTerms()["MS:1000896"].empty())
{
throw Exception::IllegalArgument(__FILE__, __LINE__, __PRETTY_FUNCTION__,
"No retention time information (CV term 1000896) available");
}
return rts[0].getCVTerms()["MS:1000896"][0].getValue().toString().toDouble();
}
std::vector<RetentionTime> rts;
String id;
std::vector<String> protein_refs;
CVTermList evidence;
String sequence;
std::vector<Modification> mods;
protected:
int charge_;
Int peptide_group_label_;
std::vector<String> * peptide_group_labels_;
};
struct OPENMS_DLLAPI Contact :
public CVTermList
{
Contact() :
CVTermList()
{
}
String id;
bool operator==(const Contact & rhs) const
{
return CVTermList::operator==(rhs) &&
id == rhs.id;
}
Contact & operator=(const Contact & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
id = rhs.id;
}
return *this;
}
};
struct OPENMS_DLLAPI Publication :
public CVTermList
{
Publication() :
CVTermList()
{
}
String id;
bool operator==(const Publication & rhs) const
{
return CVTermList::operator==(rhs) &&
id == rhs.id;
}
Publication & operator=(const Publication & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
id = rhs.id;
}
return *this;
}
};
struct OPENMS_DLLAPI Instrument :
public CVTermList
{
Instrument() :
CVTermList()
{
}
String id;
bool operator==(const Instrument & rhs) const
{
return CVTermList::operator==(rhs) &&
id == rhs.id;
}
Instrument & operator=(const Instrument & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
id = rhs.id;
}
return *this;
}
};
struct OPENMS_DLLAPI Prediction :
public CVTermList
{
Prediction() :
CVTermList()
{
}
String software_ref;
String contact_ref;
bool operator==(const Prediction & rhs) const
{
return CVTermList::operator==(rhs) &&
contact_ref == rhs.contact_ref &&
software_ref == rhs.software_ref;
}
Prediction & operator=(const Prediction & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
software_ref = rhs.software_ref;
contact_ref = rhs.contact_ref;
}
return *this;
}
};
struct OPENMS_DLLAPI TraMLProduct :
public CVTermList
{
TraMLProduct() :
CVTermList()
{
charge_ = -1;
}
bool operator==(const TraMLProduct & rhs) const
{
return CVTermList::operator==(rhs) &&
charge_ == rhs.charge_ &&
configuration_list_ == rhs.configuration_list_ &&
interpretation_list_ == rhs.interpretation_list_;
}
TraMLProduct & operator=(const TraMLProduct & rhs)
{
if (&rhs != this)
{
CVTermList::operator=(rhs);
charge_ = rhs.charge_;
configuration_list_ = rhs.configuration_list_;
interpretation_list_ = rhs.interpretation_list_;
}
return *this;
}
void setChargeState(int charge)
{
charge_ = charge;
}
int getChargeState() const
{
return charge_;
}
const std::vector<Configuration> & getConfigurationList() const
{
return configuration_list_;
}
void addConfiguration(const Configuration configuration)
{
return configuration_list_.push_back(configuration);
}
void replaceCVTerms(Map<String, std::vector<CVTerm> > & cv_terms)
{
cv_terms_ = cv_terms;
}
const std::vector<CVTermList> & getInterpretationList() const
{
return interpretation_list_;
}
void addInterpretation(const CVTermList interpretation)
{
return interpretation_list_.push_back(interpretation);
}
private:
int charge_;
std::vector<Configuration> configuration_list_;
std::vector<CVTermList> interpretation_list_;
};
/// helper function that converts a Peptide object to a AASequence object
OPENMS_DLLAPI OpenMS::AASequence getAASequence(const Peptide& peptide);
/// helper function that sets a modifiction on a AASequence object
OPENMS_DLLAPI void setModification(int location, int max_size, String modification, OpenMS::AASequence & aas);
}
} // namespace OpenMS
#endif // OPENMS_ANALYSIS_TARGETED_TARGETEDEXPERIMENTHELPER_H
|