NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <objects/seq/Seq_inst.hpp>
#include <objects/seq/Seq_data.hpp>
#include <objects/general/Dbtag.hpp>
#include <objects/seqalign/Dense_seg.hpp>
#include <objects/seq/seq_id_handle.hpp>
#include <objects/seqfeat/Feat_id.hpp>
#include <objtools/cleanup/fix_feature_id.hpp>
#include <objmgr/feat_ci.hpp>
#include <objmgr/align_ci.hpp>
#include <objmgr/bioseq_ci.hpp>
#include <objmgr/seq_annot_ci.hpp>
#include <objmgr/util/sequence.hpp>
#include <objtools/edit/cds_fix.hpp>
#include <objtools/edit/seq_entry_edit.hpp>
#include <util/sequtil/sequtil_convert.hpp>
#include <gui/objutils/cmd_composite.hpp>
#include <gui/objutils/cmd_create_feat.hpp>
#include <gui/objutils/cmd_add_cds.hpp>
#include <gui/objutils/cmd_change_seq_feat.hpp>
#include <gui/objutils/cmd_del_seq_feat.hpp>
#include <gui/objutils/cmd_change_bioseq_inst.hpp>
#include <gui/objutils/cmd_del_bioseq.hpp>
#include <gui/objutils/cmd_del_seq_align.hpp>
#include <gui/objutils/convert_raw_to_delta.hpp>
Go to the source code of this file.
Go to the SVN repository for this file.
Functions | |
USING_SCOPE (objects) | |
void | GapLocationsFromNs (const CSeq_inst &inst, const size_t min_unknown, const long max_unknown, const size_t min_known, const long max_known, vector< pair< int, int >> &start_length_locs, vector< bool > &vec_is_known) |
void | UpdateDensegAlignment (CSeq_align_Handle ah, CBioseq_Handle bsh, CRef< CCmdComposite > composite, const vector< pair< int, int >> &start_length_locs, const vector< bool > &vec_is_known, set< const CSeq_align * > &deleted_aligns) |
static void | UpdateFeaturesForGaps (const map< CBioseq_Handle, pair< vector< pair< int, int >>, vector< bool >>> &map_gaps, CRef< CCmdComposite > composite, bool break_features, bool keep_gap_length, bool create_general_only, CObject_id::TId &max_feat_id, map< CObject_id::TId, CObject_id::TId > &old_to_new, bool create_xref_map) |
static void | s_ReplaceFeatureIdXref (CSeq_feat &f, map< CObject_id::TId, CObject_id::TId > &old_to_new) |
static void | x_AdjustOrigLabel (CSeq_feat &feat, size_t &id_offset, string &id_label, const string &qual) |
static void | s_UpdateCodeBreaksAndAnticodons (CSeq_feat &feat, CScope &scope, const map< CBioseq_Handle, vector< SGap >> &gaps, bool break_features, bool keep_gap_length) |
static void | AdjustSingleFeature (const CMappedFeat &feat, CScope &scope, const map< CBioseq_Handle, vector< SGap >> &gaps, CRef< CCmdComposite > composite, bool split_gene_locations, bool break_features, bool keep_gap_length, bool create_general_only, CObject_id::TId &max_feat_id, map< CObject_id::TId, CObject_id::TId > &old_to_new, bool create_xref_map) |
void | AdjustFeatureLocations (const map< CBioseq_Handle, vector< SGap >> &map_gaps, CRef< CCmdComposite > composite, bool split_gene_locations, bool break_features, bool keep_gap_length, bool create_general_only, CObject_id::TId &max_feat_id, map< CObject_id::TId, CObject_id::TId > &old_to_new, bool create_xref_map) |
void | FindNewLocations (const CSeq_loc &feat_loc, CScope &scope, const map< CBioseq_Handle, vector< SGap >> &map_gaps, vector< CRef< CSeq_loc >> &locations, bool &comment, bool break_features, bool keep_gap_length) |
static void | s_AddComment (CRef< CSeq_feat > new_feat) |
CRef< CSeq_feat > | UpdateFeat (CRef< CSeq_loc > changed_loc, const CSeq_feat &feat, bool comment, CScope &scope) |
void | RemapOtherProtFeats (const CSeq_feat &old_cds, CSeq_feat &cds, CBioseq_Handle bh, CRef< CCmdComposite > composite, bool &any_actions) |
void | RemapOtherProtFeats (const CSeq_feat &old_cds, CSeq_feat &cds, CSeq_feat_Handle fh, vector< CRef< CSeq_feat >> &other_prot_feats, CObject_id::TId &max_feat_id, map< CObject_id::TId, CObject_id::TId > &old_to_new, bool create_xref_map) |
static CRef< CCmdComposite > | ConvertRawToDeltaByNsCommand_impl (const CSeq_entry_Handle &seh, const SGapRequestInfo &request, bool &remove_alignments, int &count, map< CObject_id::TId, CObject_id::TId > &old_to_new, bool create_xref_map) |
CRef< CCmdComposite > | ConvertRawToDeltaByNsCommand (const CSeq_entry_Handle &seh, const SGapRequestInfo &request, bool &remove_alignments, int &count) |
static CRef< CCmdComposite > | ConvertRawToDeltaByNsHugeFileCmd_impl (const CSeq_entry_Handle &seh, const SGapRequestInfo &request, CObject_id::TId &max_feat_id, bool &remove_alignments, int &count, map< CObject_id::TId, CObject_id::TId > &old_to_new, bool create_xref_map) |
CRef< CCmdComposite > | ConvertRawToDeltaByNsHugeFileCmd (const CSeq_entry_Handle &seh, const SGapRequestInfo &request, CObject_id::TId &max_feat_id, bool &remove_alignments, int &count) |
void AdjustFeatureLocations | ( | const map< CBioseq_Handle, vector< SGap >> & | map_gaps, |
CRef< CCmdComposite > | composite, | ||
bool | split_gene_locations, | ||
bool | break_features, | ||
bool | keep_gap_length, | ||
bool | create_general_only, | ||
CObject_id::TId & | max_feat_id, | ||
map< CObject_id::TId, CObject_id::TId > & | old_to_new, | ||
bool | create_xref_map | ||
) |
Definition at line 582 of file convert_raw_to_delta.cpp.
References AdjustSingleFeature().
Referenced by UpdateFeaturesForGaps().
|
static |
Definition at line 371 of file convert_raw_to_delta.cpp.
References CCmdComposite::AddCommand(), AdjustProteinFeaturePartialsToMatchCDS(), CSerialObject::Assign(), cmd, CSeq_inst_Base::eMol_aa, NStr::EndsWith(), CSeq_inst_Base::eRepr_raw, CSeqFeatData::eSubtype_cdregion, CSeqFeatData::eSubtype_gene, CSeqFeatData::eSubtype_mRNA, CSeqFeatData::eSubtype_prot, NStr::Find(), FindNewLocations(), CSeq_feat_Handle::GetAnnot(), CScope::GetBioseqHandle(), CBioseq_Handle::GetCompleteBioseq(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetExcept_text(), CSeq_feat_Handle::GetFeatSubtype(), CObject_id_Base::GetId(), CBioseq_Base::GetId(), CSeq_feat_Base::GetId(), CSeq_loc::GetId(), CBioseq::GetLength(), CFeat_id_Base::GetLocal(), CSeq_feat_Base::GetLocation(), CMappedFeat::GetLocation(), GetNewProtId(), GetNewProtIdFromExistingProt(), CMappedFeat::GetOriginalFeature(), CSeq_annot_Handle::GetParentEntry(), CSeq_feat_Base::GetProduct(), CMappedFeat::GetSeq_feat(), CMappedFeat::GetSeq_feat_Handle(), CSeqFeatData_Base::IsCdregion(), CObject_id_Base::IsId(), CFeat_id_Base::IsLocal(), CSeq_feat_Base::IsSetData(), CSeq_feat_Base::IsSetExcept_text(), CSeq_feat_Base::IsSetId(), CSeq_feat_Base::IsSetProduct(), prot, RemapOtherProtFeats(), CRef< C, Locker >::Reset(), CSeq_feat_Base::ResetLocation(), s_ReplaceFeatureIdXref(), s_UpdateCodeBreaksAndAnticodons(), CSeq_feat_Base::SetId(), CBioseq_Base::SetInst(), CSeq_feat_Base::SetLocation(), CSeq_feat_Base::SetProduct(), CSeqTranslator::Translate(), UpdateFeat(), and x_AdjustOrigLabel().
Referenced by AdjustFeatureLocations().
CRef<CCmdComposite> ConvertRawToDeltaByNsCommand | ( | const CSeq_entry_Handle & | seh, |
const SGapRequestInfo & | request, | ||
bool & | remove_alignments, | ||
int & | count | ||
) |
Definition at line 1068 of file convert_raw_to_delta.cpp.
References ConvertRawToDeltaByNsCommand_impl(), and count.
|
static |
Definition at line 994 of file convert_raw_to_delta.cpp.
References CCmdComposite::AddCommand(), SGapRequestInfo::adjust_cds, CSerialObject::Assign(), cmd, ConvertRawToDeltaByNs(), count, CSeq_annot_Base::C_Data::e_Align, CSeq_inst_Base::eMol_na, set< Key, Compare >::empty(), CCmdComposite::Execute(), SGapRequestInfo::gap_type, GapLocationsFromNs(), CBioseq_Handle::GetCompleteBioseq(), CBioseq_Base::GetInst(), CSeq_align_Base::GetSegs(), CAlign_CI::GetSeq_align_Handle(), SGapRequestInfo::is_assembly_gap, CSeq_align_Base::C_Segs::IsDenseg(), IsGeneralIdProtPresent(), CSeq_align_Base::IsSetSegs(), SGapRequestInfo::keep_gap_length, SGapRequestInfo::linkage, SGapRequestInfo::linkage_evidence, SGapRequestInfo::max_known, SGapRequestInfo::max_unknown, SGapRequestInfo::min_known, SGapRequestInfo::min_unknown, NormalizeUnknownLengthGaps(), CFixFeatureId::s_FindHighestFeatureId(), CCmdComposite::Unexecute(), UpdateDensegAlignment(), and UpdateFeaturesForGaps().
Referenced by ConvertRawToDeltaByNsCommand().
CRef<CCmdComposite> ConvertRawToDeltaByNsHugeFileCmd | ( | const CSeq_entry_Handle & | seh, |
const SGapRequestInfo & | request, | ||
CObject_id::TId & | max_feat_id, | ||
bool & | remove_alignments, | ||
int & | count | ||
) |
Definition at line 1153 of file convert_raw_to_delta.cpp.
References ConvertRawToDeltaByNsHugeFileCmd_impl(), and count.
|
static |
Definition at line 1081 of file convert_raw_to_delta.cpp.
References CCmdComposite::AddCommand(), SGapRequestInfo::adjust_cds, CSerialObject::Assign(), cmd, ConvertRawToDeltaByNs(), count, CSeq_annot_Base::C_Data::e_Align, CSeq_inst_Base::eMol_na, set< Key, Compare >::empty(), CCmdComposite::Execute(), SGapRequestInfo::gap_type, GapLocationsFromNs(), CBioseq_Handle::GetCompleteBioseq(), CBioseq_Base::GetInst(), CSeq_align_Base::GetSegs(), CAlign_CI::GetSeq_align_Handle(), SGapRequestInfo::is_assembly_gap, CSeq_align_Base::C_Segs::IsDenseg(), IsGeneralIdProtPresent(), CSeq_align_Base::IsSetSegs(), SGapRequestInfo::keep_gap_length, SGapRequestInfo::linkage, SGapRequestInfo::linkage_evidence, SGapRequestInfo::max_known, SGapRequestInfo::max_unknown, SGapRequestInfo::min_known, SGapRequestInfo::min_unknown, NormalizeUnknownLengthGaps(), CCmdComposite::Unexecute(), UpdateDensegAlignment(), and UpdateFeaturesForGaps().
Referenced by ConvertRawToDeltaByNsHugeFileCmd().
void FindNewLocations | ( | const CSeq_loc & | feat_loc, |
CScope & | scope, | ||
const map< CBioseq_Handle, vector< SGap >> & | map_gaps, | ||
vector< CRef< CSeq_loc >> & | locations, | ||
bool & | comment, | ||
bool | break_features, | ||
bool | keep_gap_length | ||
) |
Definition at line 603 of file convert_raw_to_delta.cpp.
References CSeq_loc::Assign(), done, eExtreme_Positional, ctll::empty(), ctll::front(), CScope::GetBioseqHandle(), CRange_Base::GetFrom(), GetId(), CBioseq_Handle::GetRangeSeq_loc(), CSeq_loc::GetStart(), CRange_Base::GetTo(), i, CSeq_loc_I::InsertInterval(), CSeq_loc_I::InsertNull(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CSeq_loc_I::MakeSeq_loc(), offset, CSeq_loc::SetPartialStart(), and CSeq_loc::SetPartialStop().
Referenced by AdjustSingleFeature(), and s_UpdateCodeBreaksAndAnticodons().
void GapLocationsFromNs | ( | const CSeq_inst & | inst, |
const size_t | min_unknown, | ||
const long | max_unknown, | ||
const size_t | min_known, | ||
const long | max_known, | ||
vector< pair< int, int >> & | start_length_locs, | ||
vector< bool > & | vec_is_known | ||
) |
Definition at line 69 of file convert_raw_to_delta.cpp.
References CSeqConvert::Convert(), CSeq_data_Base::e_Iupacna, CSeqUtil::e_Iupacna, CSeq_data_Base::e_Ncbi2na, CSeqUtil::e_Ncbi2na, CSeq_data_Base::e_Ncbi4na, CSeqUtil::e_Ncbi4na, CSeq_data_Base::e_Ncbi8na, CSeqUtil::e_Ncbi8na, CSeq_inst_Base::eRepr_raw, and ITERATE.
Referenced by ConvertRawToDeltaByNsCommand_impl(), and ConvertRawToDeltaByNsHugeFileCmd_impl().
void RemapOtherProtFeats | ( | const CSeq_feat & | old_cds, |
CSeq_feat & | cds, | ||
CBioseq_Handle | bh, | ||
CRef< CCmdComposite > | composite, | ||
bool & | any_actions | ||
) |
Definition at line 888 of file convert_raw_to_delta.cpp.
References CCmdComposite::AddCommand(), CSerialObject::Assign(), eExtreme_Positional, CSeq_loc_Mapper_Base::eLocationToProduct, CSeq_loc_Mapper_Base::eProductToLocation, CSeqFeatData::eSubtype_prot, CSeq_feat_Handle::GetFeatSubtype(), CSeq_feat_Base::GetLocation(), CBioseq_Handle::GetScope(), CSeq_loc::GetStart(), CSeq_loc::GetStop(), CSeq_loc_Base::IsNull(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CSeq_feat_Handle::IsPlainFeat(), CSeq_loc_Mapper_Base::Map(), CSeq_feat_Base::SetLocation(), CSeq_loc_Mapper_Base::SetMergeAbutting(), CSeq_feat_Base::SetPartial(), CSeq_loc::SetPartialStart(), and CSeq_loc::SetPartialStop().
Referenced by AdjustSingleFeature().
void RemapOtherProtFeats | ( | const CSeq_feat & | old_cds, |
CSeq_feat & | cds, | ||
CSeq_feat_Handle | fh, | ||
vector< CRef< CSeq_feat >> & | other_prot_feats, | ||
CObject_id::TId & | max_feat_id, | ||
map< CObject_id::TId, CObject_id::TId > & | old_to_new, | ||
bool | create_xref_map | ||
) |
Definition at line 937 of file convert_raw_to_delta.cpp.
References CSerialObject::Assign(), eExtreme_Positional, CSeq_loc_Mapper_Base::eLocationToProduct, CSeq_loc_Mapper_Base::eProductToLocation, CObject_id_Base::GetId(), CSeq_feat_Base::GetId(), CFeat_id_Base::GetLocal(), CSeq_feat_Base::GetLocation(), CSeq_feat_Handle::GetLocation(), CSeq_feat_Handle::GetOriginalSeq_feat(), CSeq_feat_Handle::GetScope(), CSeq_loc::GetStart(), CSeq_loc::GetStop(), CObject_id_Base::IsId(), CFeat_id_Base::IsLocal(), CSeq_loc_Base::IsNull(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), CSeq_feat_Base::IsSetId(), CSeq_loc_Mapper_Base::Map(), s_ReplaceFeatureIdXref(), CSeq_feat_Base::SetId(), CSeq_feat_Base::SetLocation(), CSeq_loc_Mapper_Base::SetMergeAbutting(), CSeq_feat_Base::SetPartial(), CSeq_loc::SetPartialStart(), and CSeq_loc::SetPartialStop().
Definition at line 854 of file convert_raw_to_delta.cpp.
References CSeq_feat_Base::GetComment(), CSeq_feat_Base::IsSetComment(), and CSeq_feat_Base::SetComment().
Referenced by UpdateFeat().
|
static |
Definition at line 268 of file convert_raw_to_delta.cpp.
References map_checker< Container >::end(), f(), map_checker< Container >::find(), and NON_CONST_ITERATE.
Referenced by AdjustSingleFeature(), and RemapOtherProtFeats().
|
static |
Definition at line 305 of file convert_raw_to_delta.cpp.
References CSeq_loc::Assign(), FindNewLocations(), CTrna_ext_Base::GetAnticodon(), CSeqFeatData_Base::GetCdregion(), CCdregion_Base::GetCode_break(), CSeq_feat_Base::GetData(), CRNA_ref_Base::GetExt(), CSeq_feat_Base::GetLocation(), CSeqFeatData_Base::GetRna(), CSeq_loc::Intersect(), CSeqFeatData_Base::IsCdregion(), CSeq_loc_Base::IsEmpty(), CSeq_loc_Base::IsNull(), CSeqFeatData_Base::IsRna(), CTrna_ext_Base::IsSetAnticodon(), CCdregion_Base::IsSetCode_break(), CSeq_feat_Base::IsSetData(), CRNA_ref_Base::IsSetExt(), CRNA_ref_Base::C_Ext::IsTRNA(), NULL, CTrna_ext_Base::ResetAnticodon(), CCdregion_Base::ResetCode_break(), CTrna_ext_Base::SetAnticodon(), CCdregion_Base::SetCode_break(), and CSeq_feat_Base::SetData().
Referenced by AdjustSingleFeature().
void UpdateDensegAlignment | ( | CSeq_align_Handle | ah, |
CBioseq_Handle | bsh, | ||
CRef< CCmdComposite > | composite, | ||
const vector< pair< int, int >> & | start_length_locs, | ||
const vector< bool > & | vec_is_known, | ||
set< const CSeq_align * > & | deleted_aligns | ||
) |
Definition at line 172 of file convert_raw_to_delta.cpp.
References CCmdComposite::AddCommand(), CSeq_align::CheckNumRows(), cmd, set< Key, Compare >::end(), set< Key, Compare >::find(), CSeq_align_Base::C_Segs::GetDenseg(), CDense_seg_Base::GetLens(), CSeq_align_Base::GetSegs(), CSeq_align_Handle::GetSeq_align(), CSeq_align::GetSeq_id(), CDense_seg_Base::GetStarts(), i, set< Key, Compare >::insert(), CBioseq_Handle::IsSynonym(), and row.
Referenced by ConvertRawToDeltaByNsCommand_impl(), and ConvertRawToDeltaByNsHugeFileCmd_impl().
CRef<CSeq_feat> UpdateFeat | ( | CRef< CSeq_loc > | changed_loc, |
const CSeq_feat & | feat, | ||
bool | comment, | ||
CScope & | scope | ||
) |
Definition at line 870 of file convert_raw_to_delta.cpp.
References CSerialObject::Assign(), eExtreme_Positional, CSeqTranslator::FindBestFrame(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetLocation(), CSeqFeatData_Base::IsCdregion(), CSeq_loc::IsPartialStart(), CSeq_loc::IsPartialStop(), s_AddComment(), CSeq_feat_Base::SetData(), CSeq_feat_Base::SetLocation(), and CSeq_feat_Base::SetPartial().
Referenced by AdjustSingleFeature().
|
static |
Definition at line 234 of file convert_raw_to_delta.cpp.
References AdjustFeatureLocations(), i, SGap::is_known, SGap::is_replace, SGap::length, and SGap::start.
Referenced by ConvertRawToDeltaByNsCommand_impl(), and ConvertRawToDeltaByNsHugeFileCmd_impl().
USING_SCOPE | ( | objects | ) |
|
static |
Definition at line 286 of file convert_raw_to_delta.cpp.
References NStr::Equal(), NStr::EqualNocase(), NStr::IsBlank(), CSeq_feat_Base::IsSetQual(), NON_CONST_ITERATE, NStr::NumericToString(), and CSeq_feat_Base::SetQual().
Referenced by AdjustSingleFeature().