NCBI C++ ToolKit
|
Search Toolkit Book for variation::CVariationUtil
#include <misc/hgvs/variation_util2.hpp>
Classes | |
class | CCdregionIndex |
Cache seq-data in the CDS regions and the cds features by location. More... | |
class | CVariantPropertiesIndex |
Given a seq-loc, compute CVariantProperties::TGene_location from annotation. More... | |
struct | SFlankLocs |
Calculate upstream (first) and downstream(second) flanks for loc. More... | |
Public Member Functions | |
CVariationUtil (CScope &scope, TOptions options=fOpt_default) | |
void | ClearCache () |
CRef< CVariation > | AsVariation (const CSeq_feat &variation_ref) |
void | AsVariation_feats (const CVariation &v, CSeq_annot::TData::TFtable &feats) |
CRef< CVariantPlacement > | Remap (const CVariantPlacement &p, const CSeq_align &aln, bool check_placements=true) |
Methods to remap a VariantPlacement. More... | |
CRef< CVariantPlacement > | Remap (const CVariantPlacement &p, CSeq_loc_Mapper &mapper) |
CRef< CVariantPlacement > | RemapToAnnotatedTarget (const CVariation &v, const CSeq_id &target) |
Remap variation from product coordinates onto a nucleotide sequence on which this product is annotated. More... | |
CRef< CVariation > | InferNAfromAA (const CVariation &prot_variation, TAA2NAFlags flags=fAA2NA_default) |
CRef< CVariation > | TranslateNAtoAA (const CVariation_inst &nuc_inst, const CVariantPlacement &p, const CSeq_feat &cds_feat) |
Evaluate protein effect of a single-inst @ single-placement. More... | |
void | AttachProteinConsequences (CVariation &nuc_variation, const CSeq_id *=NULL, bool ignore_genomic=false) |
Find the CDSes for the first placement; Compute prot consequence using TranslateNAtoAA for each and attach results to nuc_variation.consequnece. More... | |
void | FlipStrand (CVariation &v) const |
Other utility methods: More... | |
void | FlipStrand (CVariantPlacement &vp) const |
Flipping a placement involves flipping strand on the seq-loc and swapping the offsets (and signs). More... | |
void | FlipStrand (CVariation_inst &vi) const |
Flip strand on delta-items and reverse the order. More... | |
void | FlipStrand (CDelta_item &di) const |
Reverse-complement seq-literals, flip strand on the seq-locs. More... | |
bool | AttachSeq (CVariantPlacement &p, TSeqPos max_len=kMaxAttachSeqLen) |
If have offsets (intronic) or too long, return false; else set seq field on the placement and return true. More... | |
bool | AttachSeq (CVariation &v, TSeqPos max_len=kMaxAttachSeqLen) |
CVariantPlacement::TMol | GetMolType (const CSeq_id &id) |
ETestStatus | CheckExonBoundary (const CVariantPlacement &p, const CSeq_align &aln) |
ETestStatus | CheckExonBoundary (const CVariantPlacement &p) |
bool | CheckPlacement (CVariantPlacement &p) |
if placement is invalid SeqLocCheck fails, or offsets out of order, attach VariationException and return true otherwise return false; More... | |
bool | CheckAmbiguitiesInLiterals (CVariation &v) |
if variation.data contains a seq-literal with non-ACGT residues, attach VariationException to the first placement (if exists) and return true. More... | |
SFlankLocs | CreateFlankLocs (const CSeq_loc &loc, TSeqPos len) |
void | SetPlacementProperties (CVariantPlacement &placement) |
Methods to compute properties. More... | |
void | SetVariantProperties (CVariation &v) |
void | AsSOTerms (const CVariantProperties &p, TSOTerms &terms) |
void | FindLocationProperties (const CSeq_align &transcript_aln, const CSeq_loc &query_loc, TSOTerms &terms) |
Find location properties based on alignment. More... | |
TSeqPos | GetEffectiveTranscriptLength (const CBioseq_Handle &bsh) |
Length up to last position of the last exon (i.e. More... | |
CRef< CSeq_literal > | GetLiteralAtLoc (const CSeq_loc &loc) |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Private Attributes | |
CRef< CScope > | m_scope |
CVariantPropertiesIndex | m_variant_properties_index |
CCdregionIndex | m_cdregion_index |
Additional Inherited Members | |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Definition at line 67 of file variation_util2.hpp.
Methods to convert between nucleotide and protein.
Convert protein-variation (single-AA missense/nonsense) to nuc-variation on the precursor in the parent nuc-prot.
Definition at line 120 of file variation_util2.hpp.
Definition at line 75 of file variation_util2.hpp.
typedef vector<ESOTerm> variation::CVariationUtil::TSOTerms |
Definition at line 255 of file variation_util2.hpp.
anonymous enum |
Enumerator | |
---|---|
kMaxAttachSeqLen |
Definition at line 168 of file variation_util2.hpp.
Enumerator | |
---|---|
fAA2NA_truncate_common_prefix_and_suffix | |
fAA2NA_default |
Definition at line 121 of file variation_util2.hpp.
Enumerator | |
---|---|
fOpt_cache_exon_sequence | Use when there will be many calls to calculate protein consequnece per sequence. |
fOpt_default |
Definition at line 70 of file variation_util2.hpp.
Supported SO-terms.
Definition at line 231 of file variation_util2.hpp.
If placement is not intronic, or alignment is not spliced-seg -> eNotApplicable Else if variation is intronic but location is not at exon boundary -> eFail Else -> ePass
Enumerator | |
---|---|
eFail | |
ePass | |
eNotApplicable |
Definition at line 186 of file variation_util2.hpp.
|
inline |
Definition at line 77 of file variation_util2.hpp.
void variation::CVariationUtil::AsSOTerms | ( | const CVariantProperties & | p, |
TSOTerms & | terms | ||
) |
Definition at line 2794 of file variation_util2.cpp.
References CVariantProperties_Base::eEffect_frameshift, CVariantProperties_Base::eEffect_missense, CVariantProperties_Base::eEffect_nonsense, CVariantProperties_Base::eEffect_stop_gain, CVariantProperties_Base::eEffect_stop_loss, CVariantProperties_Base::eEffect_synonymous, CVariantProperties_Base::eGene_location_acceptor, CVariantProperties_Base::eGene_location_conserved_noncoding, CVariantProperties_Base::eGene_location_donor, CVariantProperties_Base::eGene_location_in_start_codon, CVariantProperties_Base::eGene_location_in_stop_codon, CVariantProperties_Base::eGene_location_intergenic, CVariantProperties_Base::eGene_location_intron, CVariantProperties_Base::eGene_location_near_gene_3, CVariantProperties_Base::eGene_location_near_gene_5, CVariantProperties_Base::eGene_location_utr_3, CVariantProperties_Base::eGene_location_utr_5, eSO_2KB_upstream_variant, eSO_3_prime_UTR_variant, eSO_500B_downstream_variant, eSO_5_prime_UTR_variant, eSO_frameshift_variant, eSO_initiator_codon_variant, eSO_intergenic_variant, eSO_intron_variant, eSO_missense_variant, eSO_nc_transcript_variant, eSO_splice_acceptor_variant, eSO_splice_donor_variant, eSO_stop_gained, eSO_stop_lost, eSO_synonymous_variant, eSO_terminator_codon_variant, CVariantProperties_Base::GetEffect(), and CVariantProperties_Base::GetGene_location().
Definition at line 2848 of file variation_util2.cpp.
References eSO_2KB_upstream_variant, eSO_3_prime_UTR_variant, eSO_500B_downstream_variant, eSO_5_prime_UTR_variant, eSO_coding_sequence_variant, eSO_frameshift_variant, eSO_inframe_indel, eSO_initiator_codon_variant, eSO_intergenic_variant, eSO_intron_variant, eSO_missense_variant, eSO_nc_transcript_variant, eSO_splice_acceptor_variant, eSO_splice_donor_variant, eSO_stop_gained, eSO_stop_lost, eSO_synonymous_variant, and eSO_terminator_codon_variant.
CRef< CVariation > variation::CVariationUtil::AsVariation | ( | const CSeq_feat & | variation_ref | ) |
Definition at line 4436 of file variation_util2.cpp.
References CSerialObject::Assign(), CVariantPlacement_Base::eMol_unknown, eUnknown, CSeq_feat_Base::GetCit(), CSeq_feat_Base::GetData(), CSeq_feat_Base::GetExt(), CSeq_feat_Base::GetExts(), GetId(), CSeq_loc::GetId(), CVariantPlacement_Base::GetLoc(), CSeq_feat_Base::GetLocation(), GetMolType(), CSeqFeatData_Base::GetVariation(), CSeq_feat_Base::IsSetCit(), CSeq_feat_Base::IsSetExt(), CSeq_feat_Base::IsSetExts(), CSeqFeatData_Base::IsVariation(), ITERATE, NCBI_THROW, NULL, s_ConvertInstOffsetsToPlacementOffsets(), CVariantPlacement_Base::SetLoc(), CVariantPlacement_Base::SetMol(), and x_AsVariation().
void variation::CVariationUtil::AsVariation_feats | ( | const CVariation & | v, |
CSeq_annot::TData::TFtable & | feats | ||
) |
Definition at line 4200 of file variation_util2.cpp.
References CSerialObject::Assign(), CVariation_Base::GetData(), CVariation_Base::GetExt(), CVariantPlacement_Base::GetLoc(), CVariation_Base::GetPlacements(), CVariation_Base::GetPub(), CVariation_Base::C_Data::GetSet(), CVariation_Base::C_Data::C_Set::GetVariations(), variation::InheritParentAttributes(), CVariation_Base::C_Data::IsSet(), CSeq_feat_Base::IsSetCit(), CVariation_Base::IsSetExt(), CVariation_Base::IsSetPlacements(), CVariation_Base::IsSetPub(), ITERATE, NON_CONST_ITERATE, CSeq_feat_Base::SetCit(), CSeq_feat_Base::SetData(), CSeq_feat_Base::SetExts(), CSeq_feat_Base::SetLocation(), and x_AsVariation_ref().
Referenced by CHgvsReader::ReadSeqAnnot().
void variation::CVariationUtil::AttachProteinConsequences | ( | CVariation & | nuc_variation, |
const CSeq_id * | target_id = NULL , |
||
bool | ignore_genomic = false |
||
) |
Find the CDSes for the first placement; Compute prot consequence using TranslateNAtoAA for each and attach results to nuc_variation.consequnece.
If seq-id specified, use only the placement with the specified id. If ignore_genomic set to true, then consequences will be evaluated for cDNA or MT placements only. Note: Alternatively, the API could be "create and return consequence protein variation(s)", rather than attach, but that for hierarchical input it would be hard to tell which consequence corresponds to which node.
Definition at line 1899 of file variation_util2.cpp.
References CVariantPlacement_Base::eMol_cdna, CVariantPlacement_Base::eMol_genomic, CVariantPlacement_Base::eMol_mitochondrion, CVariation_inst_Base::eObservation_variant, variation::CVariationUtil::CCdregionIndex::Get(), CVariation_Base::GetData(), GetId(), CSeq_loc::GetId(), CVariation_Base::C_Data::GetInstance(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetMol(), CVariation_inst_Base::GetObservation(), CVariation::Index(), CVariation_Base::C_Data::IsInstance(), CSeq_loc_Base::IsPnt(), IsSameBioseq(), CVariation_Base::C_Data::IsSet(), CVariation_inst_Base::IsSetObservation(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), ITERATE, m_cdregion_index, m_scope, NON_CONST_ITERATE, NULL, s_GetPlacements(), CVariation_Base::SetConsequence(), CVariation_Base::SetData(), and TranslateNAtoAA().
bool variation::CVariationUtil::AttachSeq | ( | CVariantPlacement & | p, |
TSeqPos | max_len = kMaxAttachSeqLen |
||
) |
If have offsets (intronic) or too long, return false; else set seq field on the placement and return true.
Definition at line 1033 of file variation_util2.cpp.
References variation::ContainsIupacNaAmbiguities(), variation::CreateException(), CVariationException_Base::eCode_ambiguous_sequence, CVariationException_Base::eCode_seqfetch_intronic, CVariationException_Base::eCode_seqfetch_invalid, CVariationException_Base::eCode_seqfetch_too_long, CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetStart_offset(), CVariantPlacement_Base::GetStop_offset(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), literal(), m_scope, CVariantPlacement_Base::ResetSeq(), s_GetLength(), CVariantPlacement_Base::SetExceptions(), CVariantPlacement_Base::SetSeq(), and x_GetLiteralAtLoc().
Referenced by AttachSeq(), Remap(), TranslateNAtoAA(), and x_InferNAfromAA().
bool variation::CVariationUtil::AttachSeq | ( | CVariation & | v, |
TSeqPos | max_len = kMaxAttachSeqLen |
||
) |
Definition at line 1075 of file variation_util2.cpp.
References AttachSeq(), Begin(), variation::CreateException(), CDelta_item_Base::eAction_morph, CVariationException_Base::eCode_inconsistent_asserted_allele, CVariationException_Base::eCode_ref_same_as_variant, CVariation_inst_Base::eObservation_asserted, CVariation_inst_Base::eObservation_variant, CSerialObject::Equals(), CVariation_Base::GetData(), CVariation_inst_Base::GetDelta(), CSeq_literal_Base::GetLength(), CVariation_inst_Base::GetObservation(), CVariantPlacement_Base::GetSeq(), CSeq_literal_Base::GetSeq_data(), CVariation::Index(), CVariation_Base::C_Data::IsSet(), CVariation_inst_Base::IsSetObservation(), CVariation_Base::IsSetPlacements(), CSeq_literal_Base::IsSetSeq_data(), literal(), LOG_POST, MSerial_AsnText, NcbiCout, NON_CONST_ITERATE, CVariation_Base::SetData(), CVariantPlacement_Base::SetExceptions(), CVariation_Base::SetPlacements(), v2, and CSeq_data_Base::Which().
|
private |
Convert any simple nucleotide variation to delins form, if possible; throw if not. Precondition: location must be set.
Definition at line 1781 of file variation_util2.cpp.
References CDelta_item_Base::eAction_del_at, CDelta_item_Base::eAction_ins_before, CDelta_item_Base::eAction_morph, CInt_fuzz_Base::eLim_unk, CVariation_inst_Base::eType_delins, CVariation_inst_Base::eType_inv, eUnknown, FlipStrand(), CDelta_item_Base::GetAction(), CVariation_Base::GetData(), CVariation_inst_Base::GetDelta(), CVariation_Base::C_Data::GetInstance(), CDelta_item_Base::C_Seq::GetLiteral(), CDelta_item_Base::C_Seq::GetLoc(), CDelta_item_Base::GetMultiplier(), CDelta_item_Base::GetSeq(), CVariation_inst_Base::GetType(), i, CVariation::Index(), CVariation_Base::C_Data::IsInstance(), CDelta_item_Base::C_Seq::IsLoc(), CVariation_Base::C_Data::IsSet(), CDelta_item_Base::IsSetAction(), CDelta_item_Base::IsSetMultiplier(), CDelta_item_Base::IsSetMultiplier_fuzz(), CDelta_item_Base::C_Seq::IsThis(), literal(), MSerial_AsnText, NCBI_THROW, NcbiCerr, NON_CONST_ITERATE, CDelta_item_Base::ResetAction(), CDelta_item_Base::ResetMultiplier(), s_SpliceLiterals(), CVariation_Base::SetData(), CVariation_inst_Base::SetDelta(), CDelta_item_Base::SetMultiplier_fuzz(), CDelta_item_Base::SetSeq(), CVariation_inst_Base::SetType(), CTempString::size(), x_FindOrCreateLiteral(), and x_GetLiteralAtLoc().
Referenced by TranslateNAtoAA().
bool variation::CVariationUtil::CheckAmbiguitiesInLiterals | ( | CVariation & | v | ) |
if variation.data contains a seq-literal with non-ACGT residues, attach VariationException to the first placement (if exists) and return true.
otherwise return false;
Definition at line 786 of file variation_util2.cpp.
References variation::ContainsIupacNaAmbiguities(), variation::CreateException(), CVariationException_Base::eCode_ambiguous_sequence, CVariation_Base::GetData(), CVariation_Base::GetPlacements(), CVariation_Base::C_Data::IsSet(), CVariation_Base::IsSetPlacements(), NON_CONST_ITERATE, CVariation_Base::SetData(), CVariation_Base::SetPlacements(), and v2.
Referenced by InferNAfromAA().
CVariationUtil::ETestStatus variation::CVariationUtil::CheckExonBoundary | ( | const CVariantPlacement & | p | ) |
Definition at line 236 of file variation_util2.cpp.
References eFail, CVariantPlacement_Base::eMol_cdna, CVariantPlacement_Base::eMol_rna, set< Key, Compare >::empty(), eNotApplicable, ePass, CSeqFeatData::eSubtype_exon, CScope::GetBioseqHandle(), CSeq_loc::GetId(), CVariantPlacement_Base::GetLoc(), CMappedFeat::GetLocation(), CVariantPlacement_Base::GetMol(), GetStart(), GetStop(), SAnnotSelector::IncludeFeatSubtype(), set< Key, Compare >::insert(), CVariantPlacement_Base::IsSetMol(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), m_scope, NULL, and variation::ValidExonTerminals().
CVariationUtil::ETestStatus variation::CVariationUtil::CheckExonBoundary | ( | const CVariantPlacement & | p, |
const CSeq_align & | aln | ||
) |
Definition at line 262 of file variation_util2.cpp.
References eFail, CVariantPlacement_Base::eMol_genomic, eNotApplicable, ePass, CProt_pos_Base::GetAmin(), CSpliced_seg_Base::GetExons(), CSeq_loc::GetId(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetMol(), CProduct_pos_Base::GetNucpos(), CSpliced_exon_Base::GetProduct_end(), CSpliced_exon_Base::GetProduct_start(), CProduct_pos_Base::GetProtpos(), CSeq_align_Base::GetSegs(), CSeq_align::GetSeq_id(), CSeq_align_Base::C_Segs::GetSpliced(), set< Key, Compare >::insert(), CProduct_pos_Base::IsNucpos(), IsSameBioseq(), CVariantPlacement_Base::IsSetMol(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), CSeq_align_Base::C_Segs::IsSpliced(), ITERATE, m_scope, and variation::ValidExonTerminals().
Referenced by Remap().
bool variation::CVariationUtil::CheckPlacement | ( | CVariantPlacement & | p | ) |
if placement is invalid SeqLocCheck fails, or offsets out of order, attach VariationException and return true otherwise return false;
Definition at line 807 of file variation_util2.cpp.
References variation::CreateException(), CVariationException_Base::eCode_bioseq_state, CVariationException_Base::eCode_hgvs_parsing, eSeqLocCheck_error, CBioseq_Handle::fState_dead, CScope::GetBioseqHandle(), CSeq_loc::GetId(), GetLength(), CVariantPlacement_Base::GetLoc(), GetStart(), CVariantPlacement_Base::GetStart_offset(), CBioseq_Handle::GetState(), GetStop(), CVariantPlacement_Base::GetStop_offset(), CSeq_loc_Base::IsEmpty(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), m_scope, NULL, SeqLocCheck(), and CVariantPlacement_Base::SetExceptions().
Referenced by Remap().
|
inline |
Definition at line 83 of file variation_util2.hpp.
References variation::CVariationUtil::CCdregionIndex::Clear(), variation::CVariationUtil::CVariantPropertiesIndex::Clear(), m_cdregion_index, and m_variant_properties_index.
CVariationUtil::SFlankLocs variation::CVariationUtil::CreateFlankLocs | ( | const CSeq_loc & | loc, |
TSeqPos | len | ||
) |
Definition at line 1242 of file variation_util2.cpp.
References CSeq_loc::Assign(), variation::CVariationUtil::SFlankLocs::downstream, CSeq_loc_Base::e_Null, eExtreme_Positional, eNa_strand_minus, first(), CScope::GetBioseqHandle(), GetId(), CSeq_loc::GetId(), CBioseq_Handle::GetInst_Length(), CSeq_id::GetSeqIdString(), GetStart(), GetStop(), GetStrand(), len, m_scope, max(), min(), NCBI_USER_THROW_FMT, NULL, CRef< C, Locker >::Reset(), CSeq_loc::SetInt(), CSeq_loc::SetNull(), and variation::CVariationUtil::SFlankLocs::upstream.
Referenced by TranslateNAtoAA().
void variation::CVariationUtil::FindLocationProperties | ( | const CSeq_align & | transcript_aln, |
const CSeq_loc & | query_loc, | ||
TSOTerms & | terms | ||
) |
Find location properties based on alignment.
Definition at line 3161 of file variation_util2.cpp.
References CSeq_align::CreateRowSeq_loc(), CSeqFeatData_Base::e_Cdregion, CSerialObject::Equals(), CSeq_loc::fMerge_SingleRange, CScope::GetBioseqHandle(), CSeq_loc::GetId(), CMappedFeat::GetLocation(), CSeq_align::GetSeq_id(), CSeq_loc::Intersect(), m_scope, CSeq_loc_Mapper_Base::Map(), NULL, CConstRef< C, Locker >::Reset(), s_FindLocationProperties(), and Seq_loc_Merge().
void variation::CVariationUtil::FlipStrand | ( | CDelta_item & | di | ) | const |
Reverse-complement seq-literals, flip strand on the seq-locs.
Definition at line 2166 of file variation_util2.cpp.
References CSeq_literal_Base::GetLength(), CDelta_item_Base::C_Seq::GetLiteral(), CDelta_item_Base::GetSeq(), CDelta_item_Base::C_Seq::IsLiteral(), CDelta_item_Base::C_Seq::IsLoc(), CDelta_item_Base::IsSetSeq(), CSeq_literal_Base::IsSetSeq_data(), CSeqportUtil::ReverseComplement(), and CDelta_item_Base::SetSeq().
void variation::CVariationUtil::FlipStrand | ( | CVariantPlacement & | vp | ) | const |
Flipping a placement involves flipping strand on the seq-loc and swapping the offsets (and signs).
If there's a seq-literal, it is reverse-complemented.
Definition at line 2074 of file variation_util2.cpp.
References CSeq_literal_Base::GetLength(), CVariantPlacement_Base::GetSeq(), CVariantPlacement_Base::IsSetSeq(), CSeq_literal_Base::IsSetSeq_data(), CVariantPlacement_Base::ResetStart_offset(), CVariantPlacement_Base::ResetStart_offset_fuzz(), CVariantPlacement_Base::ResetStop_offset(), CVariantPlacement_Base::ResetStop_offset_fuzz(), CSeqportUtil::ReverseComplement(), CVariantPlacement_Base::SetLoc(), CVariantPlacement_Base::SetSeq(), CVariantPlacement_Base::SetStart_offset(), CVariantPlacement_Base::SetStart_offset_fuzz(), CVariantPlacement_Base::SetStop_offset(), CVariantPlacement_Base::SetStop_offset_fuzz(), and tmp.
void variation::CVariationUtil::FlipStrand | ( | CVariation & | v | ) | const |
Other utility methods:
Flipping strand involves flipping all placements, and insts. Note: for insertions, the placement(s) must be dinucleotide where insertion occurs, such that semantic correctness is maintained.
Definition at line 2138 of file variation_util2.cpp.
References eUnknown, CVariation_Base::GetData(), CVariation_Base::C_Data::GetInstance(), CVariation::Index(), CVariation_Base::C_Data::IsInstance(), CVariation_Base::C_Data::IsSet(), CVariation_Base::IsSetPlacements(), NCBI_THROW, NON_CONST_ITERATE, s_IsInstStrandFlippable(), CVariation_Base::SetData(), and CVariation_Base::SetPlacements().
Referenced by ChangeToDelins(), FlipStrand(), and TranslateNAtoAA().
void variation::CVariationUtil::FlipStrand | ( | CVariation_inst & | vi | ) | const |
Flip strand on delta-items and reverse the order.
Definition at line 2182 of file variation_util2.cpp.
References FlipStrand(), CVariation_inst_Base::IsSetDelta(), NON_CONST_ITERATE, and CVariation_inst_Base::SetDelta().
TSeqPos variation::CVariationUtil::GetEffectiveTranscriptLength | ( | const CBioseq_Handle & | bsh | ) |
Length up to last position of the last exon (i.e.
not including polyA) If neither is annotated, return normal length
Definition at line 3281 of file variation_util2.cpp.
References CVariantPlacement_Base::eMol_cdna, CVariantPlacement_Base::eMol_rna, CSeqFeatData::eSubtype_exon, CSeqFeatData::eSubtype_polyA_site, CSeq_feat_Handle::GetData(), CBioseq_Handle::GetInst_Length(), CMappedFeat::GetLocation(), GetMolType(), CBioseq_Handle::GetSeqId(), GetStop(), CSeqFeatData::GetSubtype(), SAnnotSelector::IncludeFeatSubtype(), max(), and NULL.
Referenced by variation::CHgvsParser::x_general_pos(), and x_SetVariantPropertiesForIntronic().
CRef< CSeq_literal > variation::CVariationUtil::GetLiteralAtLoc | ( | const CSeq_loc & | loc | ) |
Definition at line 1617 of file variation_util2.cpp.
References x_GetLiteralAtLoc().
CVariantPlacement::TMol variation::CVariationUtil::GetMolType | ( | const CSeq_id & | id | ) |
Definition at line 1163 of file variation_util2.cpp.
References CSeq_id::eAcc_refseq_chromosome, CSeq_id::eAcc_refseq_contig, CSeq_id::eAcc_refseq_genomic, CSeq_id::eAcc_refseq_mrna, CSeq_id::eAcc_refseq_mrna_predicted, CSeq_id::eAcc_refseq_ncrna, CSeq_id::eAcc_refseq_ncrna_predicted, CSeq_id::eAcc_refseq_prot, CSeq_id::eAcc_refseq_prot_predicted, CSeq_id::eAcc_refseq_wgs_intermed, CMolInfo_Base::eBiomol_cRNA, CMolInfo_Base::eBiomol_genomic, CMolInfo_Base::eBiomol_genomic_mRNA, CMolInfo_Base::eBiomol_mRNA, CMolInfo_Base::eBiomol_ncRNA, CMolInfo_Base::eBiomol_other_genetic, CMolInfo_Base::eBiomol_peptide, CMolInfo_Base::eBiomol_pre_RNA, CMolInfo_Base::eBiomol_rRNA, CMolInfo_Base::eBiomol_scRNA, CMolInfo_Base::eBiomol_snoRNA, CMolInfo_Base::eBiomol_snRNA, CMolInfo_Base::eBiomol_tmRNA, CMolInfo_Base::eBiomol_transcribed_RNA, CMolInfo_Base::eBiomol_tRNA, CBioSource_Base::eGenome_mitochondrion, CVariantPlacement_Base::eMol_cdna, CVariantPlacement_Base::eMol_genomic, CVariantPlacement_Base::eMol_mitochondrion, CVariantPlacement_Base::eMol_protein, CVariantPlacement_Base::eMol_rna, CVariantPlacement_Base::eMol_unknown, CSeq_descr_Base::Get(), GetAccession(), CMolInfo_Base::GetBiomol(), CScope::GetBioseqHandle(), CSeq_entry_Handle::GetDescr(), CBioSource_Base::GetGenome(), GetMolInfo(), CSeqdesc_Base::GetSource(), CBioseq_Handle::GetTopLevelEntry(), CSeq_entry_Handle::IsSetDescr(), CBioSource_Base::IsSetGenome(), CSeqdesc_Base::IsSource(), ITERATE, m_scope, and NStr::StartsWith().
Referenced by AsVariation(), GetEffectiveTranscriptLength(), TranslateNAtoAA(), x_InferNAfromAA(), and x_Remap().
CRef< CVariation > variation::CVariationUtil::InferNAfromAA | ( | const CVariation & | prot_variation, |
TAA2NAFlags | flags = fAA2NA_default |
||
) |
Definition at line 1601 of file variation_util2.cpp.
References CheckAmbiguitiesInLiterals(), flags, s_FactorOutPlacements(), v2, and x_InferNAfromAA().
Referenced by RemapToAnnotatedTarget().
CRef< CVariantPlacement > variation::CVariationUtil::Remap | ( | const CVariantPlacement & | p, |
const CSeq_align & | aln, | ||
bool | check_placements = true |
||
) |
Methods to remap a VariantPlacement.
Remap using provided alignment. Ids of at least one row must match. When remapping between transcript/genomic coordiane systems, this method should be used instead of the mapper-based, as if the location is intronic, the method will use the spliced-alignment to create or resolve offset-placement as appropriate.
RSNP-2558 - Sometimes we don't need to check the validity of resulting placements, so this costly step can be skipped
Definition at line 492 of file variation_util2.cpp.
References CSeq_id::AsFastaString(), CSerialObject::Assign(), AttachSeq(), CheckExonBoundary(), CheckPlacement(), variation::CreateException(), CVariationException_Base::eCode_hgvs_exon_boundary, CVariationException_Base::eCode_hgvs_exon_boundary_induced, CVariationException_Base::eCode_mismatches_in_mapping, CVariationException_Base::eCode_source_location_overhang, eExtreme_Biological, eFail, CVariantPlacement_Base::ePlacement_method_projected, CSerialObject::Equals(), eUnknown, CSpliced_seg_Base::GetGenomic_id(), CSeq_loc::GetId(), CSeq_literal_Base::GetLength(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetPlacement_method(), CSeq_align_Base::GetSegs(), CVariantPlacement_Base::GetSeq(), CSeq_literal_Base::GetSeq_data(), CSeq_align::GetSeq_id(), CSeq_align::GetSeqStart(), CSeq_align::GetSeqStop(), CSeq_align_Base::C_Segs::GetSpliced(), CSeq_loc::GetStart(), CVariantPlacement_Base::GetStart_offset(), CSeq_loc::GetStop(), CVariantPlacement_Base::GetStop_offset(), i, IsSameBioseq(), CVariantPlacement_Base::IsSetPlacement_method(), CVariantPlacement_Base::IsSetSeq(), CSeq_literal_Base::IsSetSeq_data(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), CSeq_align_Base::C_Segs::IsSpliced(), msg(), NCBI_THROW, NULL, s_AddIntronicOffsets(), s_ResolveIntronicOffsets(), CVariantPlacement_Base::SetExceptions(), CSeq_loc_Mapper_Base::SetMergeAll(), thr, CSeq_data_Base::Which(), and x_Remap().
Referenced by RemapToAnnotatedTarget().
CRef< CVariantPlacement > variation::CVariationUtil::Remap | ( | const CVariantPlacement & | p, |
CSeq_loc_Mapper & | mapper | ||
) |
Definition at line 859 of file variation_util2.cpp.
References AttachSeq(), CheckPlacement(), variation::CreateException(), CVariationException_Base::eCode_mismatches_in_mapping, CVariantPlacement_Base::eMol_genomic, CVariantPlacement_Base::eMol_unknown, CSerialObject::Equals(), CSeq_literal_Base::GetLength(), CVariantPlacement_Base::GetMol(), CVariantPlacement_Base::GetSeq(), CSeq_literal_Base::GetSeq_data(), CVariantPlacement_Base::IsSetSeq(), CSeq_literal_Base::IsSetSeq_data(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), MSerial_AsnText, NCBI_USER_THROW, NcbiCerr, CVariantPlacement_Base::SetExceptions(), CSeq_data_Base::Which(), and x_Remap().
CRef< CVariantPlacement > variation::CVariationUtil::RemapToAnnotatedTarget | ( | const CVariation & | v, |
const CSeq_id & | target | ||
) |
Remap variation from product coordinates onto a nucleotide sequence on which this product is annotated.
e.g. {NM,NR,NP} -> {NG,NT,NW,AC,NC}. Use annotated seq-align, if available; otherwise use spliced rna or cdregion. If starting from NP, remap to the parent mRNA first.
Definition at line 633 of file variation_util2.cpp.
References CSeq_loc::Assign(), variation::ChangeIdsInPlace(), variation::CreateSplicedSeqAlignFromFeat(), CSeqFeatData_Base::e_Rna, CSeq_id::eAcc_refseq_contig, CSeq_id::eAcc_refseq_contig_ncbo, CSeq_id::eAcc_refseq_wgs_intermed, CSeq_id::eAcc_refseq_wgs_nuc, eGetId_ForceAcc, eGetId_ForceGi, CVariantPlacement_Base::eMol_genomic, CVariantPlacement_Base::eMol_protein, CVariantPlacement_Base::eMol_unknown, CSerialObject::Equals(), CSeq_loc_Mapper::eSeqMap_Up, CSeq_loc::fSortAndMerge_All, CScope::GetBioseqHandle(), CVariation_Base::GetData(), GetId(), CSeq_loc::GetId(), CVariantPlacement_Base::GetLoc(), CMappedFeat::GetLocation(), CMappedFeat::GetMappedFeature(), CVariantPlacement_Base::GetMol(), CVariation_Base::GetPlacements(), CMappedFeat::GetProduct(), CBioseq_Handle::GetRangeSeq_loc(), CSeq_align::GetSeq_id(), CSeq_id_Handle::GetSeqId(), CVariation_Base::C_Data::GetSet(), CVariation_Base::C_Data::C_Set::GetVariations(), CSeq_id_Handle::IdentifyAccession(), SAnnotSelector::IncludeFeatType(), InferNAfromAA(), IsSameBioseq(), CVariation_Base::C_Data::IsSet(), CVariation_Base::IsSetPlacements(), CSeq_feat_Handle::IsSetProduct(), ITERATE, m_scope, NULL, Remap(), CRef< C, Locker >::Reset(), result, Seq_loc_Merge(), SAnnotSelector::SetAdaptiveDepth(), SAnnotSelector::SetResolveAll(), and v2.
|
staticprivate |
Definition at line 4419 of file variation_util2.cpp.
References variation::CreateDeltaForOffset(), CVariantPlacement_Base::GetStart_offset(), CVariantPlacement_Base::GetStart_offset_fuzz(), CVariantPlacement_Base::GetStop_offset(), CVariantPlacement_Base::GetStop_offset_fuzz(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStart_offset_fuzz(), CVariantPlacement_Base::IsSetStop_offset(), CVariantPlacement_Base::IsSetStop_offset_fuzz(), NULL, and CVariation_inst_Base::SetDelta().
Referenced by x_AsVariation_ref().
|
staticprivate |
If start|stop don't fall into an exon, adjust start|stop to the closest exon boundary and add offset to inst. This is to be applied before remapping a genomic variation to transcript coordinates
Definition at line 394 of file variation_util2.cpp.
References abs, eExtreme_Positional, eNa_strand_minus, eUnknown, CSeq_loc::fMerge_SingleRange, CSpliced_seg_Base::GetExons(), CSpliced_exon_Base::GetGenomic_end(), CSpliced_seg_Base::GetGenomic_id(), CSpliced_exon_Base::GetGenomic_start(), CSeq_loc::GetId(), CVariantPlacement_Base::GetLoc(), CSeq_loc::GetStart(), CSeq_loc::GetStop(), CSeq_loc::GetStrand(), CSeq_loc_Base::IsInt(), CSeq_loc_Base::IsPnt(), IsSameBioseq(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStart_offset_fuzz(), CVariantPlacement_Base::IsSetStop_offset(), CVariantPlacement_Base::IsSetStop_offset_fuzz(), ITERATE, NCBI_THROW, NULL, offset, Seq_loc_Merge(), CSeq_loc::SetInt(), CVariantPlacement_Base::SetLoc(), CVariantPlacement_Base::SetStart_offset(), and CVariantPlacement_Base::SetStop_offset().
Referenced by Remap().
|
staticprivate |
Definition at line 3039 of file variation_util2.cpp.
References CDbtag_Base::GetDb(), CObject_id_Base::GetId(), CDbtag_Base::GetTag(), CObject_id_Base::IsId(), ITERATE, CDbtag_Base::SetDb(), CVariantPlacement_Base::SetDbxrefs(), and CDbtag_Base::SetTag().
Referenced by SetPlacementProperties().
|
private |
Definition at line 1335 of file variation_util2.cpp.
References ITERATE, s_CountMatches(), and s_UntranslateProt().
Referenced by x_InferNAfromAA().
|
staticprivate |
join two seq-literals
Definition at line 1695 of file variation_util2.cpp.
References a, CSeqportUtil::Append(), CSerialObject::Assign(), b, CInt_fuzz_Base::eLim_unk, CSeq_literal_Base::SetFuzz(), CSeq_literal_Base::SetLength(), and CSeq_literal_Base::SetSeq_data().
Referenced by s_SpliceLiterals(), and x_AdjustDelinsToInterval().
|
staticprivate |
Definition at line 1373 of file variation_util2.cpp.
References eUnknown, i, ITERATE, and NCBI_THROW.
Referenced by x_InferNAfromAA().
|
staticprivate |
Definition at line 4650 of file variation_util2.cpp.
References CDelta_item_Base::eAction_offset, CVariation_Base::GetData(), CVariation_inst_Base::GetDelta(), variation::GetFuzz(), CVariation_Base::C_Data::GetInstance(), variation::GetSignedOffset(), CVariation_Base::C_Data::IsInstance(), CVariation_Base::C_Data::IsSet(), NON_CONST_ITERATE, CVariation_Base::SetData(), CVariantPlacement_Base::SetStart_offset(), CVariantPlacement_Base::SetStart_offset_fuzz(), CVariantPlacement_Base::SetStop_offset(), and CVariantPlacement_Base::SetStop_offset_fuzz().
Referenced by AsVariation().
|
staticprivate |
Definition at line 1324 of file variation_util2.cpp.
References a, b, count, i, and min().
Referenced by s_CalcPrecursorVariationCodon().
|
static |
If at any level in variation-set all variations have all same placements, move them to the parent level.
Definition at line 2945 of file variation_util2.cpp.
References variation::Equals(), CVariation_Base::GetData(), CVariation_Base::C_Data::IsSet(), NON_CONST_ITERATE, NULL, ok, CVariation_Base::SetData(), CVariation_Base::SetPlacements(), and v2.
Referenced by InferNAfromAA(), and variation::CHgvsParser::x_root().
|
staticprivate |
Definition at line 2899 of file variation_util2.cpp.
References CVariation_inst_Base::eObservation_asserted, CVariation_Base::GetData(), CVariation_inst_Base::GetDelta(), CVariation_Base::C_Data::GetInstance(), CVariation_inst_Base::GetObservation(), CVariation::GetParent(), CVariation_Base::C_Data::GetSet(), CVariation_Base::C_Data::C_Set::GetVariations(), CVariation_Base::C_Data::IsInstance(), CVariation_Base::C_Data::IsSet(), CVariation_inst_Base::IsSetObservation(), ITERATE, and NULL.
|
static |
Find attached consequence variation in v that corresponds to p (has same seq-id).
Definition at line 2998 of file variation_util2.cpp.
References CSerialObject::Equals(), CVariation_Base::GetConsequence(), CVariation_Base::GetData(), CSeq_loc::GetId(), CVariantPlacement_Base::GetLoc(), CVariation_Base::C_Data::GetSet(), CVariation_Base::C_Data::C_Set::GetVariations(), CVariation_Base::C_Data::IsSet(), CVariation_Base::IsSetConsequence(), ITERATE, NULL, and CConstRef< C, Locker >::Reset().
|
staticprivate |
Call s_GetPlacements and find first seq-literal in any of them.
Definition at line 2886 of file variation_util2.cpp.
References CVariantPlacement_Base::GetSeq(), CVariantPlacement_Base::IsSetSeq(), ITERATE, NULL, and s_GetPlacements().
Referenced by x_FindOrCreateLiteral().
|
static |
Definition at line 3197 of file variation_util2.cpp.
References set< Key, Compare >::begin(), copy(), CSeq_loc_CI::eEmpty_Skip, eExtreme_Positional, set< Key, Compare >::end(), CSeq_loc_CI::eOrder_Biological, eSO_2KB_upstream_variant, eSO_3_prime_UTR_variant, eSO_500B_downstream_variant, eSO_5_prime_UTR_variant, eSO_coding_sequence_variant, eSO_initiator_codon_variant, eSO_intron_variant, eSO_nc_transcript_variant, eSO_splice_acceptor_variant, eSO_splice_donor_variant, eSO_terminator_codon_variant, CSeq_loc::GetStop(), i, set< Key, Compare >::insert(), variation::CVariationUtil::CVariantPropertiesIndex::s_GetIntronsAndSpliceSiteLocs(), variation::CVariationUtil::CVariantPropertiesIndex::s_GetNeighborhoodLocs(), variation::CVariationUtil::CVariantPropertiesIndex::s_GetStartAndStopCodonsLocs(), and variation::CVariationUtil::CVariantPropertiesIndex::s_GetUTRLocs().
Referenced by FindLocationProperties().
|
static |
Definition at line 136 of file variation_util2.cpp.
References GetLength(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetStart_offset(), CVariantPlacement_Base::GetStop_offset(), CSeq_loc_Base::IsPnt(), CVariantPlacement_Base::IsSetStart_offset(), and CVariantPlacement_Base::IsSetStop_offset().
Referenced by AttachSeq(), s_IsInstStrandFlippable(), variation::CHgvsParser::x_deletion(), variation::CHgvsParser::x_delins(), variation::CHgvsParser::x_duplication(), variation::CHgvsParser::x_GetInstLength(), variation::CHgvsParser::x_insertion(), variation::CHgvsParser::x_location(), variation::CHgvsParser::x_nuc_subst(), variation::CHgvsParser::x_PlacementCoordsToStr(), variation::CHgvsParser::x_range(), and x_Remap().
|
static |
If this variation has placements defined, return it; otherwise, recursively try parent all the way to the root; return NULL if nothing found. Precondition: root Variation must have been indexed (links to parents defined as necessary)
Definition at line 2875 of file variation_util2.cpp.
References CVariation::GetParent(), CVariation_Base::GetPlacements(), CVariation_Base::IsSetPlacements(), and NULL.
Referenced by AttachProteinConsequences(), s_FindFirstLiteral(), s_IsInstStrandFlippable(), variation::CHgvsParser::x_AsHgvsExpression(), x_FindOrCreateLiteral(), and x_InferNAfromAA().
|
staticprivate |
Definition at line 2114 of file variation_util2.cpp.
References CDelta_item_Base::eAction_ins_before, CDelta_item_Base::GetAction(), CVariation_Base::GetData(), CVariation_inst_Base::GetDelta(), CVariation_Base::C_Data::GetInstance(), CDelta_item_Base::IsSetAction(), ITERATE, NULL, s_GetLength(), and s_GetPlacements().
Referenced by FlipStrand().
|
staticprivate |
Apply offsets to the variation's location (variation must be inst) E.g. the original variation could be a transcript location with offsets specifying intronic location. After original transcript lociation is remapped, the offsets are to be applied to the remapped location to get absolute offset-free genomic location.
Definition at line 324 of file variation_util2.cpp.
References variation::ApplyOffsetFuzz(), eNa_strand_minus, eUnknown, CSeq_loc::fMerge_SingleRange, CSeq_loc::fSortAndMerge_All, COpenRange< Position >::GetLength(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetStart_offset(), CVariantPlacement_Base::GetStart_offset_fuzz(), CVariantPlacement_Base::GetStop_offset(), CVariantPlacement_Base::GetStop_offset_fuzz(), CSeq_loc::GetStrand(), CSeq_loc::GetTotalRange(), CSeq_loc_Base::IsInt(), CSeq_loc_Base::IsPnt(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStart_offset_fuzz(), CVariantPlacement_Base::IsSetStop_offset(), CVariantPlacement_Base::IsSetStop_offset_fuzz(), MSerial_AsnText, NCBI_THROW, NcbiCerr, NULL, CVariantPlacement_Base::ResetStart_offset(), CVariantPlacement_Base::ResetStart_offset_fuzz(), CVariantPlacement_Base::ResetStop_offset(), CVariantPlacement_Base::ResetStop_offset_fuzz(), Seq_loc_Merge(), CSeq_loc::SetInt(), CVariantPlacement_Base::SetLoc(), and CVariantPlacement_Base::SetStop_offset().
Referenced by Remap().
|
staticprivate |
insert seq-literal payload into ref before pos (pos=0 -> prepend; pos=ref.len -> append)
Definition at line 1719 of file variation_util2.cpp.
References CSerialObject::Assign(), CSeq_literal_Base::GetLength(), CSeqportUtil::Keep(), result, s_CatLiterals(), CSeq_literal_Base::SetLength(), and CSeq_literal_Base::SetSeq_data().
Referenced by ChangeToDelins().
|
staticprivate |
Definition at line 1297 of file variation_util2.cpp.
References codons, eUnknown, CSeqTranslator::fIs5PrimePartial, NCBI_THROW, prot, NStr::ReplaceInPlace(), and CSeqTranslator::Translate().
Referenced by s_CalcPrecursorVariationCodon(), and x_InferNAfromAA().
void variation::CVariationUtil::SetPlacementProperties | ( | CVariantPlacement & | placement | ) |
Methods to compute properties.
Fill location-specific variant-properties for a placement. Attach related GeneID(s) to placement with respect to which the properties are defined.
Definition at line 3057 of file variation_util2.cpp.
References CVariantProperties_Base::eGene_location_intron, CVariantProperties_Base::eGene_location_near_gene_3, CVariantProperties_Base::eGene_location_near_gene_5, CVariantPlacement_Base::eMol_genomic, flags, CScope::GetBioseqHandle(), GetId(), GetLength(), CVariantPlacement_Base::GetLoc(), variation::CVariationUtil::CVariantPropertiesIndex::GetLocationProperties(), CVariantPlacement_Base::GetMol(), CVariantPlacement_Base::GetStart_offset(), CVariantPlacement_Base::GetStop_offset(), i, CVariantPlacement_Base::IsSetGene_location(), CVariantPlacement_Base::IsSetMol(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), ITERATE, m_scope, m_variant_properties_index, NULL, s_AttachGeneIDdbxref(), CVariantPlacement_Base::SetGene_location(), and x_SetVariantPropertiesForIntronic().
Referenced by SetVariantProperties().
void variation::CVariationUtil::SetVariantProperties | ( | CVariation & | v | ) |
Definition at line 3356 of file variation_util2.cpp.
References Begin(), CVariantPlacement_Base::GetGene_location(), CVariation::Index(), NON_CONST_ITERATE, SetPlacementProperties(), and v2.
CRef< CVariation > variation::CVariationUtil::TranslateNAtoAA | ( | const CVariation_inst & | nuc_inst, |
const CVariantPlacement & | p, | ||
const CSeq_feat & | cds_feat | ||
) |
Evaluate protein effect of a single-inst @ single-placement.
Two placements will be added: The protein placement, and an additional placement on the original nucleotide level, representing the location and sequence of affected codons.
The inst will be at the nucleotide level (describe variant codons). Rationale: the user may want to know the codons, or translate it to AA if necessary.
Only a subset of sequence edits is supported (mismatch, ins, del, indel) Nuc-variation's placement must fall within cds-feat location.
Definition at line 2387 of file variation_util2.cpp.
References abs, CSerialObject::Assign(), AttachSeq(), variation::CalcEffectForProt(), variation::CalcInstTypeForAA(), variation::CalcSOTermsForProt(), variation::ChangeIdsInPlace(), ChangeToDelins(), variation::Contains(), copy(), CreateFlankLocs(), variation::CreateUnknownProtConsequenceVariation(), variation::CVariationUtil::SFlankLocs::downstream, CDelta_item_Base::eAction_del_at, CDelta_item_Base::eAction_ins_before, CVariantProperties_Base::eEffect_frameshift, eExtreme_Biological, eGetId_ForceAcc, CSeq_loc_Mapper_Base::eLocationToProduct, CVariantPlacement_Base::eMol_mitochondrion, CSeq_loc_Mapper_Base::eProductToLocation, eUnknown, FlipStrand(), CSeq_loc::fMerge_SingleRange, CSeq_loc::fSortAndMerge_All, CAliasBase< TPrim >::Get(), variation::GetCommonPrefixLen(), variation::GetCommonSuffixLen(), GetId(), CSeq_data_Base::GetIupacna(), GetLength(), CSeq_literal_Base::GetLength(), CDelta_item_Base::C_Seq::GetLiteral(), CVariantPlacement_Base::GetLoc(), CSeq_feat_Base::GetLocation(), CVariantPlacement_Base::GetMol(), GetMolType(), CDelta_item_Base::GetSeq(), CSeq_literal_Base::GetSeq_data(), CSeq_loc::GetStart(), GetStrand(), variation::HasProblematicExceptions(), CSeq_loc::Intersect(), CDelta_item_Base::C_Seq::IsLiteral(), CSeq_loc_Base::IsNull(), CRef< C, Locker >::IsNull(), IsSameBioseq(), CSeq_literal_Base::IsSetSeq_data(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), literal(), m_scope, CSeq_loc_Mapper_Base::Map(), min(), MSerial_AsnText, NCBI_THROW, NcbiCerr, NULL, CRef< C, Locker >::Reset(), CVariantPlacement_Base::ResetSeq(), SameOrientation(), Seq_loc_Add(), Seq_loc_Merge(), CVariantPlacement_Base::SetFrame(), CSeq_loc::SetId(), CSeq_loc::SetInt(), CVariantPlacement_Base::SetLoc(), CVariantPlacement_Base::SetMol(), CVariantPlacement_Base::SetSeq(), variation::Translate(), x_AdjustDelinsToInterval(), and x_GetLiteralAtLoc().
Referenced by AttachProteinConsequences().
|
private |
Extend delins to specified location (adjust location and delta)
Precondition: -variation must be a inst-type normalized delins (via x_ChangeToDelins) -loc must be a superset of variation's location.
Definition at line 2196 of file variation_util2.cpp.
References CSeq_loc::Assign(), Begin(), delta(), eExtreme_Positional, eNa_strand_minus, eUnknown, CSeq_loc::fMerge_SingleRange, CSeq_loc::fSortAndMerge_All, CVariation_inst_Base::GetDelta(), GetLength(), CVariation_Base::GetPlacements(), GetStart(), GetStop(), GetStrand(), CVariation_Base::IsSetPlacements(), NCBI_THROW, NULL, s_CatLiterals(), Seq_loc_Merge(), Seq_loc_Subtract(), CVariation_inst_Base::SetDelta(), CSeq_loc::SetInt(), CSeq_loc::SetNull(), CVariation_Base::SetPlacements(), CSeq_loc::Subtract(), swap(), CSeq_loc_Base::Which(), and x_GetLiteralAtLoc().
Referenced by TranslateNAtoAA().
|
private |
Definition at line 4477 of file variation_util2.cpp.
References CSerialObject::Assign(), eUnknown, CVariation_ref_Base::GetConsequence(), CVariation_ref_Base::GetData(), CVariation_ref_Base::GetDescription(), CVariation_ref_Base::GetId(), CVariation_ref_Base::C_Data::GetInstance(), CVariation_ref_Base::GetMethod(), CVariation_ref_Base::C_Data::C_Set::GetName(), CVariation_ref_Base::GetName(), CVariation_ref_Base::C_Data::GetNote(), CVariation_ref_Base::GetOther_ids(), CVariation_ref_Base::GetParent_id(), CVariation_ref_Base::GetPhenotype(), CVariation_ref_Base::GetSample_id(), CVariation_ref_Base::C_Data::GetSet(), CVariation_ref_Base::GetSomatic_origin(), CVariation_ref_Base::GetSynonyms(), CVariation_ref_Base::C_Data::C_Set::GetType(), CVariation_ref_Base::GetVariant_prop(), CVariation_ref_Base::C_Data::C_Set::GetVariations(), CVariation_ref_Base::C_Data::IsComplex(), CVariation_ref_Base::C_Data::IsInstance(), CVariation_ref_Base::C_Data::IsNote(), CVariation_ref_Base::C_Data::IsSet(), CVariation_ref_Base::IsSetConsequence(), CVariation_ref_Base::IsSetDescription(), CVariation_ref_Base::IsSetId(), CVariation_ref_Base::IsSetMethod(), CVariation_ref_Base::C_Data::C_Set::IsSetName(), CVariation_ref_Base::IsSetName(), CVariation_ref_Base::IsSetOther_ids(), CVariation_ref_Base::IsSetParent_id(), CVariation_ref_Base::IsSetPhenotype(), CVariation_ref_Base::IsSetSample_id(), CVariation_ref_Base::IsSetSomatic_origin(), CVariation_ref_Base::IsSetSynonyms(), CVariation_ref_Base::IsSetVariant_prop(), CVariation_ref_Base::C_Data::IsUniparental_disomy(), CVariation_ref_Base::C_Data::IsUnknown(), ITERATE, NCBI_THROW, SerialClone(), CVariation_Base::SetFrameshift(), CVariation_Base::C_Data::C_Set::SetName(), CVariation_Base::C_Data::C_Set::SetType(), and CVariation_Base::C_Data::C_Set::SetVariations().
Referenced by AsVariation().
|
private |
Definition at line 4242 of file variation_util2.cpp.
References CSerialObject::Assign(), eUnknown, CVariation_Base::GetConsequence(), CVariation_Base::GetData(), CVariation_Base::GetDescription(), CVariation_Base::GetFrameshift(), CVariation_Base::GetId(), CVariation_Base::C_Data::GetInstance(), CVariation_Base::GetMethod(), CVariationMethod_Base::GetMethod(), CVariation_Base::C_Data::C_Set::GetName(), CVariation_Base::GetName(), CVariation_Base::C_Data::GetNote(), CVariation_Base::GetOther_ids(), CVariation_Base::GetParent_id(), CVariation_Base::C_Frameshift::GetPhase(), CVariation_Base::GetPhenotype(), CVariation_Base::GetSample_id(), CVariation_Base::C_Data::GetSet(), CVariation_Base::GetSomatic_origin(), CVariation_Base::GetSynonyms(), CVariation_Base::C_Data::C_Set::GetType(), CVariation_Base::GetVariant_prop(), CVariation_Base::C_Data::C_Set::GetVariations(), CVariation_Base::C_Frameshift::GetX_length(), CVariation_Base::C_Data::IsComplex(), CVariation_Base::C_Data::IsInstance(), CVariation_Base::C_Data::IsNote(), CVariation_Base::C_Data::IsSet(), CVariation_Base::IsSetConsequence(), CVariation_Base::IsSetDescription(), CVariation_Base::IsSetFrameshift(), CVariation_Base::IsSetId(), CVariation_Base::IsSetMethod(), CVariation_Base::C_Data::C_Set::IsSetName(), CVariation_Base::IsSetName(), CVariation_Base::IsSetOther_ids(), CVariation_Base::IsSetParent_id(), CVariation_Base::C_Frameshift::IsSetPhase(), CVariation_Base::IsSetPhenotype(), CVariation_Base::IsSetSample_id(), CVariation_Base::IsSetSomatic_origin(), CVariation_Base::IsSetSynonyms(), CVariation_Base::IsSetVariant_prop(), CVariation_Base::C_Frameshift::IsSetX_length(), CVariation_Base::C_Data::IsUniparental_disomy(), CVariation_Base::C_Data::IsUnknown(), ITERATE, NCBI_THROW, s_AddInstOffsetsFromPlacementOffsets(), SerialClone(), CVariation_ref_Base::C_Data::C_Set::SetName(), CVariation_ref_Base::C_Data::C_Set::SetType(), and CVariation_ref_Base::C_Data::C_Set::SetVariations().
Referenced by AsVariation_feats().
|
private |
|
private |
Definition at line 2272 of file variation_util2.cpp.
References variation::ChangeIdsInPlace(), eGetId_ForceAcc, m_scope, CVariantPlacement_Base::SetLoc(), and CVariantPlacement_Base::SetMol().
|
private |
Definition at line 1748 of file variation_util2.cpp.
References CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), ITERATE, literal(), s_FindFirstLiteral(), s_GetPlacements(), and x_GetLiteralAtLoc().
Referenced by ChangeToDelins().
|
private |
Definition at line 1641 of file variation_util2.cpp.
References CSeqVector::begin(), CBioseq_Handle::eCoding_Iupac, eExtreme_Positional, CSeqVector::end(), CSeq_loc::fMerge_SingleRange, CScope::GetBioseqHandle(), variation::CVariationUtil::CCdregionIndex::GetCachedLiteralAtLoc(), GetId(), CBioseq_Handle::GetInst_Length(), CSeq_loc::GetLabel(), GetLength(), CSeqVector::GetSeqData(), CSeq_loc::GetStop(), CSeq_loc::Intersect(), CSeqVector::IsNucleotide(), CSeqVector::IsProtein(), variation::IsRightPartial(), literal(), m_cdregion_index, m_scope, NCBI_RETHROW_SAME, NULL, Seq_loc_Merge(), and CSeq_loc::SetInt().
Referenced by AttachSeq(), ChangeToDelins(), GetLiteralAtLoc(), TranslateNAtoAA(), x_AdjustDelinsToInterval(), and x_FindOrCreateLiteral().
|
private |
Definition at line 1410 of file variation_util2.cpp.
References CSerialObject::Assign(), AttachSeq(), CSeqVector::begin(), variation::ChangeIdsInPlace(), CSeqportUtil::Convert(), delta(), CSeqFeatData_Base::e_Cdregion, CSeq_data_Base::e_Iupacaa, CDelta_item_Base::eAction_morph, CBioseq_Handle::eCoding_Iupac, eGetId_ForceAcc, CVariantPlacement_Base::eMol_protein, CVariantPlacement_Base::eMol_unknown, eNa_strand_minus, CSeqVector::end(), CVariation_inst_Base::eObservation_asserted, CVariation_inst_Base::eObservation_variant, CSeq_loc_Mapper_Base::eProductToLocation, CVariation_inst_Base::eType_mnp, CVariation_inst_Base::eType_snv, eUnknown, fAA2NA_truncate_common_prefix_and_suffix, flags, CSeq_loc::fSortAndMerge_All, CVariation_Base::GetData(), CVariation_inst_Base::GetDelta(), GetId(), CSeq_loc::GetId(), CVariation_Base::C_Data::GetInstance(), CSeq_data_Base::GetIupacaa(), GetLength(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetMol(), GetMolType(), CVariation_inst_Base::GetObservation(), CSeqVector::GetSeqData(), CVariation_Base::C_Data::GetSet(), CSeq_loc::GetStrand(), CVariation_Base::C_Data::C_Set::GetVariations(), CVariation_Base::C_Data::IsInstance(), CSeq_loc_Base::IsInt(), CVariation_Base::C_Data::IsSet(), CVariation_Base::IsSetFrameshift(), CVariantPlacement_Base::IsSetMol(), CVariation_inst_Base::IsSetObservation(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStop_offset(), m_scope, CSeq_loc_Mapper_Base::Map(), NCBI_THROW, NON_CONST_ITERATE, NULL, CRef< C, Locker >::Reset(), CVariation_Base::ResetPlacements(), s_CalcPrecursorVariationCodon(), s_CollapseAmbiguities(), s_GetPlacements(), s_UntranslateProt(), Seq_loc_Merge(), CVariation_Base::SetData(), CVariation_inst_Base::SetDelta(), CSeq_loc::SetInt(), CVariantPlacement_Base::SetLoc(), CVariantPlacement_Base::SetMol(), CVariation_inst_Base::SetObservation(), CVariation_inst_Base::SetType(), and v2.
Referenced by InferNAfromAA().
|
private |
Definition at line 898 of file variation_util2.cpp.
References variation::ChangeIdsInPlace(), variation::CreateException(), CVariationException_Base::eCode_no_mapping, CVariationException_Base::eCode_partial_mapping, CVariationException_Base::eCode_source_location_overhang, CVariationException_Base::eCode_split_mapping, eGetId_ForceAcc, CVariantPlacement_Base::eMol_genomic, CVariantPlacement_Base::eMol_mitochondrion, CVariantPlacement_Base::eMol_unknown, CVariantPlacement_Base::ePlacement_method_projected, CSeq_loc::fMerge_SingleRange, CSeq_loc::fSortAndMerge_All, CSeq_interval_Base::GetFrom(), GetId(), CSeq_loc::GetId(), CSeq_loc_Base::GetInt(), GetLength(), CVariantPlacement_Base::GetLoc(), CVariantPlacement_Base::GetMol(), GetMolType(), CVariantPlacement_Base::GetStart_offset(), CVariantPlacement_Base::GetStart_offset_fuzz(), CVariantPlacement_Base::GetStop_offset(), CVariantPlacement_Base::GetStop_offset_fuzz(), CSeq_loc_Base::IsEmpty(), CSeq_loc_Base::IsInt(), CSeq_loc_Base::IsMix(), CSeq_loc_Base::IsNull(), CSeq_loc_Base::IsPacked_int(), CSeq_loc_Base::IsPnt(), CSeq_interval_Base::IsSetFuzz_from(), CSeq_interval_Base::IsSetFuzz_to(), CVariantPlacement_Base::IsSetStart_offset(), CVariantPlacement_Base::IsSetStart_offset_fuzz(), CVariantPlacement_Base::IsSetStop_offset(), CVariantPlacement_Base::IsSetStop_offset_fuzz(), m_scope, CSeq_loc_Mapper_Base::Map(), NULL, CRef< C, Locker >::Reset(), s_GetLength(), Seq_loc_Merge(), CSeq_loc::SetEmpty(), CVariantPlacement_Base::SetExceptions(), CSeq_loc::SetInt(), CVariantPlacement_Base::SetLoc(), CVariantPlacement_Base::SetMol(), CVariantPlacement_Base::SetPlacement_method(), CVariantPlacement_Base::SetStart_offset(), CVariantPlacement_Base::SetStart_offset_fuzz(), CVariantPlacement_Base::SetStop_offset(), CVariantPlacement_Base::SetStop_offset_fuzz(), and CSeq_loc_Base::Which().
Referenced by Remap().
|
private |
|
private |
Definition at line 3309 of file variation_util2.cpp.
References eExtreme_Positional, CVariantProperties_Base::eGene_location_acceptor, CVariantProperties_Base::eGene_location_donor, CVariantProperties_Base::eGene_location_intergenic, CVariantProperties_Base::eGene_location_intron, CVariantProperties_Base::eGene_location_near_gene_3, CVariantProperties_Base::eGene_location_near_gene_5, eNa_strand_minus, GetEffectiveTranscriptLength(), CVariantPlacement_Base::GetGene_location(), CSeq_loc::GetStart(), CSeq_loc::GetStop(), GetStrand(), CVariantPlacement_Base::IsSetGene_location(), NULL, offset, CVariantPlacement_Base::ResetGene_location(), and CVariantPlacement_Base::SetGene_location().
Referenced by SetPlacementProperties().
|
private |
|
private |
Definition at line 491 of file variation_util2.hpp.
Referenced by AttachProteinConsequences(), ClearCache(), and x_GetLiteralAtLoc().
Definition at line 489 of file variation_util2.hpp.
Referenced by AttachProteinConsequences(), AttachSeq(), CheckExonBoundary(), CheckPlacement(), CreateFlankLocs(), FindLocationProperties(), variation::CVariationUtil::CCdregionIndex::Get(), variation::CVariationUtil::CCdregionIndex::GetCachedLiteralAtLoc(), GetMolType(), RemapToAnnotatedTarget(), SetPlacementProperties(), TranslateNAtoAA(), variation::CVariationUtil::CCdregionIndex::x_CacheSeqData(), x_CreateUnknownVariation(), x_GetLiteralAtLoc(), variation::CVariationUtil::CCdregionIndex::x_Index(), variation::CVariationUtil::CVariantPropertiesIndex::x_Index(), x_InferNAfromAA(), and x_Remap().
|
private |
Definition at line 490 of file variation_util2.hpp.
Referenced by ClearCache(), and SetPlacementProperties().