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

Go to the SVN repository for this file.

1 #ifndef GUI_PLUGINS_ALGO_ALIGN___ALIGN_GROUP__HPP
2 #define GUI_PLUGINS_ALGO_ALIGN___ALIGN_GROUP__HPP
3 
4 /* $Id: align_group.hpp 91957 2020-12-17 12:53:43Z grichenk $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Mike DiCuccio
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbiobj.hpp>
36 #include <memory>
37 #include <set>
38 
40 
42  class CSeq_align;
43  class CSeq_annot;
44  class CScope;
45  class COrg_ref;
46  class CSeq_id_Handle;
47  class CTaxon1;
49 
50 
52 {
53 public:
54 
55  typedef list< CRef<objects::CSeq_align> > TAlignList;
56  typedef list< CRef<objects::CSeq_annot> > TAnnotList;
57 
58  CAlignGroup();
59  ~CAlignGroup();
60 
61  /// @name Taxonomic Separation Interface
62  /// @{
63 
64  /// typedefs for dealing with separations by tax-id
67 
68  /// typedefs for caching of taxonomic information
71 
72  /// Separate a set of alignments into groups that describe
73  /// how the alignments relate taxonomically
74  void GroupByTaxIds(const TAlignList& aligns,
75  TAnnotList& align_groups,
76  const string& annot_base_name,
77  objects::CScope& scope);
78 
79  /// Separate a set of alignments into groups that describe
80  /// how the alignments relate taxonomically. This version
81  /// will group together all alignments that have more than one
82  /// tax-id represented.
83  void GroupByLikeTaxIds(const TAlignList& aligns,
84  TAnnotList& align_groups,
85  const string& annot_base_name,
86  objects::CScope& scope);
87 
88  /// @}
89 
90  /// @name Sequence Type Separation Interface
91  /// @{
92 
94  fRefSeq = 0x01,
95  fRefSeqPredicted = 0x02,
96  fEST = 0x04,
97  fWGS = 0x08,
98  fHTGS = 0x10,
99  fPatent = 0x20,
100  fGB_EMBL_DDBJ = 0x40,
101 
102  fSequenceDefaults = fRefSeq | fEST | fGB_EMBL_DDBJ
103  };
104  typedef int TSequenceFlags;
105 
106  /// Group alignments into sequence-related categories.
107  void GroupBySequenceType(const TAlignList& aligns,
108  TAnnotList& align_groups,
109  const string& annot_base_name,
110  objects::CScope& scope,
111  TSequenceFlags flags = fSequenceDefaults);
112 
113 
114  enum ESeqIdFlags {
115  fResolveToGi = 0x01
116  };
117  typedef int TSeqIdFlags;
118 
119  /// Group alignments into bins for each set of seq-ids.
120  void GroupBySeqIds(const TAlignList& aligns,
121  TAnnotList& align_groups,
122  const string& annot_base_name,
123  objects::CScope& scope,
124  TSeqIdFlags flags = 0);
125 
126  /// Group alignments into bins for each set of strands.
127  void GroupByStrand(const TAlignList& aligns,
128  TAnnotList& align_groups,
129  const string& annot_base_name,
130  objects::CScope& scope);
131 
132  /// @}
133 
134 
135 private:
136 
137  unique_ptr<objects::CTaxon1> m_Taxon1;
140 
141  void x_SeparateByTaxId(const TAlignList& alignments,
142  TTaxAlignMap& tax_aligns,
143  objects::CScope& scope);
144 
145  CConstRef<objects::COrg_ref> x_GetOrgRef(TTaxId tax_id);
146  CConstRef<objects::COrg_ref> x_GetOrgRef(const objects::CSeq_id_Handle& id,
147  objects::CScope& scope);
148  TTaxId x_GetTaxId(const objects::CSeq_id_Handle& id,
149  objects::CScope& scope);
150 
151 private:
152  /// forbidden!
155 };
156 
157 
158 
160 
161 #endif // GUI_PLUGINS_ALGO_ALIGN___ALIGN_GROUP__HPP
map< TTaxId, CConstRef< objects::COrg_ref > > TTaxInfoMap
Definition: align_group.hpp:70
map< objects::CSeq_id_Handle, TTaxId > TTaxIdMap
typedefs for caching of taxonomic information
Definition: align_group.hpp:69
set< TTaxId > TTaxIds
typedefs for dealing with separations by tax-id
Definition: align_group.hpp:65
CAlignGroup & operator=(const CAlignGroup &)
TTaxInfoMap m_TaxInfo
TTaxIdMap m_TaxIds
unique_ptr< objects::CTaxon1 > m_Taxon1
map< TTaxIds, list< CRef< objects::CSeq_align > > > TTaxAlignMap
Definition: align_group.hpp:66
CAlignGroup(const CAlignGroup &)
forbidden!
CConstRef< objects::COrg_ref > x_GetOrgRef(const objects::CSeq_id_Handle &id, objects::CScope &scope)
list< CRef< objects::CSeq_align > > TAlignList
Definition: align_group.hpp:55
list< CRef< objects::CSeq_annot > > TAnnotList
Definition: align_group.hpp:56
CScope –.
Definition: scope.hpp:92
Definition: map.hpp:338
static uch flags
SStrictId_Tax::TId TTaxId
Taxon id type.
Definition: ncbimisc.hpp:1048
#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
#define NCBI_XALGOSEQ_EXPORT
Definition: ncbi_export.h:1017
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Fri Jan 05 07:23:06 2024 by modify_doxy.py rev. 669887