70 void CMacroFunction_TaxLookup::TheFunction()
80 if (m_DataIter->IsHugeDataMode()) {
81 bool rmv_ncbicleanup_userobj = !(m_DataIter->TopLevelObject());
82 auto& remote_updater = m_DataIter->RemoteUpdater();
84 auto update_fnc = remote_updater->GetUpdateFunc();
85 cleanup_tax_cmd =
CleanupHugeFileCommand(m_DataIter->GetSEH(),
true,
true, update_fnc, rmv_ncbicleanup_userobj);
89 cleanup_tax_cmd =
CleanupCommand(m_DataIter->GetSEH(),
true,
true);
91 if (cleanup_tax_cmd) {
92 m_DataIter->RunCommand(cleanup_tax_cmd, m_CmdComposite);
94 log <<
"Performed TaxLookup and corrected genetic codes";
99 bool CMacroFunction_TaxLookup::x_ValidArguments()
const
101 return (m_Args.empty());
119 s_SpellingFixes(*entry,
log);
122 if (m_DataIter->IsSetSeqSubmit() && m_DataIter->GetSeqSubmit().IsSetSub()){
123 const CSubmit_block& submit_block = m_DataIter->GetSeqSubmit().GetSub();
125 edited_subblock->
Assign(submit_block);
128 s_SpellingFixes(*edited_subblock, log_sblock);
135 cmd->AddCommand(*chg_subblock);
136 m_DataIter->RunCommand(
cmd, m_CmdComposite);
137 log << log_sblock.str();
142 m_DataIter->SetModified();
153 {
"\\bAgricultrual\\b",
"Agricultural" },
154 {
"\\bAgricultureal\\b",
"Agricultural" },
155 {
"\\bAgricultrure\\b",
"Agriculture" },
156 {
"\\bbioremidiation\\b",
"bioremediation" },
157 {
"\\bColledge\\b",
"College" },
158 {
"\\bInsitiute\\b",
"Institute" },
159 {
"\\bInstutite\\b",
"Institute" },
160 {
"\\binstute\\b",
"Institute" },
161 {
"\\binstitue\\b",
"Institute" },
162 {
"\\binsitute\\b",
"Institute" },
163 {
"\\binsititute\\b",
"Institute" },
164 {
"\\bInstiute\\b",
"Institute" },
165 {
"\\bhpothetical\\b",
"hypothetical" },
166 {
"\\bhyphotetical\\b",
"hypothetical" },
167 {
"\\bhyphotheical\\b",
"hypothetical" },
168 {
"\\bhypotehtical\\b",
"hypothetical" },
169 {
"\\bhypotethical\\b",
"hypothetical" },
170 {
"\\bhypotetical\\b",
"hypothetical" },
171 {
"\\bhypotheical\\b",
"hypothetical" },
172 {
"\\bhypotheitcal\\b",
"hypothetical" },
173 {
"\\bhypothetcial\\b",
"hypothetical" },
174 {
"\\bhypothetica\\b",
"hypothetical" },
175 {
"\\bhypothteical\\b",
"hypothetical" },
176 {
"\\bhypothtical\\b",
"hypothetical" },
177 {
"\\bhypthetical\\b",
"hypothetical" },
178 {
"\\bhyptothetical\\b",
"hypothetical" },
179 {
"\\bidendification\\b",
"identification" },
180 {
"\\bprotien\\b",
"protein" },
181 {
"\\bpuatative\\b",
"putative" },
182 {
"\\bpuative\\b",
"putative" },
183 {
"\\bpuative\\b",
"putative" },
184 {
"\\bputaitive\\b",
"putative" },
185 {
"\\bputaitve\\b",
"putative" },
186 {
"\\bputaive\\b",
"putative" },
187 {
"\\bputataive\\b",
"putative" },
188 {
"\\bputatitve\\b",
"putative" },
189 {
"\\bputitive\\b",
"putative" },
190 {
"\\breseach\\b",
"research" },
191 {
"\\bsequene\\b",
"sequence" },
192 {
"\\buniveristy\\b",
"University" },
193 {
"\\buniverisity\\b",
"University" },
194 {
"\\bunivercity\\b",
"University" },
195 {
"\\buiniversity\\b",
"University" },
196 {
"\\buinversity\\b",
"University" },
197 {
"\\bunivesity\\b",
"University" },
198 {
"\\buviversity\\b",
"University" },
199 {
"\\buniverstiy\\b",
"University" },
200 {
"\\bunvierstity\\b",
"University" },
201 {
"\\buniviersity\\b",
"University" },
202 {
"\\buniverstity\\b",
"University" },
203 {
"\\bUnversity\\b",
"University" },
204 {
"\\bUnivresity\\b",
"University" },
219 oss <<
"Replaced " << search.substr(2, search.length() - 4) <<
" with " <<
macro_spell_fixes[pat].second << endl;
242 m_QualsChangedCount = s_RemoveSingleItemSet(seh);
243 if (m_QualsChangedCount) {
244 m_DataIter->SetModified();
246 log <<
"Removed " << m_QualsChangedCount <<
" wrapper set";
289 if (!direct_child_ci) {
294 if (direct_child_ci) {
301 for (; annot_ci; ++annot_ci) {
334 m_QualsChangedCount = 0;
335 s_RenormalizeNucProtSets(seh, m_QualsChangedCount);
337 if (m_QualsChangedCount) {
338 m_DataIter->SetModified();
340 log <<
"Renormalized " << m_QualsChangedCount <<
" sets";
390 void CMacroFunction_DiscrepancyAutofix::TheFunction()
399 if (m_DataIter->IsHugeDataMode()) {
404 m_DataIter->RunCommand(autofix_cmd, m_CmdComposite);
406 x_LogChangedQuals(fnc_log);
413 m_DataIter->RunCommand(autofix_cmd, m_CmdComposite);
421 bool CMacroFunction_DiscrepancyAutofix::x_ValidArguments()
const
438 if (!entry && !(bseq && bseq->
IsNa())) {
447 string feat_list = m_Args[0]->GetString();
449 m_Descr.append(feat_list +
", ");
453 string misc_feat = m_Args[1]->GetString();
455 m_Descr.append(
"use misc_feat with comments " + misc_feat);
457 x_AddModifiersToOptions(options);
459 autodef_cmd = s_AutodefSeqEntry(m_DataIter->GetSEH(), options);
468 if (!m_DataIter->HasBeenCompleted()) {
471 string feat_list = m_Args[0]->GetString();
473 m_Descr.append(feat_list +
", ");
477 string misc_feat = m_Args[1]->GetString();
479 m_Descr.append(
"use misc_feat with comments " + misc_feat);
481 x_AddModifiersToOptions(options);
483 seq_iter->SetAutodefOptions() = options;
484 m_DataIter->SetCompleted();
487 options = seq_iter->GetAutodefOptions();
490 autodef_cmd = s_AutodefSequence(m_DataIter->GetSEH(), m_DataIter->GetBioseqHandle(), options);
494 m_DataIter->RunCommand(autodef_cmd, m_CmdComposite);
496 log << x_GetDescription();
506 mod_combo->InitFromOptions(options);
507 mod_combo->SetUseModifierLabels(
true);
508 mod_combo->SetKeepParen(
true);
509 mod_combo->SetMaxModifiers(0);
522 for (
CBioseq_CI b_iter(seh); b_iter; ++b_iter) {
546 for (
CBioseq_CI b_iter(seh); b_iter; ++b_iter) {
563 if (
si->IsSet() &&
si->GetSet().GetCompleteBioseq_set()->NeedsDocsumTitle()) {
582 if (
si->IsSet() &&
si->GetSet().GetCompleteBioseq_set()->NeedsDocsumTitle()) {
597 mod_combo->InitFromOptions(options);
598 mod_combo->SetUseModifierLabels(
true);
599 mod_combo->SetKeepParen(
true);
600 mod_combo->SetMaxModifiers(0);
614 cmd->AddCommand(*ecmd);
632 opts_desc->
SetUser(*autodef_opts);
633 bool has_autodef_opts =
false;
636 has_autodef_opts =
true;
643 if (!has_autodef_opts) {
654 for (
const auto& it :
m_Args) {
655 if (!it->IsString()) {
664 for (
size_t index = 2; index <
m_Args.size(); ++index) {
665 const string& mod_name =
m_Args[index]->GetString();
669 m_Descr.append(
", with " + mod_name);
676 m_Descr.append(
", with " + mod_name);
695 src_combo->GetAvailableModifiers(modifiers);
697 for (
size_t n = 0;
n < modifiers.size();
n++) {
699 if (modifiers[
n].IsOrgMod()) {
711 return "Performed Autodef " +
m_Descr;
730 s_ConfigureAutodefOptionsForID(modifiers, m_DataIter->GetSEH());
736 for (
size_t n = 0;
n < modifiers.size();
n++) {
737 if (modifiers[
n].IsRequested()) {
738 if (modifiers[
n].IsOrgMod()) {
749 m_DataIter->RunCommand(autodef_cmd, m_CmdComposite);
751 log <<
"Autodef_id sequences";
764 for (
size_t n = 0;
n < modifiers.size();
n++) {
765 if (modifiers[
n].IsOrgMod() && is_org_mod) {
766 if (modifiers[
n].GetOrgModType() == subtype) {
767 if (modifiers[
n].AllPresent()) {
770 else if (modifiers[
n].AnyPresent() && !require_all) {
774 modifiers[
n].SetRequested(
true);
779 else if (!modifiers[
n].IsOrgMod() && !is_org_mod) {
780 if (modifiers[
n].GetSubSourceType() == subtype) {
781 if (modifiers[
n].AllPresent()) {
784 else if (modifiers[
n].AnyPresent() && !require_all) {
788 modifiers[
n].SetRequested(
true);
799 vector<string> clause_list;
802 clause_list.push_back(clause);
804 if (clause_list.size() < 2) {
807 sort(clause_list.begin(), clause_list.end());
809 vector<string>::iterator it = clause_list.begin();
812 while (it != clause_list.end()) {
833 src_combo->GetAvailableModifiers(modifiers);
845 static bool is_orgmod[] = {
true,
false,
true,
false,
true,
true,
true,
true,
true,
true };
846 static int num_subtypes =
sizeof(subtypes) /
sizeof(
int);
850 for (
int i = 0;
i < num_subtypes && !found;
i++) {
855 for (
int i = 0;
i < num_subtypes && !found;
i++) {
861 for (
size_t n = 0;
n < modifiers.size();
n++) {
862 if (modifiers[
n].AnyPresent()) {
863 if (modifiers[
n].IsOrgMod()) {
864 if (src_combo->HasOrgMod(modifiers[
n].GetOrgModType())) {
865 modifiers[
n].SetRequested(
true);
868 else if (src_combo->HasSubSource(modifiers[
n].GetSubSourceType())) {
869 modifiers[
n].SetRequested(
true);
903 m_DataIter->RunCommand(refresh_cmd, m_CmdComposite);
905 log <<
"Refreshed deflines";
913 for (
CBioseq_CI b_iter(se, objects::CSeq_inst::eMol_na); b_iter; ++b_iter) {
927 bool found_existing =
false;
929 if ((*it)->IsTitle()) {
935 cmd->AddCommand(*ecmd);
937 found_existing =
true;
941 if (!found_existing) {
957 while (
b && !options) {
974 bool found_existing =
false;
977 if ((*it)->IsTitle()) {
983 cmd->AddCommand(*ecmd);
985 found_existing =
true;
989 if (!found_existing) {
1023 string misc_feat = m_Args[0]->GetString();
1029 m_Descr.append(
"use misc_feat with comments " + misc_feat);
1032 x_AddModifiersToOptions(options);
1035 autodef_complete.
AddSources(m_DataIter->GetSEH());
1037 mod_combo->InitFromOptions(options);
1038 mod_combo->SetUseModifierLabels(
true);
1039 mod_combo->SetKeepParen(
true);
1040 mod_combo->SetMaxModifiers(0);
1053 for (
CBioseq_CI b_iter(seh); b_iter; ++b_iter) {
1055 bool is_complete = x_IsComplete(*b_iter);
1057 defline = autodef_complete.
GetOneDefLine(mod_combo, *b_iter);
1060 defline = autodef_nocomplete.
GetOneDefLine(mod_combo, *b_iter);
1068 cmd->AddCommand(*ecmd);
1069 m_QualsChangedCount++;
1072 cmd->AddCommand(*delcmd);
1077 m_QualsChangedCount++;
1090 if (m_QualsChangedCount > 0) {
1091 m_DataIter->RunCommand(
cmd, m_CmdComposite);
1093 log <<
"Performed Autodef Complete " + m_Descr;
1110 src_combo->GetAvailableModifiers(modifiers);
1112 for (
size_t n = 0;
n < modifiers.size();
n++) {
1114 if (modifiers[
n].IsOrgMod()) {
1115 opts.
AddOrgMod(modifiers[
n].GetOrgModType());
1126 for (
size_t index = 1; index <
m_Args.size(); ++index) {
1127 const string& mod_name =
m_Args[index]->GetString();
1131 m_Descr.append(
", with " + mod_name);
1138 m_Descr.append(
", with " + mod_name);
1148 bool is_complete =
false;
1163 for (
const auto& it :
m_Args) {
1164 if (!it->IsString()) {
1180 CRef<CScope> scope = m_DataIter->GetScopedObject().scope;
1181 if (!scope || !entry)
1184 if (!m_DataIter->HasBeenCompleted()) {
1185 m_ProductToCds.clear();
1187 m_DataIter->SetCompleted();
1191 for (
auto& it : m_ProductToCds) {
1196 if (cds_set.
size() == 1) {
1198 new_cds->
Assign(*cds_set.
begin()->GetOriginalSeq_feat());
1199 bool cds_change =
false;
1207 m_QualsChangedCount++;
1212 if (m_QualsChangedCount) {
1213 m_DataIter->RunCommand(
cmd, m_CmdComposite);
1215 log <<
"Created " << m_QualsChangedCount <<
" protein features";
1233 void CMacroFunction_ConvertRawToDeltabyNs::TheFunction()
1237 CRef<CScope> scope = m_DataIter->GetScopedObject().scope;
1238 if (!entry || !scope)
1241 NRawToDeltaSeq::SGapRequestInfo request;
1244 request.min_unknown = (long)m_Args[index]->GetInt();
1245 request.max_unknown = (long)m_Args[++index]->GetInt();
1246 request.min_known = (long)m_Args[++index]->GetInt();
1247 request.max_known = (long)m_Args[++index]->GetInt();
1249 request.adjust_cds = m_Args[++index]->GetBool();
1250 request.keep_gap_length = m_Args[++index]->GetBool();
1254 int linkage_evidence = -1;
1256 if (!m_Args[++index]->GetString().empty()) {
1259 if (!m_Args[++index]->GetString().empty()) {
1262 request.linkage = linkage;
1263 request.linkage_evidence = linkage_evidence;
1264 request.is_assembly_gap =
true;
1266 bool remove_alignments =
false;
1270 if (m_DataIter->IsHugeDataMode()) {
1272 request, m_DataIter->MaxFeatureId(), remove_alignments, count);
1276 request, remove_alignments, count);
1281 m_DataIter->RunCommand(convert_cmd, m_CmdComposite);
1282 log <<
"Added assembly gaps by Ns to " << count <<
" sequences";
1283 if (remove_alignments) {
1284 log <<
"and affected alignments were removed";
1290 bool CMacroFunction_ConvertRawToDeltabyNs::x_ValidArguments()
const
1292 if (m_Args.size() != 9)
1296 for (; index < 4; ++index) {
1297 if (!m_Args[index]->IsInt())
1300 if (!m_Args[index]->IsBool())
1302 if (!m_Args[++index]->IsBool())
1306 for (;index < m_Args.size(); ++index) {
1307 if (!m_Args[index]->IsString())
1320 void CMacroFunction_AddGapFeaturesByNs::TheFunction()
1324 CRef<CScope> scope = m_DataIter->GetScopedObject().scope;
1325 if (!entry || !scope)
1328 NRawToDeltaSeq::SGapRequestInfo request;
1331 request.min_unknown = (long)m_Args[index]->GetInt();
1332 request.max_unknown = (long)m_Args[++index]->GetInt();
1333 request.min_known = (long)m_Args[++index]->GetInt();
1334 request.max_known = (long)m_Args[++index]->GetInt();
1336 request.adjust_cds = m_Args[++index]->GetBool();
1337 request.keep_gap_length = m_Args[++index]->GetBool();
1339 bool remove_alignments =
false;
1343 if (m_DataIter->IsHugeDataMode()) {
1345 request, m_DataIter->MaxFeatureId(), remove_alignments, count);
1349 request, remove_alignments, count);
1354 m_DataIter->RunCommand(convert_cmd, m_CmdComposite);
1355 log <<
"Added gap features " << count <<
" sequences";
1356 if (remove_alignments) {
1357 log <<
"and affected alignments were removed";
1363 bool CMacroFunction_AddGapFeaturesByNs::x_ValidArguments()
const
1365 if (m_Args.size() != 6)
1369 for (; index < 4; ++index) {
1370 if (!m_Args[index]->IsInt())
1373 return (m_Args[index]->IsBool() && m_Args[++index]->IsBool());
1385 CRef<CScope> scope = m_DataIter->GetScopedObject().scope;
1386 if (!entry || !scope)
1389 CRef<CCmdComposite> delta_to_raw = s_ConvertDeltaToRaw(m_DataIter->GetSEH(), m_QualsChangedCount);
1391 if (m_QualsChangedCount) {
1392 m_DataIter->RunCommand(delta_to_raw, m_CmdComposite);
1394 log <<
"Converted " << m_QualsChangedCount <<
" delta sequences to raw sequences";
1411 new_inst->
Assign(b_iter->GetInst());
1432 CRef<CScope> scope = m_DataIter->GetScopedObject().scope;
1433 if (!entry || !scope)
1436 const string& filename = m_Args[0]->GetString();
1437 if (filename.empty()) {
1439 log <<
"Empty filename is specified";
1447 log <<
"Failed to open '" << filename;
1461 x_ReadUpdateSeqs(in_str);
1470 log <<
"File '" << filename <<
"' is expected to have FASTA format";
1475 if (m_Proteins.empty()) {
1477 log <<
"File '" << filename <<
"' does not contain any protein sequences";
1483 if (
match == eMatchId) {
1485 for (
size_t index = 0; index < m_Proteins.size(); ++index) {
1486 auto& prot_ids = m_Proteins[index]->GetSeq().GetId();
1487 for (
const auto&
id : prot_ids) {
1491 auto inserted = id_to_index.emplace(idh, index);
1492 if (!inserted.second) {
1494 log <<
"Protein id '" << idh.AsString() <<
"' appears multiple times in the update file";
1505 auto prot_ids = prot_iter->GetCompleteBioseq()->GetId();
1506 for (
const auto&
id : prot_ids) {
1511 auto inserted = orig_proteins.emplace(idh, *prot_iter);
1517 m_QualsChangedCount = 0;
1519 for (
const auto& upd_it : id_to_index) {
1520 auto orig_it = orig_proteins.
find(upd_it.first);
1521 if (orig_it == orig_proteins.
end()) {
1524 const auto& prot_seq = m_Proteins[upd_it.second]->GetSeq();
1526 new_inst->
Assign(prot_seq.GetInst());
1540 m_QualsChangedCount++;
1543 if (m_QualsChangedCount) {
1544 m_DataIter->RunCommand(composite, m_CmdComposite);
1546 log <<
"Updated " << m_QualsChangedCount <<
" protein sequences";
1550 else if (
match == eMatchName) {
1564 while (!fasta_reader.
AtEOF()) {
1576 const string&
str =
m_Args[1]->GetString();
1589 return (
m_Args.size() == 2) ? (
m_Args[0]->IsString() &&
m_Args[1]->IsString()) :
false;
COrgMod::ESubtype GetOrgModType() const
CSubSource::ESubtype GetSubSourceType() const
void SetOptions(const CAutoDefOptions &options)
void AddOrgMod(COrgMod::TSubtype subtype)
unsigned int TMiscFeatRule
void InitFromUserObject(const CUser_object &obj)
void SetMiscFeatRule(TMiscFeatRule rule)
TFeatureListType GetFeatureListType() const
TMiscFeatRule GetMiscFeatRule() const
void SetFeatureListType(EFeatureListType list_type)
void SetUseLabels(bool val=true)
void AddSubSource(CSubSource::TSubtype subtype)
unsigned int TFeatureListType
vector< CAutoDefAvailableModifier > TAvailableModifierVector
string GetDocsumDefLine(CSeq_entry_Handle se)
void SetOptionsObject(const CUser_object &user)
void AddSources(CSeq_entry_Handle se)
CRef< CUser_object > GetOptionsObject() const
void SetOptions(const CAutoDefModifierCombo &mod_combo)
void SetFeatureListType(CAutoDefOptions::EFeatureListType feature_list_type)
string GetOneDefLine(CAutoDefModifierCombo *mod_combo, const CBioseq_Handle &bh, CRef< feature::CFeatTree > featTree=null)
CRef< CAutoDefModifierCombo > FindBestModifierCombo()
void SetMiscFeatRule(CAutoDefOptions::EMiscFeatRule misc_feat_rule)
CAutoDefModifierCombo * GetEmptyCombo()
string GetOneFeatureClauseList(CBioseq_Handle bh, unsigned int genome_val)
bool NeedsDocsumTitle() const
void Add(CObject *obj, const CObject *new_obj)
void AddCommand(IEditCommand &command)
Base class for reading FASTA sequences.
static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
namespace ncbi::objects::
Base class for all serializable objects.
Simple implementation of ILineReader for i(o)streams.
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)
Template class for iteration on objects of class C.
@ eObjectType_AutodefOptions
EObjectType GetObjectType() const
const_iterator end() const
const_iterator find(const key_type &key) const
const_iterator begin() const
CRef< CCmdComposite > ConvertRawToDeltaByNsCommand(const objects::CSeq_entry_Handle &seh, const SGapRequestInfo &request, bool &remove_alignments, int &count)
CRef< CCmdComposite > ConvertRawToDeltaByNsHugeFileCmd(const objects::CSeq_entry_Handle &seh, const SGapRequestInfo &request, objects::CObject_id::TId &max_feat_id, bool &remove_alignments, int &count)
static const char si[8][64]
CChangeUnindexedObjectCommand< objects::CSubmit_block > CChangeSubmitBlockCommand
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
Operators to edit gaps in sequences.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
void x_ReadUpdateSeqs(CNcbiIstream &istr)
bool x_ValidArguments() const
Tests the number and the type of function arguments.
bool x_ValidArguments() const
Tests the number and the type of function arguments.
static void s_ConfigureAutodefOptionsForID(TModifiers &modifiers, objects::CSeq_entry_Handle seh)
static void s_AutodefSetsNoTitle(const objects::CSeq_entry_Handle &seh, objects::CAutoDefWithTaxonomy &autodef, CRef< CCmdComposite > composite_cmd)
static const SStaticPair< const char *, const char * > macro_spell_fixes[]
static void s_AddAutodefOptions(const objects::CAutoDef &autodef, const objects::CBioseq_Handle &bsh, CRef< CCmdComposite > composite_cmd)
bool x_ValidArguments() const
Tests the number and the type of function arguments.
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
string x_GetDescription()
static CRef< CCmdComposite > s_RefreshDeflineCommand(const objects::CSeq_entry_Handle &seh)
static CRef< CCmdComposite > s_AutodefSequence(const objects::CSeq_entry_Handle &seh, const objects::CBioseq_Handle &target, const objects::CAutoDefOptions &options)
bool x_ValidArguments() const
Tests the number and the type of function arguments.
bool x_IsComplete(const objects::CBioseq_Handle bsh)
void x_AddModifiersToOptions(objects::CAutoDefOptions &opts)
static void s_SelectModifiersforAutodefID(objects::CAutoDef &autodef, TModifiers &modifiers, objects::CSeq_entry_Handle seh)
bool x_IsRequested(const objects::CAutoDefAvailableModifier &modifier)
static bool s_ChooseModInModList(bool is_org_mod, int subtype, bool require_all, CAutoDefSourceDescription::TAvailableModifierVector &modifiers)
bool x_ValidArguments() const
Tests the number and the type of function arguments.
static CRef< CCmdComposite > s_ConvertDeltaToRaw(objects::CSeq_entry_Handle seh, Int4 &count)
static CRef< CCmdComposite > s_AutodefSeqEntry(const objects::CSeq_entry_Handle &seh, const objects::CAutoDefOptions &options)
static short s_RemoveSingleItemSet(objects::CSeq_entry_Handle &seh)
bool x_ValidArguments() const
Tests the number and the type of function arguments.
bool x_ValidArguments() const
Tests the number and the type of function arguments.
const string & GetSuspectRules() const
static bool s_AreFeatureClausesUnique(CSeq_entry_Handle seh, CAutoDef &autodef)
void x_AddModifiersToOptions(objects::CAutoDefOptions &opts)
static void s_AutodefBioseqs(const objects::CSeq_entry_Handle &seh, objects::CAutoDefWithTaxonomy &autodef, objects::CAutoDefModifierCombo *mod_combo, CRef< CCmdComposite > composite_cmd)
#define DEFINE_MACRO_FUNCNAME(CL_NAME, FN_NAME)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
vector< CRef< objects::CSeq_entry > > m_Proteins
bool x_IsRequested(const objects::CAutoDefAvailableModifier &modifier)
static CMacroLib & GetInstance()
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static void s_SpellingFixes(CSerialObject &object, CNcbiOstrstream &oss)
static bool s_IsSingletonSet(const objects::CBioseq_set_Handle &bioseq_set)
static void s_AutodefBioseqsNoTitle(const objects::CSeq_entry_Handle &seh, objects::CAutoDefWithTaxonomy &autodef, objects::CAutoDefModifierCombo *mod_combo, CRef< CCmdComposite > composite_cmd)
CIRef< IMacroBioDataIter > m_DataIter
void s_RenormalizeNucProtSets(objects::CSeq_entry_Handle seh, Int4 &count)
objects::CAutoDefSourceDescription::TAvailableModifierVector TModifiers
static void s_AutodefSets(const objects::CSeq_entry_Handle &seh, objects::CAutoDefWithTaxonomy &autodef, CRef< CCmdComposite > composite_cmd)
@ eMatchId
match protein by protein_id
@ eMatchName
match protein by protein name
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define ENUM_METHOD_NAME(EnumName)
static const TObjectType * SafeCast(TTypeInfo type)
virtual CRef< CSeq_entry > ReadOneSeq(ILineErrorListener *pMessageListener=nullptr)
Read a single effective sequence, which may turn out to be a segmented set.
long TFlags
binary OR of EFlags
bool AtEOF(void) const
Indicates (negatively) whether there is any more input.
@ fForceType
Force specified type regardless of accession.
@ fAssumeProt
Assume prots unless accns indicate otherwise.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
TObjectPtr GetObjectPtr(void) const
Get pointer to object.
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
TSeq ConvertSetToSeq(void) const
Do the same as CollapseSet() when sub-entry is of type bioseq.
TClass GetClass(void) const
CRef< CSeqdesc > RemoveSeqdesc(const CSeqdesc &v) const
bool IsEmptySeq_set(void) const
Check if the bioseq set is empty.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
const TDescr & GetDescr(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
void CollapseSet(void) const
Collapse one level of Bioseq-set.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
@ eNonRecursive
Deprecated.
@ fIncludeGivenEntry
Include the top (given) entry.
@ fRecursive
Iterate recursively.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
int32_t Int4
4-byte (32-bit) signed integer
size_t Replace(CTempStringEx search, CTempString replace, CRegexp::TCompile compile_flags=CRegexp::fCompile_default, CRegexp::TMatch match_flags=CRegexp::fMatch_default, size_t max_replace=0)
Replace occurrences of a substring within a string by pattern.
string GetResult(void)
Get result string.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define USING_SCOPE(ns)
Use the specified namespace.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
bool IsOssEmpty(CNcbiOstrstream &oss)
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static string & ToLower(string &str)
Convert string to lower case – string& version.
@ eSubtype_specimen_voucher
@ eSubtype_culture_collection
void SetExcept(TExcept value)
Assign a value to Except data member.
void SetExcept_text(const TExcept_text &value)
Assign a value to Except_text data member.
const TSeq & GetSeq(void) const
Get the variant data.
const TSet & GetSet(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
list< CRef< CSeq_entry > > TSeq_set
@ eClass_pop_set
population study
@ eClass_phy_set
phylogenetic study
@ eClass_wgs_set
whole genome shotgun project
@ eClass_mut_set
set of mutations
@ eClass_eco_set
ecological sample study
@ eClass_nuc_prot
nuc acid and coded proteins
@ eClass_gen_prod_set
genomic products, chrom+mRNA+protein
@ eClass_genbank
converted genbank
@ eClass_small_genome_set
viral segments or mitochondrial minicircles
bool IsSetCompleteness(void) const
Check if a value has been assigned to Completeness data member.
list< CRef< CSeqdesc > > Tdata
const TUser & GetUser(void) const
Get the variant data.
TTitle & SetTitle(void)
Select the variant.
const Tdata & Get(void) const
Get the member data.
TUser & SetUser(void)
Select the variant.
TCompleteness GetCompleteness(void) const
Get the Completeness member data.
const TMolinfo & GetMolinfo(void) const
Get the variant data.
@ eCompleteness_complete
complete biological entity
@ e_User
user defined object
@ e_Molinfo
info on the molecule and techniques
@ e_Title
a title for this sequence
@ eMol_na
just a nucleic acid
Functions used in the DO/DONE section affecting the top seq-entry.
Macro library for storing parsed macros.
constexpr auto sort(_Init &&init)
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
static SQLCHAR output[256]
static const char * str(char *buf, int n)
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
C++ wrappers for the Perl-compatible regular expression (PCRE) library.
CRef< CCmdComposite > AutofixCommand(objects::CSeq_entry_Handle seh, const string &test_name, string *output, const string &suspect_rules=kEmptyStr)
CRef< CCmdComposite > CleanupCommand(objects::CSeq_entry_Handle orig_seh, bool extended, bool do_tax)
void GetProductToCDSMap(objects::CScope &scope, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
void AdjustProteinFeature(objects::CSeq_feat &prot, objects::CBioseq_Handle product, objects::CSeq_feat &cds, bool &cds_change)
CRef< CCmdComposite > AutofixCommandHugeMode(objects::CSeq_entry_Handle seh, const string &test_name, map< string, size_t > &report, const string &suspect_rules=kEmptyStr)
CRef< CCmdComposite > CleanupHugeFileCommand(objects::CSeq_entry_Handle orig_seh, bool extended, bool do_tax, objects::taxupdate_func_t &updater, bool rmv_user_object)