NCBI C++ ToolKit
Functions | Variables
util_cmds.cpp File Reference
#include <ncbi_pch.hpp>
#include <objects/taxon3/taxon3.hpp>
#include <misc/discrepancy/discrepancy.hpp>
#include <objmgr/seq_feat_handle.hpp>
#include <objmgr/scope.hpp>
#include <objmgr/object_manager.hpp>
#include <objmgr/bioseq_ci.hpp>
#include <objmgr/seqdesc_ci.hpp>
#include <objmgr/util/sequence.hpp>
#include <objtools/edit/cds_fix.hpp>
#include <objtools/cleanup/cleanup.hpp>
#include <objtools/validator/validatorp.hpp>
#include <objtools/validator/go_term_validation_and_cleanup.hpp>
#include <gui/objutils/registry.hpp>
#include <gui/objutils/cmd_factory.hpp>
#include <gui/objutils/cmd_del_bioseq.hpp>
#include <gui/objutils/cmd_del_bioseq_set.hpp>
#include <gui/objutils/cmd_del_seq_feat.hpp>
#include <gui/objutils/cmd_change_seq_feat.hpp>
#include <gui/objutils/cmd_add_seqentry.hpp>
#include <gui/objutils/cmd_change_seq_entry.hpp>
#include <gui/objutils/descriptor_change.hpp>
#include <gui/objutils/cmd_create_feat.hpp>
#include <gui/objutils/cmd_create_desc.hpp>
#include <gui/objutils/cmd_change_bioseq_inst.hpp>
#include <gui/objutils/util_cmds.hpp>
+ Include dependency graph for util_cmds.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

 USING_SCOPE (objects)
 
static bool s_AreThereOtherCDSForThisProduct (const CSeq_feat_Handle &fh)
 
static bool s_IsFarLocation (CSeq_feat_Handle fh)
 
CRef< CCmdCompositeGetDeleteFeatureCommand (const CSeq_feat_Handle &fh, bool remove_proteins)
 
void GetProductToCDSMap (CScope &scope, map< CBioseq_Handle, set< CSeq_feat_Handle > > &product_to_cds)
 
CRef< CCmdCompositeGetDeleteFeatureCommand (const CSeq_feat_Handle &fh, bool remove_proteins, map< CBioseq_Handle, set< CSeq_feat_Handle > > &product_to_cds)
 
CRef< CCmdCompositeGetDeleteSequenceCommand (CBioseq_Handle bsh)
 
static bool s_IsNucLocation (CSeq_feat_Handle fh)
 
CRef< CCmdCompositeGetDeleteAllFeaturesCommand (CSeq_entry_Handle seh, size_t &count, bool remove_proteins)
 
static void s_GetSourceDescriptors (const CSeq_entry &se, vector< pair< const CSeqdesc *, const CSeq_entry * >> &src_descs)
 
CRef< CCmdCompositeCleanupCommand (CSeq_entry_Handle orig_seh, bool extended, bool do_tax)
 
CRef< CCmdCompositeCleanupHugeFileCommand (CSeq_entry_Handle orig_seh, bool extended, bool do_tax, objects::taxupdate_func_t &updater, bool rmv_user_object)
 
CRef< CCmdCompositeTaxonomyLookupCommand (CSeq_entry_Handle seh)
 
CRef< CCmdCompositeCachedTaxonomyLookupCommand (CSeq_entry_Handle seh, objects::taxupdate_func_t &updater)
 
CRef< CCmdCompositeSpecificHostCleanupCommand (CSeq_entry_Handle seh)
 
CRef< CCmdCompositeGetChangeStrainForwardingCommand (CSeq_entry_Handle seh, bool disable)
 
CRef< CCmdCompositeGetDisableStrainForwardingCommand (CSeq_entry_Handle seh)
 
CRef< CCmdCompositeGetEnableStrainForwardingCommand (CSeq_entry_Handle seh)
 
bool s_IsSpeciesLevel (const COrg_ref &org)
 
CRef< CCmdCompositeGetRmCultureNotesCommand (CSeq_entry_Handle seh)
 
CRef< CCmdCompositeGetSynchronizeProductMolInfoCommand (CScope &scope, const CSeq_feat &cds)
 
