NCBI C++ ToolKit
Public Types | Static Public Member Functions | Static Public Attributes | Static Private Member Functions | List of all members
NSNPVariationHelper Class Reference

Search Toolkit Book for NSNPVariationHelper

set of functions for dealing with SNP represented as variation objects More...

#include <objtools/snputil/snp_utils.hpp>

Public Types

enum  ESNPPropTypes {
  eSNPPropName_Undef , eSNPPropName_GeneLocation , eSNPPropName_Effect , eSNPPropName_Mapping ,
  eSNPPropName_FreqValidation , eSNPPropName_QualityCheck , eSNPPropName_ResourceLink , eSNPPropName_ResourceLinkURL
}
 enums to control getting a string list representation of various CVariantProperties More...
 

Static Public Member Functions

static bool ConvertFeat (CVariation &Variation, const CSeq_feat &SrcFeat)
 legacy SNP feature conversion into a variation object More...
 
static bool ConvertFeat (CVariation_ref &Variation, const CSeq_feat &SrcFeat)
 
static void DecodeBitfield (CVariantProperties &prop, const CSnpBitfield &bf)
 convert SNP bitfield data to respective fields in CVariantProperties More...
 
static void VariantPropAsStrings (list< string > &ResList, const CVariantProperties &prop, ESNPPropTypes ePropType)
 get lists of strings corresponding to a given property type More...
 
template<class TVariation >
static void GetDeltas (list< string > &Alleles, const TVariation *pVariation)
 add alleles to a list of strings from deltas in variation data More...
 

Static Public Attributes

static const string sResourceLink_RsID
 

Static Private Member Functions

template<class TPVariation >
static bool x_CommonConvertFeat (TPVariation pVariation, const CSeq_feat &SrcFeat)
 

Detailed Description

set of functions for dealing with SNP represented as variation objects

Definition at line 249 of file snp_utils.hpp.

Member Enumeration Documentation

◆ ESNPPropTypes

enums to control getting a string list representation of various CVariantProperties

See also
VariantPropAsStrings
Enumerator
eSNPPropName_Undef 
eSNPPropName_GeneLocation 

prop.gene-location

eSNPPropName_Effect 

prop.effect

eSNPPropName_Mapping 

prop.mapping

eSNPPropName_FreqValidation 

prop.frequence-based-validation

eSNPPropName_QualityCheck 

prop.quality-check

eSNPPropName_ResourceLink 

prop.resource-link

eSNPPropName_ResourceLinkURL 

generate URL templates, with one of sResourceLink_ substrings potentially inside

the user should perform correct substitution of sResourceLink_ substring for the actual value an empty string will be inserted into the list when the resource URL is not known the order is guaranteed to be exactly the same as for _ResourceLink for the same prop prop.resource-link

Definition at line 285 of file snp_utils.hpp.

Member Function Documentation

◆ ConvertFeat() [1/2]

bool NSNPVariationHelper::ConvertFeat ( CVariation Variation,
const CSeq_feat SrcFeat 
)
static

legacy SNP feature conversion into a variation object

reads a feature that supposedly contains a SNP record (old, up-to-2012, style, with SNP data encoded as "qual" (alleles) and "ext.data" (bitfield)) and sets Variation to content found in the feature

Parameters
Variationconversion result will be put here, old contents are destroyed upon conversion success
SrcFeatold format feature
Returns
false if a given feature is not a correctly formed SNP feature

Definition at line 336 of file snp_utils.cpp.

References NSnp::GetBitfield(), CSeq_feat_Base::GetLocation(), CSnpBitfield::isGood(), MSerial_AsnText, CUser_object_Base::SetClass(), CUser_field_Base::SetData(), CVariation_Base::SetExt(), CUser_object::SetField(), CVariantPlacement_Base::SetLoc(), CVariation_Base::SetPlacements(), SNP_VAR_EXT_BITFIELD, SNP_VAR_EXT_CLASS, and x_CommonConvertFeat().

Referenced by CTestBMApp::Run().

◆ ConvertFeat() [2/2]

bool NSNPVariationHelper::ConvertFeat ( CVariation_ref Variation,
const CSeq_feat SrcFeat 
)
static
See also
same as the other ConvertFeat(), but result put into variation-ref, placement is lost

Definition at line 359 of file snp_utils.cpp.

References NSnp::GetBitfield(), CSnpBitfield::isGood(), MSerial_AsnText, CVariation_ref::SetExt(), SNP_VAR_EXT_BITFIELD, SNP_VAR_EXT_CLASS, and x_CommonConvertFeat().

◆ DecodeBitfield()

