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

Go to the SVN repository for this file.

1 #ifndef GUI_OBJUTILS___ADJUST_CONSENSUS_SPLICESITE__HPP
2 #define GUI_OBJUTILS___ADJUST_CONSENSUS_SPLICESITE__HPP
3 
4 /* $Id: adjust_consensus_splicesite.hpp 43721 2019-08-22 17:22:05Z asztalos $
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: Colleen Bollin, Andrea Asztalos
30  *
31  * File Description:
32  *
33  */
34 
35 
36 #include <corelib/ncbiobj.hpp>
37 #include <gui/gui_export.h>
38 
41 
42 
45  class CSeq_feat;
46  class CScope;
47  class CBioseq_Handle;
49 
51 {
52 public:
53  CAdjustForConsensusSpliceSite(objects::CScope& scope)
54  : m_Scope(&scope) {}
55 
56  void SetScope(objects::CScope& scope) { m_Scope.Reset(&scope); }
57 
58  CRef<CCmdComposite> GetCommand(const objects::CSeq_feat& cds);
59  CRef<CCmdComposite> GetCommandToAdjustCDSEnds(const objects::CSeq_feat& cds);
60 
61  static bool s_IsBioseqGood_Strict(const objects::CBioseq_Handle& bsh);
62  static bool s_IsBioseqGood_Relaxed(const objects::CBioseq_Handle& bsh);
63  static bool s_IsBioseqGood_AdjustEnds(const objects::CBioseq_Handle& bsh);
64  static bool s_IsAdjustedSpliceSitePairOK(const string& seqdata, TSeqPos intron_start, TSeqPos intron_stop);
65 
66  bool AdjustCDS(objects::CSeq_feat& cds);
67  bool AdjustmRNAToMatchCDS(const objects::CSeq_feat& edit_cds, objects::CSeq_feat& mrna);
68  CRef<CCmdComposite> AdjustmRNAandExonFeatures(const objects::CSeq_feat& new_cds, const objects::CSeq_feat& orig_cds);
69 
70  // Splice adjustments can lead to extension or trimming by 2 nucleotides
71  bool AdjustCDSEnds(objects::CSeq_feat& cds);
72  bool AdjustmRNAToMatchCDSEnds(const objects::CSeq_feat& edit_cds, objects::CSeq_feat& mrna);
73  CRef<CCmdComposite> AdjustmRNAandExonEnds(const objects::CSeq_feat& new_cds, const objects::CSeq_feat& orig_cds);
74 
75 private:
76  typedef vector<TSeqRange> TLocs;
77 
78  void x_InitRanges(const objects::CSeq_feat& cds);
79  void x_UpdateMixLocations(const objects::CSeq_loc& orig_loc, objects::CSeq_loc::TLocations& locs);
80  void x_UpdateInterval(objects::CSeq_interval& interval);
81  void x_UpdateIntervals(objects::CSeq_loc::TIntervals& locs);
82  CRef<objects::CSeq_loc> x_UpdateLocation(const objects::CSeq_feat& cds);
83 
84  TSeqPos x_IntronLength(const TSeqRange& rng_prev, const TSeqRange& rng);
85  void x_ShiftExonPairForward(TSeqRange& range_prev, TSeqRange& range, TSeqPos offset);
86  void x_ShiftExonPairBackward(TSeqRange& range_prev, TSeqRange& range, TSeqPos offset);
87 
88  CRef<objects::CSeq_loc> x_CreateNewLocation(const objects::CSeq_feat& cds);
89  bool x_HasProteinChanged(const objects::CSeq_feat& cds, const string& orig_prot_seq);
90  bool x_HasProteinChangedAt5End(objects::CSeq_feat& cds, const string& orig_prot_seq);
91  bool x_HasProteinChangedAt3End(objects::CSeq_feat& cds, const string& orig_prot_seq);
92  bool x_AlsoAdjustmRNA(objects::CSeq_feat& mrna, const objects::CSeq_loc& loc);
93  void x_UpdateExonFeatures(CCmdComposite* cmd, const objects::CSeq_feat& orig_cds, const objects::CSeq_feat& new_cds);
94 
95  bool x_AdjustCDS5End(objects::CSeq_feat& cds, const string& orig_prot_seq);
96  bool x_AdjustCDS3End(objects::CSeq_feat& cds, const string& orig_prot_seq);
97 
98  bool x_ExtendStartOfExon(TSeqRange& range, TSeqPos offset, const objects::CSeq_loc& loc, objects::CBioseq_Handle bsh);
99  void x_TrimStartOfExon(TSeqRange& range, TSeqPos offset);
100  bool x_ExtendStopOfExon(TSeqRange& range, TSeqPos offset, const objects::CSeq_loc& loc, objects::CBioseq_Handle bsh);
101  void x_TrimStopOfExon(TSeqRange& range, TSeqPos offset);
102 
103  // strand of cds and associated mRNA
105  // original location ranges of the cds
107  // updated location ranges of the cds
109  // indicates that the protein changed during location adjustment
110  // however, this change is acceptable when the 5'end needs to be adjusted
111  // and possibly the frame is changed
112  bool m_ProtChanged{ false };
113 
115 };
116 
118 
119 #endif // GUI_OBJUTILS___ADJUST_CONSENSUS_SPLICESITE__HPP
120 
121 
122 
static CRef< CScope > m_Scope
void SetScope(objects::CScope &scope)
CAdjustForConsensusSpliceSite(objects::CScope &scope)
CBioseq_Handle –.
CScope –.
Definition: scope.hpp:92
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#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_GUIOBJUTILS_EXPORT
Definition: gui_export.h:512
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
Defines to provide correct exporting from DLLs in Windows.
range(_Ty, _Ty) -> range< _Ty >
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
int offset
Definition: replacements.h:160
Modified on Sun Mar 03 03:10:43 2024 by modify_doxy.py rev. 669887