CRef< CCmdCompositeGetSynchronizeProteinPartialsCommand (CScope &scope, const CSeq_feat &cds)
 
void SetProteinFeature (CSeq_feat &prot, CBioseq_Handle product, const CSeq_feat &cds)
 
void AdjustProteinFeature (CSeq_feat &prot, CBioseq_Handle product, CSeq_feat &cds, bool &cds_change)
 
CRef< CCmdCompositeCreateOrAdjustProteinFeature (CBioseq_Handle product, CSeq_feat &cds, bool &cds_change)
 
CRef< CCmdCompositeTranslateCDSCommand (CScope &scope, CSeq_feat &cds, bool &cds_change, int &offset, bool create_general_only)
 
CRef< CCmdCompositeGetRetranslateCDSCommand (CScope &scope, CSeq_feat &cds, bool &cds_change, bool create_general_only)
 
CRef< CCmdCompositeGetRetranslateCDSCommand (CScope &scope, CSeq_feat &cds, bool &cds_change, int &offset, bool create_general_only)
 
CRef< CCmdCompositeGetRetranslateCDSCommand (CScope &scope, const CSeq_feat &cds, bool create_general_only)
 
CRef< CCmdCompositeGetRetranslateCDSCommand (CScope &scope, const CSeq_feat &cds, int &offset, bool create_general_only)
 
CRef< CCmdCompositeSetTranslExcept (CSeq_entry_Handle seh, const string &comment, bool strict, bool extend, bool adjust_gene)
 SetTranslExcept A function to set a code break at the 3' end of coding regions in a Seq-entry to indicate that the stop codon is formed by the addition of a poly-A tail. More...
 
CRef< CCmdCompositeGetReverseComplimentSequenceCommand (CBioseq_Handle bsh)
 
CRef< CCmdCompositeTrimStopsFromCompleteCDS (const CSeq_feat &cds, CScope &scope)
 TrimStopsFromCompleteCDS If the CDS is 3' complete and the protein sequence ends with a stop codon, the function removes the stop codon, shortens the protein length and adjusts the features on the protein sequence so that they do not extend past the "new" end of the sequence. More...
 
static string s_GetProductRules ()
 
CRef< CCmdCompositeAutofixCommand (CSeq_entry_Handle orig_seh, const string &test_name, string *output, const string &suspect_rules)
 
CRef< CCmdCompositeAutofixCommandHugeMode (CSeq_entry_Handle orig_seh, const string &str_test_name, map< string, size_t > &report, const string &suspect_rules)
 
CRef< CCmdCompositeGetEditLocationCommand (const edit::CLocationEditPolicy &policy, bool retranslate, bool adjust_gene, const CSeq_feat &orig_feat, CScope &scope, int &offset, bool create_general_only)
 GetEditLocationCommand Changes the location properties of a feature according to a location policy. More...
 
CRef< CCmdChangeSeq_featAdjustGene (const CSeq_feat &orig_feat, const CSeq_feat &new_feat, CScope &scope)
 
bool GetNormalizeGeneQualsCommand (CBioseq_Handle bsh, CRef< CCmdComposite > cmd)
 
CRef< CCmdCompositeGetNormalizeGeneQualsCommand (CSeq_entry_Handle seh)
 
bool GetRemoveDuplicateGOTermsCommand (CBioseq_Handle bsh, CRef< CCmdComposite > cmd)
 
CRef< CCmdCompositeGetRemoveDuplicateGOTermsCommand (CSeq_entry_Handle seh)
 
CRef< CCmdCompositeUpdatemRNAProduct (const CSeq_feat &protein, CScope &scope, string &message)
 
CRef< CCmdCompositeUpdatemRNAProduct (const string &prot_product, CConstRef< CObject > object, CScope &scope)
 

Variables

static const char * kDiscrepancyEdit = "Dialogs.Edit.Discrepancy"
 

Function Documentation

◆ AdjustGene()

CRef<CCmdChangeSeq_feat> AdjustGene ( const CSeq_feat orig_feat,
const CSeq_feat new_feat,
CScope scope 
)

◆ AdjustProteinFeature()