void NSNPVariationHelper::DecodeBitfield ( CVariantProperties prop,
const CSnpBitfield bf 
)
static

convert SNP bitfield data to respective fields in CVariantProperties

Parameters
propThe result will be put here
bfBitfield that will be decoded
Note
Not all of the bitfield bit currently have direct correspondencies within CVariantProperties so they will be lost during the conversion

Definition at line 379 of file snp_utils.cpp.

References CSnpBitfield::e5PctMinorAllele1Plus, CSnpBitfield::e5PctMinorAlleleAll, CSnpBitfield::eAcceptor, CSnpBitfield::eDonor, CVariantProperties_Base::eEffect_frameshift, CVariantProperties_Base::eEffect_missense, CVariantProperties_Base::eEffect_stop_gain, CVariantProperties_Base::eEffect_stop_loss, CVariantProperties_Base::eEffect_synonymous, CSnpBitfield::eFrameshift, CVariantProperties_Base::eFrequency_based_validation_above_5pct_1plus, CVariantProperties_Base::eFrequency_based_validation_above_5pct_all, CVariantProperties_Base::eFrequency_based_validation_is_mutation, CVariantProperties_Base::eFrequency_based_validation_validated, CVariantProperties_Base::eGene_location_acceptor, CVariantProperties_Base::eGene_location_donor, CVariantProperties_Base::eGene_location_in_gene, 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, CVariantProperties_Base::eGenotype_has_genotypes, CVariantProperties_Base::eGenotype_in_haplotype_set, CSnpBitfield::eHasAssemblyConflict, CSnpBitfield::eHasGenotype, CSnpBitfield::eHasGenotypeConflict, CSnpBitfield::eHasLinkOut, CSnpBitfield::eHasMemberSsConflict, CSnpBitfield::eHasOtherSameSNP, CSnpBitfield::eHasProvisionalTPA, CSnpBitfield::eHasSnp3D, CSnpBitfield::eInGene, CSnpBitfield::eInGene3, CSnpBitfield::eInGene5, CSnpBitfield::eInGenotypeKit, CSnpBitfield::eInHaplotypeSet, CSnpBitfield::eIntron, CSnpBitfield::eInUTR3, CSnpBitfield::eInUTR5, CSnpBitfield::eIsAssemblySpecific, CSnpBitfield::eIsClinical, CSnpBitfield::eIsContigAlleleAbsent, CSnpBitfield::eIsMutation, CSnpBitfield::eIsPrecious, CSnpBitfield::eIsStrainSpecific, CSnpBitfield::eIsValidated, CSnpBitfield::eIsWithdrawn, CVariantProperties_Base::eMapping_has_assembly_conflict, CVariantProperties_Base::eMapping_has_other_snp, CVariantProperties_Base::eMapping_is_assembly_specific, CSnpBitfield::eMissense, CVariantProperties_Base::eQuality_check_contig_allele_missing, CVariantProperties_Base::eQuality_check_genotype_conflict, CVariantProperties_Base::eQuality_check_non_overlapping_alleles, CVariantProperties_Base::eQuality_check_strain_specific, CVariantProperties_Base::eQuality_check_withdrawn_by_submitter, CVariantProperties_Base::eResource_link_clinical, CVariantProperties_Base::eResource_link_genotypeKit, CVariantProperties_Base::eResource_link_has3D, CVariantProperties_Base::eResource_link_preserved, CVariantProperties_Base::eResource_link_provisional, CVariantProperties_Base::eResource_link_submitterLinkout, CSnpBitfield::eStopGain, CSnpBitfield::eStopLoss, CSnpBitfield::eSynonymous, CSnpBitfield::GetVersion(), CSnpBitfield::IsTrue(), CVariantProperties_Base::SetEffect(), CVariantProperties_Base::SetFrequency_based_validation(), CVariantProperties_Base::SetGene_location(), CVariantProperties_Base::SetGenotype(), CVariantProperties_Base::SetMapping(), CVariantProperties_Base::SetQuality_check(), CVariantProperties_Base::SetResource_link(), and CVariantProperties_Base::SetVersion().

Referenced by x_CommonConvertFeat().

◆ GetDeltas()

template<class TVariation >
void NSNPVariationHelper::GetDeltas ( list< string > &  Alleles,
const TVariation *  pVariation 
)
inlinestatic

add alleles to a list of strings from deltas in variation data

empty deltas are converted to dashes "-"

Parameters
Alleleslist of strings to the end of which the found deltas will be added, alleles already present in the list are retained
pVariationvariation object from which the deltas are read

