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

Go to the SVN repository for this file.

1 #ifndef _GUI_PACKAGES_IMPORT_FEAT_TABLE_INPUT_HPP_
2 #define _GUI_PACKAGES_IMPORT_FEAT_TABLE_INPUT_HPP_
3 /* $Id: import_feat_table.hpp 45461 2020-08-10 19:42:39Z asztalos $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Colleen Bollin, Andrea Asztalos
29  */
30 
31 #include <corelib/ncbistd.hpp>
38 
41  class CSeq_annot;
42  class CSeq_feat;
43  class CSeq_entry;
44  class CBioseq_Handle;
45  class CTSE_Handle;
47 
48 
50 {
51 public:
54 
55  CImportFeatTable(objects::CSeq_entry_Handle seh) : m_Seh(seh), m_is_gff(false) {}
56 
58 
59  CIRef<IEditCommand> ImportFeaturesFromFile(const wxString& workDir = wxEmptyString, const string &format_id = kEmptyStr);
60  CIRef<IEditCommand> ImportFeaturesFromClipboard(const wxString& workDir);
61 
62  CIRef<IEditCommand> AddSeqAnnotToSeqEntry(const objects::CSeq_annot& orig_annot, TFeatSeqIDMap& ftbl_seqid_map,
63  unsigned int &startingLocusTagNumber, unsigned int &startingFeatureId, const string &locus_tag, bool euk);
64 
65  // used for testing
66  CIRef<IEditCommand> TestImport(const objects::CSeq_annot& orig_annot, TFeatSeqIDMap& ftbl_seqid_map,
67  unsigned int &startingLocusTagNumber, unsigned int &startingFeatureId, const string &locus_tag, bool euk);
68 
69  // show informative message about importing feature tables
70  static void ShowTableInfo();
71 
72 private:
73  // attach all features to the nucleotide sequence,
74  // even the ones whose location do not fall within the sequence
75  CIRef<IEditCommand> x_DoImportFeaturesFromFile(const wxString& workDir, const string &format_id = kEmptyStr);
76  CIRef<IEditCommand> x_DoImportFeaturesFromClipboard(const wxString& workDir);
77 
78  CIRef<IEditCommand> x_CreateCommand( const IObjectLoader::TObjects& objects);
79 
80  // translate coding regions whose location falls within the sequence
81  // attach coding regions to the existing set or seq level
82  // returns true if it is translated, false otherwise
84 
85  CIRef<IEditCommand> x_GatherAdditionalChanges(CIRef<IEditCommand>& start_cmd);
86 
87  objects::CBioseq_Handle x_FindLocalBioseq_Handle(const objects::CSeq_feat& feat, const objects::CTSE_Handle& tseh) const;
88  objects::CSeq_id_Handle x_GetFixedId(const objects::CSeq_id& id, const objects::CTSE_Handle& tseh) const;
89  /// returns true if the feature table contains at least one pair of duplicate protein/transcript ids
90  bool x_ContainsDuplicateIds(const IObjectLoader::TObjects& objects);
91 
92  // return a message with duplicate product ids - compares feature from table with already present features
93  string x_CheckCollidingIds(const IObjectLoader::TObjects& objects);
94 
95  // returns a message if there are coding regions with and without protein_id qualifier
96  string x_CheckConsistentProteinIds(const IObjectLoader::TObjects& objects);
97 
98  void xPostProcessAnnot(objects::CSeq_annot& annot, unsigned int &startingLocusTagNumber, unsigned int &startingFeatureId, const string &locus_tag, bool euk);
99 
102 
103 private:
104  objects::CSeq_entry_Handle m_Seh;
105  // map to store the next available offset used in creating protein seq-id for a given bioseq
107 
108  // message about feature tables not added to the top seq_entry
109  string m_Error;
110  bool m_is_gff;
111 };
112 
114 
115 #endif //_GUI_PACKAGES_IMPORT_FEAT_TABLE_INPUT_HPP_
CBioseq_Handle –.
map< string, int > m_OffsetForId
CMatchFeatureTableDlg::TFeatSeqIDMap TFeatSeqIDMap
CImportFeatTable & operator=(const CImportFeatTable &)
CImportFeatTable(objects::CSeq_entry_Handle seh)
CMatchFeatureTableDlg::TUniqueFeatTblIDs TUniqueFeatTblIDs
objects::CSeq_entry_Handle m_Seh
CImportFeatTable(const CImportFeatTable &)
Definition: Seq_entry.hpp:56
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
vector< SObject > TObjects
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define false
Definition: bool.h:36
#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 kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_GUIPKG_SEQUENCE_EDIT_EXPORT
Definition: gui_export.h:515
Modified on Fri Sep 20 14:58:27 2024 by modify_doxy.py rev. 669887