void AdjustProteinFeature ( CSeq_feat prot,
CBioseq_Handle  product,
CSeq_feat cds,
bool cds_change 
)

◆ AutofixCommand()

CRef<CCmdComposite> AutofixCommand ( CSeq_entry_Handle  orig_seh,
const string test_name,
string output,
const string suspect_rules 
)

◆ AutofixCommandHugeMode()

CRef<CCmdComposite> AutofixCommandHugeMode ( CSeq_entry_Handle  orig_seh,
const string str_test_name,
map< string, size_t > &  report,
const string suspect_rules 
)

◆ CachedTaxonomyLookupCommand()

CRef<CCmdComposite> CachedTaxonomyLookupCommand ( CSeq_entry_Handle  seh,
objects::taxupdate_func_t updater 
)

◆ CleanupCommand()

CRef<CCmdComposite> CleanupCommand ( CSeq_entry_Handle  orig_seh,
bool  extended,
bool  do_tax 
)

◆ CleanupHugeFileCommand()

CRef<CCmdComposite> CleanupHugeFileCommand ( CSeq_entry_Handle  orig_seh,
bool  extended,
bool  do_tax,
objects::taxupdate_func_t updater,
bool  rmv_user_object 
)

◆ CreateOrAdjustProteinFeature()

CRef<CCmdComposite> CreateOrAdjustProteinFeature ( CBioseq_Handle  product,
CSeq_feat cds,
bool cds_change 
)

◆ GetChangeStrainForwardingCommand()

CRef<CCmdComposite> GetChangeStrainForwardingCommand ( CSeq_entry_Handle  seh,
bool  disable 
)

◆ GetDeleteAllFeaturesCommand()

CRef<CCmdComposite> GetDeleteAllFeaturesCommand ( CSeq_entry_Handle  seh,
size_t &  count,
bool  remove_proteins 
)

◆ GetDeleteFeatureCommand() [1/2]

CRef<CCmdComposite> GetDeleteFeatureCommand ( const CSeq_feat_Handle fh,
bool  remove_proteins 
)

◆ GetDeleteFeatureCommand() [2/2]

CRef<CCmdComposite> GetDeleteFeatureCommand ( const CSeq_feat_Handle fh,
bool  remove_proteins,
map< CBioseq_Handle, set< CSeq_feat_Handle > > &  product_to_cds 
)

◆ GetDeleteSequenceCommand()

CRef<CCmdComposite> GetDeleteSequenceCommand ( CBioseq_Handle  bsh)

◆ GetDisableStrainForwardingCommand()

CRef<CCmdComposite> GetDisableStrainForwardingCommand ( CSeq_entry_Handle  seh)

Definition at line 729 of file util_cmds.cpp.

References GetChangeStrainForwardingCommand().

◆ GetEditLocationCommand()

CRef<CCmdComposite> GetEditLocationCommand ( const edit::CLocationEditPolicy &  policy,
bool  retranslate,
bool  adjust_gene,
const CSeq_feat orig_feat,
CScope scope,
int offset,
bool  create_general_only 
)

◆ GetEnableStrainForwardingCommand()

CRef<CCmdComposite> GetEnableStrainForwardingCommand ( CSeq_entry_Handle  seh)

Definition at line 734 of file util_cmds.cpp.

References GetChangeStrainForwardingCommand().

◆ GetNormalizeGeneQualsCommand() [1/2]

bool GetNormalizeGeneQualsCommand ( CBioseq_Handle  bsh,
CRef< CCmdComposite cmd 
)

◆ GetNormalizeGeneQualsCommand() [2/2]

CRef<CCmdComposite> GetNormalizeGeneQualsCommand ( CSeq_entry_Handle  seh)

Definition at line 1639 of file util_cmds.cpp.

References cmd, CSeq_inst_Base::eMol_na, GetNormalizeGeneQualsCommand(), and NULL.

◆ GetProductToCDSMap()

void GetProductToCDSMap ( CScope scope,
map< CBioseq_Handle, set< CSeq_feat_Handle > > &  product_to_cds 
)

◆ GetRemoveDuplicateGOTermsCommand() [1/2]

