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

Go to the SVN repository for this file.

1 /* $Id: subprep_util.hpp 42167 2019-01-08 17:17:20Z filippov $
2  * ===========================================================================
3  *
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: Colleen Bollin
27  */
28 #ifndef _SUBPREP_UTIL_H_
29 #define _SUBPREP_UTIL_H_
31 #include <corelib/ncbistd.hpp>
55 const string kSubmissionPreparationToolVersion = "1.0";
58 typedef pair<CSourceRequirements::EWizardType, string> TWizardName;
59 typedef vector<TWizardName> TWizardNameList;
65 string FindBadRows (CRef<objects::CSeq_table> src, CRef<objects::CSeq_table> dst, objects::CSeq_entry_Handle seh);
66 CRef<objects::CSeqTable_column> FindSeqIDColumn(const objects::CSeq_table& table);
70 int CountTableColumnConflicts (CRef<objects::CSeq_table> dst, const objects::CSeq_table& src);
72 int CombineTables (CRef<objects::CSeq_table> dst, const objects::CSeq_table& src);
73 bool SaveTableFile (wxWindow *parent, wxString& save_file_dir, wxString& save_file_name, CRef<objects::CSeq_table> values_table);
75 bool AreAllColumnValuesTheSame(CRef<objects::CSeqTable_column> col, string default_val = "");
77 bool AreAnyColumnValuesPresent(CRef<objects::CSeqTable_column> col, string default_val = "");
80 bool AddSeqEntryToSeqEntry(const objects::CSeq_entry* entry, objects::CSeq_entry_Handle seh, CRef<CCmdComposite> cmd, bool& has_nuc, bool& has_prot, bool create_general_only);
82 string CheckFeatureAnnotation (objects::CSeq_entry_Handle entry, bool& is_ok);
84 int AddFeatureToSeqTable (const objects::CSeq_feat& f, CRef<objects::CSeq_table> table);
85 CRef<objects::CSeq_table> GetFeaturesFromSeqEntry(objects::CSeq_entry_Handle entry, const objects::CSeq_feat& feat, const TFeatureSeqTableColumnList& reqs);
86 void MergeStringVectors (vector<string>& problems, vector<string> add);
89 CRef<CCmdComposite> AddFeatureSeqTableToSeqEntry(CRef<objects::CSeq_table> table, objects::CSeq_entry_Handle entry, objects::CSeqFeatData::ESubtype subtype, const TFeatureSeqTableColumnList& reqs, const TFeatureSeqTableColumnList& opts);
90 bool HasLocalIntFeatureId (const objects::CSeq_feat& feat);
91 CRef<CCmdComposite> RemoveMatchingFeaturesWithoutLocalIntFeatureIdsFromSeqEntry(objects::CSeq_entry_Handle entry, const objects::CSeq_feat &feat, const TFeatureSeqTableColumnList& reqs);
94 vector<string> GetTrueFalseList();
95 bool IsSynonymForTrue(const string& val);
96 bool IsSynonymForFalse(const string& val);
97 bool IsTrueFalseList(const vector<string>& choices);
99 wxString GetAsnSqnExtensions();
101 const string kWizardLabel = "NCBIWizard";
102 bool IsWizardObject(const objects::CUser_object& user);
104 string GetFieldFromWizardObject (const objects::CUser_object& user, string field_name);
105 void SetWizardFieldInSeqEntryNoUndo(objects::CSeq_entry_Handle entry, string field_name, string value);
108 bool IsBankItSubmissionObject(const objects::CUser_object& user);
109 string GetDescAlternateEmailAddress(const objects::CSeqdesc& desc);
110 string GetAlternateEmailAddress(objects::CSeq_entry_Handle entry);
111 void SetUserAlternateEmailAddress(objects::CUser_object& u, string alt_email);
112 void SetAlternateEmailAddress(objects::CSeq_entry_Handle entry, string alt_email);
113 bool IsValidEmail(string email);
115 CRef<objects::CSeq_table> GetIdsFromSeqEntry(const objects::CSeq_entry& entry);
116 void AddIdsFromSeqEntryToTable (const objects::CSeq_entry& entry, CRef<objects::CSeq_table> table);
120 void ApplyReplacementIds(objects::CSeq_entry& entry, CRef<objects::CSeq_table> table);
121 vector<string> FindNonUniqueStrings(const vector<string>& values);
122 vector<string> SortUniqueStrings(const vector<string>& values);
124 bool AlreadyHasFeature(objects::CBioseq_Handle bh, string key, string comment);
125 bool AlreadyHasFeature(objects::CBioseq_Handle bh, objects::CSeqFeatData::ESubtype subtype);
131 #endif
132  // _SUBPREP_UTIL_H_
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
char value[7]
Definition: config.c:431
Include a standard set of the NCBI C++ Toolkit most basic headers.
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
vector< CRef< CFeatureSeqTableColumnBase > > TFeatureSeqTableColumnList
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
Define ncbi namespace.
Definition: ncbistl.hpp:100
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const struct ncbi::grid::netcache::search::fields::KEY key
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
vector< TWizardName > TWizardNameList
int CombineTables(CRef< objects::CSeq_table > dst, const objects::CSeq_table &src)
vector< string > FindNonUniqueStrings(const vector< string > &values)
bool AreAnyColumnValuesMissing(CRef< objects::CSeqTable_column > col)
int CountColumnRowConflicts(CRef< objects::CSeqTable_column > dst_id, CRef< objects::CSeqTable_column > dst_col, CRef< objects::CSeqTable_column > src_id, CRef< objects::CSeqTable_column > src_col)
bool AreAllColumnValuesTheSame(CRef< objects::CSeqTable_column > col, string default_val="")
int AddFeatureToSeqTable(const objects::CSeq_feat &f, CRef< objects::CSeq_table > table)
bool AddSeqEntryToSeqEntry(const objects::CSeq_entry *entry, objects::CSeq_entry_Handle seh, CRef< CCmdComposite > cmd, bool &has_nuc, bool &has_prot, bool create_general_only)
bool SaveTableFile(wxWindow *parent, wxString &save_file_dir, wxString &save_file_name, CRef< objects::CSeq_table > values_table)
CSourceRequirements::EWizardType GetWizardTypeFromName(string wizard_name)
int CountTableColumnConflicts(CRef< objects::CSeq_table > dst, const objects::CSeq_table &src)
CRef< objects::CUser_object > MakeWizardObject()
CRef< objects::CUser_object > MakeBankItSubmissionObject()
bool IsValidEmail(string email)
CRef< objects::CSeq_table > GetIdsFromSeqEntry(const objects::CSeq_entry &entry)
vector< string > SortUniqueStrings(const vector< string > &values)
bool IsWizardObject(const objects::CUser_object &user)
bool IsBankItSubmissionObject(const objects::CUser_object &user)
CRef< CCmdComposite > AddFeatureSeqTableToSeqEntry(CRef< objects::CSeq_table > table, objects::CSeq_entry_Handle entry, objects::CSeqFeatData::ESubtype subtype, const TFeatureSeqTableColumnList &reqs, const TFeatureSeqTableColumnList &opts)
CRef< CCmdComposite > RemoveMatchingFeaturesWithoutLocalIntFeatureIdsFromSeqEntry(objects::CSeq_entry_Handle entry, const objects::CSeq_feat &feat, const TFeatureSeqTableColumnList &reqs)
void AddProblemsColumnToFeatureSeqTable(CRef< objects::CSeq_table > table, const TFeatureSeqTableColumnList &reqs, const TFeatureSeqTableColumnList &opts)
bool IsSynonymForFalse(const string &val)
void SetWizardFieldInSeqEntryNoUndo(objects::CSeq_entry_Handle entry, string field_name, string value)
string GetDescAlternateEmailAddress(const objects::CSeqdesc &desc)
const string kSubmissionPreparationToolVersion
wxString GetAsnSqnExtensions()
void AddIdsFromSeqEntryToTable(const objects::CSeq_entry &entry, CRef< objects::CSeq_table > table)
int FindRowForSeqId(CRef< objects::CSeqTable_column > id_col, CRef< objects::CSeq_id > id)
CRef< CFeatureSeqTableColumnBase > GetColumnRuleForFeatureSeqTable(CRef< objects::CSeqTable_column > col, const TFeatureSeqTableColumnList &reqs, const TFeatureSeqTableColumnList &opts)
CRef< objects::CSeqTable_column > FindSeqIDColumn(const objects::CSeq_table &table)
bool IsSynonymForTrue(const string &val)
string SummarizeIdProblems(CRef< objects::CSeqTable_column > problems)
void DeleteTableRow(CRef< objects::CSeq_table > table, int row)
string GetAlternateEmailAddress(objects::CSeq_entry_Handle entry)
bool AlreadyHasFeature(objects::CBioseq_Handle bh, string key, string comment)
void RemoveProblemsColumn(CRef< objects::CSeq_table > values_table)
void SetAlternateEmailAddress(objects::CSeq_entry_Handle entry, string alt_email)
bool DoesColumnHaveValue(CRef< objects::CSeqTable_column > col, string val)
string GetFieldFromWizardObject(const objects::CUser_object &user, string field_name)
void ApplyReplacementIds(objects::CSeq_entry &entry, CRef< objects::CSeq_table > table)
bool AreAnyColumnValuesPresent(CRef< objects::CSeqTable_column > col, string default_val="")
vector< string > GetTrueFalseList()
pair< CSourceRequirements::EWizardType, string > TWizardName
const string kWizardLabel
string CheckFeatureAnnotation(objects::CSeq_entry_Handle entry, bool &is_ok)
void FixTableAfterImport(CRef< objects::CSeq_table > input_table)
string FindBadRows(CRef< objects::CSeq_table > src, CRef< objects::CSeq_table > dst, objects::CSeq_entry_Handle seh)
CRef< objects::CSeq_table > GetFeaturesFromSeqEntry(objects::CSeq_entry_Handle entry, const objects::CSeq_feat &feat, const TFeatureSeqTableColumnList &reqs)
bool IsTrueFalseList(const vector< string > &choices)
void SetUserAlternateEmailAddress(objects::CUser_object &u, string alt_email)
CRef< objects::CSeqTable_column > GetSeqIdProblems(CRef< objects::CSeq_table > new_ids, CRef< objects::CSeq_table > old_ids, size_t max_len)
bool HasLocalIntFeatureId(const objects::CSeq_feat &feat)
CRef< objects::CSeqTable_column > GetReplacementSeqIds(CRef< objects::CSeq_table > new_ids, CRef< objects::CSeq_table > old_ids, size_t max_len)
void MergeStringVectors(vector< string > &problems, vector< string > add)
TWizardNameList GetWizardNameList()
Modified on Sun Mar 03 03:16:14 2024 by rev. 669887