NCBI C++ ToolKit
|
Search Toolkit Book for CSequenceUpdater
Class responsible for executing the sequence update for one old-update sequence pair. More...
#include <gui/packages/pkg_sequence_edit/update_seq.hpp>
Public Member Functions | |
CSequenceUpdater (const CUpdateSeq_Input &updseq_in, const SUpdateSeqParams ¶ms) | |
~CSequenceUpdater () | |
void | SetUpdateSeqParams (const SUpdateSeqParams ¶ms) |
CRef< CCmdComposite > | Update (bool create_general_only) |
Main function responsible to update the old sequence with the update sequence. More... | |
bool | IsOldSequenceOK () const |
bool | IsUpdateSequenceRaw () const |
bool | IsAlignmentOK () const |
bool | CheckParameters () const |
const string & | GetCitSubMessage () const |
void | ShowCitSubMessage (void) const |
bool | IsReverseComplemented () const |
string | GetRevCompReport () const |
void | GetNotImportedFeatsReport (CNcbiOstream &out) const |
Static Public Member Functions | |
static objects::CSeq_align::TDim | FindRowInAlignment (const objects::CBioseq_Handle &bsh, const objects::CSeq_align &align) |
static CRef< objects::CSeq_inst > | s_ExtendOneEndOfSequence (const objects::CBioseq_Handle &bsh, const string &extension, SUpdateSeqParams::ESequenceUpdateType update_type) |
Extends the 5' or 3' end of a NA sequence (no alignment is necessary). More... | |
static CRef< objects::CSeq_inst > | s_UpdateSeqInst (const objects::CBioseq_Handle &bsh, const string &upd_str) |
static string | s_GetValidExtension (const string &extension) |
static CRef< objects::CSeq_feat > | s_OffsetFeature (const objects::CSeq_feat &feat, const TSeqPos offset, const objects::CSeq_id *newId=NULL) |
Offsets the location of the feature. More... | |
static void | s_Shift_CDSCodeBreaks (CRef< objects::CSeq_feat > feat, const TSeqPos &offset, const objects::CSeq_id *targetId=NULL) |
static void | s_Shift_tRNAAntiCodon (CRef< objects::CSeq_feat > feat, const TSeqPos &offset, const objects::CSeq_id *targetId=NULL) |
static CRef< objects::CSeq_loc > | s_OffsetLocation (const objects::CSeq_loc &sourceLoc, const TSeqPos &offset, const objects::CSeq_id *targetId=NULL) |
Private Types | |
typedef list< CRef< objects::CSeq_feat > > | TFeatList |
Private Member Functions | |
void | NoChange (bool create_general_only) |
void | Replace (bool create_general_only) |
void | Patch (bool create_general_only) |
void | ExtendOneEndOfSequence (bool create_general_only) |
CRef< objects::CSeq_inst > | x_ReplaceSequence () |
CRef< objects::CSeq_inst > | x_PatchSequence () |
CRef< objects::CSeq_inst > | x_ExtendOneEnd () |
CRef< objects::CSeq_inst > | x_UpdateSeqInst (const string &upd_str) |
void | x_MakeNewEntry (const objects::CSeq_inst &newInst) |
Creates the new seq-entry. It is not added to the scope, yet. More... | |
void | x_PrepareNewEntry (CRef< objects::CSeq_entry > entry, const objects::CSeq_inst &newInst) |
objects::CSeq_entry_Handle | x_GetOldBseq_EntryHandle (void) |
CIRef< IEditCommand > | x_SwapOldWithNewSeq () |
Creates command that swaps the old sequence with the new one. More... | |
bool | x_ShouldRemoveFeature (const objects::CSeq_feat_Handle &fh) |
bool | x_ShouldImportFeature (const objects::CSeq_feat_Handle &fh) |
Determines whether the feature from update sequence should be imported to the new one. More... | |
void | x_ChangeIDInFeature (objects::CSeq_feat_Handle fh, const objects::CSeq_align &align, objects::CSeq_align::TDim row) |
Replaces the location ID in the feature to match the alignment ID corresponding to the given row. More... | |
CRef< objects::CSeq_feat > | x_MappedFeature_ChangeId (const objects::CSeq_feat_Handle &orig_fh) |
Changes only the location ID of the feature. More... | |
CRef< objects::CSeq_feat > | x_MappedFeature_ThroughAlign (const objects::CSeq_feat_Handle &orig_fh, const objects::CSeq_align &align) |
Maps feature's location through the alignment. More... | |
void | x_ReplaceIdInOldFeatures () |
void | x_MapOldAndImportedFeatsThroughNewAlign () |
CConstRef< objects::CSeq_align > | x_GetNewAlign_Replace (const objects::CBioseq_Handle &bsh) |
vector< CConstRef< objects::CSeq_align > > | x_FormNewAlignment (const objects::CBioseq_Handle &subject) |
Generates alignment between subject_bsh and the new sequence (query) More... | |
void | x_HandleDuplicateFeatures () |
Decides which duplicate features will end up on the new sequence. More... | |
CRef< objects::CSeq_feat > | x_FuseFeatures (const objects::CSeq_feat &feat1, const objects::CSeq_feat &feat2) |
Merges duplicate features. More... | |
void | x_FuseProtFeatsForCDS (const objects::CSeq_feat &fusedFeat, const objects::CSeq_feat &feat_old) |
Merges protein sequence features for duplicate coding regions. More... | |
void | x_FixID_AttachFeatures (bool create_general_only) |
void | x_AttachFeaturesToNewSeq (bool create_general_only) |
Removes newId in features and stores them in two seq-annots: one that will be attached to the sequence and another one that will be attached to the set. More... | |
void | x_FixIDInNewEntry (CRef< objects::CSeq_entry > entry) |
void | x_RemoveNewIDInFeature (CRef< objects::CSeq_feat > feat) |
void | x_UpdateProteinID (CRef< objects::CSeq_entry > protein, CRef< objects::CSeq_id > newId) |
void | x_AdjustProteinFeature (CRef< objects::CSeq_entry > protein, CRef< objects::CSeq_id > newId=CRef< objects::CSeq_id >()) |
void | x_SetOldIDInFeatures () |
CRef< objects::CSeq_annot > | x_GetSeqAnnot_WithoutCDS (bool &has_cds) |
void | x_AdjustOldCDSProduct (CRef< objects::CSeq_feat > cds, objects::CSeq_entry_EditHandle &eh) |
void | x_ImportCDSProduct (CRef< objects::CSeq_feat > cds, objects::CSeq_entry_EditHandle &eh, objects::CBioseq_Handle &newBsh, bool create_general_only) |
void | x_RetranslateOldCDSProduct (CRef< objects::CSeq_feat > cds, objects::CSeq_entry_EditHandle &eh, objects::CBioseq_Handle &newBsh, bool create_general_only) |
void | x_RetranslateImportedCDSProduct (CRef< objects::CSeq_feat > cds, objects::CSeq_entry_EditHandle &eh, objects::CBioseq_Handle &newBsh, bool create_general_only) |
void | x_RemoveDescriptorsFromImportedProducts (CRef< objects::CSeq_entry > protein) |
Removes RefGeneTracking user-object and create-date descriptors from imported cds products. More... | |
void | x_AddCitSubToUpdatedSequence () |
Attaches a cit-sub to the New sequence. More... | |
void | x_PrintNewEntryIds () |
TSeqPos | x_GetNewSeqLength () |
CSequenceUpdater (const CSequenceUpdater &) | |
CSequenceUpdater & | operator= (const CSequenceUpdater &) |
Private Attributes | |
objects::CBioseq_Handle | m_OldBsh |
const objects::CBioseq_Handle & | m_UpdBsh |
CConstRef< objects::CSeq_align > | m_Align |
SUpdateSeqParams | m_Params |
CRef< objects::CSeq_entry > | m_NewEntry |
The new seq-entry. More... | |
CConstRef< objects::CSeq_id > | m_NewId |
Temporary seq-id of the new seq-entry. More... | |
TFeatList | m_MappedOldFeats |
List of features, originally belonging to the Old Sequence and update sequence, respectively. More... | |
TFeatList | m_ImportUpdFeats |
string | m_CitSubMessage |
bool | m_Reversed |
vector< string > | m_NotImportedFeats |
List of features that were not imported as they were outside the alignment range. More... | |
Class responsible for executing the sequence update for one old-update sequence pair.
Definition at line 56 of file update_seq.hpp.
|
private |
Definition at line 208 of file update_seq.hpp.
CSequenceUpdater::CSequenceUpdater | ( | const CUpdateSeq_Input & | updseq_in, |
const SUpdateSeqParams & | params | ||
) |
Definition at line 488 of file update_seq.cpp.
References CheckParameters(), IsAlignmentOK(), IsOldSequenceOK(), CUpdateSeq_Input::IsReadyForUpdate(), IsUpdateSequenceRaw(), m_UpdBsh, NCBI_THROW, and CUpdateSeq_Input::s_IsDeltaWithFarPointers().
CSequenceUpdater::~CSequenceUpdater | ( | ) |
Definition at line 520 of file update_seq.cpp.
|
private |
bool CSequenceUpdater::CheckParameters | ( | ) | const |
Definition at line 548 of file update_seq.cpp.
References SUpdateSeqParams::eSeqUpdateExtend3, SUpdateSeqParams::eSeqUpdateExtend5, SUpdateSeqParams::eSeqUpdatePatch, m_Align, SUpdateSeqParams::m_IgnoreAlignment, m_Params, and SUpdateSeqParams::m_SeqUpdateOption.
Referenced by CSequenceUpdater().
|
private |
Definition at line 722 of file update_seq.cpp.
References SUpdateSeqParams::eSeqUpdateExtend3, SUpdateSeqParams::eSeqUpdateExtend5, CSeqFeatData::eSubtype_any, SUpdateSeqParams::m_FeatImportType, SUpdateSeqParams::m_IgnoreAlignment, SUpdateSeqParams::m_ImportFeatures, m_ImportUpdFeats, m_MappedOldFeats, m_NewId, m_OldBsh, m_Params, SUpdateSeqParams::m_SeqUpdateOption, m_UpdBsh, s_OffsetFeature(), SAnnotSelector::SetLimitTSE(), x_ExtendOneEnd(), x_FixID_AttachFeatures(), x_HandleDuplicateFeatures(), x_MakeNewEntry(), x_MapOldAndImportedFeatsThroughNewAlign(), and x_ShouldRemoveFeature().
Referenced by Update().
|
static |
Definition at line 611 of file update_seq.cpp.
References CSeq_align::CheckNumRows(), CSeq_align::GetSeq_id(), CBioseq_Handle::IsSynonym(), and row.
Referenced by GetNotImportedFeatsReport(), Replace(), x_ExtendOneEnd(), x_GetNewAlign_Replace(), CUpdateSeqPanel::x_InitDrawingParams(), x_MapOldAndImportedFeatsThroughNewAlign(), x_PatchSequence(), CUpdateSeqPanel::x_SetUpdateTypes(), x_ShouldImportFeature(), and x_ShouldRemoveFeature().
Definition at line 94 of file update_seq.hpp.
References m_CitSubMessage.
Referenced by BOOST_AUTO_TEST_CASE(), and CSeqUpdateWorker::x_LaunchSingleUpdateSequence().
void CSequenceUpdater::GetNotImportedFeatsReport | ( | CNcbiOstream & | out | ) | const |
Definition at line 2123 of file update_seq.cpp.
References _ASSERT, CSeq_id::eContent, eGetId_Best, FindRowInAlignment(), GetId(), CSeq_loc::GetLabel(), CSeq_id::GetLabel(), CSeq_id_Handle::GetSeqId(), m_Align, m_NotImportedFeats, m_UpdBsh, and out().
Referenced by CSeqUpdateWorker::x_LaunchSingleUpdateSequence(), and CUpdateMultiSeq_Dlg::x_UpdateSelected().
string CSequenceUpdater::GetRevCompReport | ( | ) | const |
Definition at line 2108 of file update_seq.cpp.
References CSeq_id::BestRank(), FindBestChoice(), CSeq_id::GetLabel(), kEmptyStr, m_OldBsh, and m_Reversed.
Referenced by CSeqUpdateWorker::x_LaunchSingleUpdateSequence().
bool CSequenceUpdater::IsAlignmentOK | ( | ) | const |
Definition at line 543 of file update_seq.cpp.
References m_Align.
Referenced by CSequenceUpdater().
bool CSequenceUpdater::IsOldSequenceOK | ( | ) | const |
Definition at line 529 of file update_seq.cpp.
References CSeq_inst_Base::eRepr_raw, m_OldBsh, CUpdateSeq_Input::s_IsDeltaWithFarPointers(), and CUpdateSeq_Input::s_IsDeltaWithNoGaps().
Referenced by BOOST_AUTO_TEST_CASE(), and CSequenceUpdater().
|
inline |
Definition at line 97 of file update_seq.hpp.
References m_Reversed.
Referenced by CUpdateMultiSeq_Dlg::x_UpdateSelected().
bool CSequenceUpdater::IsUpdateSequenceRaw | ( | ) | const |
Definition at line 538 of file update_seq.cpp.
References CSeq_inst_Base::eRepr_raw, and m_UpdBsh.
Referenced by BOOST_AUTO_TEST_CASE(), and CSequenceUpdater().
|
private |
Definition at line 640 of file update_seq.cpp.
References CSerialObject::Assign(), m_Align, SUpdateSeqParams::m_FeatImportType, SUpdateSeqParams::m_ImportFeatures, m_ImportUpdFeats, m_OldBsh, m_Params, m_UpdBsh, SAnnotSelector::SetLimitTSE(), x_FixID_AttachFeatures(), x_GetNewAlign_Replace(), x_HandleDuplicateFeatures(), x_MakeNewEntry(), x_MappedFeature_ThroughAlign(), x_ReplaceIdInOldFeatures(), and x_ShouldImportFeature().
Referenced by Update().
|
private |
|
private |
Definition at line 711 of file update_seq.cpp.
References _ASSERT, m_Align, x_FixID_AttachFeatures(), x_MakeNewEntry(), x_MapOldAndImportedFeatsThroughNewAlign(), and x_PatchSequence().
Referenced by Update().
|
private |
Definition at line 669 of file update_seq.cpp.
References CSeqFeatData::eSubtype_any, FindRowInAlignment(), m_Align, SUpdateSeqParams::m_FeatImportType, SUpdateSeqParams::m_ImportFeatures, m_ImportUpdFeats, m_MappedOldFeats, m_OldBsh, m_Params, m_UpdBsh, SAnnotSelector::SetLimitTSE(), x_ChangeIDInFeature(), x_FixID_AttachFeatures(), x_GetNewAlign_Replace(), x_HandleDuplicateFeatures(), x_MakeNewEntry(), x_MappedFeature_ChangeId(), x_MappedFeature_ThroughAlign(), x_ReplaceIdInOldFeatures(), x_ReplaceSequence(), and x_ShouldRemoveFeature().
Referenced by Update().
|
static |
Extends the 5' or 3' end of a NA sequence (no alignment is necessary).
Only valid residues are kept and used for sequence extension
Definition at line 953 of file update_seq.cpp.
References CBioseq_Handle::eCoding_Iupac, eNa_strand_plus, SUpdateSeqParams::eSeqUpdateExtend3, SUpdateSeqParams::eSeqUpdateExtend5, CBioseq_Handle::GetBioseqLength(), CSeqVector::GetSeqData(), CBioseq_Handle::GetSeqVector(), CBioseq_Handle::IsAa(), s_GetValidExtension(), and s_UpdateSeqInst().
Referenced by BOOST_AUTO_TEST_CASE(), CEditSequenceEnds::GetCommand(), and x_ExtendOneEnd().
Definition at line 934 of file update_seq.cpp.
References kEmptyStr, NPOS, and NStr::ToLower().
Referenced by BOOST_AUTO_TEST_CASE(), and s_ExtendOneEndOfSequence().
|
static |
Offsets the location of the feature.
If newId is not Null, it also changes the feature location ID
Definition at line 1014 of file update_seq.cpp.
References CSerialObject::Assign(), CSeqFeatData::eSubtype_tRNA, CSeq_feat_Base::GetData(), CSeq_feat_Base::GetLocation(), CSeqFeatData::GetSubtype(), CSeqFeatData_Base::IsCdregion(), offset, s_OffsetLocation(), s_Shift_CDSCodeBreaks(), s_Shift_tRNAAntiCodon(), and CSeq_feat_Base::SetLocation().
Referenced by BOOST_AUTO_TEST_CASE(), ExtendOneEndOfSequence(), and CEditSequenceEnds::GetCommand().
|
static |
Definition at line 1057 of file update_seq.cpp.
References CSeq_loc::Assign(), CRange_Base::GetFrom(), CSeq_loc_CI::GetRange(), CRange_Base::GetTo(), CSeq_loc_I::MakeSeq_loc(), offset, CSeq_loc_I::SetFrom(), CSeq_loc_I::SetSeq_id(), and CSeq_loc_I::SetTo().
Referenced by s_OffsetFeature(), s_Shift_CDSCodeBreaks(), and s_Shift_tRNAAntiCodon().
|
static |
Definition at line 1030 of file update_seq.cpp.
References CCdregion_Base::IsSetCode_break(), NON_CONST_ITERATE, offset, s_OffsetLocation(), CCdregion_Base::SetCode_break(), and CSeq_feat_Base::SetData().
Referenced by s_OffsetFeature().
|
static |
Definition at line 1044 of file update_seq.cpp.
References CTrna_ext_Base::GetAnticodon(), CSeq_feat_Base::GetData(), CSeqFeatData_Base::GetRna(), CRNA_ref_Base::C_Ext::GetTRNA(), CTrna_ext_Base::IsSetAnticodon(), CRNA_ref_Base::IsSetExt(), CRNA_ref_Base::C_Ext::IsTRNA(), offset, s_OffsetLocation(), CTrna_ext_Base::SetAnticodon(), CSeq_feat_Base::SetData(), and CRNA_ref_Base::C_Ext::SetTRNA().
Referenced by s_OffsetFeature().
|
static |
Definition at line 988 of file update_seq.cpp.
References CSerialObject::Assign(), CSeq_inst_Base::eRepr_delta, CSeq_inst_Base::eRepr_raw, CBioseq_Handle::GetCompleteBioseq(), CBioseq_Handle::GetInst(), CBioseq_Handle::GetInst_Repr(), CConstRef< C, Locker >::GetObject(), NStr::IsBlank(), CBioseq_Handle::IsNa(), CSeqportUtil::Pack(), CSeq_inst_Base::ResetExt(), CUpdateSeq_Input::s_IsDeltaWithNoGaps(), CSeq_inst_Base::SetLength(), CSeq_inst_Base::SetRepr(), and CSeq_inst_Base::SetSeq_data().
Referenced by s_ExtendOneEndOfSequence(), and x_UpdateSeqInst().
void CSequenceUpdater::SetUpdateSeqParams | ( | const SUpdateSeqParams & | params | ) |
Definition at line 524 of file update_seq.cpp.
References m_Params.
void CSequenceUpdater::ShowCitSubMessage | ( | void | ) | const |
Definition at line 2101 of file update_seq.cpp.
References m_CitSubMessage, and NcbiInfoBox().
CRef< CCmdComposite > CSequenceUpdater::Update | ( | bool | create_general_only | ) |
Main function responsible to update the old sequence with the update sequence.
Definition at line 564 of file update_seq.cpp.
References CCmdComposite::AddCommand(), ConstRef(), CSeq_id_Base::e_Local, SUpdateSeqParams::eSeqUpdateExtend3, SUpdateSeqParams::eSeqUpdateExtend5, SUpdateSeqParams::eSeqUpdateNoChange, SUpdateSeqParams::eSeqUpdatePatch, SUpdateSeqParams::eSeqUpdateReplace, ExtendOneEndOfSequence(), kNewLocalID, SUpdateSeqParams::m_AddCitSub, m_Align, m_NewId, m_Params, m_Reversed, SUpdateSeqParams::m_SeqUpdateOption, NoChange(), Patch(), Replace(), CConstRef< C, Locker >::Reset(), SameOrientation(), x_AddCitSubToUpdatedSequence(), and x_SwapOldWithNewSeq().
Referenced by BOOST_AUTO_TEST_CASE(), CSeqUpdateWorker::x_LaunchSingleUpdateSequence(), and CUpdateMultiSeq_Dlg::x_UpdateSelected().
|
private |
Attaches a cit-sub to the New sequence.
Definition at line 2032 of file update_seq.cpp.
References CScope::AddDefaults(), CSeq_entry_EditHandle::AddSeqdesc(), CScope::AddTopLevelSeqEntry(), CBioseq_set_Base::eClass_nuc_prot, NStr::EqualNocase(), CBioseq_set_Handle::GetClass(), CSeq_entry_Handle::GetEditHandle(), CObjectManager::GetInstance(), CSeq_entry_EditHandle::GetParentBioseq_set(), CBioseq_set_Handle::GetParentEntry(), CBioseq_Handle::GetSeq_entry_Handle(), CSeq_entry_Handle::IsSet(), CBioseq_set_Handle::IsSetClass(), m_CitSubMessage, m_NewEntry, m_OldBsh, CSeq_entry_EditHandle::RemoveSeqdesc(), CRef< C, Locker >::Reset(), CCitSubUpdater::s_GetCitSubForUpdatedSequence(), and CCitSubUpdater::sm_ChangeExistingCitSub.
Referenced by Update().
|
private |
Definition at line 1788 of file update_seq.cpp.
References CSerialObject::Assign(), CSeq_entry_EditHandle::AttachEntry(), CScope::GetBioseqHandle(), CSeq_entry_Handle::GetCompleteSeq_entry(), CSeq_feat_Base::GetProduct(), CBioseq_Handle::GetSeq_entry_Handle(), CSeq_feat_Base::IsSetProduct(), and m_OldBsh.
Referenced by x_AttachFeaturesToNewSeq().
|
private |
Definition at line 1986 of file update_seq.cpp.
References EDIT_EACH_FEATURE_ON_ANNOT, EDIT_EACH_SEQANNOT_ON_BIOSEQ, CSeq_feat_Base::GetData(), CBioseq::GetLength(), CSeqFeatData_Base::GetProt(), CSeq_entry_Base::GetSeq(), CSeq_annot::IsFtable(), CBioseq::IsNa(), CSeqFeatData_Base::IsProt(), CSeq_entry_Base::IsSet(), CSeq_feat_Base::IsSetData(), CProt_ref_Base::IsSetProcessed(), CBioseq_Base::ResetId(), CBioseq_Base::SetId(), CSeq_feat_Base::SetLocation(), and CSeq_entry_Base::SetSeq().
Referenced by x_RetranslateImportedCDSProduct(), and x_RetranslateOldCDSProduct().
|
private |
Removes newId in features and stores them in two seq-annots: one that will be attached to the sequence and another one that will be attached to the set.
Definition at line 1647 of file update_seq.cpp.
References _ASSERT, CScope::AddDefaults(), CSeq_entry_EditHandle::AddSeqdesc(), CScope::AddTopLevelSeqEntry(), CBioseq_EditHandle::AttachAnnot(), CSeq_entry_EditHandle::AttachAnnot(), CSeq_entry_EditHandle::ConvertSeqToSet(), CBioseq_set_Base::eClass_nuc_prot, CBioseq_set_Handle::GetClass(), CSeq_feat_Base::GetData(), CBioseq_Handle::GetEditHandle(), CSeq_entry_Handle::GetEditHandle(), CObjectManager::GetInstance(), CSeq_entry_EditHandle::GetParentBioseq_set(), CBioseq_set_Handle::GetParentEntry(), CBioseq_Handle::GetSeq_entry_Handle(), CSeqFeatData_Base::IsCdregion(), CRef< C, Locker >::IsNull(), CSeq_entry_Handle::IsSet(), CBioseq_set_Handle::IsSetClass(), CSeq_feat_Base::IsSetData(), m_ImportUpdFeats, m_MappedOldFeats, m_NewEntry, m_OldBsh, m_Params, SUpdateSeqParams::m_UpdateProteins, NON_CONST_ITERATE, CSeq_annot_Base::SetData(), CBioseq_EditHandle::SetDescr(), CSeq_entry_EditHandle::SetSet(), x_AdjustOldCDSProduct(), x_GetSeqAnnot_WithoutCDS(), x_ImportCDSProduct(), x_RetranslateImportedCDSProduct(), x_RetranslateOldCDSProduct(), and x_SetOldIDInFeatures().
Referenced by x_FixID_AttachFeatures().
|
private |
Replaces the location ID in the feature to match the alignment ID corresponding to the given row.
Definition at line 1345 of file update_seq.cpp.
References copy(), CSeqFeatData::eSubtype_tRNA, CSeq_feat_Handle::GetLocationId(), CSeq_feat_Handle::GetSeq_feat(), CSeq_align::GetSeq_id(), CCdregion_Base::IsSetCode_break(), NON_CONST_ITERATE, CSeq_feat_EditHandle::Replace(), rna, row, CCdregion_Base::SetCode_break(), CSeq_id_Handle::Which(), and CSeq_id_Base::Which().
Referenced by Replace(), and x_MapOldAndImportedFeatsThroughNewAlign().
Definition at line 879 of file update_seq.cpp.
References _ASSERT, CBioseq_Handle::eCoding_Iupac, eNa_strand_plus, SUpdateSeqParams::eSeqUpdateExtend3, SUpdateSeqParams::eSeqUpdateExtend5, FindRowInAlignment(), CSeqVector::GetSeqData(), m_Align, SUpdateSeqParams::m_IgnoreAlignment, m_OldBsh, m_Params, SUpdateSeqParams::m_SeqUpdateOption, m_UpdBsh, s_ExtendOneEndOfSequence(), and x_UpdateSeqInst().
Referenced by ExtendOneEndOfSequence().
|
private |
Definition at line 767 of file update_seq.cpp.
References m_NewEntry, x_AttachFeaturesToNewSeq(), and x_FixIDInNewEntry().
Referenced by ExtendOneEndOfSequence(), NoChange(), Patch(), and Replace().
|
private |
Definition at line 1963 of file update_seq.cpp.
References CSeq_id::Assign(), CSeq_entry_Base::IsSeq(), ITERATE, m_NewEntry, m_OldBsh, CBioseq_Base::ResetId(), CBioseq_Base::SetId(), CSeq_entry_Base::SetSeq(), CBioseq_set_Base::SetSeq_set(), and CSeq_entry_Base::SetSet().
Referenced by x_FixID_AttachFeatures().
|
private |
Generates alignment between subject_bsh and the new sequence (query)
Definition at line 1384 of file update_seq.cpp.
References _ASSERT, ERR_POST, CSeq_entry_Handle::GetBioseqHandle(), CSeq_entry_Handle::GetEditHandle(), CSeq_entry_Handle::GetTopLevelEntry(), m_NewEntry, m_NewId, m_OldBsh, NCBI_THROW, CSeq_entry_EditHandle::Remove(), sequpd::RunBlast2Seq(), subject, and CException::what().
Referenced by x_MapOldAndImportedFeatsThroughNewAlign().
|
private |
Merges duplicate features.
Definition at line 1468 of file update_seq.cpp.
References AddValueToString(), CSerialObject::Assign(), CSeqFeatData_Base::e_Cdregion, CSeqFeatData_Base::e_Gene, CSeqFeatData_Base::e_Prot, CSeqFeatData_Base::e_Region, CSeqFeatData_Base::e_Rna, eExistingText_append_semi, NStr::EqualNocase(), CSeq_feat_Base::GetData(), CRNA_ref_Base::GetExt(), CSeqFeatData_Base::GetGene(), CRNA_ref_Base::C_Ext::GetName(), CSeqFeatData_Base::GetRegion(), CSeqFeatData_Base::GetRna(), CRNA_ref_Base::C_Ext::IsName(), CRNA_ref_Base::IsSetExt(), rna, CSeq_feat_Base::SetData(), CRNA_ref_Base::SetExt(), rapidjson::value, CSeqFeatData_Base::Which(), and x_FuseProtFeatsForCDS().
Referenced by x_FuseProtFeatsForCDS(), and x_HandleDuplicateFeatures().
|
private |
Merges protein sequence features for duplicate coding regions.
Definition at line 1521 of file update_seq.cpp.
References CSeq_annot_EditHandle::AddFeat(), CSerialObject::Assign(), CBioseq_EditHandle::AttachAnnot(), CScope::GetBioseqHandle(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetProduct(), CSeqFeatData_Base::IsCdregion(), CSeq_feat_Base::IsSetProduct(), ITERATE, m_OldBsh, NON_CONST_ITERATE, CSeq_annot_EditHandle::Remove(), CSeq_annot_Base::SetData(), and x_FuseFeatures().
Referenced by x_FuseFeatures().
|
private |
Definition at line 1409 of file update_seq.cpp.
References _ASSERT, CSerialObject::Assign(), ConstRef(), FindRowInAlignment(), CRef< C, Locker >::GetPointer(), m_Align, m_NewId, row, CDense_seg_Base::SetIds(), and CSeq_align_Base::SetSegs().
Referenced by NoChange(), and Replace().
|
private |
Definition at line 623 of file update_seq.cpp.
References _ASSERT, FOR_EACH_SEQENTRY_ON_SEQSET, and m_NewEntry.
Referenced by x_MappedFeature_ThroughAlign(), and x_ReplaceIdInOldFeatures().
|
private |
Definition at line 1175 of file update_seq.cpp.
References _ASSERT, CBioseq_set_Base::eClass_nuc_prot, CBioseq_set_Handle::GetClass(), CBioseq_set_Handle::GetParentEntry(), CBioseq_set_Handle::IsSetClass(), and m_OldBsh.
Referenced by x_MakeNewEntry(), and x_SwapOldWithNewSeq().
|
private |
Definition at line 1602 of file update_seq.cpp.
References CSeq_feat_Base::GetData(), CSeqFeatData_Base::IsCdregion(), CSeq_feat_Base::IsSetData(), m_ImportUpdFeats, m_MappedOldFeats, NON_CONST_ITERATE, and CSeq_annot_Base::SetData().
Referenced by x_AttachFeaturesToNewSeq().
|
private |
Decides which duplicate features will end up on the new sequence.
Definition at line 1427 of file update_seq.cpp.
References SUpdateSeqParams::eFeatUpdateAll, SUpdateSeqParams::eFeatUpdateAllExceptDups, SUpdateSeqParams::eFeatUpdateAllMergeDups, SUpdateSeqParams::eFeatUpdateAllReplaceDups, SUpdateSeqParams::m_FeatImportOption, m_ImportUpdFeats, m_MappedOldFeats, m_Params, and x_FuseFeatures().
Referenced by ExtendOneEndOfSequence(), NoChange(), Replace(), and x_MapOldAndImportedFeatsThroughNewAlign().
|
private |
Definition at line 1864 of file update_seq.cpp.
References CSerialObject::Assign(), CSeq_entry_EditHandle::AttachEntry(), CScope::GetBioseqHandle(), CSeq_entry_Handle::GetCompleteSeq_entry(), GetNewProtId(), CSeq_feat_Base::GetProduct(), CBioseq_Handle::GetScope(), CBioseq_Handle::GetSeq_entry_Handle(), CSeq_feat_Base::IsSetProduct(), SUpdateSeqParams::m_KeepProteinId, m_OldBsh, m_Params, offset, CScope::RemoveFromHistory(), CSeq_feat_Base::SetProduct(), x_RemoveDescriptorsFromImportedProducts(), and x_UpdateProteinID().
Referenced by x_AttachFeaturesToNewSeq().
|
private |
Creates the new seq-entry. It is not added to the scope, yet.
Definition at line 1133 of file update_seq.cpp.
References CSeq_entry_Handle::GetCompleteSeq_entry(), m_NewEntry, CRef< C, Locker >::Reset(), x_GetOldBseq_EntryHandle(), and x_PrepareNewEntry().
Referenced by ExtendOneEndOfSequence(), NoChange(), Patch(), and Replace().
|
private |
Definition at line 1101 of file update_seq.cpp.
References CSeqFeatData::eSubtype_any, FindRowInAlignment(), SUpdateSeqParams::m_FeatImportType, SUpdateSeqParams::m_ImportFeatures, m_ImportUpdFeats, m_MappedOldFeats, m_OldBsh, m_Params, m_UpdBsh, SAnnotSelector::SetLimitTSE(), x_ChangeIDInFeature(), x_FormNewAlignment(), x_HandleDuplicateFeatures(), x_MappedFeature_ThroughAlign(), and x_ShouldRemoveFeature().
Referenced by ExtendOneEndOfSequence(), and Patch().
|
private |
Changes only the location ID of the feature.
Definition at line 1251 of file update_seq.cpp.
References CSeq_loc::Assign(), CSerialObject::Assign(), eExtreme_Biological, CSeqFeatData::eSubtype_tRNA, CSeq_feat_Base::GetData(), CSeq_feat_Handle::GetLocation(), CSeq_feat_Handle::GetSeq_feat(), CSeqFeatData::GetSubtype(), CSeqFeatData_Base::IsCdregion(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CCdregion_Base::IsSetCode_break(), m_NewId, NON_CONST_ITERATE, CSeq_feat_Base::ResetLocation(), CSeq_feat_Base::ResetPartial(), rna, CCdregion_Base::SetCode_break(), CSeq_feat_Base::SetData(), CSeq_loc::SetId(), CSeq_feat_Base::SetLocation(), and CSeq_feat_Base::SetPartial().
Referenced by Replace(), and x_ReplaceIdInOldFeatures().
|
private |
Maps feature's location through the alignment.
Definition at line 1296 of file update_seq.cpp.
References CSerialObject::Assign(), eExtreme_Biological, CSeqFeatData::eSubtype_tRNA, CSeq_inst_Base::eTopology_circular, CSeq_feat_Base::GetData(), CSeq_feat_Handle::GetLocation(), CSeq_feat_Handle::GetScope(), CSeq_feat_Handle::GetSeq_feat(), CSeqFeatData::GetSubtype(), CSeqFeatData_Base::IsCdregion(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CCdregion_Base::IsSetCode_break(), m_NewId, m_OldBsh, NON_CONST_ITERATE, CSeq_feat_Base::ResetLocation(), CSeq_feat_Base::ResetPartial(), rna, CCdregion_Base::SetCode_break(), CSeq_feat_Base::SetData(), CSeq_feat_Base::SetLocation(), CSeq_feat_Base::SetPartial(), and x_GetNewSeqLength().
Referenced by NoChange(), Replace(), and x_MapOldAndImportedFeatsThroughNewAlign().
Definition at line 818 of file update_seq.cpp.
References _ASSERT, CBioseq_Handle::eCoding_Iupac, eNa_strand_plus, FindRowInAlignment(), CSeqVector::GetSeqData(), m_Align, m_OldBsh, m_UpdBsh, and x_UpdateSeqInst().
Referenced by Patch().
|
private |
Definition at line 1143 of file update_seq.cpp.
References CSeq_id::Assign(), CSeq_entry_Base::IsSeq(), m_NewEntry, m_NewId, CBioseq_Base::ResetAnnot(), CBioseq_set_Base::ResetAnnot(), CBioseq_Base::ResetId(), CBioseq_Base::ResetInst(), CBioseq_Base::SetId(), CBioseq_Base::SetInst(), CSeq_entry_Base::SetSeq(), CBioseq_set_Base::SetSeq_set(), and CSeq_entry_Base::SetSet().
Referenced by x_MakeNewEntry().
|
private |
Definition at line 2080 of file update_seq.cpp.
References _ASSERT, FOR_EACH_SEQENTRY_ON_SEQSET, Info(), LOG_POST, m_NewEntry, and MSerial_AsnText.
|
private |
Removes RefGeneTracking user-object and create-date descriptors from imported cds products.
Definition at line 1939 of file update_seq.cpp.
References CSeqdesc_Base::e_Create_date, CSeqdesc_Base::e_User, EDIT_EACH_SEQDESC_ON_SEQDESCR, NStr::EqualCase(), ERASE_SEQDESC_ON_SEQDESCR, CObject_id_Base::GetStr(), CUser_object_Base::GetType(), CUser_object_Base::IsSetClass(), CUser_object_Base::IsSetType(), CObject_id_Base::IsStr(), and CSeq_entry::SetDescr().
Referenced by x_ImportCDSProduct(), and x_RetranslateImportedCDSProduct().
|
private |
Definition at line 1906 of file update_seq.cpp.
References _ASSERT, CSeq_id::Assign(), CSeq_id::BestRank(), CSeqFeatData::eSubtype_tRNA, FindBestChoice(), CSeq_feat_Base::GetData(), CSeqFeatData::GetSubtype(), CSeqFeatData_Base::IsCdregion(), CCdregion_Base::IsSetCode_break(), m_OldBsh, NON_CONST_ITERATE, CRef< C, Locker >::Reset(), rna, CCdregion_Base::SetCode_break(), CSeq_feat_Base::SetData(), and CSeq_feat_Base::SetLocation().
Referenced by x_SetOldIDInFeatures().
|
private |
Definition at line 1076 of file update_seq.cpp.
References eExtreme_Positional, CSeqFeatData::eSubtype_any, m_MappedOldFeats, m_OldBsh, SAnnotSelector::SetLimitTSE(), CSeq_feat_Base::SetLocation(), x_GetNewSeqLength(), x_MappedFeature_ChangeId(), and x_ShouldRemoveFeature().
Referenced by NoChange(), and Replace().
Definition at line 775 of file update_seq.cpp.
References CSerialObject::Assign(), CSeq_data_Base::e_Iupacna, CSeq_inst_Base::eRepr_delta, CSeq_inst_Base::eRepr_raw, CSeqVector::GetSeqData(), m_OldBsh, m_UpdBsh, NCBI_THROW, CSeqportUtil::Pack(), CSeq_inst_Base::ResetExt(), CUpdateSeq_Input::s_IsDeltaWithNoGaps(), CSeqVector::SetCoding(), CSeq_inst_Base::SetLength(), CSeq_inst_Base::SetRepr(), and CSeq_inst_Base::SetSeq_data().
Referenced by Replace().
|
private |
Definition at line 1813 of file update_seq.cpp.
References CSerialObject::Assign(), CSeq_entry_EditHandle::AttachEntry(), CreateTranslatedProteinSequence(), eExtreme_Biological, NStr::Find(), CScope::GetBioseqHandle(), CSeq_entry_Handle::GetCompleteSeq_entry(), CSeq_feat_Base::GetExcept_text(), CSeq_feat_Base::GetLocation(), GetNewProtId(), CSeq_feat_Base::GetProduct(), CBioseq_Handle::GetScope(), CBioseq_Handle::GetSeq_entry_Handle(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CSeq_feat_Base::IsSetExcept_text(), CSeq_feat_Base::IsSetProduct(), SUpdateSeqParams::m_KeepProteinId, m_OldBsh, m_Params, offset, CScope::RemoveFromHistory(), CBioseq_Base::SetInst(), CSeq_inst_Base::SetLength(), SetMolinfoForProtein(), CSeq_feat_Base::SetProduct(), CSeq_entry_Base::SetSeq(), CSeq_inst_Base::SetSeq_data(), x_AdjustProteinFeature(), and x_RemoveDescriptorsFromImportedProducts().
Referenced by x_AttachFeaturesToNewSeq().
|
private |
Definition at line 1753 of file update_seq.cpp.
References CSerialObject::Assign(), CSeq_entry_EditHandle::AttachEntry(), CreateTranslatedProteinSequence(), eExtreme_Biological, NStr::Find(), CScope::GetBioseqHandle(), CSeq_entry_Handle::GetCompleteSeq_entry(), CSeq_feat_Base::GetExcept_text(), CSeq_feat_Base::GetLocation(), CSeq_feat_Base::GetProduct(), CBioseq_Handle::GetSeq_entry_Handle(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CSeq_feat_Base::IsSetExcept_text(), CSeq_feat_Base::IsSetProduct(), m_OldBsh, CBioseq_Base::SetInst(), CSeq_inst_Base::SetLength(), SetMolinfoForProtein(), CSeq_entry_Base::SetSeq(), CSeq_inst_Base::SetSeq_data(), and x_AdjustProteinFeature().
Referenced by x_AttachFeaturesToNewSeq().
|
private |
Definition at line 1637 of file update_seq.cpp.
References m_ImportUpdFeats, m_MappedOldFeats, NON_CONST_ITERATE, and x_RemoveNewIDInFeature().
Referenced by x_AttachFeaturesToNewSeq().
Determines whether the feature from update sequence should be imported to the new one.
Definition at line 1196 of file update_seq.cpp.
References _ASSERT, Compare(), eAbutting, eNoOverlap, fCompareOverlapping, FindRowInAlignment(), CSeq_feat_Base::GetData(), CSeq_loc::GetLabel(), CSeq_feat_Base::GetLocation(), CSeq_feat_Handle::GetOriginalSeq_feat(), CSeqFeatData::GetSubtype(), label, m_Align, SUpdateSeqParams::m_IgnoreAlignment, m_NotImportedFeats, m_Params, m_UpdBsh, and CSeqFeatData::SubtypeValueToName().
Referenced by NoChange().
Definition at line 1221 of file update_seq.cpp.
References _ASSERT, eExtreme_Positional, SUpdateSeqParams::eFeatRemoveAligned, SUpdateSeqParams::eFeatRemoveAll, SUpdateSeqParams::eFeatRemoveNone, SUpdateSeqParams::eFeatRemoveNotAligned, FindRowInAlignment(), CSeq_feat_Handle::GetLocation(), CSeq_loc::GetStart(), CSeq_loc::GetStop(), m_Align, SUpdateSeqParams::m_FeatRemoveOption, m_OldBsh, and m_Params.
Referenced by ExtendOneEndOfSequence(), Replace(), x_MapOldAndImportedFeatsThroughNewAlign(), and x_ReplaceIdInOldFeatures().
|
private |
Creates command that swaps the old sequence with the new one.
Definition at line 2072 of file update_seq.cpp.
References cmd, m_NewEntry, and x_GetOldBseq_EntryHandle().
Referenced by Update().
|
private |
Definition at line 2014 of file update_seq.cpp.
References EDIT_EACH_FEATURE_ON_ANNOT, EDIT_EACH_SEQANNOT_ON_BIOSEQ, CSeq_entry_Base::GetSeq(), CSeq_annot::IsFtable(), CBioseq::IsNa(), CSeq_entry_Base::IsSet(), CBioseq_Base::ResetId(), CBioseq_Base::SetId(), and CSeq_entry_Base::SetSeq().
Referenced by x_ImportCDSProduct().
Definition at line 983 of file update_seq.cpp.
References m_OldBsh, and s_UpdateSeqInst().
Referenced by x_ExtendOneEnd(), and x_PatchSequence().
|
private |
Definition at line 200 of file update_seq.hpp.
Referenced by CheckParameters(), GetNotImportedFeatsReport(), IsAlignmentOK(), NoChange(), Patch(), Replace(), Update(), x_ExtendOneEnd(), x_GetNewAlign_Replace(), x_PatchSequence(), x_ShouldImportFeature(), and x_ShouldRemoveFeature().
|
private |
Definition at line 216 of file update_seq.hpp.
Referenced by GetCitSubMessage(), ShowCitSubMessage(), and x_AddCitSubToUpdatedSequence().
|
private |
Definition at line 213 of file update_seq.hpp.
Referenced by ExtendOneEndOfSequence(), NoChange(), Replace(), x_AttachFeaturesToNewSeq(), x_GetSeqAnnot_WithoutCDS(), x_HandleDuplicateFeatures(), x_MapOldAndImportedFeatsThroughNewAlign(), and x_SetOldIDInFeatures().
|
private |
List of features, originally belonging to the Old Sequence and update sequence, respectively.
Their locations have been adjusted (including new SeqId), ready to be attached to the New Sequence Lists are ready to be searched for duplicates
Definition at line 212 of file update_seq.hpp.
Referenced by ExtendOneEndOfSequence(), Replace(), x_AttachFeaturesToNewSeq(), x_GetSeqAnnot_WithoutCDS(), x_HandleDuplicateFeatures(), x_MapOldAndImportedFeatsThroughNewAlign(), x_ReplaceIdInOldFeatures(), and x_SetOldIDInFeatures().
|
private |
The new seq-entry.
Definition at line 204 of file update_seq.hpp.
Referenced by x_AddCitSubToUpdatedSequence(), x_AttachFeaturesToNewSeq(), x_FixID_AttachFeatures(), x_FixIDInNewEntry(), x_FormNewAlignment(), x_GetNewSeqLength(), x_MakeNewEntry(), x_PrepareNewEntry(), x_PrintNewEntryIds(), and x_SwapOldWithNewSeq().
|
private |
Temporary seq-id of the new seq-entry.
Definition at line 206 of file update_seq.hpp.
Referenced by ExtendOneEndOfSequence(), Update(), x_FormNewAlignment(), x_GetNewAlign_Replace(), x_MappedFeature_ChangeId(), x_MappedFeature_ThroughAlign(), and x_PrepareNewEntry().
|
private |
List of features that were not imported as they were outside the alignment range.
Definition at line 219 of file update_seq.hpp.
Referenced by GetNotImportedFeatsReport(), and x_ShouldImportFeature().
|
private |
Definition at line 198 of file update_seq.hpp.
Referenced by ExtendOneEndOfSequence(), GetRevCompReport(), IsOldSequenceOK(), NoChange(), Replace(), x_AddCitSubToUpdatedSequence(), x_AdjustOldCDSProduct(), x_AttachFeaturesToNewSeq(), x_ExtendOneEnd(), x_FixIDInNewEntry(), x_FormNewAlignment(), x_FuseProtFeatsForCDS(), x_GetOldBseq_EntryHandle(), x_ImportCDSProduct(), x_MapOldAndImportedFeatsThroughNewAlign(), x_MappedFeature_ThroughAlign(), x_PatchSequence(), x_RemoveNewIDInFeature(), x_ReplaceIdInOldFeatures(), x_ReplaceSequence(), x_RetranslateImportedCDSProduct(), x_RetranslateOldCDSProduct(), x_ShouldRemoveFeature(), and x_UpdateSeqInst().
|
private |
Definition at line 201 of file update_seq.hpp.
Referenced by CheckParameters(), ExtendOneEndOfSequence(), NoChange(), Replace(), SetUpdateSeqParams(), Update(), x_AttachFeaturesToNewSeq(), x_ExtendOneEnd(), x_HandleDuplicateFeatures(), x_ImportCDSProduct(), x_MapOldAndImportedFeatsThroughNewAlign(), x_RetranslateImportedCDSProduct(), x_ShouldImportFeature(), and x_ShouldRemoveFeature().
|
private |
Definition at line 217 of file update_seq.hpp.
Referenced by GetRevCompReport(), IsReverseComplemented(), and Update().
|
private |
Definition at line 199 of file update_seq.hpp.
Referenced by CSequenceUpdater(), ExtendOneEndOfSequence(), GetNotImportedFeatsReport(), IsUpdateSequenceRaw(), NoChange(), Replace(), x_ExtendOneEnd(), x_MapOldAndImportedFeatsThroughNewAlign(), x_PatchSequence(), x_ReplaceSequence(), and x_ShouldImportFeature().