bool GetRemoveDuplicateGOTermsCommand ( CBioseq_Handle  bsh,
CRef< CCmdComposite cmd 
)

Definition at line 1656 of file util_cmds.cpp.

References CSerialObject::Assign(), cmd, f(), and RemoveDuplicateGoTerms().

Referenced by GetRemoveDuplicateGOTermsCommand().

◆ GetRemoveDuplicateGOTermsCommand() [2/2]

CRef<CCmdComposite> GetRemoveDuplicateGOTermsCommand ( CSeq_entry_Handle  seh)

Definition at line 1676 of file util_cmds.cpp.

References cmd, CSeq_inst_Base::eMol_na, GetRemoveDuplicateGOTermsCommand(), and NULL.

◆ GetRetranslateCDSCommand() [1/4]

CRef<CCmdComposite> GetRetranslateCDSCommand ( CScope scope,
const CSeq_feat cds,
bool  create_general_only 
)

Definition at line 1165 of file util_cmds.cpp.

References GetRetranslateCDSCommand(), and offset.

◆ GetRetranslateCDSCommand() [2/4]

CRef<CCmdComposite> GetRetranslateCDSCommand ( CScope scope,
const CSeq_feat cds,
int offset,
bool  create_general_only 
)

◆ GetRetranslateCDSCommand() [3/4]

CRef<CCmdComposite> GetRetranslateCDSCommand ( CScope scope,
CSeq_feat cds,
bool cds_change,
bool  create_general_only 
)

Definition at line 1036 of file util_cmds.cpp.

References offset.

Referenced by GetEditLocationCommand(), and GetRetranslateCDSCommand().

◆ GetRetranslateCDSCommand() [4/4]

CRef<CCmdComposite> GetRetranslateCDSCommand ( CScope scope,
CSeq_feat cds,
bool cds_change,
int offset,
bool  create_general_only 
)

◆ GetReverseComplimentSequenceCommand()

CRef<CCmdComposite> GetReverseComplimentSequenceCommand ( CBioseq_Handle  bsh)

◆ GetRmCultureNotesCommand()

CRef<CCmdComposite> GetRmCultureNotesCommand ( CSeq_entry_Handle  seh)

◆ GetSynchronizeProductMolInfoCommand()

CRef<CCmdComposite> GetSynchronizeProductMolInfoCommand ( CScope scope,
const CSeq_feat cds 
)

◆ GetSynchronizeProteinPartialsCommand()

CRef<CCmdComposite> GetSynchronizeProteinPartialsCommand ( CScope scope,
const CSeq_feat cds 
)

◆ s_AreThereOtherCDSForThisProduct()

static bool s_AreThereOtherCDSForThisProduct ( const CSeq_feat_Handle fh)
static

◆ s_GetProductRules()

static string s_GetProductRules ( )
static

◆ s_GetSourceDescriptors()

static void s_GetSourceDescriptors ( const CSeq_entry se,
vector< pair< const CSeqdesc *, const CSeq_entry * >> &  src_descs 
)
static

◆ s_IsFarLocation()

static bool s_IsFarLocation ( CSeq_feat_Handle  fh)
static

◆ s_IsNucLocation()

static bool s_IsNucLocation ( CSeq_feat_Handle  fh)
static

◆ s_IsSpeciesLevel()

bool s_IsSpeciesLevel ( const COrg_ref org)

◆ SetProteinFeature()

void SetProteinFeature ( CSeq_feat prot,
CBioseq_Handle  product,
const CSeq_feat cds 
)

◆ SetTranslExcept()

CRef<CCmdComposite> SetTranslExcept ( CSeq_entry_Handle  seh,
const string comment,
bool  strict,
bool  extend,
bool  adjust_gene 
)

SetTranslExcept A function to set a code break at the 3' end of coding regions in a Seq-entry to indicate that the stop codon is formed by the addition of a poly-A tail.

Parameters
sehThe Seq-entry to search for coding regions to adjust
commentThe string to place in the note on cds if a code break is added
strictOnly add code break if last partial codon consists of "TA" or just "T". If strict is false, add code break if first NT of last partial codon is T or N.
extendIf true, extend coding region to cover partial stop codon
adjust_geneIf true, adjust gene location to match coding region after adjustment

