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

Go to the SVN repository for this file.

1 /* $Id: Org_ref.hpp 89903 2020-04-30 12:36:14Z grichenk $
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 specifications from the ASN data definition file
34  * 'seqfeat.asn'.
35  */
36 
37 #ifndef OBJECTS_SEQFEAT_ORG_REF_HPP
38 #define OBJECTS_SEQFEAT_ORG_REF_HPP
39 
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
51 {
53 public:
54  enum EOrgref_part {
55  eOrgref_nothing = 0,
56  eOrgref_taxname = 0x0010, // org-ref.taxname
57  eOrgref_common = 0x0040, // org-ref.common
58  eOrgref_mod = 0x0800, // org-ref.mod
59 
60  eOrgref_db = 0x2000, // org-ref.db
61  eOrgref_db_taxid = 0x0001, // org-ref.db[@dbtag='taxon']
62  eOrgref_db_all = (eOrgref_db | eOrgref_db_taxid),
63 
64  eOrgref_syn = 0x4000, // org-ref.syn
65 
66  eOrgref_orgname = 0x0008, // org-ref.orgname
67  eOrgref_on_name = 0x0080, // org-ref.orgname.name
68  eOrgref_on_attr = 0x1000, // org-ref.orgname.attrib
69  eOrgref_on_attr_spec = 0x00010000, // org-ref.orgname.attrib[.='specified']
70  eOrgref_on_attr_nofwd = 0x00040000, // org-ref.orgname.attrib[.='nomodforward']
71  eOrgref_on_attr_uncult= 0x00080000, // org-ref.orgname.attrib[.='uncultured']
72  eOrgref_on_attr_all = (eOrgref_on_attr | eOrgref_on_attr_spec | eOrgref_on_attr_nofwd | eOrgref_on_attr_uncult),
73  eOrgref_on_mod = 0x0200, // org-ref.orgname.mod
74  eOrgref_on_mod_nom = 0x00020000, // org-ref.orgname.mod[subtype=nomenclature]
75  eOrgref_on_mod_oldname= 0x00100000, // org-ref.orgname.mod[subtype=old-name]
76  eOrgref_on_mod_tm = 0x00200000, // org-ref.orgname.mod[subtype=type-material]
77  eOrgref_on_mod_all = (eOrgref_on_mod | eOrgref_on_mod_nom | eOrgref_on_mod_oldname | eOrgref_on_mod_tm),
78  eOrgref_on_lin = 0x0020, // org-ref.orgname.lineage
79  eOrgref_on_gc = 0x0002, // org-ref.orgname.gcode
80  eOrgref_on_mgc = 0x0004, // org-ref.orgname.mgcode
81  eOrgref_on_pgc = 0x0400, // org-ref.orgname.pgcode
82  eOrgref_on_div = 0x0100, // org-ref.orgname.div
83  eOrgref_on_all = (eOrgref_orgname | eOrgref_on_name | eOrgref_on_attr_all | eOrgref_on_mod_all |
84  eOrgref_on_lin | eOrgref_on_gc | eOrgref_on_mgc | eOrgref_on_pgc | eOrgref_on_div),
85 
86  eOrgref_all = (eOrgref_taxname | eOrgref_common | eOrgref_mod | eOrgref_db_all | eOrgref_syn |
87  eOrgref_on_all),
88 
89  eOrgref_all_but_syn = (eOrgref_all ^ eOrgref_syn), // all but synonyms
90  eOrgref_all_but_spec = (eOrgref_all ^ eOrgref_on_attr_spec), // all but orgname's 'specified' attribute
91 
92  eOrgref_default = eOrgref_all
93  };
94  typedef unsigned int fOrgref_parts;
95 
96  // constructor
97  COrg_ref(void);
98  // destructor
99  ~COrg_ref(void);
100 
101  // Appends a label to "label" based on content
102  void GetLabel(string* label) const;
103 
104  // Returns NCBI Taxonomy database id (AKA tax id)
105  // if the latter is found in Org_ref; otherwise returns 0
106  TTaxId GetTaxId() const;
107  // Sets tax id into Org_ref contents.
108  // Returns old value of tax id or 0 if it was not found
109  TTaxId SetTaxId( TTaxId tax_id );
110 
111  // shortcut access to selected OrgName methods
112  bool IsSetLineage(void) const;
113  const string& GetLineage(void) const;
114 
115  bool IsSetGcode(void) const;
116  int GetGcode(void) const;
117 
118  bool IsSetMgcode(void) const;
119  int GetMgcode(void) const;
120 
121  bool IsSetPgcode(void) const;
122  int GetPgcode(void) const;
123 
124  bool IsSetDivision(void) const;
125  const string& GetDivision(void) const;
126 
127  bool IsSetOrgMod(void) const;
128 
129  bool IsVarietyValid(const string& variety) const;
130  bool HasValidVariety() const;
131  bool IsSubspeciesValid(const string& subspecies) const;
132 
133  CRef<COrg_ref> MakeCommon(const COrg_ref& other) const;
134 
135  static CConstRef<COrg_ref> TableLookup(const string& taxname);
136  static const vector<string>& GetTaxnameList();
137  bool UpdateFromTable();
138 
139  void CleanForGenBank();
140 
141  void FilterOutParts( fOrgref_parts to_remain );
142 private:
143  // Prohibit copy constructor and assignment operator
146 
147  string x_GetTaxnameAfterFirstTwoWords() const;
148 };
149 
150 
151 
152 /////////////////// COrg_ref inline methods
153 
154 // constructor
155 inline
157 {
158 }
159 
160 
161 /////////////////// end of COrg_ref inline methods
162 
163 
164 END_objects_SCOPE // namespace ncbi::objects::
165 
167 
168 
169 #endif // OBJECTS_SEQFEAT_ORG_REF_HPP
170 /* Original file checksum: lines: 90, chars: 2371, CRC32: 49735a91 */
Data storage class.
CConstRef –.
Definition: ncbiobj.hpp:1266
*** Org-ref *********************************************** * * Reference to an organism * defines on...
Definition: Org_ref_.hpp:86
unsigned int fOrgref_parts
Definition: Org_ref.hpp:94
COrg_ref & operator=(const COrg_ref &value)
COrg_ref(const COrg_ref &value)
EOrgref_part
Definition: Org_ref.hpp:54
COrg_ref(void)
Definition: Org_ref.hpp:156
COrg_ref_Base Tparent
Definition: Org_ref.hpp:52
SStrictId_Tax::TId TTaxId
Taxon id type.
Definition: ncbimisc.hpp:1048
string GetLabel(const CSeq_id &id)
TTaxId GetTaxId(const CBioseq_Handle &handle)
return the tax-id associated with a given sequence.
Definition: sequence.cpp:274
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
static const char label[]
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void GetGcode(const TEntryList &seq_entries, ParserPtr pp)
Definition: nucprot.cpp:247
Modified on Wed Apr 24 14:12:42 2024 by modify_doxy.py rev. 669887