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

Go to the SVN repository for this file.

1 /* $Id: cav_seqset.hpp 33815 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 * Authors: Paul Thiessen
27 *
28 * File Description:
29 * Classes to hold sets of sequences
30 *
31 * ===========================================================================
32 */
33 
34 #ifndef CAV_SEQUENCE_SET__HPP
35 #define CAV_SEQUENCE_SET__HPP
36 
37 #include <corelib/ncbistl.hpp>
38 #include <corelib/ncbiobj.hpp>
39 
40 #include <string>
41 #include <list>
42 #include <vector>
43 
45 
46 
48 
50 class CBioseq_set;
51 class CBioseq;
52 class CSeq_id;
54 
55 typedef list < CRef < objects::CSeq_entry > > SeqEntryList;
56 
57 class Sequence;
59 
60 class SequenceSet
61 {
62 private:
63  int status;
64  void UnpackSeqSet(const objects::CBioseq_set& bss);
65  void UnpackSeqEntry(const objects::CSeq_entry& seqEntry);
66 
67 public:
68  SequenceSet(const objects::CSeq_entry& seqEntry);
69  SequenceSet(const SeqEntryList& seqEntries);
70  ~SequenceSet();
71 
72  typedef vector < const Sequence * > SequenceList;
74 
75  int Status(void) const { return status; }
76 
77  // there is one and only one sequence in this set that will be the master
78  // for all alignments of sequences from this set
79  const Sequence *master;
80 };
81 
82 class Sequence
83 {
84 private:
85  int status;
86 
87 public:
88  Sequence(const objects::CBioseq& bioseq);
89 
91  typedef list < CRef < objects::CSeq_id > > SeqIdList;
94 
95  static const int NOT_SET;
96  int mmdbLink;
97 
98  unsigned int Length(void) const { return sequenceString.size(); }
99  bool Matches(const objects::CSeq_id& seqID) const;
100  bool Matches(const SeqIdList& others) const;
101  string GetTitle(void) const; // includes some indicator if id type
102  string GetLabel(void) const; // just the content
103 
104  int Status(void) const { return status; }
105 };
106 
108 
109 
110 #endif // CAV_SEQUENCE_SET__HPP
list< CRef< objects::CSeq_entry > > SeqEntryList
Definition: cav_seqset.hpp:52
CRef –.
Definition: ncbiobj.hpp:618
Definition: Seq_entry.hpp:56
vector< const Sequence * > SequenceList
Definition: cav_seqset.hpp:72
std::list< ncbi::CRef< ncbi::objects::CSeq_entry > > SeqEntryList
const Sequence * master
Definition: cav_seqset.hpp:79
std::list< ncbi::CRef< Sequence > > SequenceList
SequenceList sequences
Definition: cav_seqset.hpp:73
int Status(void) const
Definition: cav_seqset.hpp:75
SequenceSet(const objects::CSeq_entry &seqEntry)
static const int NOT_SET
Definition: cav_seqset.hpp:95
bool Matches(const objects::CSeq_id &seqID) const
string description
Definition: cav_seqset.hpp:93
int status
Definition: cav_seqset.hpp:85
Sequence(const objects::CBioseq &bioseq)
string GetLabel(void) const
Definition: cav_seqset.cpp:313
int mmdbLink
Definition: cav_seqset.hpp:96
int Status(void) const
Definition: cav_seqset.hpp:104
unsigned int Length(void) const
Definition: cav_seqset.hpp:98
string sequenceString
Definition: cav_seqset.hpp:93
string GetTitle(void) const
Definition: cav_seqset.cpp:290
list< CRef< objects::CSeq_id > > SeqIdList
Definition: cav_seqset.hpp:91
const SeqIdList seqIDs
Definition: cav_seqset.hpp:92
CConstRef< objects::CBioseq > bioseqASN
Definition: cav_seqset.hpp:90
#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
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
The NCBI C++/STL use hints.
static void UnpackSeqSet(CBioseq_set &bss, SequenceSet::SequenceList &seqlist)
static void UnpackSeqEntry(CSeq_entry &seqEntry, SequenceSet::SequenceList &seqlist)
Modified on Thu Jun 13 17:28:20 2024 by modify_doxy.py rev. 669887