NCBI C++ ToolKit
src_table_column.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: src_table_column.hpp 62520 2014-04-16 18:06:28Z bollin $
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: Colleen Bollin
27  *
28  * File Description:
29  * check biosource and structured comment descriptors against biosample database
30  *
31  */
32 
33 #ifndef BIOSAMPLE_CHK__SRC_TABLE_COLUMN__HPP
34 #define BIOSAMPLE_CHK__SRC_TABLE_COLUMN__HPP
35 
36 #include <corelib/ncbistd.hpp>
37 #include <corelib/ncbistr.hpp>
38 
40 #include <objects/seq/Seqdesc.hpp>
44 
45 #include <objmgr/bioseq_handle.hpp>
46 
47 
50 
51 const string kOrganismName = "Organism Name";
52 const string kTaxId = "Tax ID";
53 const string kPcrForwardName = "fwd-primer-name";
54 const string kPcrForwardSeq = "fwd-primer-seq";
55 const string kPcrReverseName = "rev-primer-name";
56 const string kPcrReverseSeq = "rev-primer-seq";
57 
58 
59 class CSrcTableColumnBase : public CObject
60 {
61 public:
62  // default is to do no command. Subclasses will almost always override this
63  virtual void AddToBioSource(
64  objects::CBioSource & in_out_bioSource, const string & newValue ) { }
65  virtual void ClearInBioSource(
66  objects::CBioSource & in_out_bioSource ) { }
67  virtual string GetFromBioSource(
68  const objects::CBioSource & in_out_bioSource ) const { return ""; }
69  virtual string GetLabel() const { return ""; }
70 };
71 
73 {
74 public:
75  virtual void AddToBioSource(
76  objects::CBioSource & in_out_bioSource, const string & newValue );
77  virtual void ClearInBioSource(
78  objects::CBioSource & in_out_bioSource );
79  virtual string GetFromBioSource(
80  const objects::CBioSource & in_out_bioSource ) const;
81  virtual string GetLabel() const { return kOrganismName; }
82 };
83 
84 
86 {
87 public:
88  virtual void AddToBioSource(
89  objects::CBioSource & in_out_bioSource, const string & newValue );
90  virtual void ClearInBioSource(
91  objects::CBioSource & in_out_bioSource );
92  virtual string GetFromBioSource(
93  const objects::CBioSource & in_out_bioSource ) const;
94  virtual string GetLabel() const { return kTaxId; }
95 };
96 
97 
99 {
100 public:
101  virtual void AddToBioSource(
102  objects::CBioSource & in_out_bioSource, const string & newValue );
103  virtual void ClearInBioSource(
104  objects::CBioSource & in_out_bioSource );
105  virtual string GetFromBioSource(
106  const objects::CBioSource & in_out_bioSource ) const;
107  virtual string GetLabel() const { return "Genome"; }
108 };
109 
111 {
112 public:
113  CSrcTableSubSourceColumn(objects::CSubSource::TSubtype subtype) { m_Subtype = subtype; };
114  virtual void AddToBioSource(
115  objects::CBioSource & in_out_bioSource, const string & newValue );
116  virtual void ClearInBioSource(
117  objects::CBioSource & in_out_bioSource );
118  virtual string GetFromBioSource(
119  const objects::CBioSource & in_out_bioSource ) const;
120  virtual string GetLabel() const;
121 private:
122  objects::CSubSource::TSubtype m_Subtype;
123 };
124 
126 {
127 public:
128  CSrcTableOrgModColumn(objects::COrgMod::TSubtype subtype) { m_Subtype = subtype; };
129  virtual void AddToBioSource(
130  objects::CBioSource & in_out_bioSource, const string & newValue );
131  virtual void ClearInBioSource(
132  objects::CBioSource & in_out_bioSource );
133  virtual string GetFromBioSource(
134  const objects::CBioSource & in_out_bioSource ) const;
135  virtual string GetLabel() const;
136 private:
137  objects::COrgMod::TSubtype m_Subtype;
138 };
139 
140 
142 {
143 public:
145  virtual void AddToBioSource(
146  objects::CBioSource & in_out_bioSource, const string & newValue );
147  virtual void ClearInBioSource(
148  objects::CBioSource & in_out_bioSource );
149  virtual string GetFromBioSource(
150  const objects::CBioSource & in_out_bioSource ) const;
151  virtual string GetLabel() const { return kPcrForwardSeq; }
152 };
153 
154 
156 {
157 public:
159  virtual void AddToBioSource(
160  objects::CBioSource & in_out_bioSource, const string & newValue );
161  virtual void ClearInBioSource(
162  objects::CBioSource & in_out_bioSource );
163  virtual string GetFromBioSource(
164  const objects::CBioSource & in_out_bioSource ) const;
165  virtual string GetLabel() const { return kPcrReverseSeq; }
166 };
167 
168 
170 {
171 public:
173  virtual void AddToBioSource(
174  objects::CBioSource & in_out_bioSource, const string & newValue );
175  virtual void ClearInBioSource(
176  objects::CBioSource & in_out_bioSource );
177  virtual string GetFromBioSource(
178  const objects::CBioSource & in_out_bioSource ) const;
179  virtual string GetLabel() const { return kPcrForwardName; }
180 };
181 
182 
184 {
185 public:
187  virtual void AddToBioSource(
188  objects::CBioSource & in_out_bioSource, const string & newValue );
189  virtual void ClearInBioSource(
190  objects::CBioSource & in_out_bioSource );
191  virtual string GetFromBioSource(
192  const objects::CBioSource & in_out_bioSource ) const;
193  virtual string GetLabel() const { return kPcrReverseName; }
194 };
195 
196 
198 {
199 public:
200  static CRef<CSrcTableColumnBase> Create(string sTitle);
201 };
202 
203 
204 typedef vector< CRef<CSrcTableColumnBase> > TSrcTableColumnList;
205 
207 
208 
211 
212 #endif //SRC_TABLE_COLUMN
CObject –.
Definition: ncbiobj.hpp:180
static CRef< CSrcTableColumnBase > Create(const objects::CSeqTable_column &column)
virtual string GetLabel() const
virtual void AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual string GetLabel() const
virtual void AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue)
virtual string GetLabel() const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual string GetLabel() const
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
CSrcTableOrgModColumn(objects::COrgMod::TSubtype subtype)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual string GetLabel() const
objects::COrgMod::TSubtype m_Subtype
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetLabel() const
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual string GetLabel() const
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetLabel() const
virtual void AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue)
virtual string GetLabel() const
objects::CSubSource::TSubtype m_Subtype
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
CSrcTableSubSourceColumn(objects::CSubSource::TSubtype subtype)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual bool AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue, objects::edit::EExistingText existing_text)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetLabel() const
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
Include a standard set of the NCBI C++ Toolkit most basic headers.
The NCBI C++ standard methods for dealing with std::string.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
TSrcTableColumnList GetSourceFields(const CBioSource &src)
const string kOrganismName
const string kPcrReverseName
const string kPcrForwardName
const string kPcrReverseSeq
vector< CRef< CSrcTableColumnBase > > TSrcTableColumnList
const string kPcrForwardSeq
const string kTaxId
#define const
Definition: zconf.h:230
Modified on Sun Mar 03 03:14:50 2024 by modify_doxy.py rev. 669887