1 /* $Id: MSHits.cpp 103491 2007-05-04 17:18:18Z kazimird $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: .......
27 *
28 * File Description:
29 * .......
30 *
31 * Remark:
32 * This code was originally generated by application DATATOOL
33 * using the following specifications:
34 * 'omssa.asn'.
35 */
36
37 // standard includes
38 #include <ncbi_pch.hpp>
39
40 // generated includes
41 #include <objects/omssa/MSHits.hpp>
42
43 #include <objects/omssa/MSMod.hpp>
44 #include <objects/omssa/MSModHit.hpp>
45
46 // generated classes
47
48 BEGIN_NCBI_SCOPE
49
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51
52 // destructor
~CMSHits(void)53 CMSHits::~CMSHits(void)
54 {
55 }
56
57
58 ///
59 /// Makes a string of mods, positions for display purposes
60 ///
MakeModString(string & StringOut,CRef<CMSModSpecSet> Modset) const61 void CMSHits::MakeModString(string& StringOut, CRef <CMSModSpecSet> Modset) const
62 {
63 StringOut.erase();
64 if(CanGetMods()) {
65 ITERATE(TMods, i, GetMods()) {
66 if(!StringOut.empty()) StringOut += " ,";
67 if((*i)->GetModtype() < eMSMod_max) StringOut += Modset->GetModName((*i)->GetModtype());
68 else StringOut += NStr::IntToString((*i)->GetModtype());
69 StringOut += ":" + NStr::IntToString((*i)->GetSite()+1);
70 }
71 }
72 }
73
74
75 ///
76 /// Makes a peptide AA string, lower case for mods
77 ///
MakePepString(string & StringOut) const78 void CMSHits::MakePepString(string& StringOut) const
79 {
80 StringOut.erase();
81 if(CanGetPepstring()) {
82 StringOut = GetPepstring();
83 NStr::ToUpper(StringOut);
84 ITERATE(TMods, i, GetMods()) {
85 if((*i)->GetSite() < static_cast <int> (StringOut.size()))
86 StringOut[(*i)->GetSite()] = tolower((unsigned char) StringOut[(*i)->GetSite()]);
87 }
88 }
89 }
90
91
92 END_objects_SCOPE // namespace ncbi::objects::
93
94 END_NCBI_SCOPE
95
96 /* Original file checksum: lines: 65, chars: 1878, CRC32: e17e37ca */
97