Definition at line 1211 of file util_cmds.cpp.

References CSerialObject::Assign(), cmd, CSeqFeatData_Base::e_Cdregion, eExtreme_Biological, eNa_strand_minus, ExtendStop(), CSeq_feat_Base::GetLocation(), CMappedFeat::GetLocation(), CMappedFeat::GetOriginalFeature(), GetOverlappingGene(), CSeq_entry_Handle::GetScope(), CScope::GetSeq_featHandle(), CSeq_loc::GetStop(), CSeq_loc::GetStrand(), NULL, and CSeq_feat_Base::SetLocation().

◆ SpecificHostCleanupCommand()

CRef<CCmdComposite> SpecificHostCleanupCommand ( CSeq_entry_Handle  seh)

◆ TaxonomyLookupCommand()

CRef<CCmdComposite> TaxonomyLookupCommand ( CSeq_entry_Handle  seh)

◆ TranslateCDSCommand()

CRef<CCmdComposite> TranslateCDSCommand ( CScope scope,
CSeq_feat cds,
bool cds_change,
int offset,
bool  create_general_only 
)

◆ TrimStopsFromCompleteCDS()

CRef<CCmdComposite> TrimStopsFromCompleteCDS ( const CSeq_feat cds,
CScope scope 
)

TrimStopsFromCompleteCDS If the CDS is 3' complete and the protein sequence ends with a stop codon, the function removes the stop codon, shortens the protein length and adjusts the features on the protein sequence so that they do not extend past the "new" end of the sequence.

The function does not modify either the CDS location or the nucleotide sequence.

Parameters
cdsCoding region feature which product will be examined
scopeThe scope in which adjustments are to be made (if necessary)
Returns
True if stop codon was found, removed and features on the protein sequence were adjusted, false otherwise

Definition at line 1307 of file util_cmds.cpp.

References CSerialObject::Assign(), CSeq_feat_Base::CanGetLocation(), cmd, CSeq_data_Base::e_Ncbieaa, CSeqFeatData_Base::e_Prot, CBioseq_Handle::eCoding_Ncbi, eExtreme_Biological, ctll::empty(), NStr::EndsWith(), CScope::GetBioseqHandle(), CSeq_feat_Base::GetData(), CBioseq_Handle::GetInst(), CBioseq_Handle::GetInst_Seq_data(), CSeq_loc_Base::GetInt(), CSeq_inst_Base::GetLength(), CSeq_feat_Base::GetLocation(), CMappedFeat::GetOriginalFeature(), CSeq_feat_Base::GetProduct(), CSeqVector::GetSeqData(), CBioseq_Handle::GetSeqVector(), CSeq_loc::GetStop(), CSeq_interval_Base::GetTo(), CSeqFeatData_Base::IsCdregion(), CSeq_loc_Base::IsInt(), CSeq_data_Base::IsIupacaa(), CSeq_data_Base::IsNcbieaa(), CSeq_loc::IsPartialStop(), CBioseq_Handle::IsProtein(), CSeq_feat_Base::IsSetProduct(), CSeq_inst_Base::IsSetSeq_data(), NULL, CSeqVector::SetCoding(), CSeq_inst_Base::SetLength(), CSeq_feat_Base::SetLocation(), CSeq_inst_Base::SetSeq_data(), and CSeqVector::size().

◆ UpdatemRNAProduct() [1/2]

CRef<CCmdComposite> UpdatemRNAProduct ( const CSeq_feat protein,
CScope scope,
string message 
)

◆ UpdatemRNAProduct() [2/2]

CRef<CCmdComposite> UpdatemRNAProduct ( const string prot_product,
CConstRef< CObject object,
CScope scope 
)

◆ USING_SCOPE()

USING_SCOPE ( objects  )

Variable Documentation

◆ kDiscrepancyEdit

const char* kDiscrepancyEdit = "Dialogs.Edit.Discrepancy"
static

Definition at line 1378 of file util_cmds.cpp.

Referenced by s_GetProductRules().

Modified on Wed Sep 04 15:02:45 2024 by modify_doxy.py rev. 669887