Definition at line 329 of file snp_utils.hpp.

References CSeq_literal_Base::CanGetSeq_data(), CDelta_item_Base::C_Seq::e_Literal, CDelta_item_Base::C_Seq::e_This, CAliasBase< TPrim >::Get(), CSeq_data_Base::GetIupacaa(), CSeq_data_Base::GetIupacna(), CDelta_item_Base::C_Seq::GetLiteral(), CSeq_literal_Base::GetSeq_data(), CSeq_data_Base::IsIupacaa(), CSeq_data_Base::IsIupacna(), ITERATE, and CDelta_item_Base::C_Seq::Which().

◆ VariantPropAsStrings()

void NSNPVariationHelper::VariantPropAsStrings ( list< string > &  ResList,
const CVariantProperties prop,
ESNPPropTypes  ePropType 
)
static

get lists of strings corresponding to a given property type

Parameters
ResListwill be reset to the resulting list of strings
propproperty based upon values within which the result will be generated
ePropTypetype of property requested
See also
ESNPPropTypes

Definition at line 536 of file snp_utils.cpp.

References CVariantProperties_Base::CanGetEffect(), CVariantProperties_Base::CanGetFrequency_based_validation(), CVariantProperties_Base::CanGetGene_location(), CVariantProperties_Base::CanGetMapping(), CVariantProperties_Base::CanGetQuality_check(), CVariantProperties_Base::CanGetResource_link(), CVariantProperties_Base::eEffect_down_regulator, CVariantProperties_Base::eEffect_frameshift, CVariantProperties_Base::eEffect_methylation, CVariantProperties_Base::eEffect_missense, CVariantProperties_Base::eEffect_no_change, CVariantProperties_Base::eEffect_nonsense, CVariantProperties_Base::eEffect_stop_gain, CVariantProperties_Base::eEffect_stop_loss, CVariantProperties_Base::eEffect_synonymous, CVariantProperties_Base::eEffect_up_regulator, CVariantProperties_Base::eFrequency_based_validation_above_1pct_1plus, CVariantProperties_Base::eFrequency_based_validation_above_1pct_all, CVariantProperties_Base::eFrequency_based_validation_above_5pct_1plus, CVariantProperties_Base::eFrequency_based_validation_above_5pct_all, CVariantProperties_Base::eFrequency_based_validation_is_mutation, CVariantProperties_Base::eFrequency_based_validation_validated, CVariantProperties_Base::eGene_location_acceptor, CVariantProperties_Base::eGene_location_conserved_noncoding, CVariantProperties_Base::eGene_location_donor, CVariantProperties_Base::eGene_location_in_gene, 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, CVariantProperties_Base::eMapping_has_assembly_conflict, CVariantProperties_Base::eMapping_has_other_snp, CVariantProperties_Base::eMapping_is_assembly_specific, CVariantProperties_Base::eQuality_check_contig_allele_missing, CVariantProperties_Base::eQuality_check_genotype_conflict, CVariantProperties_Base::eQuality_check_non_overlapping_alleles, CVariantProperties_Base::eQuality_check_strain_specific, CVariantProperties_Base::eQuality_check_withdrawn_by_submitter, CVariantProperties_Base::eResource_link_clinical, CVariantProperties_Base::eResource_link_genotypeKit, CVariantProperties_Base::eResource_link_has3D, CVariantProperties_Base::eResource_link_preserved, CVariantProperties_Base::eResource_link_provisional, CVariantProperties_Base::eResource_link_submitterLinkout, eSNPPropName_Effect, eSNPPropName_FreqValidation, eSNPPropName_GeneLocation, eSNPPropName_Mapping, eSNPPropName_QualityCheck, eSNPPropName_ResourceLink, eSNPPropName_ResourceLinkURL, CVariantProperties_Base::GetEffect(), CVariantProperties_Base::GetFrequency_based_validation(), CVariantProperties_Base::GetGene_location(), CVariantProperties_Base::GetMapping(), CVariantProperties_Base::GetQuality_check(), and CVariantProperties_Base::GetResource_link().

◆ x_CommonConvertFeat()

template<class TPVariation >
bool NSNPVariationHelper::x_CommonConvertFeat ( TPVariation  pVariation,
const CSeq_feat SrcFeat 
)
inlinestaticprivate

Member Data Documentation

◆ sResourceLink_RsID

const string NSNPVariationHelper::sResourceLink_RsID
static

Definition at line 281 of file snp_utils.hpp.


The documentation for this class was generated from the following files:
Modified on Tue May 28 05:53:39 2024 by modify_doxy.py rev. 669887