NCBI C++ ToolKit
GC_AssemblyUnit.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: GC_AssemblyUnit.cpp 82628 2018-06-18 15:43:23Z mozese2 $
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  * 'genome_collection.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
45 
46 // generated classes
47 
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
52 // constructor
54  : m_Assembly(NULL)
55 {
56 }
57 
58 
59 // destructor
61 {
62 }
63 
65 {
66  return GetDesc().GetName();
67 }
68 
69 
71 {
72  string accession;
75  {
76  if ((*id_it)->GetDb() == "GenColl" &&
77  (*id_it)->GetTag().IsStr())
78  {
79  return (*id_it)->GetTag().GetStr();
80  }
81  }
82  return "";
83 }
84 
86 {
87  return GetFullAssembly()->GetName() + ' ' + GetName();
88 }
89 
90 
92 {
93  return GetDesc().IsSetFilesafe_name()
95  : NStr::Replace(GetName(), " ", "_");
96 }
97 
98 
100 {
101  return GetFullAssembly()->GetFileSafeName() + '_' + GetFileSafeName();
102 }
103 
104 
106 {
107  int release_id = 0;
109  ITERATE (CGC_AssemblyUnit::TId, id_it, GetId()) {
110  if ((*id_it)->GetDb() == "GenColl" &&
111  (*id_it)->GetTag().IsId()) {
112  release_id = (*id_it)->GetTag().GetId();
113  break;
114  }
115  }
116  return release_id;
117 }
118 
120 {
121  return GetName() == "non-nuclear";
122 }
123 
124 
125 /// Access the assembly the sequence belongs to
127 {
129 }
130 
132 {
133  return m_Assembly->IsUnit() ||
135  == this;
136 }
137 
138 END_objects_SCOPE // namespace ncbi::objects::
139 
141 
142 /* Original file checksum: lines: 57, chars: 1770, CRC32: de4faec2 */
User-defined methods of the data storage class.
User-defined methods of the data storage class.
string GetName() const
Retrieve this unit's name.
bool IsPrimaryUnit() const
Is this the primary unit of its full assembly?
string GetFileSafeDisplayName() const
Get file-safe version of full label for assmebly.
CConstRef< CGC_Assembly > GetFullAssembly() const
Access the most specific full assembly the assembly unit belongs to This is needed because assemblies...
CGC_Assembly * m_Assembly
bool IsOrganelle() const
Is this a non-nuclear assembly unit?
string GetFileSafeName() const
Retrieve the file-safe version of assembly name, if available; othwreise default to standard name.
string GetAccession() const
Retrieve this unit's accession.
string GetDisplayName() const
Get full display name of assembly unit.
int GetReleaseId() const
Retrieve the release id for this assembly.
string GetName() const
Retrieve the name of this assembly.
string GetFileSafeName() const
Retrieve the file-safe version of assembly name, if available; othwreise default to standard name.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3310
const TName & GetName(void) const
Get the Name member data.
const TUnit & GetUnit(void) const
Get the variant data.
const TDesc & GetDesc(void) const
Get the Desc member data.
list< CRef< CDbtag > > TId
const TFilesafe_name & GetFilesafe_name(void) const
Get the Filesafe_name member data.
bool IsSetFilesafe_name(void) const
Check if a value has been assigned to Filesafe_name data member.
const TPrimary_assembly & GetPrimary_assembly(void) const
Get the Primary_assembly member data.
const TAssembly_set & GetAssembly_set(void) const
Get the variant data.
bool IsUnit(void) const
Check if variant Unit is selected.
const TId & GetId(void) const
Get the Id member data.
Modified on Thu Mar 28 17:11:03 2024 by modify_doxy.py rev. 669887