CMacroFunction_TrimStopFromCompleteCDS::TheFunction()
90 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
91 if(!edit_feat || !scope)
99m_DataIter->RunCommand(
cmd, m_CmdComposite);
104 log<<
"Removed trailing * from protein sequence "<< best_id;
109 boolCMacroFunction_TrimStopFromCompleteCDS::x_ValidArguments()
const 111 return(m_Args.empty());
121void CMacroFunction_SynchronizeCDSPartials::TheFunction()
125 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
126 if(!edit_feat || !scope)
132m_DataIter->SetModified();
138m_DataIter->RunCommand(synch_cmd, m_CmdComposite);
141 if(change || synch_cmd) {
143 log<< m_DataIter->GetBestDescr() <<
" synchronized coding region partials";
148 boolCMacroFunction_SynchronizeCDSPartials::x_ValidArguments()
const 150 return(m_Args.empty());
159 voidCMacroFunction_AdjustConsensusSpliceSites::TheFunction()
163 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
164 if(!edit_feat || !scope)
168orig_feat.
Assign(*edit_feat);
175 boolchanged = worker.AdjustCDS(*edit_feat);
177m_DataIter->SetModified();
182m_DataIter->RunCommand(update_cmd, m_CmdComposite);
185 log<<
"Adjusted location for splice consensus: "<< m_DataIter->GetBestDescr() <<
" became ";
203 boolCMacroFunction_AdjustConsensusSpliceSites::x_ValidArguments()
const 205 return(m_Args.empty());
215 voidCMacroFunction_RemoveInvalidECNumbers::TheFunction()
224 if(!
prot.IsSetEc() ||
prot.GetEc().empty())
227 typedefvector< CProt_ref::EECNumberStatus > TVecStatus;
229TVecStatus st_before;
236 unsigned intreplaced = 0;
237TVecStatus::const_iterator it_bef = st_before.begin();
238CProt_ref::TEc::const_iterator ec =
prot.GetEc().begin();
239 for(; ec !=
prot.GetEc().end() && it_bef != st_before.end(); ++ec, ++it_bef) {
247 unsigned intremoved = (
unsigned int)(st_before.size() -
prot.GetEc().size());
249 if(replaced || removed) {
250m_DataIter->SetModified();
252 log<< m_DataIter->GetBestDescr() <<
": ";
254 log<<
" replaced "<< replaced <<
" EC numbers";
257 log<<
" removed "<< removed <<
" EC numbers";
263 boolCMacroFunction_RemoveInvalidECNumbers::x_ValidArguments()
const 265 return(m_Args.empty());
276void CMacroFunction_UpdateReplacedECNumbers::TheFunction()
278 booldel_improper_format = m_Args[0]->GetBool();
279 booldel_unrecognized = m_Args[1]->GetBool();
280 booldel_mult_replacement = m_Args[2]->GetBool();
284 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
285 if(!prot_feat || !prot_feat->
GetData().
IsProt() || !scope) {
290 if(!
prot.IsSetEc() ||
prot.GetEc().empty())
294 stringlocus_tag(
"No locus tag");
298CProt_ref::TEc::iterator ec =
prot.SetEc().begin();
299 while(ec !=
prot.SetEc().end()) {
300 boolremoved =
false;
307 log<< locus_tag <<
": replaced "<< *ec <<
" with "<< repl_ec <<
"\n";
310 else if(del_mult_replacement) {
311 log<< locus_tag <<
": removed "<< *ec <<
"\n";
312ec =
prot.SetEc().erase(ec);
318 log<< locus_tag <<
": removed "<< *ec <<
"\n";
319ec =
prot.SetEc().erase(ec);
324 if(del_improper_format) {
325 log<< locus_tag <<
": removed "<< *ec <<
"\n";
326ec =
prot.SetEc().erase(ec);
336 if(
prot.GetEc().empty()) {
340m_DataIter->SetModified();
344 boolCMacroFunction_UpdateReplacedECNumbers::x_ValidArguments()
const 346 size_targ_size = m_Args.size();
351 for(
size_t n= 0;
n< arg_size; ++
n) {
364 voidCMacroFunction_UpdatemRNAProduct::TheFunction()
366 if(!m_Args.empty()) {
381 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
383 if(!prot_feat || !scope ||
390 stringproduct =
prot.GetName().front();
392 log<< m_DataIter->GetBestDescr() <<
": ";
401new_mrna->Assign(*mrna);
403 boolmodified =
false;
408 log<<
"Reset the mRNA product name ";
411 else if(!
rna.IsSetExt() || (
rna.IsSetExt() && !
NStr::Equal(
rna.GetExt().GetName(), product))){
412 rna.SetExt().SetName(product);
413 log<<
"Applied "<< product <<
" to mRNA product name ";
422 cmd->AddCommand(*chgFeat);
423m_DataIter->RunCommand(
cmd, m_CmdComposite);
431 boolCMacroFunction_UpdatemRNAProduct::x_ValidArguments()
const 447void CMacroFunction_RemoveFeature::TheFunction()
449 if(!m_DataIter->IsFeature()) {
453m_DataIter->SetToDelete(
true);
455 booldelete_gene =
false;
457 if(m_Args.size() == 1 && m_Args[0]->GetBool()) {
461 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
467 cmd->AddCommand(*del_cmd);
468m_DataIter->RunCommand(
cmd, m_CmdComposite);
474 log<< m_DataIter->GetBestDescr() <<
": feature removed";
476 log<<
" and the overlapping gene";
481 boolCMacroFunction_RemoveFeature::x_ValidArguments()
const 483 returnm_Args.empty() || (m_Args.size() == 1 && m_Args[0]->IsBool());
492void CMacroFunction_CopyNameToCDSNote::TheFunction()
496 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
498 if(!prot_feat || !scope ||
505 stringproduct =
prot.GetName().front();
507 log<< m_DataIter->GetBestDescr() <<
": ";
514new_cds->Assign(*cds);
516 boolmodified =
false;
517 stringorig_comment = (new_cds->IsSetComment()) ? new_cds->GetComment() :
kEmptyStr;
519new_cds->SetComment(orig_comment);
520 log<<
"Copied protein name to CDS note";
528 cmd->AddCommand(*chgFeat);
529m_DataIter->RunCommand(
cmd, m_CmdComposite);
536 boolCMacroFunction_CopyNameToCDSNote::x_ValidArguments()
const 538 return(m_Args.empty());
551 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
555 boolremove_proteins =
true;
560 else if(bseq && bseq->
IsNa()) {
567 if(!m_DataIter->HasBeenCompleted()) {
568m_ProductToCds.clear();
570m_DataIter->SetCompleted();
583m_DataIter->RunCommand(delete_features_cmd, m_CmdComposite);
585 log<<
"Removed "<<
count<<
" features";
586x_LogFunction(
log);
592 return(
m_Args.empty());
600void CMacroFunction_RemoveDuplFeatures::TheFunction()
604 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
609 boolcheck_partials = m_Args[1]->GetBool();
610 boolcase_sensitive = m_Args[2]->GetBool();
611 boolremove_proteins = m_Args[3]->GetBool();
617 for(
CFeat_CIfeat_it1(bsh, sel); feat_it1; ++feat_it1) {
618 for(
CFeat_CIfeat_it2(*scope, feat_it1->GetLocation(), sel); feat_it2; ++feat_it2) {
619 if(feat_it1->GetSeq_feat_Handle() < feat_it2->GetSeq_feat_Handle()) {
622duplicates.
insert(feat_it2->GetSeq_feat_Handle());
628 if(duplicates.
empty())
636m_DataIter->RunCommand(
cmd, m_CmdComposite);
638report[
"removal of duplicate features"] = duplicates.
size();
640x_LogChangedQuals(fnc_log);
643 boolCMacroFunction_RemoveDuplFeatures::x_ValidArguments()
const 645 if(m_Args.size() != 4 || !m_Args[0]->IsString()) {
649 for(
size_t i= 1;
i< m_Args.size(); ++
i) {
650 if(!m_Args[
i]->IsBool())
667 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
668 if(!prot_feat || !prot_feat->
GetData().
IsProt() || !scope)
674 if(m_DataIter->IsHugeDataMode()) {
675vector<string> seh_taxnames;
678x_FixProteinNames(prot_feat->
SetData().SetProt(), seh_taxnames);
681 if(m_NewNames.empty()) {
682 const auto& taxnames = m_DataIter->GetTaxnames();
683x_FixProteinNames(prot_feat->
SetData().SetProt(), taxnames);
686 if(!m_NewNames.empty()) {
687m_DataIter->SetModified();
689 for(
size_t n= 0;
n< m_NewNames.size(); ++
n) {
690 log<<
"On "<< m_DataIter->GetBestDescr();
691 log<<
": changed protein name from "<< m_OrigNames[
n];
692 log<<
" to "<< m_NewNames[
n];
694x_LogFunction(
log);
700 for(
auto& it :
prot.SetName()) {
712 return(
m_Args.empty());
720 if(taxnames.empty())
723 stringnew_prot(protein);
724vector<string> pattern;
725pattern.push_back(
"()");
726pattern.push_back(
"( )");
727pattern.push_back(
"[]");
728pattern.push_back(
"[ ]");
729 ITERATE(vector<string>, name, taxnames) {
732new_prot = protein.substr(0, pos) + protein.substr(pos + name->length());
736 ITERATE(vector<string>, pat_it, pattern) {
775 m_Seqfeat->GetLocation().GetLabel(&new_loc);
777 log<< descr <<
" for "<<
m_DataIter->GetBestDescr() <<
" to "<< new_loc;
783 if(adjust_gene_cmd) {
785 cmd->AddCommand(*adjust_gene_cmd);
787 log<<
" and adjusted gene location.";
795 if(
m_Seqfeat->GetData().IsCdregion()) {
799 if(!
m_DataIter->HasBeenCompleted() && feat_iter) {
800feat_iter->SetCreateGeneralIdFlag();
804 boolcds_change =
false;
809 log<<
" and retranslated the coding region ";
817 log<<
" and synchronized CDS partials";
834 if(!x_CheckInitFeature())
837m_Modified = s_SetBothEndsPartial(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString(), m_Args[1]->GetBool());
839m_RetranslateCDS = (m_Args.size() > 2) ? m_Args[2]->GetBool() :
false;
840m_AdjustGene = (m_Args.size() == 4) ? m_Args[3]->GetBool() :
false;
841x_RetranslateCDSAdjustGene(
"Set both end partials");
854edit::CLocationEditPolicy::EPartialPolicy policy5 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
855edit::CLocationEditPolicy::EPartialPolicy policy3 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
857policy5 = edit::CLocationEditPolicy::ePartialPolicy_eSet;
858policy3 = edit::CLocationEditPolicy::ePartialPolicy_eSet;
863&& edit::CLocationEditPolicy::Is5AtEndOfSeq(feat.
GetLocation(), bsh)
864&& edit::CLocationEditPolicy::Is3AtEndOfSeq(feat.
GetLocation(), bsh)) {
866policy5 = edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd;
867policy3 = edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd;
871 boolextend5(
false), extend3(
false);
878 returnpolicy->ApplyPolicyToFeature(feat, scope);
887 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
905 if(!x_CheckInitFeature())
908m_Modified = s_RemoveBothPartials(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString());
910m_RetranslateCDS = (m_Args.size() > 1) ? m_Args[1]->GetBool() :
false;
911m_AdjustGene = (m_Args.size() == 3) ? m_Args[2]->GetBool() :
false;
912x_RetranslateCDSAdjustGene(
"Removed both ends partial");
925edit::CLocationEditPolicy::EPartialPolicy policy5 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
926edit::CLocationEditPolicy::EPartialPolicy policy3 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
928policy5 = edit::CLocationEditPolicy::ePartialPolicy_eClear;
929policy3 = edit::CLocationEditPolicy::ePartialPolicy_eClear;
934&& !edit::CLocationEditPolicy::Is5AtEndOfSeq(feat.
GetLocation(), bsh)
935&& !edit::CLocationEditPolicy::Is3AtEndOfSeq(feat.
GetLocation(), bsh)) {
937policy5 = edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd;
938policy3 = edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd;
942 boolextend5 =
false, extend3 =
false;
944 returnpolicy->ApplyPolicyToFeature(feat, scope);
952 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
968 if(!x_CheckInitFeature())
971m_Modified = s_Set5EndPartial(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString(), m_Args[1]->GetBool());
973m_RetranslateCDS = (m_Args.size() > 2) ? m_Args[2]->GetBool() :
false;
974m_AdjustGene = (m_Args.size() == 4) ? m_Args[3]->GetBool() :
false;
975x_RetranslateCDSAdjustGene(
"Set 5' end partial");
988edit::CLocationEditPolicy::EPartialPolicy policy5 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
991policy5 = edit::CLocationEditPolicy::ePartialPolicy_eSet;
994policy5 = edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd;
997policy5 = edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd;
1000policy5 = edit::CLocationEditPolicy::ePartialPolicy_eSetForFrame;
1004 boolextend3 =
false;
1005 CRef<edit::CLocationEditPolicy>policy(
newedit::CLocationEditPolicy(policy5, edit::CLocationEditPolicy::ePartialPolicy_eNoChange, extend5, extend3));
1006 returnpolicy->ApplyPolicyToFeature(feat, scope);
1014 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
1030 if(!x_CheckInitFeature())
1033m_Modified = s_Set3EndPartial(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString(), m_Args[1]->GetBool());
1035m_RetranslateCDS = (m_Args.size() > 2) ? m_Args[2]->GetBool() :
false;
1036m_AdjustGene = (m_Args.size() == 4) ? m_Args[3]->GetBool() :
false;
1037x_RetranslateCDSAdjustGene(
"Set 3' end partial");
1050edit::CLocationEditPolicy::EPartialPolicy policy3 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
1053policy3 = edit::CLocationEditPolicy::ePartialPolicy_eSet;
1056policy3 = edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd;
1059policy3 = edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd;
1063 boolextend5 =
false;
1064 CRef<edit::CLocationEditPolicy>policy(
newedit::CLocationEditPolicy(edit::CLocationEditPolicy::ePartialPolicy_eNoChange, policy3, extend5, extend3));
1065 returnpolicy->ApplyPolicyToFeature(feat, scope);
1073 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
1088 if(!x_CheckInitFeature())
1091m_Modified = s_Clear5EndPartial(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString());
1093m_RetranslateCDS = (m_Args.size() > 1) ? m_Args[1]->GetBool() :
false;
1094m_AdjustGene = (m_Args.size() == 3) ? m_Args[2]->GetBool() :
false;
1095x_RetranslateCDSAdjustGene(
"Cleared 5' end partial");
1108edit::CLocationEditPolicy::EPartialPolicy policy5 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
1111policy5 = edit::CLocationEditPolicy::ePartialPolicy_eClear;
1114policy5 = edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd;
1117policy5 = edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd;
1121 boolextend5 =
false, extend3 =
false;
1122 CRef<edit::CLocationEditPolicy>policy(
newedit::CLocationEditPolicy(policy5, edit::CLocationEditPolicy::ePartialPolicy_eNoChange, extend5, extend3));
1123 returnpolicy->ApplyPolicyToFeature(feat, scope);
1131 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
1148 if(!x_CheckInitFeature())
1151m_Modified = s_Clear3EndPartial(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString());
1153m_RetranslateCDS = (m_Args.size() > 1) ? m_Args[1]->GetBool() :
false;
1154m_AdjustGene = (m_Args.size() == 3) ? m_Args[2]->GetBool() :
false;
1155x_RetranslateCDSAdjustGene(
"Cleared 3' end partial");
1168edit::CLocationEditPolicy::EPartialPolicy policy3 = edit::CLocationEditPolicy::ePartialPolicy_eNoChange;
1171policy3 = edit::CLocationEditPolicy::ePartialPolicy_eClear;
1174policy3 = edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd;
1177policy3 = edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd;
1181 boolextend5 =
false, extend3 =
false;
1182 CRef<edit::CLocationEditPolicy>policy(
newedit::CLocationEditPolicy(edit::CLocationEditPolicy::ePartialPolicy_eNoChange, policy3, extend5, extend3));
1183 returnpolicy->ApplyPolicyToFeature(feat, scope);
1191 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
1209 if(!x_CheckInitFeature())
1212m_RetranslateCDS = (m_Args.size() > 2) ? m_Args[2]->GetBool() :
false;
1213m_AdjustGene = (m_Args.size() == 4) ? m_Args[3]->GetBool() :
false;
1215m_Modified = s_ConvertLocationStrand(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString(), m_Args[1]->GetString());
1220m_DataIter->SetModified();
1222m_Seqfeat->GetLocation().GetLabel(&new_loc);
1224 log<<
"Converted location strand for "<< m_DataIter->GetBestDescr() <<
" to "<< new_loc;
1227x_RetranslateCDS(
log);
1229 if(m_AdjustGene && !m_Seqfeat->GetData().IsGene()) {
1233new_gene->
Assign(*overlap_gene);
1234 boolchange_gene = s_ConvertLocationStrand(*new_gene, *
m_Scope, m_Args[0]->GetString(), m_Args[1]->GetString());
1240 cmd->AddCommand(*chgFeat);
1241m_DataIter->RunCommand(
cmd, m_CmdComposite);
1242 log<<
" and adjusted gene location.";
1247x_LogFunction(
log);
1268 boolmodified =
false;
1273 stringfrom = str_from;
1294 if(start_any || strand_from == current_strand) {
1312 else if(strand_to != current_strand) {
1326 for(
size_t i= 2;
i<
m_Args.size(); ++
i) {
1342 if(!x_CheckInitFeature())
1345m_RetranslateCDS = (m_Args.size() > 1) ? m_Args[1]->GetBool() :
false;
1346m_AdjustGene = (m_Args.size() == 3) ? m_Args[2]->GetBool() :
false;
1348m_Modified = s_ConvertLocationType(*m_Seqfeat, *
m_Scope, m_Args[0]->GetString());
1353m_DataIter->SetModified();
1355m_Seqfeat->GetLocation().GetLabel(&new_loc);
1357 log<<
"Converted location type for "<< m_DataIter->GetBestDescr() <<
" to "<< new_loc;
1360x_RetranslateCDS(
log);
1362 if(m_AdjustGene && !m_Seqfeat->GetData().IsGene()) {
1366new_gene->
Assign(*overlap_gene);
1367 boolchange_gene = s_ConvertLocationType(*new_gene, *
m_Scope, m_Args[0]->GetString());
1373 cmd->AddCommand(*chgFeat);
1374m_DataIter->RunCommand(
cmd, m_CmdComposite);
1375 log<<
" and adjusted gene location.";
1380x_LogFunction(
log);
1386edit::CLocationEditPolicy::EMergePolicy merge_type = edit::CLocationEditPolicy::eMergePolicy_NoChange;
1389merge_type = edit::CLocationEditPolicy::eMergePolicy_Join;
1392merge_type = edit::CLocationEditPolicy::eMergePolicy_Order;
1395merge_type = edit::CLocationEditPolicy::eMergePolicy_SingleInterval;
1402policy->SetMergePolicy(merge_type);
1403 returnpolicy->ApplyPolicyToFeature(feat, scope);
1411 for(
size_t i= 1;
i<
m_Args.size(); ++
i) {
1426 if(!x_CheckInitFeature())
1429m_Modified = edit::CLocationEditPolicy::Extend5(*m_Seqfeat, *
m_Scope);
1431m_RetranslateCDS = (m_Args.empty()) ?
false: m_Args[0]->GetBool();
1432m_AdjustGene = (m_Args.size() == 2) ? m_Args[1]->GetBool() :
false;
1433x_RetranslateCDSAdjustGene(
"Extended feature to 5' end");
1442 for(
auto& it :
m_Args) {
1458 if(!x_CheckInitFeature())
1461m_Modified = edit::CLocationEditPolicy::Extend3(*m_Seqfeat, *
m_Scope);
1463m_RetranslateCDS = (m_Args.empty()) ?
false: m_Args[0]->GetBool();
1464m_AdjustGene = (m_Args.size() == 2) ? m_Args[1]->GetBool() :
false;
1465x_RetranslateCDSAdjustGene(
"Extended feature to 3' end");
1474 for(
auto& it :
m_Args) {
1492 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1497 ECdsFrameframe = s_GetFrameFromName(m_Args[0]->GetString());
1502 boolmodified = s_SetCDSFrame(*cds, frame, *scope);
1505m_DataIter->SetModified();
1511 if(!m_DataIter->HasBeenCompleted() && feat_iter) {
1512feat_iter->SetCreateGeneralIdFlag();
1513m_DataIter->SetCompleted();
1519m_DataIter->RunCommand(upd_cmd, m_CmdComposite);
1523 log<< m_DataIter->GetBestDescr() <<
": the "<< m_Args[0]->GetString() <<
" frame was set";
1524x_LogFunction(
log);
1539 switch(frame_type) {
1550 boolmodified =
false;
1551 if(orig_frame != new_frame) {
1552cds.
SetData().SetCdregion().SetFrame(new_frame);
1568 if(!product || !product.
IsProtein()) {
1575 stringorig_prot_seq;
1585tmp_cds->
SetData().SetCdregion().SetFrame(fr);
1587 stringnew_prot_seq;
1590new_prot_seq.erase(new_prot_seq.end() - 1);
1634 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1635 if(!from_feat || !const_feat || !scope) {
1639 const string& to_feat = m_Args[0]->GetString();
1648x_LogFunction(
log);
1652x_SetConvertOptions(converter);
1654 boolkeep_orig(
true);
1658m_DataIter->RunCommand(convert_cmd, m_CmdComposite);
1660 log<<
"Converted "<< m_DataIter->GetBestDescr() <<
" to "<< to_feat;
1661x_LogFunction(
log);
1683 const string& opt_label = (*it)->GetLabel();
1685(*it)->SetBool()->SetVal(
m_Args[index]->GetBool());
1689(*it)->SetBool()->SetVal(
m_Args[index]->GetBool());
1693(*it)->SetBool()->SetVal(
m_Args[index]->GetBool());
1701 const string& opt_label = (*it)->GetLabel();
1703(*it)->SetString()->SetVal(
m_Args[1]->GetString());
1708 const string& opt_label = (*it)->GetLabel();
1710(*it)->SetString()->SetVal(
m_Args[1]->GetString());
1715 const string& opt_label = (*it)->GetLabel();
1717(*it)->SetString()->SetVal(
m_Args[1]->GetString());
1723 const string& opt_label = (*it)->GetLabel();
1725(*it)->SetBool()->SetVal(
m_Args[1]->GetBool());
1743 for(
size_tindex =
m_Args.size() - 1; index <
m_Args.size() - 3; --index) {
1757void CMacroFunction_AddGeneXref::TheFunction()
1761 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1771m_DataIter->SetModified();
1774 log<<
"Added Gene xref to "<< m_DataIter->GetBestDescr();
1778 boolCMacroFunction_AddGeneXref::x_ValidArguments()
const 1780 return(m_Args.empty());
1794 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1795 if(!edit_feat || !edit_feat->
IsSetXref() || !scope) {
1800 const string& suppr_str = m_Args[0]->GetString();
1808 const string& necessary_str = m_Args[0]->GetString();
1815 boolremoved(
false);
1816CSeq_feat::TXref::iterator xref_it = edit_feat->
SetXref().begin();
1817 while(xref_it != edit_feat->
SetXref().end()) {
1818 if((*xref_it)->IsSetData() && (*xref_it)->GetData().IsGene() &&
1819s_GeneXrefMatchesSuppression((*xref_it)->GetData().GetGene(), suppr_type) &&
1820s_GeneXrefMatchesNecessary((*xref_it)->GetData().GetGene(), *edit_feat, *scope, necessary_type)) {
1821xref_it = edit_feat->
SetXref().erase(xref_it);
1834m_DataIter->SetModified();
1836 log<<
"Removed Gene xref from "<< m_DataIter->GetBestDescr();
1837x_LogFunction(
log);
1843 if(
m_Args.size() != 2) {
1855 switch(necessary_type) {
1872 switch(suppr_type) {
1901 if(strand1 == strand2) {
1903 return(start1 > start2);
1906 return(start1 < start2);
1910 returnstrand1 < strand2;
1913 returnproduct1 < product2;
1932void CMacroFunction_JoinShorttRNAs::TheFunction()
1936 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
1937 if(!bseq || !scope)
1940vector<CConstRef<CSeq_feat> > tRNAFeats;
1943 const CSeq_feat& feature = *feat_it->GetOriginalSeq_feat();
1945tRNAFeats.push_back(feat_it->GetOriginalSeq_feat());
1953 autoit = tRNAFeats.begin();
1954 automodified =
false;
1955 while(it != tRNAFeats.end()) {
1960vector<string> comments;
1966rnaLoc->Add((*next)->GetLocation());
1967 if((*next)->IsSetComment()) {
1968comments.push_back((*next)->GetComment());
1977 cmd->AddCommand(*delGene);
1980geneLoc->Add((*next)->GetLocation());
1986 cmd->AddCommand(*delNext);
1993newtRNA->Assign(**it);
1995rnaLoc->Add((*it)->GetLocation());
1997newtRNA->SetLocation(*rnaLoc);
1999 if(!comments.empty()) {
2000 stringorigComment = (*it)->IsSetComment() ? (*it)->GetComment() :
kEmptyStr;
2002 if(origComment.empty()) {
2003origComment = comments[0];
2006 for( ; index < comments.size(); ++index) {
2009 if(!origComment.empty()) {
2010newtRNA->SetComment(origComment);
2021 log<<
"Joined "<< loc_ci.GetSize() <<
" short tRNAs with product name "<< newtRNA->GetData().GetRna().GetRnaProductName();
2029newGene->Assign(*gene);
2030newGene->SetLocation(*geneLoc);
2035newGene->GetLocation().GetLabel(&
label);
2036 log<<
"\n"<<
"Corresponding gene has been extended to "<<
label<<
"\n";
2045m_DataIter->RunCommand(
cmd, m_CmdComposite);
2050 boolCMacroFunction_JoinShorttRNAs::x_ValidArguments()
const 2052 return(m_Args.empty());
2066 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2085 autoit = find_if(
names.begin(),
names.end(), [](
const string&
str) { return (NStr::Find(str,
"seleno") != NPOS); });
2086 if(it ==
names.end()) {
2108 unsigned intreplaced = 0;
2112 for(
size_tindex = 0; index < prot_seq.size(); ++index) {
2113 if(prot_seq[index] ==
'*') {
2123 if(codon ==
"TGA") {
2125code_break->
SetLoc(*nuc_loc);
2126code_break->
SetAa().SetNcbieaa(
'U');
2127cds_feat->
SetData().SetCdregion().SetCode_break().push_back(code_break);
2131 log<<
"Unable to add transl_except for stop codon at position "<< index + 1;
2132 log<<
" in protein "<< prot_label <<
" because codon is not TGA\n";
2142 if(!m_DataIter->HasBeenCompleted() && feat_iter) {
2143feat_iter->SetCreateGeneralIdFlag();
2144m_DataIter->SetCompleted();
2147 booltransl_change =
false;
2150m_DataIter->RunCommand(retransl_cmd, m_CmdComposite);
2154m_DataIter->SetModified();
2155 log<<
"Replaced "<< replaced <<
" stops with selenocysteine.";
2156x_LogFunction(
log);
2162 return(
m_Args.empty());
2172prot_loc->
SetPnt(*prot_pnt);
2185void CMacroFunction_RetranslateCDS::TheFunction()
2189 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2197 boolobey_stop_codon = m_Args[0]->GetBool();
2202 if(!m_DataIter->HasBeenCompleted() && feat_iter) {
2203feat_iter->SetCreateGeneralIdFlag();
2204m_DataIter->SetCompleted();
2207 booltransl_change =
false;
2211m_DataIter->RunCommand(retransl_cmd, m_CmdComposite);
2212 if(cds_change || transl_change) {
2213m_DataIter->SetModified();
2215 log<<
"Retranslated "<< m_DataIter->GetBestDescr();
2220 boolCMacroFunction_RetranslateCDS::x_ValidArguments()
const 2235 if(!bseq || !scope)
2244 if(index <
m_Args.size()) {
2246 if(
m_Args[index]->GetInt() < 1) {
2268 if(!x_SetCurrentBioseq())
2271x_HandleNegativeCoordinates(0);
2272x_HandleNegativeCoordinates(1);
2274 ENa_strandstrand = x_GetStrand(m_Args.back()->GetString());
2280 if(to > m_Bsh.GetBioseqLength() - 1) {
2281to = m_Bsh.GetBioseqLength() - 1;
2284 if(m_Args[2]->GetBool()) {
2287 if(m_Args[3]->GetBool()) {
2297 if(
m_Args.size() != 5)
2317 if(!x_SetCurrentBioseq())
2320 ENa_strandstrand = x_GetStrand(m_Args.back()->GetString());
2322 if(m_Args[0]->GetBool()) {
2325 if(m_Args[1]->GetBool()) {
2335 if(
m_Args.size() != 3)
2353 if(!x_SetCurrentBioseq())
2356x_HandleNegativeCoordinates(0);
2357 ENa_strandstrand = x_GetStrand(m_Args.back()->GetString());
2359 if(point > m_Bsh.GetBioseqLength() - 1) {
2360point = m_Bsh.GetBioseqLength() - 1;
2364 location->SetPnt().SetPoint(point);
2365 location->SetPnt().SetId().Assign(*m_Bsh.GetCompleteBioseq()->GetFirstId());
2366 location->SetPnt().SetStrand(strand);
2367 if(m_Args[1]->GetBool()) {
2370 if(m_Args[2]->GetBool()) {
2380 if(
m_Args.size() != 4)
2398 booladd_redundant =
m_Args[index]->GetBool();
2399 if(add_redundant) {
2412 if(location_obj.empty()) {
2416 if(
NStr::EqualCase(location_obj.front().field.GetName(),
"Seq-loc")) {
2436 size_targ_size =
m_Args.size();
2437 while(index < arg_size) {
2438 const stringfield =
m_Args[index]->GetString();
2439 if(field ==
"qual.qual") {
2440 const stringqualifier =
m_Args[++index]->GetString();
2444 m_NewFeat->SetQual().push_back(new_gbqual);
2453 if(index < arg_size) {
2478 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2480 if(!bseq || !scope || bseq->
IsAa())
2484m_NewFeat->SetData().SetCdregion();
2489m_NewFeat->SetData().SetCdregion().SetCode(*
code);
2492 boolfind_best_frame =
false;
2493 size_tfr_index = 2;
2497find_best_frame =
true;
2504 switch(m_Args[fr_index]->GetInt()) {
2519 if(!x_SetLocation(3) || !x_ShouldAddRedundant(4))
2522x_SetAdditionalFields(6);
2524 booladd_mRNA = m_Args[5]->GetBool();
2525 const string& protein_name = m_Args[0]->GetString();
2526 const string& protein_descr = m_Args[1]->GetString();
2535new_mrna->
SetData().SetRna().SetExt().SetName(protein_name);
2539 if(m_Location->IsPnt()) {
2543 if(find_best_frame) {
2544 boolambiguous =
false;
2548m_NewFeat->SetData().SetCdregion().SetFrame(codon_start);
2556 if(!protein_name.empty()) {
2557 prot->SetData().SetProt().SetName().push_back(protein_name);
2559 if(!protein_descr.empty()) {
2560 prot->SetData().SetProt().SetDesc(protein_descr);
2569 cleanup.BasicCleanup(*m_NewFeat);
2573m_DataIter->RunCommand(
cmd, m_CmdComposite);
2578 log<<
"Added CDS feature to "<< best_id;
2579x_LogFunction(
log);
2588 boolgood =
m_Args[0]->IsString()
2589&&
m_Args[1]->IsString()
2595 if(
m_Args.size() > 6) {
2596 for(
size_tindex = 6; index <
m_Args.size(); ++index) {
2597 if(!
m_Args[index]->IsString()) {
2615 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2617 if(!bseq || !scope || bseq->
IsAa())
2627 const string& rna_name = m_Args[1]->GetString();
2632m_NewFeat->SetData().SetRna().Assign(*rna_ref);
2634 if(!x_SetLocation(2) || !x_ShouldAddRedundant(3))
2637x_SetAdditionalFields(4);
2639 cleanup.BasicCleanup(*m_NewFeat);
2645m_DataIter->RunCommand(
cmd, m_CmdComposite);
2650 log<<
"Added "<< m_Args[0]->GetString() <<
" feature to "<< best_id;
2651x_LogFunction(
log);
2665 if(
m_Args.size() > 4) {
2666 for(
size_tindex = 4; index <
m_Args.size(); ++index) {
2688 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2691 if(!bseq || !scope || bseq->
IsAa())
2695 if(!x_SetLocation(0))
2698x_SetAdditionalFields(1);
2705m_DataIter->RunCommand(
cmd, m_CmdComposite);
2709 log<<
"Added Gene feature to "<< best_id;
2710x_LogFunction(
log);
2721 if(
m_Args.size() > 1) {
2722 for(
size_tindex = 1; index <
m_Args.size(); ++index) {
2745 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2747 if(!bseq || !scope)
2751 CObjectInfooi(m_NewFeat, m_NewFeat->GetTypeInfo());
2758 const string& new_str = m_Args[1]->
GetString();
2774 if(!SetQualStringValue(new_oi, new_str)) {
2785 if(!x_SetLocation(2) || !x_ShouldAddRedundant(3))
2788x_SetAdditionalFields(4);
2795m_DataIter->RunCommand(
cmd, m_CmdComposite);
2800 log<<
"Added feature to "<< best_id;
2801x_LogFunction(
log);
2812 if(
m_Args.size() > 4) {
2813 for(
size_tindex = 4; index <
m_Args.size(); ++index) {
2829 voidCMacroFunction_RestoreRNAEditing::TheFunction()
2833 CRef<CScope>scope = m_DataIter->GetScopedObject().scope;
2837 stringprot_name = m_Args[0]->GetString();
2840 boolgood_cds =
false;
2851prot_vec.GetSeqData(0, prot_vec.size(), prot_seq);
2853 if(!prot_seq.empty() && prot_seq.front() !=
'M') {
2859 if(prot_name == *name_it) {
2876m_DataIter->SetModified();
2883new_inst->Assign(prot_bsh.
GetInst());
2884new_inst->ResetSeq_data();
2887new_inst->ResetExt();
2888new_inst->SetRepr(objects::CSeq_inst::eRepr_raw);
2889new_inst->SetSeq_data().SetNcbieaa().Set(prot_seq);
2890new_inst->SetLength(
TSeqPos(prot_seq.length()));
2893upd_cmd->AddCommand(*chgInst);
2896m_DataIter->RunCommand(upd_cmd, m_CmdComposite);
2900 log<< m_DataIter->GetBestDescr() <<
" restored RNA editing";
2904 boolCMacroFunction_RestoreRNAEditing::x_ValidArguments()
const 2906 return(m_Args.size() == 1 && m_Args[0]->IsString());
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
@ eExtreme_Biological
5' and 3'
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.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool TruncateCDSAtStop(CSeq_feat &cds, CScope &scope)
TruncateCDSAtStop A function to truncate a CDS location after the first stop codon in the protein tra...
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
CRef< CGenetic_code > GetGeneticCodeForBioseq(CBioseq_Handle bh)
GetGeneticCodeForBioseq A function to construct the appropriate CGenetic_code object to use when cons...
static bool s_IsBioseqGood_Strict(const objects::CBioseq_Handle &bsh)
const CSeq_id * GetFirstId() const
static bool IsGeneXrefUnnecessary(const CSeq_feat &sf, CScope &scope, const CGene_ref &gene_xref)
Calculates whether a Gene-xref is unnecessary (because it refers to the same gene as would be calcula...
static bool FixRNAEditingCodingRegion(CSeq_feat &cds)
From GB-7563 An action has been requested that will do the following: 1.
void AddCommand(IEditCommand &command)
static CRef< CConvertFeatureBase > Create(objects::CSeqFeatData::ESubtype subtype_from, objects::CSeqFeatData::ESubtype subtype_to)
static const string s_PlaceOnProt
static const string s_RemoveTranscriptID
static const string s_SiteType
virtual CRef< CCmdComposite > Convert(const objects::CSeq_feat &orig, bool keep_orig, objects::CScope &scope)
static const string s_BondType
virtual string GetDescription()
static const string s_NcrnaClass
static const string s_RemovemRNA
vector< CRef< CConversionOption > > TOptions
static const string s_RemoveGene
@Gb_qual.hpp User-defined methods of the data storage class.
bool IsSuppressed(void) const
Subclass of the IQueryParseUserObject which is held as the user-defined object in each CQueryParseNod...
CMacroBioData_FeatIterBase - iterates over any type of features.
class CMacroExecException
class CMacroExecException
static bool IsValidECNumberFormat(const string &ecno)
Verify correct form of EC number.
static const string & GetECNumberReplacement(const string &old_ecno)
Return a replaced EC number's replacement.
EECNumberStatus
Enzyme Commission number status.
@ eEC_replaced
Obsolete synonym for some other EC number.
@ eEC_ambiguous
Valid wildcard for a broader family.
@ eEC_specific
Specifically identifies a valid classification.
static EECNumberStatus GetECNumberStatus(const string &ecno)
Determine an EC number's validity and specificity.
@RNA_ref.hpp User-defined methods of the data storage class.
string GetRnaProductName(void) const
void SetRnaProductName(const string &product, string &remainder)
ESubtype GetSubtype(void) const
static E_Choice GetTypeFromSubtype(ESubtype subtype)
namespace ncbi::objects::
void SetGeneXref(CGene_ref &value)
Seq-loc iterator class â iterates all intervals from a seq-loc in the correct order.
static bool GetBestId(CSeq_id_Handle, CScope &, string &)
iterator_bool insert(const value_type &val)
CRef< objects::CSeq_entry > CreateTranslatedProteinSequence(CRef< objects::CSeq_feat > cds, objects::CBioseq_Handle nuc_h, bool create_general_only, int *offset=nullptr)
CRef< objects::CSeq_feat > AddProteinFeatureToProtein(CRef< objects::CSeq_entry > protein, bool partial5, bool partial3)
static const string kConversionNotSupported
static auto & FindOrgNames
static void cleanup(void)
static const struct name_t names[]
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
static const char location[]
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define NCBI_RETHROW2(prev_exception, exception_class, err_code, message, extra)
Re-throw exception with extra parameter.
@ eUnknown
Unknown exception.
void x_FixProteinNames(objects::CProt_ref &prot, const vector< string > &taxnames)
static bool s_Set5EndPartial(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr, bool extend5=false)
CRef< objects::CScope > m_Scope
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
void x_SetConvertOptions(CRef< CConvertFeatureBase > converter)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static bool s_Clear5EndPartial(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr)
static ECdsFrame s_GetFrameFromName(const string &name)
static bool s_ShouldBeMerged(const CSeq_feat &feat1, const CSeq_feat &feat2)
objects::CSeqFeatData::ESubtype GetFeatSubtype(const string &feat_type)
CRef< CMacroCmdComposite > m_CmdComposite
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static bool s_ConvertLocationType(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
CConstRef< objects::CSeq_feat > m_Origfeat
list< SResolvedField > TObs
void x_RetranslateCDS(CNcbiOstrstream &log)
static string s_FixProteinNameFormat(const string &protein, const vector< string > &taxnames)
void Dereference()
If it is a reference it is resolved to the first non reference type in the hierarchy.
static bool s_GeneXrefMatchesSuppression(const objects::CGene_ref &gene, objects::EGene_xref_suppression_type suppr_type)
bool ResolveIdentToObjects(const CObjectInfo &oi, const string &identifier, CMQueryNodeValue &v)
Resolve name to the list of objects.
bool SetSimpleTypeValue(CObjectInfo &oi, const CMQueryNodeValue &value, objects::edit::EExistingText existing_text=objects::edit::eExistingText_replace_old)
Set single node data to the node specified by parameter of type CObjectInfo.
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
bool x_SetCurrentBioseq()
class CMacroFunction_MakeLocation Generates different type of seq-loc objects
virtual 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.
CRef< objects::CSeq_feat > m_Seqfeat
const string & GetString() const
EType GetDataType() const
void GetPrimitiveObjectInfos(CMQueryNodeValue::TObs &objs, const CMQueryNodeValue::SResolvedField &info)
objects::CRNA_ref::EType GetRNAType(const string &rna_type)
bool x_ShouldAddRedundant(size_t index)
class CMacroFunction_ApplyFeature Generates different types of apply feature commands
objects::CBioseq_Handle m_Bsh
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static objects::ENa_strand s_GetStrandFromString(const string &str)
void x_RetranslateCDSAdjustGene(const string &descr)
bool x_SetLocation(size_t index)
vector< string > m_NewNames
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static bool s_GeneXrefMatchesNecessary(const objects::CGene_ref &gene, const objects::CSeq_feat &feat, objects::CScope &scope, objects::EGene_xref_necessary_type necessary_type)
bool SetFieldsByName(CMQueryNodeValue::TObs *results, CObjectInfo &oi_i, const string &field_name)
Resolve not necessarily existing dot qualified ASN.1 name (field_name) starting from the object infor...
static bool s_SetBothEndsPartial(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr, bool extend=false)
void x_GetObjectsFromRef(CMQueryNodeValue::TObs &objects, const size_t &index)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
bool GetLocusTagFromProtRef(const objects::CSeq_feat &prot_feat, objects::CScope &scope, string &locus_tag)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static bool s_SortShorttRNAs(const CConstRef< CSeq_feat > &feat1, const CConstRef< CSeq_feat > &feat2)
class CMacroFunction_JoinShorttRNAs JoinShorttRNAs() - joins short (< 50bp) tRNAs and extends the cor...
objects::ENa_strand x_GetStrand(const string &str)
CRef< objects::CSeq_loc > m_Location
virtual 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.
static bool s_Clear3EndPartial(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr)
DEFINE_MACRO_FUNCNAME(CMacroFunction_TrimStopFromCompleteCDS, "TrimStopsFromCompleteCDS")
class CMacroFunction_TrimStopFromCompleteCDS TrimStopsFromCompleteCDS()
CRef< objects::CSeq_feat > m_NewFeat
virtual 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.
static bool s_RemoveBothPartials(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr)
void x_LogFunction(CNcbiOstrstream &logstr)
CRef< objects::CSeq_loc > x_GetProteinLoc(const objects::CSeq_id &prot_id, TSeqPos pos) const
bool x_CheckInitFeature()
static bool s_Set3EndPartial(objects::CSeq_feat &feat, objects::CScope &scope, const string &descr, bool extend3=false)
virtual 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.
void x_SetAdditionalFields(size_t index)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
vector< string > m_OrigNames
static bool s_ConvertLocationStrand(objects::CSeq_feat &feat, objects::CScope &scope, const string &str_from, const string &str_to)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
static objects::CCdregion::TFrame s_FindMatchingFrame(const objects::CSeq_feat &cds, objects::CScope &scope)
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
CIRef< IMacroBioDataIter > m_DataIter
static bool s_SetCDSFrame(objects::CSeq_feat &cds, ECdsFrame frame_type, objects::CScope &scope)
virtual 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.
void x_HandleNegativeCoordinates(size_t index)
objects::CBioseq_Handle m_Bsh
virtual 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.
objects::CBioseq_Handle GetBioseqForSeqFeat(const objects::CSeq_feat &f, objects::CScope &scope)
C & SerialAssign(C &dest, const C &src, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
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)
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void GetLabel(string *label) const
Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
TObjectPtr GetObjectPtr(void) const
Get pointer to object.
CObjectInfo AddNewElement(void) const
Add and return new element object.
ETypeFamily GetTypeFamily(void) const
Get data type family.
bool AdjustFeaturePartialFlagForLocation(CSeq_feat &new_feat)
AdjustFeaturePartialFlagForLocation A function to ensure that Seq-feat.partial is set if either end o...
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
void ChangeSeqLocId(CSeq_loc *loc, bool best, CScope *scope)
Change each of the CSeq_ids embedded in a CSeq_loc to the best or worst CSeq_id accoring to the value...
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
CSeq_loc * SeqLocRevCmpl(const CSeq_loc &loc, CScope *scope)
Get reverse complement of the seq-loc (?)
const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)
Get the encoding CDS feature of a given protein sequence.
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
CConstRef< CSeq_feat > GetOverlappingGene(const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing=eTransSplicing_Auto)
CConstRef< CSeq_feat > GetGeneForFeature(const CSeq_feat &feat, CScope &scope)
Finds gene for feature, but obeys SeqFeatXref directives.
static CCdregion::EFrame FindBestFrame(const CSeq_feat &cds, CScope &scope)
Find "best" frame for a coding region.
CConstRef< CSeq_feat > GetmRNAforCDS(const CSeq_feat &cds, CScope &scope)
GetmRNAforCDS A function to find a CSeq_feat representing the appropriate mRNA for a given CDS.
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
@ eProductToLocation
Map from the feature's product to location.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
CSeq_id_Handle GetAccessSeq_id_Handle(void) const
Get any CSeq_id_Handle handle that can be used to access this bioseq Use GetSeq_id_Handle() if it's n...
const CSeqFeatData & GetData(void) const
bool IsProtein(void) const
bool IsSetData(void) const
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
const TInst & GetInst(void) const
@ eCoding_Ncbi
Set coding to binary coding (Ncbi4na or Ncbistdaa)
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
void SetCoding(TCoding coding)
void SetIupacCoding(void)
Set coding to either Iupacaa or Iupacna depending on molecule type.
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
#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)
NCBI_NS_STD::string::size_type SIZE_TYPE
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive equality of a substring with another string.
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 & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
static const char label[]
EPartial_both_clear_constraint
Access to EPartial_both_clear_constraint's attributes (values, names) as defined in spec.
EPartial_3_clear_constraint
Access to EPartial_3_clear_constraint's attributes (values, names) as defined in spec.
EPartial_3_set_constraint
Access to EPartial_3_set_constraint's attributes (values, names) as defined in spec.
EPartial_both_set_constraint
Access to EPartial_both_set_constraint's attributes (values, names) as defined in spec.
EGene_xref_suppression_type
Access to EGene_xref_suppression_type's attributes (values, names) as defined in spec.
EGene_xref_necessary_type
Access to EGene_xref_necessary_type's attributes (values, names) as defined in spec.
EFeature_location_strand_from
Access to EFeature_location_strand_from's attributes (values, names) as defined in spec.
EPartial_5_clear_constraint
Access to EPartial_5_clear_constraint's attributes (values, names) as defined in spec.
EPartial_5_set_constraint
Access to EPartial_5_set_constraint's attributes (values, names) as defined in spec.
EFeature_location_strand_to
Access to EFeature_location_strand_to's attributes (values, names) as defined in spec.
@ ePartial_both_clear_constraint_all
@ ePartial_3_clear_constraint_good_end
@ ePartial_3_clear_constraint_not_at_end
@ ePartial_3_clear_constraint_all
@ ePartial_3_set_constraint_all
@ ePartial_3_set_constraint_bad_end
@ ePartial_3_set_constraint_at_end
@ ePartial_both_set_constraint_all
@ eGene_xref_suppression_type_non_suppressing
@ eGene_xref_suppression_type_any
@ eGene_xref_suppression_type_suppressing
@ eGene_xref_necessary_type_any
@ eGene_xref_necessary_type_unnecessary
@ eGene_xref_necessary_type_necessary
@ ePartial_5_clear_constraint_all
@ ePartial_5_clear_constraint_not_at_end
@ ePartial_5_clear_constraint_good_start
@ ePartial_5_set_constraint_bad_start
@ ePartial_5_set_constraint_frame_not_one
@ ePartial_5_set_constraint_at_end
@ ePartial_5_set_constraint_all
const TName & GetName(void) const
Get the Name member data.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
TType GetType(void) const
Get the Type member data.
EType
type of RNA feature
void SetType(TType value)
Assign a value to Type data member.
void SetAa(TAa &value)
Assign a value to Aa data member.
TXref & SetXref(void)
Assign a value to Xref data member.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsProt(void) const
Check if variant Prot is selected.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void SetPartial(TPartial value)
Assign a value to Partial data member.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsGene(void) const
Check if variant Gene is selected.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
const TProduct & GetProduct(void) const
Get the Product member data.
const TGene & GetGene(void) const
Get the variant data.
const TProt & GetProt(void) const
Get the variant data.
const TXref & GetXref(void) const
Get the Xref member data.
void ResetXref(void)
Reset Xref data member.
const TRna & GetRna(void) const
Get the variant data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsRna(void) const
Check if variant Rna is selected.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
@ eFrame_not_set
not set, code uses one
@ eFrame_three
reading frame
ENa_strand
strand of nucleic acid
@ eNa_strand_both
in forward orientation
@ e_not_set
No variant selected.
@ e_Ncbieaa
extended ASCII 1 letter aa codes
unsigned int
A callback function used to compare two keys in a database.
Functions that resolve field names described in asn format.
constexpr auto sort(_Init &&init)
const GenericPointer< typename T::ValueType > T2 value
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define FOR_EACH_NAME_ON_PROTREF(Itr, Var)
FOR_EACH_NAME_ON_PROTREF EDIT_EACH_NAME_ON_PROTREF.
@ eExistingText_append_semi
bool AddValueToString(string &str, const string &value, EExistingText existing_text)
Add text to an existing string, using the "existing_text" directive to combine new text with existing...
CRef< CCmdChangeSeq_feat > AdjustGene(const objects::CSeq_feat &orig_feat, const objects::CSeq_feat &new_feat, objects::CScope &scope)
CRef< CCmdComposite > GetSynchronizeProteinPartialsCommand(objects::CScope &scope, const objects::CSeq_feat &cds)
CRef< CCmdComposite > GetRetranslateCDSCommand(objects::CScope &scope, const objects::CSeq_feat &cds, bool create_general_only)
void GetProductToCDSMap(objects::CScope &scope, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
CRef< CCmdComposite > TrimStopsFromCompleteCDS(const objects::CSeq_feat &cds, objects::CScope &scope)
CRef< CCmdComposite > GetDeleteAllFeaturesCommand(objects::CSeq_entry_Handle seh, size_t &count, bool remove_proteins=true)
CRef< CCmdComposite > GetDeleteFeatureCommand(const objects::CSeq_feat_Handle &fh, bool remove_proteins=true)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4