NCBI C++ ToolKit
snp_utils.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: snp_utils.cpp 94067 2021-06-22 14:12:27Z grichenk $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Melvin Quintos, Dmitry Rudnev
27  *
28  * File Description:
29  * Provides implementation of NSnp class. See snp_extra.hpp
30  * for class usage.
31  *
32  */
33 
34 #include <ncbi_pch.hpp>
35 
37 
42 #include <objects/general/Date.hpp>
50 
52 #include <objmgr/seq_vector.hpp>
53 
56 
57 const string NSnp::sm_dbTag_dbSNP("dbSNP");
58 
59 ///////////////////////////////////////////////////////////////////////////////
60 // Public Methods
61 ///////////////////////////////////////////////////////////////////////////////
62 bool NSnp::IsSnp(const CMappedFeat &mapped_feat)
63 {
64  return IsSnp(mapped_feat.GetOriginalFeature());
65 }
66 
67 bool NSnp::IsSnp(const CSeq_feat &feat)
68 {
69  return feat.IsSetData() && feat.GetData().GetSubtype() == CSeqFeatData::eSubtype_variation && GetTag(feat).NotEmpty() && IsSnp(*GetTag(feat));
70 }
71 
72 bool NSnp::IsSnp(const CDbtag& tag)
73 {
74  return tag.GetType() == CDbtag::eDbtagType_dbSNP;
75  }
76 
78 {
79  return SrcFeat.GetNamedDbxref(sm_dbTag_dbSNP);
80 }
81 
83 {
84  return GetTag(SrcFeat.GetOriginalFeature());
85 }
86 
87 
89 {
90  CTime time;
91  CSeq_annot_Handle h = feat.GetAnnot();
92 
93  if (h.Seq_annot_CanGetDesc()) {
94  const CAnnot_descr &desc = h.Seq_annot_GetDesc();
95  if (desc.CanGet()) {
96  ITERATE( CAnnot_descr::Tdata, it, desc.Get() ) {
97  const CRef<CAnnotdesc> &d = *it;
98  if (d->IsCreate_date()) {
99  time = d->GetCreate_date().AsCTime();
100  break;
101  }
102  }
103  }
104  }
105 
106  return time;
107 }
108 
110 {
111  return GetRsid(mapped_feat.GetOriginalFeature());
112 }
113 
115 {
116  CConstRef<CDbtag> ref = GetTag(feat);
117  if (ref) {
118  return GetRsid(*ref);
119  }
120  return 0;
121 }
123 {
124  const auto& dbtag = tag.GetTag();
125  if (dbtag.IsStr() && (string::npos != dbtag.GetStr().find("rs"))) {
126  return NStr::StringToNumeric<NSnp::TRsid>(dbtag.GetStr().substr(2));
127  }
128  else {
129  return dbtag.GetId8();
130  }
131 }
132 
133 int NSnp::GetLength(const CMappedFeat &mapped_feat)
134 {
135  return GetLength(mapped_feat.GetOriginalFeature());
136 }
137 
138 int NSnp::GetLength(const CSeq_feat &feat)
139 {
140  int length = 0;
141 
142  // features pre-SNP 2.0 have length encoded as neighbors in "Extra"
143  if(GetBitfield(feat).GetVersion() < 20) {
144  if (feat.IsSetExt()) {
145  CConstRef<CUser_field> field =
146  feat.GetExt().GetFieldRef("Extra");
147  if (field) {
148  string s1, s2;
149  const string &str = field->GetData().GetStr();
150  if (NStr::SplitInTwo(str, "=", s1, s2)) {
151  vector<string> v;
152 
153  NStr::Split(str, ",", v);
154  if (v.size()==4) {
157  length = rc + lc + 1;
158  }
159  }
160  }
161  }
162  } else {
163  // SNP 2.0 length is feature length
164  if(feat.CanGetLocation()) {
165  length = feat.GetLocation().GetTotalRange().GetLength();
166  }
167  }
168 
169  return length;
170 }
171 
172 string NSnp::ClinSigAsString(const CVariation_ref& var, ELetterCase LetterCase)
173 {
174  ITERATE (CVariation_ref::TPhenotype, pnt_iter, var.GetPhenotype()) {
175  if ((*pnt_iter)->CanGetClinical_significance()) {
176  return ClinSigAsString((*pnt_iter)->GetClinical_significance(), LetterCase);
177  }
178  }
179  return "";
180 }
181 
182 string NSnp::ClinSigAsString(TClinSigID ClinSigID, ELetterCase LetterCase)
183 {
184  string sResult;
185  switch(ClinSigID)
186  {
188  sResult = "Benign";
189  break;
191  sResult = "Likely benign";
192  break;
194  sResult = "Likely pathogenic";
195  break;
197  sResult = "Pathogenic";
198  break;
200  sResult = "Drug response";
201  break;
203  sResult = "Histocompatibility";
204  break;
206  sResult = "Uncertain significance";
207  break;
209  sResult = "Not tested";
210  break;
212  default:
213  sResult = "Other";
214  break;
215  }
216  return LetterCase == eLetterCase_ForceLower ? NStr::ToLower(sResult) : sResult;
217 }
218 
219 
221 {
222  return GetBitfield(mapped_feat.GetOriginalFeature());
223 }
224 
226 {
227  CSnpBitfield b;
228 
229  if(IsSnp(feat)) {
230  b = feat;
231  }
232 
233  return b;
234 }
235 
236 
237 void NSnp::GetAlleles(const CMappedFeat &mapped_feat, TAlleles& Alleles)
238 {
239  GetAlleles(mapped_feat.GetOriginalFeature(), Alleles);
240 }
241 
242 void NSnp::GetAlleles(const CSeq_feat &feat, TAlleles& Alleles, bool isPadding, CBioseq_Handle* bsh)
243 {
244  bool isRefAlleleEmpty{false};
245  bool isAnyAltAlleleEmpty{false};
246 
247  Alleles.clear();
248 
249  if (feat.CanGetQual()) {
250  Alleles.reserve(feat.GetQual().size());
251  ITERATE (CSeq_feat::TQual, it, feat.GetQual()) {
252  const CGb_qual& qual = **it;
253  if (qual.GetQual() == "replace") {
254  string sQualVal(qual.GetVal());
255  Alleles.push_back(sQualVal.empty() ? "-" : sQualVal);
256  if(sQualVal.empty()) {
257  if(it == feat.GetQual().begin()) {
258  isRefAlleleEmpty = true;
259  } else {
260  isAnyAltAlleleEmpty = true;
261  }
262  }
263  }
264  }
265  }
266  if(isPadding && bsh && (isRefAlleleEmpty || isAnyAltAlleleEmpty)) {
267  string sPadding;
268  const CSeq_loc& feat_seq_loc(feat.GetLocation());
269  CSeqVector seq_vector(*bsh, CBioseq_Handle::eCoding_Iupac);
270  int delta(isRefAlleleEmpty ? 0 : -1);
271  if(feat_seq_loc.GetStart(ESeqLocExtremes::eExtreme_Positional) + delta < 0) {
272  seq_vector.GetSeqData(feat_seq_loc.GetStop(ESeqLocExtremes::eExtreme_Positional), feat_seq_loc.GetStop(ESeqLocExtremes::eExtreme_Positional) + 1, sPadding);
273  } else {
274  seq_vector.GetSeqData(feat_seq_loc.GetStart(ESeqLocExtremes::eExtreme_Positional) + delta, feat_seq_loc.GetStart(ESeqLocExtremes::eExtreme_Positional) + delta + 1, sPadding);
275  }
276  for(auto& allele: Alleles) {
277  allele = allele == "-" ? sPadding : sPadding + allele;
278  }
279  }
280 }
281 
282 bool NSnp::IsSnpKnown( CScope &scope, const CMappedFeat &private_snp, const string &allele)
283 {
284  const CSeq_loc &loc = private_snp.GetLocation();
285  return IsSnpKnown(scope, loc, allele);
286 }
287 
288 bool NSnp::IsSnpKnown( CScope& scope, const CSeq_loc& loc, const string & allele)
289 {
290  bool isKnown = false;
291  SAnnotSelector sel; // annotation selector
292 
293  // Prepare Annotation Selection to find the SNPs
294  //sel = CSeqUtils::GetAnnotSelector(CSeqFeatData::eSubtype_variation);
295  sel .SetOverlapTotalRange()
296  .SetResolveAll()
297  .AddNamedAnnots("SNP")
298  .SetExcludeExternal(false)
302  .SetMaxSize(100000); // In case someone does something silly.
303 
304  CFeat_CI feat_it(scope, loc, sel);
305 
306  if (allele == kEmptyStr) {
307  // Don't check for alleles
308  // Existing of any returned SNP means there are known SNPs
309  if (feat_it.GetSize()>0) {
310  isKnown = true;
311  }
312  }
313  else {
314  // Check all the alleles for all the returned SNPs
315  for (; feat_it && !isKnown; ++feat_it) {
316  const CSeq_feat & or_feat = feat_it->GetOriginalFeature();
317  if (or_feat.CanGetQual()) {
318  ITERATE (CSeq_feat::TQual, it, or_feat.GetQual()) {
319  const CRef<CGb_qual> &qual = *it;
320  if (qual->GetQual() == "replace" &&
321  qual->GetVal().find(allele) != string::npos) {
322  isKnown = true;
323  break;
324  }
325  }
326  }
327  }
328  }
329 
330  return isKnown;
331 }
332 
333 
334 const string NSNPVariationHelper::sResourceLink_RsID("%rsid%");
335 
336 bool NSNPVariationHelper::ConvertFeat(CVariation& Variation, const CSeq_feat& SrcFeat)
337 {
338  if(!x_CommonConvertFeat(&Variation, SrcFeat)) {
339  return false;
340  }
342  pPlacement->SetLoc().Assign(SrcFeat.GetLocation());
343  Variation.SetPlacements().push_back(pPlacement);
344 
345  // save a copy of the feature since not every bit
346  // currently is adequately represented in Variation
347  CSnpBitfield bf(NSnp::GetBitfield(SrcFeat));
348  if(bf.isGood()) {
349  CRef<CUser_object> pExt(new CUser_object());
350  CNcbiOstrstream ostr;
351  ostr << MSerial_AsnText << SrcFeat;
354  Variation.SetExt().push_back(pExt);
355  }
356  return true;
357 }
358 
360 {
361  if(!x_CommonConvertFeat(&Variation, SrcFeat)) {
362  return false;
363  }
364  // save a copy of the feature since not every bit
365  // currently is adequately represented in Variation
366  CSnpBitfield bf(NSnp::GetBitfield(SrcFeat));
367  if(bf.isGood()) {
368  CNcbiOstrstream ostr;
369  ostr << MSerial_AsnText << SrcFeat;
370  Variation.SetExt().SetField(SNP_VAR_EXT_BITFIELD).SetData().SetStr(CNcbiOstrstreamToString(ostr));
371  Variation.SetExt().SetClass(SNP_VAR_EXT_CLASS);
372  }
373  return true;
374 }
375 
376 
377 
378 
380 {
381  prop.SetVersion(bf.GetVersion());
382 
383  /// resource link
384  int res_link = 0;
387  }
390  }
393  }
396  }
399  }
402  }
403  if (res_link) {
404  prop.SetResource_link(res_link);
405  }
406 
407  /// gene function
408  int gene_location = 0;
409  if (bf.IsTrue(CSnpBitfield::eInGene)) {
411  }
412  if (bf.IsTrue(CSnpBitfield::eInGene5)) {
414  }
415  if (bf.IsTrue(CSnpBitfield::eInGene3)) {
417  }
418  if (bf.IsTrue(CSnpBitfield::eIntron)) {
420  }
421  if (bf.IsTrue(CSnpBitfield::eDonor)) {
423  }
426  }
427  if (bf.IsTrue(CSnpBitfield::eInUTR5)) {
429  }
430  if (bf.IsTrue(CSnpBitfield::eInUTR3)) {
432  }
433  if (gene_location) {
434  prop.SetGene_location(gene_location);
435  }
436 
437  // effect
438  int effect(0);
441  }
444  }
447  }
450  }
453  }
454  if (effect) {
455  prop.SetEffect(effect);
456  }
457 
458  /// mapping
459  int mapping = 0;
462  }
465  }
468  }
469  if (mapping) {
470  prop.SetMapping(mapping);
471  }
472 
473 
474  /// DEPRECATED
475  /// There is not 1:1 correspondance between Bitfield weight
476  /// and VariantProperties map-weight. See SNP-5729.
477  /// So, I am commenting out. JB Holmes, April 2013
478  /// weight
479  // int weight = bf.GetWeight();
480  // if (weight) {
481  // prop.SetMap_weight(weight);
482  // }
483 
484  /// allele frequency
485  int allele_freq = 0;
488  }
491  }
494  }
497  }
498  if (allele_freq) {
499  prop.SetFrequency_based_validation(allele_freq);
500  }
501 
502  /// genotype
503  int genotype = 0;
506  }
509  }
510  if (genotype) {
511  prop.SetGenotype(genotype);
512  }
513 
514  /// quality checking
515  int qual_check = 0;
518  }
521  }
524  }
527  }
530  }
531  if (qual_check) {
532  prop.SetQuality_check(qual_check);
533  }
534 }
535 
536 void NSNPVariationHelper::VariantPropAsStrings(list<string>& ResList, const CVariantProperties& prop, ESNPPropTypes ePropType)
537 {
538  ResList.clear();
539  switch(ePropType) {
541  if(prop.CanGetGene_location()) {
544  ResList.push_back("In Gene");
546  ResList.push_back("In 5\' Gene");
548  ResList.push_back("In 3\' Gene");
550  ResList.push_back("Intron");
552  ResList.push_back("Donor");
554  ResList.push_back("Acceptor");
556  ResList.push_back("In 5\' UTR");
558  ResList.push_back("In 3\' UTR");
560  ResList.push_back("In Start Codon");
562  ResList.push_back("In Stop Codon");
564  ResList.push_back("Intergenic");
566  ResList.push_back("In Conserved Non-coding region");
567  }
568  break;
569  case eSNPPropName_Effect:
570  if(prop.CanGetEffect()) {
571  CVariantProperties::TEffect effect(prop.GetEffect());
573  ResList.push_back("No change");
574  else {
576  ResList.push_back("Synonymous");
578  ResList.push_back("Nonsense");
580  ResList.push_back("Missense");
582  ResList.push_back("Frameshift");
584  ResList.push_back("Up-regulator");
586  ResList.push_back("Down-regulator");
588  ResList.push_back("Methylation");
590  ResList.push_back("Stop-gain");
592  ResList.push_back("Stop-loss");
593  }
594  }
595  break;
597  if(prop.CanGetMapping()) {
600  ResList.push_back("Has other SNP");
602  ResList.push_back("Has Assembly conflict");
604  ResList.push_back("Is assembly specific");
605  }
606  break;
611  ResList.push_back(">1% minor allele freq in 1+ populations");
613  ResList.push_back(">1% minor allele freq in each and all populations");
615  ResList.push_back(">5% minor allele freq in 1+ populations");
617  ResList.push_back(">5% minor allele freq in each and all populations");
619  ResList.push_back("Is mutation");
621  ResList.push_back("Validated (has a minor allele in two or more separate chromosomes)");
622  }
623  break;
625  if(prop.CanGetQuality_check()) {
628  ResList.push_back("Reference allele missing from SNP alleles");
630  ResList.push_back("Genotype conflict");
632  ResList.push_back("Non-overlapping allele sets");
634  ResList.push_back("Strain specific fixed difference");
636  ResList.push_back("Member SS withdrawn by submitter");
637  }
638  break;
640  if(prop.CanGetResource_link()) {
643  ResList.push_back("Clinical");
645  ResList.push_back("Provisional");
647  ResList.push_back("Preserved");
649  ResList.push_back("On high density genotyping kit");
650  if(resource_link & CVariantProperties::eResource_link_has3D)
651  ResList.push_back("SNP3D");
653  ResList.push_back("SubmitterLinkOut");
654  }
655  break;
657  // NB: take care to have the same order as in eSNPPropName_ResourceLink
658  if(prop.CanGetResource_link()) {
661  ResList.push_back("");
663  ResList.push_back("");
665  ResList.push_back("");
667  ResList.push_back("");
669  ResList.push_back("");
670  }
671  break;
672  default:
673  break;
674  }
675 }
676 
677 
678 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
Definition: Na_strand.hpp:63
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
size_t GetSize(void) const
CAnnot_descr –.
Definition: Annot_descr.hpp:66
CBioseq_Handle –.
CTime AsCTime(CTime::ETimeZone tz=CTime::eLocal) const
Definition: Date.cpp:70
Definition: Dbtag.hpp:53
@ eDbtagType_dbSNP
Definition: Dbtag.hpp:185
CFeat_CI –.
Definition: feat_ci.hpp:64
@Gb_qual.hpp User-defined methods of the data storage class.
Definition: Gb_qual.hpp:61
CMappedFeat –.
Definition: mapped_feat.hpp:59
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CScope –.
Definition: scope.hpp:92
ESubtype GetSubtype(void) const
CSeqVector –.
Definition: seq_vector.hpp:65
CSeq_annot_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
Definition: Seq_feat.cpp:415
CSnpBitfield is a facade for representing any version of the SNP bitfield.
bool IsTrue(EProperty prop) const
int GetVersion() const
bool isGood() const
@ eHasSnp3D
Has 3D structure SNP3D.
@ eHasLinkOut
Has SubmitterLinkOut From SNP->SubSNP->Batch.link_out.
@ eIsMutation
! temp here for backward compatibility; remove once a jump to SC11 is done
CTime –.
Definition: ncbitime.hpp:296
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Definition: User_object.cpp:84
CUser_field & SetField(const string &str, const string &delim=".", const string &obj_subtype=kEmptyStr, NStr::ECase use_case=NStr::eCase)
Access a named field in this user object.
CVariantPlacement –.
void SetExt(TExt &value)
static bool x_CommonConvertFeat(TPVariation pVariation, const CSeq_feat &SrcFeat)
Definition: snp_utils.hpp:379
static const string sResourceLink_RsID
Definition: snp_utils.hpp:281
static bool ConvertFeat(CVariation &Variation, const CSeq_feat &SrcFeat)
legacy SNP feature conversion into a variation object
Definition: snp_utils.cpp:336
ESNPPropTypes
enums to control getting a string list representation of various CVariantProperties
Definition: snp_utils.hpp:285
@ eSNPPropName_GeneLocation
prop.gene-location
Definition: snp_utils.hpp:287
@ eSNPPropName_ResourceLink
prop.resource-link
Definition: snp_utils.hpp:292
@ eSNPPropName_QualityCheck
prop.quality-check
Definition: snp_utils.hpp:291
@ eSNPPropName_Mapping
prop.mapping
Definition: snp_utils.hpp:289
@ eSNPPropName_FreqValidation
prop.frequence-based-validation
Definition: snp_utils.hpp:290
@ eSNPPropName_Effect
prop.effect
Definition: snp_utils.hpp:288
@ eSNPPropName_ResourceLinkURL
generate URL templates, with one of sResourceLink_ substrings potentially inside
Definition: snp_utils.hpp:299
static void DecodeBitfield(CVariantProperties &prop, const CSnpBitfield &bf)
convert SNP bitfield data to respective fields in CVariantProperties
Definition: snp_utils.cpp:379
static void VariantPropAsStrings(list< string > &ResList, const CVariantProperties &prop, ESNPPropTypes ePropType)
get lists of strings corresponding to a given property type
Definition: snp_utils.cpp:536
int TClinSigID
Definition: snp_utils.hpp:76
static TRsid GetRsid(const CMappedFeat &mapped_feat)
Return rsid of SNP.
Definition: snp_utils.cpp:109
ELetterCase
controls the case of strings returned from ClinSigAsString()
Definition: snp_utils.hpp:211
@ eLetterCase_ForceLower
always use lower case only
Definition: snp_utils.hpp:212
static int GetLength(const CMappedFeat &)
Return distance of neighbors in flanking sequence.
Definition: snp_utils.cpp:133
static CConstRef< CDbtag > GetTag(const CSeq_feat &SrcFeat)
find a SNP tag in the feature returns NULL if no such tag (sm_dbTag_dbSNP)
Definition: snp_utils.cpp:77
vector< string > TAlleles
list of alleles belonging to particular SNP a deletion is represented by a "-"
Definition: snp_utils.hpp:188
static bool IsSnp(const CMappedFeat &mapped_feat)
Determine if feature is a SNP.
Definition: snp_utils.cpp:62
CObject_id::TId8 TRsid
Definition: snp_utils.hpp:70
static void GetAlleles(const CMappedFeat &mapped_feat, TAlleles &Alleles)
Return list of alleles encoded in qual.
Definition: snp_utils.cpp:237
static CSnpBitfield GetBitfield(const CMappedFeat &)
Return bitfield information stored in the feature.
Definition: snp_utils.cpp:220
static CTime GetCreateTime(const CMappedFeat &mapped_feat)
Get Create Time It will fetch the creation time based on the CAnnotDescr of the feature's parent anno...
Definition: snp_utils.cpp:88
static const string sm_dbTag_dbSNP
Definition: snp_utils.hpp:67
static bool IsSnpKnown(CScope &scope, const CMappedFeat &private_snp, const string &allele=kEmptyStr)
Check if SNP exists in GenBank database.
Definition: snp_utils.cpp:282
static string ClinSigAsString(const CVariation_ref &var, ELetterCase LetterCase=eLetterCase_Mixed)
get a human-readable text for various clinical significance types
Definition: snp_utils.cpp:172
static int lc
Definition: getdata.c:30
static const char * str(char *buf, int n)
Definition: stats.c:84
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
TRange GetTotalRange(void) const
Definition: Seq_loc.hpp:913
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
Definition: Seq_loc.cpp:915
TSeqPos GetStop(ESeqLocExtremes ext) const
Definition: Seq_loc.cpp:963
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
const CSeq_annot::TDesc & Seq_annot_GetDesc(void) const
bool Seq_annot_CanGetDesc(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
SAnnotSelector & SetOverlapTotalRange(void)
Check overlapping only of total ranges.
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
SAnnotSelector & SetExcludeExternal(bool exclude=true)
External annotations for the Object Manger are annotations located in top level Seq-entry different f...
SAnnotSelector & SetAnnotType(TAnnotType type)
Set annotation type (feat, align, graph)
SAnnotSelector & SetMaxSize(TMaxSize max_size)
Set maximum number of annotations to find.
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
SAnnotSelector & SetFeatSubtype(TFeatSubtype subtype)
Set feature subtype (also set annotation and feat type)
SAnnotSelector & ExcludeUnnamedAnnots(void)
Add unnamed annots to set of annots names to exclude.
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
Definition: seq_vector.cpp:304
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:1392
position_type GetLength(void) const
Definition: range.hpp:158
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
Definition: ncbistr.cpp:630
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3461
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
Definition: ncbistr.cpp:3554
static string & ToLower(string &str)
Convert string to lower case – string& version.
Definition: ncbistr.cpp:405
@ fConvErr_NoThrow
Do not throw an exception on error.
Definition: ncbistr.hpp:285
const TStr & GetStr(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
void SetClass(const TClass &value)
Assign a value to Class data member.
void SetData(TData &value)
Assign a value to Data data member.
const TVal & GetVal(void) const
Get the Val member data.
Definition: Gb_qual_.hpp:259
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:913
bool CanGetQual(void) const
Check if it is safe to call GetQual method.
Definition: Seq_feat_.hpp:1141
bool IsSetExt(void) const
user defined structure extension Check if a value has been assigned to Ext data member.
Definition: Seq_feat_.hpp:1207
const TQual & GetQual(void) const
Get the Qual member data.
Definition: Seq_feat_.hpp:1147
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1117
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
Definition: Seq_feat_.hpp:1111
vector< CRef< CGb_qual > > TQual
Definition: Seq_feat_.hpp:117
const TQual & GetQual(void) const
Get the Qual member data.
Definition: Gb_qual_.hpp:212
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_feat_.hpp:1219
const TCreate_date & GetCreate_date(void) const
Get the variant data.
Definition: Annotdesc_.cpp:206
const Tdata & Get(void) const
Get the member data.
bool IsCreate_date(void) const
Check if variant Create_date is selected.
Definition: Annotdesc_.hpp:567
bool CanGet(void) const
Check if it is safe to call Get method.
list< CRef< CAnnotdesc > > Tdata
TExt & SetExt(void)
Assign a value to Ext data member.
TPlacements & SetPlacements(void)
Assign a value to Placements data member.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
void SetQuality_check(TQuality_check value)
Assign a value to Quality_check data member.
TFrequency_based_validation GetFrequency_based_validation(void) const
Get the Frequency_based_validation member data.
void SetFrequency_based_validation(TFrequency_based_validation value)
Assign a value to Frequency_based_validation data member.
void SetGenotype(TGenotype value)
Assign a value to Genotype data member.
list< CRef< CPhenotype > > TPhenotype
void SetResource_link(TResource_link value)
Assign a value to Resource_link data member.
TEffect GetEffect(void) const
Get the Effect member data.
bool CanGetGene_location(void) const
Check if it is safe to call GetGene_location method.
void SetVersion(TVersion value)
Assign a value to Version data member.
TMapping GetMapping(void) const
Get the Mapping member data.
bool CanGetQuality_check(void) const
Check if it is safe to call GetQuality_check method.
const TPhenotype & GetPhenotype(void) const
Get the Phenotype member data.
bool CanGetFrequency_based_validation(void) const
Check if it is safe to call GetFrequency_based_validation method.
TResource_link GetResource_link(void) const
Get the Resource_link member data.
void SetGene_location(TGene_location value)
Assign a value to Gene_location data member.
bool CanGetEffect(void) const
Check if it is safe to call GetEffect method.
bool CanGetResource_link(void) const
Check if it is safe to call GetResource_link method.
TQuality_check GetQuality_check(void) const
Get the Quality_check member data.
void SetMapping(TMapping value)
Assign a value to Mapping data member.
void SetEffect(TEffect value)
Assign a value to Effect data member.
bool CanGetMapping(void) const
Check if it is safe to call GetMapping method.
TGene_location GetGene_location(void) const
Get the Gene_location member data.
@ eMapping_has_assembly_conflict
Weight 1 or 2 SNPs that map to different chromosomes on different assemblies (0x02)
@ eMapping_has_other_snp
Another SNP has the same mapped positions on reference assembly (0x01)
@ eMapping_is_assembly_specific
Only maps to 1 assembly (0x04)
@ eGenotype_has_genotypes
SNP has individual genotype (0x02)
@ eGenotype_in_haplotype_set
Exists in a haplotype tagging set (0x01)
@ eFrequency_based_validation_above_5pct_1plus
>5% minor allele freq in 1+ populations (0x04)
@ eFrequency_based_validation_validated
Bit is set if the variant has a minor allele observed in two or more separate chromosomes.
@ eFrequency_based_validation_above_1pct_all
>1% minor allele freq in each and all populations (0x10)
@ eFrequency_based_validation_above_5pct_all
>5% minor allele freq in each and all populations (0x02)
@ eFrequency_based_validation_above_1pct_1plus
>1% minor allele freq in 1+ populations (0x20)
@ eFrequency_based_validation_is_mutation
low frequency variation that is cited in journal or other reputable sources (0x01)
@ eEffect_stop_gain
reference codon is not stop codon, but the snp variant allele changes the codon to a terminating codo...
@ eEffect_down_regulator
the variant causes decreased transcription (0x20)
@ eEffect_missense
one allele in the set changes protein peptide (0x4)
@ eEffect_nonsense
one allele in the set changes to STOP codon (TER). (0x2)
@ eEffect_up_regulator
the variant causes increased transcription (0x10)
@ eEffect_no_change
known to cause no functional changes since 0 does not combine with any other bit value,...
@ eEffect_stop_loss
reverse of STOP-GAIN: reference codon is a stop codon, but a snp variant allele changes the codon to ...
@ eEffect_synonymous
one allele in the set does not change the encoded amino acid (0x1)
@ eEffect_frameshift
one allele in the set changes all downstream amino acids (0x8)
@ eQuality_check_genotype_conflict
Has Genotype Conflict (0x10)
@ eQuality_check_strain_specific
Straing specific fixed difference (0x08)
@ eQuality_check_non_overlapping_alleles
RS set has 2+ alleles from different submissions and these sets share no alleles in common (0x04)
@ eQuality_check_contig_allele_missing
Reference sequence allele at the mapped position is not present in the SNP allele list,...
@ eQuality_check_withdrawn_by_submitter
One member SS is withdrawn by submitter (0x02)
@ eResource_link_has3D
Has 3D strcture SNP3D table (0x04)
@ eResource_link_provisional
Provisional Third Party Annotations (0x02)
@ eResource_link_genotypeKit
Marker exists on high density genotyping kit (0x20)
@ eResource_link_clinical
Clinical if LSDB, OMIM, TPA, Diagnostic (0x10)
@ eResource_link_submitterLinkout
SNP->SubSNP->Batch link_out (0x08)
@ eResource_link_preserved
Clinical, Pubmed, Cited, (0x01)
@ eGene_location_in_start_codon
the variant is observed in a start codon (0x100)
@ eGene_location_acceptor
In acceptor splice-site (0x20)
@ eGene_location_near_gene_5
Within 2kb of the 5' end of a gene feature.
@ eGene_location_near_gene_3
Within 0.5kb of the 3' end of a gene feature.
@ eGene_location_utr_3
In 3' UTR (0x80)
@ eGene_location_in_gene
Sequence intervals covered by a gene ID but not having an aligned transcript (0x01)
@ eGene_location_utr_5
In 5' UTR (0x40)
@ eGene_location_intron
In Intron (0x08)
@ eGene_location_intergenic
variant located between genes (0x400)
@ eGene_location_donor
In donor splice-site (0x10)
@ eGene_location_in_stop_codon
the variant is observed in a stop codon (0x200)
@ eGene_location_conserved_noncoding
variant is located in a conserved non-coding region (0x800)
@ eClinical_significance_drug_response
Definition: Phenotype_.hpp:97
@ eClinical_significance_probable_pathogenic
Definition: Phenotype_.hpp:95
@ eClinical_significance_unknown
Definition: Phenotype_.hpp:91
@ eClinical_significance_untested
Definition: Phenotype_.hpp:92
@ eClinical_significance_pathogenic
Definition: Phenotype_.hpp:96
@ eClinical_significance_probable_non_pathogenic
Definition: Phenotype_.hpp:94
@ eClinical_significance_other
Definition: Phenotype_.hpp:99
@ eClinical_significance_histocompatibility
Definition: Phenotype_.hpp:98
@ eClinical_significance_non_pathogenic
Definition: Phenotype_.hpp:93
const char * tag
Int4 delta(size_t dimension_, const Int4 *score_)
USING_SCOPE(objects)
#define SNP_VAR_EXT_CLASS
Definition: snp_utils.hpp:245
#define SNP_VAR_EXT_BITFIELD
Definition: snp_utils.hpp:246
SAnnotSelector –.
Modified on Wed Apr 17 13:10:50 2024 by modify_doxy.py rev. 669887