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

Go to the SVN repository for this file.

1 /* $Id: cmd_change_seq_feat.cpp 33112 2015-05-28 11:54:16Z bollin $
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: Roman Katargin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
32 #include <objects/seq/Bioseq.hpp>
33 #include <objmgr/scope.hpp>
34 #include <objmgr/seq_annot_ci.hpp>
35 #include <objmgr/util/feature.hpp>
37 
40 
41 
43 {
44  x_Switch();
45  if (m_PromoteRequested) {
47  }
48 
49 }
50 
52 {
53  x_Switch();
54  if (m_ShouldDemote) {
56  }
57 }
58 
60 {
61  return "Modify feature";
62 }
63 
65 {
66  // This is necessary, to make sure that we are in "editing mode"
67  const CSeq_annot_Handle& annot_handle = m_Orig_feat.GetAnnot();
69 
70  // Now actually edit the feature
71  CConstRef<CSeq_feat> saveFeat = m_Orig_feat.GetOriginalSeq_feat();
73  CSeq_entry_Handle parent_entry = feh.GetAnnot().GetParentEntry();
74 
75  feh.Replace(*m_New_feat);
76 
77  m_New_feat = saveFeat;
78 }
79 
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
virtual void Execute()
Do the editing action.
bool PromoteCDSToNucProtSet(objects::CSeq_feat_Handle &orig_feat)
Promotes coding region from Seq-annot on nucleotide sequence to Seq-annot on nuc-prot-set if necessar...
Definition: feature.cpp:3329
CSeq_annot_EditHandle GetAnnot(void) const
USING_SCOPE(objects)
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
objects::CSeq_feat_Handle m_Orig_feat
CSeq_feat_EditHandle –.
virtual void Unexecute()
Undo (opposite to Execute())
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
CSeq_entry_Handle –.
CSeq_annot_Handle –.
CSeq_entry_Handle –.
CConstRef< objects::CSeq_feat > m_New_feat
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
virtual string GetLabel()
CSeq_entry_EditHandle GetParentEntry(void) const
Navigate object tree.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
bool DemoteCDSToNucSeq(objects::CSeq_feat_Handle &orig_feat)
Definition: cds_fix.cpp:1051
Modified on Sat Jun 25 14:44:30 2016 by modify_doxy.py rev. 426318