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

Go to the SVN repository for this file.

1 #ifndef ALGO_GNOMON___GNOMON_SEQ__HPP
2 #define ALGO_GNOMON___GNOMON_SEQ__HPP
3 
4 /* $Id: gnomon_seq.hpp 101798 2024-02-13 17:18:22Z souvorov $
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: Alexandre Souvorov, Vyacheslav Chetvernin
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 
38 
40 BEGIN_SCOPE(gnomon)
41 
42 class CEResidueVec : public vector<EResidue> {};
43 
45 public:
46  const CEResidueVec& operator[](EStrand s) const { return m_seq[s]; }
47  CEResidueVec& operator[](EStrand s) { return m_seq[s]; }
48  TSignedSeqPos size() const { return (TSignedSeqPos)m_seq[0].size(); }
49 private:
51 };
52 
53 void Convert(const CResidueVec& src, CEResidueVec& dst);
54 void Convert(const CEResidueVec& src, CResidueVec& dst);
55 void Convert(const CResidueVec& src, CDoubleStrandSeq& dst);
56 
57 void ReverseComplement(const CEResidueVec& src, CEResidueVec& dst);
58 
60 {
61  switch(c)
62  {
63  case 'A':
64  case 'a':
65  return enA;
66  case 'C':
67  case 'c':
68  return enC;
69  case 'G':
70  case 'g':
71  return enG;
72  case 'T':
73  case 't':
74  return enT;
75  default:
76  return enN;
77  }
78 
79 }
80 
82 {
83  switch(c) {
84  case enA:
85  return 'A';
86  case enC:
87  return 'C';
88  case enG:
89  return 'G';
90  case enT:
91  return 'T';
92  case enN:
93  return 'N';
94  default:
95  return 'N';
96  }
97 }
98 
99 void FindAllStarts(TIVec codons[], const CEResidueVec& mrna, const CAlignMap& mrnamap, TSignedSeqRange search_region, int fixed_frame);
100 void FindAllStops(TIVec codons[], const CEResidueVec& mrna, const CAlignMap& mrnamap, TSignedSeqRange search_region, int fixed_frame);
101 void FindStartsStops(const CGeneModel& model, const CEResidueVec& contig_seq, const CEResidueVec& mrna, const CAlignMap& mrnamap,
102  TIVec starts[3], TIVec stops[3], int& frame, bool obeystart);
103 bool FindUpstreamStop(const vector<int>& stops, int start, int& stop);
104 bool FindFirstStart(const vector<int>& starts, int stop, int& start);
105 
106 
107 END_SCOPE(gnomon)
109 
110 #endif // ALGO_GNOMON___GNOMON_SEQ__HPP
CEResidueVec & operator[](EStrand s)
Definition: gnomon_seq.hpp:47
TSignedSeqPos size() const
Definition: gnomon_seq.hpp:48
const CEResidueVec & operator[](EStrand s) const
Definition: gnomon_seq.hpp:46
CEResidueVec m_seq[2]
Definition: gnomon_seq.hpp:50
Include a standard set of the NCBI C++ Toolkit most basic headers.
vector< TResidue > CResidueVec
vector< int > TIVec
@ enN
@ enC
@ enG
@ enT
@ enA
EStrand
objects::CSeqVectorTypes::TResidue TResidue
const TResidue codons[4][4]
Definition: gnomon_seq.cpp:76
bool FindFirstStart(const vector< int > &starts, int stop, int &start)
Definition: gnomon_seq.cpp:298
void FindAllStops(TIVec codons[], const CEResidueVec &mrna, const CAlignMap &mrnamap, TSignedSeqRange search_region, int fixed_frame)
bool FindUpstreamStop(const vector< int > &stops, int start, int &stop)
Definition: gnomon_seq.cpp:287
void FindAllStarts(TIVec codons[], const CEResidueVec &mrna, const CAlignMap &mrnamap, TSignedSeqRange search_region, int fixed_frame)
void FindStartsStops(const CGeneModel &model, const CEResidueVec &contig_seq, const CEResidueVec &mrna, const CAlignMap &mrnamap, TIVec starts[3], TIVec stops[3], int &frame, bool obeystart)
Definition: gnomon_seq.cpp:183
TResidue toACGT(EResidue c)
Definition: gnomon_seq.hpp:81
void ReverseComplement(const CEResidueVec &src, CEResidueVec &dst)
Definition: gnomon_seq.cpp:67
void Convert(const CResidueVec &src, CEResidueVec &dst)
Definition: gnomon_seq.cpp:43
EResidue fromACGT(TResidue c)
Definition: gnomon_seq.hpp:59
int TSignedSeqPos
Type for signed sequence position.
Definition: ncbimisc.hpp:887
#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
Modified on Fri Mar 01 10:06:28 2024 by modify_doxy.py rev. 669887