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 77864 2017-05-11 11:59:45Z ivanov $
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 
55 
56 const string NSnp::sm_dbTag_dbSNP("dbSNP");
57 
58 ///////////////////////////////////////////////////////////////////////////////
59 // Public Methods
60 ///////////////////////////////////////////////////////////////////////////////
61 bool NSnp::IsSnp(const CMappedFeat &mapped_feat)
62 {
63  return IsSnp(mapped_feat.GetOriginalFeature());
64 }
65 
66 bool NSnp::IsSnp(const CSeq_feat &feat)
67 {
68  return feat.IsSetData() && feat.GetData().GetSubtype() == CSeqFeatData::eSubtype_variation && GetTag(feat).NotEmpty() && IsSnp(*GetTag(feat));
69 }
70 
71 bool NSnp::IsSnp(const CDbtag& tag)
72 {
73  return tag.GetType() == CDbtag::eDbtagType_dbSNP;
74  }
75 
77 {
78  return SrcFeat.GetNamedDbxref(sm_dbTag_dbSNP);
79 }
80 
82 {
83  return GetTag(SrcFeat.GetOriginalFeature());
84 }
85 
86 
88 {
89  CTime time;
90  CSeq_annot_Handle h = feat.GetAnnot();
91 
92  if (h.Seq_annot_CanGetDesc()) {
93  const CAnnot_descr &desc = h.Seq_annot_GetDesc();
94  if (desc.CanGet()) {
95  ITERATE( CAnnot_descr::Tdata, it, desc.Get() ) {
96  const CRef<CAnnotdesc> &d = *it;
97  if (d->IsCreate_date()) {
98  time = d->GetCreate_date().AsCTime();
99  break;
100  }
101  }
102  }
103  }
104 
105  return time;
106 }
107 
109 {
110  return GetRsid(mapped_feat.GetOriginalFeature());
111 }
112 
114 {
115  CConstRef<CDbtag> ref = GetTag(feat);
116  if (ref) {
117  return GetRsid(*ref);
118  }
119  return 0;
120 }
122 {
123  return tag.GetTag().GetId8();
124 }
125 
126 int NSnp::GetLength(const CMappedFeat &mapped_feat)
127 {
128  return GetLength(mapped_feat.GetOriginalFeature());
129 }
130 
131 int NSnp::GetLength(const CSeq_feat &feat)
132 {
133  int length = 0;
134 
135  // features pre-SNP 2.0 have length encoded as neighbors in "Extra"
136  if(GetBitfield(feat).GetVersion() < 20) {
137  if (feat.IsSetExt()) {
138  CConstRef<CUser_field> field =
139  feat.GetExt().GetFieldRef("Extra");
140  if (field) {
141  string s1, s2;
142  const string &str = field->GetData().GetStr();
143  if (NStr::SplitInTwo(str, "=", s1, s2)) {
144  vector<string> v;
145 
147  if (v.size()==4) {
150  length = rc + lc + 1;
151  }
152  }
153  }
154  }
155  } else {
156  // SNP 2.0 length is feature length
157  if(feat.CanGetLocation()) {
158  length = feat.GetLocation().GetTotalRange().GetLength();
159  }
160  }
161 
162  return length;
163 }
164 
165 string NSnp::ClinSigAsString(const CVariation_ref& var, ELetterCase LetterCase)
166 {
167  ITERATE (CVariation_ref::TPhenotype, pnt_iter, var.GetPhenotype()) {
168  if ((*pnt_iter)->CanGetClinical_significance()) {
169  return ClinSigAsString((*pnt_iter)->GetClinical_significance(), LetterCase);
170  }
171  }
172  return "";
173 }
174 
175 string NSnp::ClinSigAsString(TClinSigID ClinSigID, ELetterCase LetterCase)
176 {
177  string sResult;
178  switch(ClinSigID)
179  {
181  sResult = "Benign";
182  break;
184  sResult = "Likely benign";
185  break;
187  sResult = "Likely pathogenic";
188  break;
190  sResult = "Pathogenic";
191  break;
193  sResult = "Drug response";
194  break;
196  sResult = "Histocompatibility";
197  break;
199  sResult = "Uncertain significance";
200  break;
202  sResult = "Not tested";
203  break;
205  default:
206  sResult = "Other";
207  break;
208  }
209  return LetterCase == eLetterCase_ForceLower ? NStr::ToLower(sResult) : sResult;
210 }
211 
212 
214 {
215  return GetBitfield(mapped_feat.GetOriginalFeature());
216 }
217 
219 {
220  CSnpBitfield b;
221 
222  if(IsSnp(feat)) {
223  b = feat;
224  }
225 
226  return b;
227 }
228 
229 
230 void NSnp::GetAlleles(const CMappedFeat &mapped_feat, TAlleles& Alleles)
231 {
232  GetAlleles(mapped_feat.GetOriginalFeature(), Alleles);
233 }
234 
235 void NSnp::GetAlleles(const CSeq_feat &feat, TAlleles& Alleles)
236 {
237  Alleles.clear();
238 
239  if (feat.CanGetQual()) {
240  Alleles.reserve(feat.GetQual().size());
241  ITERATE (CSeq_feat::TQual, it, feat.GetQual()) {
242  const CGb_qual& qual = **it;
243  if (qual.GetQual() == "replace") {
244  string sQualVal(qual.GetVal());
245  Alleles.push_back(sQualVal.empty() ? "-" : sQualVal);
246  }
247  }
248  }
249 }
250 
251 bool NSnp::IsSnpKnown( CScope &scope, const CMappedFeat &private_snp, const string &allele)
252 {
253  const CSeq_loc &loc = private_snp.GetLocation();
254  return IsSnpKnown(scope, loc, allele);
255 }
256 
257 bool NSnp::IsSnpKnown( CScope& scope, const CSeq_loc& loc, const string & allele)
258 {
259  bool isKnown = false;
260  SAnnotSelector sel; // annotation selector
261 
262  // Prepare Annotation Selection to find the SNPs
263  //sel = CSeqUtils::GetAnnotSelector(CSeqFeatData::eSubtype_variation);
264  sel .SetOverlapTotalRange()
265  .SetResolveAll()
266  .AddNamedAnnots("SNP")
267  .SetExcludeExternal(false)
271  .SetMaxSize(100000); // In case someone does something silly.
272 
273  CFeat_CI feat_it(scope, loc, sel);
274 
275  if (allele == kEmptyStr) {
276  // Don't check for alleles
277  // Existing of any returned SNP means there are known SNPs
278  if (feat_it.GetSize()>0) {
279  isKnown = true;
280  }
281  }
282  else {
283  // Check all the alleles for all the returned SNPs
284  for (; feat_it && !isKnown; ++feat_it) {
285  const CSeq_feat & or_feat = feat_it->GetOriginalFeature();
286  if (or_feat.CanGetQual()) {
287  ITERATE (CSeq_feat::TQual, it, or_feat.GetQual()) {
288  const CRef<CGb_qual> &qual = *it;
289  if (qual->GetQual() == "replace" &&
290  qual->GetVal().find(allele) != string::npos) {
291  isKnown = true;
292  break;
293  }
294  }
295  }
296  }
297  }
298 
299  return isKnown;
300 }
301 
302 
303 const string NSNPVariationHelper::sResourceLink_RsID("%rsid%");
304 
305 bool NSNPVariationHelper::ConvertFeat(CVariation& Variation, const CSeq_feat& SrcFeat)
306 {
307  if(!x_CommonConvertFeat(&Variation, SrcFeat)) {
308  return false;
309  }
311  pPlacement->SetLoc().Assign(SrcFeat.GetLocation());
312  Variation.SetPlacements().push_back(pPlacement);
313 
314  // save a copy of the feature since not every bit
315  // currently is adequately represented in Variation
316  CSnpBitfield bf(NSnp::GetBitfield(SrcFeat));
317  if(bf.isGood()) {
318  CRef<CUser_object> pExt(new CUser_object());
319  CNcbiOstrstream ostr;
320  ostr << MSerial_AsnText << SrcFeat;
323  Variation.SetExt().push_back(pExt);
324  }
325  return true;
326 }
327 
329 {
330  if(!x_CommonConvertFeat(&Variation, SrcFeat)) {
331  return false;
332  }
333  // save a copy of the feature since not every bit
334  // currently is adequately represented in Variation
335  CSnpBitfield bf(NSnp::GetBitfield(SrcFeat));
336  if(bf.isGood()) {
337  CNcbiOstrstream ostr;
338  ostr << MSerial_AsnText << SrcFeat;
339  Variation.SetExt().SetField(SNP_VAR_EXT_BITFIELD).SetData().SetStr(CNcbiOstrstreamToString(ostr));
340  Variation.SetExt().SetClass(SNP_VAR_EXT_CLASS);
341  }
342  return true;
343 }
344 
345 
346 
347 
349 {
350  prop.SetVersion(bf.GetVersion());
351 
352  /// resource link
353  int res_link = 0;
356  }
359  }
362  }
365  }
368  }
371  }
372  if (res_link) {
373  prop.SetResource_link(res_link);
374  }
375 
376  /// gene function
377  int gene_location = 0;
378  if (bf.IsTrue(CSnpBitfield::eInGene)) {
380  }
381  if (bf.IsTrue(CSnpBitfield::eInGene5)) {
383  }
384  if (bf.IsTrue(CSnpBitfield::eInGene3)) {
386  }
387  if (bf.IsTrue(CSnpBitfield::eIntron)) {
389  }
390  if (bf.IsTrue(CSnpBitfield::eDonor)) {
392  }
395  }
396  if (bf.IsTrue(CSnpBitfield::eInUTR5)) {
398  }
399  if (bf.IsTrue(CSnpBitfield::eInUTR3)) {
401  }
402  if (gene_location) {
403  prop.SetGene_location(gene_location);
404  }
405 
406  // effect
407  int effect(0);
410  }
413  }
416  }
419  }
422  }
423  if (effect) {
424  prop.SetEffect(effect);
425  }
426 
427  /// mapping
428  int mapping = 0;
431  }
434  }
437  }
438  if (mapping) {
439  prop.SetMapping(mapping);
440  }
441 
442 
443  /// DEPRECATED
444  /// There is not 1:1 correspondance between Bitfield weight
445  /// and VariantProperties map-weight. See SNP-5729.
446  /// So, I am commenting out. JB Holmes, April 2013
447  /// weight
448  // int weight = bf.GetWeight();
449  // if (weight) {
450  // prop.SetMap_weight(weight);
451  // }
452 
453  /// allele frequency
454  int allele_freq = 0;
457  }
460  }
463  }
466  }
467  if (allele_freq) {
468  prop.SetFrequency_based_validation(allele_freq);
469  }
470 
471  /// genotype
472  int genotype = 0;
475  }
478  }
479  if (genotype) {
480  prop.SetGenotype(genotype);
481  }
482 
483  /// quality checking
484  int qual_check = 0;
487  }
490  }
493  }
496  }
499  }
500  if (qual_check) {
501  prop.SetQuality_check(qual_check);
502  }
503 }
504 
505 void NSNPVariationHelper::VariantPropAsStrings(list<string>& ResList, const CVariantProperties& prop, ESNPPropTypes ePropType)
506 {
507  ResList.clear();
508  switch(ePropType) {
510  if(prop.CanGetGene_location()) {
513  ResList.push_back("In Gene");
515  ResList.push_back("In 5\' Gene");
517  ResList.push_back("In 3\' Gene");
519  ResList.push_back("Intron");
521  ResList.push_back("Donor");
523  ResList.push_back("Acceptor");
525  ResList.push_back("In 5\' UTR");
527  ResList.push_back("In 3\' UTR");
529  ResList.push_back("In Start Codon");
531  ResList.push_back("In Stop Codon");
533  ResList.push_back("Intergenic");
535  ResList.push_back("In Conserved Non-coding region");
536  }
537  break;
538  case eSNPPropName_Effect:
539  if(prop.CanGetEffect()) {
540  CVariantProperties::TEffect effect(prop.GetEffect());
542  ResList.push_back("No change");
543  else {
545  ResList.push_back("Synonymous");
547  ResList.push_back("Nonsense");
549  ResList.push_back("Missense");
551  ResList.push_back("Frameshift");
553  ResList.push_back("Up-regulator");
555  ResList.push_back("Down-regulator");
557  ResList.push_back("Methylation");
559  ResList.push_back("Stop-gain");
561  ResList.push_back("Stop-loss");
562  }
563  }
564  break;
566  if(prop.CanGetMapping()) {
569  ResList.push_back("Has other SNP");
571  ResList.push_back("Has Assembly conflict");
573  ResList.push_back("Is assembly specific");
574  }
575  break;
580  ResList.push_back(">1% minor allele freq in 1+ populations");
582  ResList.push_back(">1% minor allele freq in each and all populations");
584  ResList.push_back(">5% minor allele freq in 1+ populations");
586  ResList.push_back(">5% minor allele freq in each and all populations");
588  ResList.push_back("Is mutation");
590  ResList.push_back("Validated (has a minor allele in two or more separate chromosomes)");
591  }
592  break;
594  if(prop.CanGetQuality_check()) {
597  ResList.push_back("Reference allele missing from SNP alleles");
599  ResList.push_back("Genotype conflict");
601  ResList.push_back("Non-overlapping allele sets");
603  ResList.push_back("Strain specific fixed difference");
605  ResList.push_back("Member SS withdrawn by submitter");
606  }
607  break;
609  if(prop.CanGetResource_link()) {
612  ResList.push_back("Clinical");
614  ResList.push_back("Provisional");
616  ResList.push_back("Preserved");
618  ResList.push_back("On high density genotyping kit");
619  if(resource_link & CVariantProperties::eResource_link_has3D)
620  ResList.push_back("SNP3D");
622  ResList.push_back("SubmitterLinkOut");
623  }
624  break;
626  // NB: take care to have the same order as in eSNPPropName_ResourceLink
627  if(prop.CanGetResource_link()) {
630  ResList.push_back("");
632  ResList.push_back("");
634  ResList.push_back("");
636  ResList.push_back("");
637  if(resource_link & CVariantProperties::eResource_link_has3D)
638  ResList.push_back("http://www.ncbi.nlm.nih.gov/SNP/snp3D.cgi?rsnum=" + sResourceLink_RsID);
640  ResList.push_back("");
641  }
642  break;
643  default:
644  break;
645  }
646 }
647 
648 
649 
Has 3D structure SNP3D.
static int GetLength(const CMappedFeat &)
Return distance of neighbors in flanking sequence.
Definition: snp_utils.cpp:126
SAnnotSelector & SetMaxSize(TMaxSize max_size)
Set maximum number of annotations to find.
SAnnotSelector & ExcludeUnnamedAnnots(void)
Add unnamed annots to set of annots names to exclude.
static CSnpBitfield GetBitfield(const CMappedFeat &)
Return bitfield information stored in the feature.
Definition: snp_utils.cpp:213
bool CanGetQual(void) const
Check if it is safe to call GetQual method.
Definition: Seq_feat_.hpp:1106
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
SAnnotSelector & SetResolveAll(void)
SetResolveAll() is equivalent to SetResolveMethod(eResolve_All).
void SetClass(const TClass &value)
Assign a value to Class data member.
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:87
Do not merge the delimiters.
Definition: ncbistr.hpp:2442
static int lc
Definition: getdata.c:33
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:641
TResource_link GetResource_link(void) const
Get the Resource_link member data.
SAnnotSelector & SetExcludeExternal(bool exclude=true)
External annotations for the Object Manger are annotations located in top level Seq-entry different f...
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:1296
Provisional Third Party Annotations (0x02)
one allele in the set changes protein peptide (0x4)
the variant causes decreased transcription (0x20)
const TCreate_date & GetCreate_date(void) const
Get the variant data.
Definition: Annotdesc_.cpp:206
CAnnot_descr –.
Definition: Annot_descr.hpp:65
void SetData(TData &value)
Assign a value to Data data member.
bool CanGetQuality_check(void) const
Check if it is safe to call GetQuality_check method.
const TStr & GetStr(void) const
Get the variant data.
Within 2kb of the 5' end of a gene feature.
position_type GetLength(void) const
Definition: range.hpp:158
Do not throw an exception on error.
Definition: ncbistr.hpp:252
User-defined methods of the data storage class.
void SetVersion(TVersion value)
Assign a value to Version data member.
static void DecodeBitfield(CVariantProperties &prop, const CSnpBitfield &bf)
convert SNP bitfield data to respective fields in CVariantProperties
Definition: snp_utils.cpp:348
generate URL templates, with one of sResourceLink_ substrings potentially inside
Definition: snp_utils.hpp:295
always use lower case only
Definition: snp_utils.hpp:208
TPlacements & SetPlacements(void)
Assign a value to Placements data member.
reference codon is not stop codon, but the snp variant allele changes the codon to a terminating codo...
One member SS is withdrawn by submitter (0x02)
EDbtagType GetType(void) const
Definition: Dbtag.cpp:443
const TData & GetData(void) const
Get the Data member data.
Sequence intervals covered by a gene ID but not having an aligned transcript (0x01) ...
User-defined methods of the data storage class.
static TRsid GetRsid(const CMappedFeat &mapped_feat)
Return rsid of SNP.
Definition: snp_utils.cpp:108
Bit is set if the variant has a minor allele observed in two or more separate chromosomes.
bool isGood() const
bool CanGet(void) const
Check if it is safe to call Get method.
TQuality_check GetQuality_check(void) const
Get the Quality_check member data.
CConstRef< CDbtag > GetNamedDbxref(const CTempString &db) const
Return a specified DB xref.
Definition: Seq_feat.cpp:403
bool CanGetGene_location(void) const
Check if it is safe to call GetGene_location method.
Within 0.5kb of the 3' end of a gene feature.
Marker exists on high density genotyping kit (0x20)
static string & ToLower(string &str)
Convert string to lower case – string& version.
Definition: ncbistr.cpp:298
TRange GetTotalRange(void) const
Definition: Seq_loc.hpp:897
SAnnotSelector –.
TGene_location GetGene_location(void) const
Get the Gene_location member data.
#define kEmptyStr
Definition: ncbistr.hpp:120
SAnnotSelector & SetAnnotType(TAnnotType type)
Set annotation type (feat, align, graph)
CVariantPlacement –.
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_feat_.hpp:1177
void SetEffect(TEffect value)
Assign a value to Effect data member.
const Tdata & Get(void) const
Get the member data.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:776
Reference sequence allele at the mapped position is not present in the SNP allele list...
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: Seq_feat_.hpp:1082
const CSeq_loc & GetLocation(void) const
void SetMapping(TMapping value)
Assign a value to Mapping data member.
TFrequency_based_validation GetFrequency_based_validation(void) const
Get the Frequency_based_validation member data.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
prop.frequence-based-validation
Definition: snp_utils.hpp:286
SAnnotSelector & SetOverlapTotalRange(void)
Check overlapping only of total ranges.
RS set has 2+ alleles from different submissions and these sets share no alleles in common (0x04) ...
User-defined methods of the data storage class.
SAnnotSelector & SetFeatSubtype(TFeatSubtype subtype)
Set feature subtype (also set annotation and feat type)
static bool IsSnp(const CMappedFeat &mapped_feat)
Determine if feature is a SNP.
Definition: snp_utils.cpp:61
one allele in the set does not change the encoded amino acid (0x1)
const char * tag
void SetGenotype(TGenotype value)
Assign a value to Genotype data member.
list< CRef< CPhenotype > > TPhenotype
const TQual & GetQual(void) const
Get the Qual member data.
Definition: Gb_qual_.hpp:202
ELetterCase
controls the case of strings returned from ClinSigAsString()
Definition: snp_utils.hpp:207
the variant causes increased transcription (0x10)
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Definition: User_object.cpp:80
CFeat_CI –.
Definition: feat_ci.hpp:63
bool CanGetResource_link(void) const
Check if it is safe to call GetResource_link method.
Clinical if LSDB, OMIM, TPA, Diagnostic (0x10)
void SetFrequency_based_validation(TFrequency_based_validation value)
Assign a value to Frequency_based_validation data member.
void SetQuality_check(TQuality_check value)
Assign a value to Quality_check data member.
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.
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:3455
void SetResource_link(TResource_link value)
Assign a value to Resource_link data member.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool IsTrue(EProperty prop) const
the variant is observed in a start codon (0x100)
static const string sm_dbTag_dbSNP
Definition: snp_utils.hpp:67
CSeq_annot_Handle –.
TExt & SetExt(void)
Assign a value to Ext data member.
CTime AsCTime(CTime::ETimeZone tz=CTime::eLocal) const
Definition: Date.cpp:70
Exists in a haplotype tagging set (0x01)
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:885
.hpp User-defined methods of the data storage class.
Definition: Gb_qual.hpp:60
int TClinSigID
Definition: snp_utils.hpp:76
size_t GetSize(void) const
list< CRef< CAnnotdesc > > Tdata
CTime –.
Definition: ncbitime.hpp:290
TMapping GetMapping(void) const
Get the Mapping member data.
CObject_id::TId8 TRsid
Definition: snp_utils.hpp:70
known to cause no functional changes since 0 does not combine with any other bit value, 'no-change' specifically implies that there are no consequences
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:76
void SetLoc(TLoc &value)
Assign a value to Loc data member.
void SetExt(TExt &value)
CScope –.
Definition: scope.hpp:90
int GetVersion() const
static const string sResourceLink_RsID
Definition: snp_utils.hpp:277
const TQual & GetQual(void) const
Get the Qual member data.
Definition: Seq_feat_.hpp:1112
Another SNP has the same mapped positions on reference assembly (0x01)
User-defined methods of the data storage class.
static const char * str(char *buf, int n)
Definition: stats.c:84
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:505
bool Seq_annot_CanGetDesc(void) const
vector< string > TAlleles
list of alleles belonging to particular SNP a deletion is represented by a "-"
Definition: snp_utils.hpp:188
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
bool CanGetEffect(void) const
Check if it is safe to call GetEffect method.
#define SNP_VAR_EXT_CLASS
Definition: snp_utils.hpp:241
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
low frequency variation that is cited in journal or other reputable sources (0x01) ...
one allele in the set changes all downstream amino acids (0x8)
const TPhenotype & GetPhenotype(void) const
Get the Phenotype member data.
TId8 GetId8(void) const
Definition: Object_id.cpp:145
bool CanGetFrequency_based_validation(void) const
Check if it is safe to call GetFrequency_based_validation method.
static bool x_CommonConvertFeat(TPVariation pVariation, const CSeq_feat &SrcFeat)
Definition: snp_utils.hpp:375
IO_PREFIX::ostrstream CNcbiOstrstream
Portable alias for ostrstream.
Definition: ncbistre.hpp:155
bool IsCreate_date(void) const
Check if variant Create_date is selected.
Definition: Annotdesc_.hpp:567
Has SubmitterLinkOut From SNP->SubSNP->Batch.link_out.
void SetGene_location(TGene_location value)
Assign a value to Gene_location data member.
const TTag & GetTag(void) const
Get the Tag member data.
Definition: Dbtag_.hpp:251
CSnpBitfield is a facade for representing any version of the SNP bitfield.
#define SNP_VAR_EXT_BITFIELD
Definition: snp_utils.hpp:242
>1% minor allele freq in each and all populations (0x10)
reverse of STOP-GAIN: reference codon is a stop codon, but a snp variant allele changes the codon to ...
>5% minor allele freq in each and all populations (0x02)
namespace ncbi::objects::
Definition: Seq_feat.hpp:56
static void GetAlleles(const CMappedFeat &mapped_feat, TAlleles &Alleles)
Return list of alleles encoded in qual.
Definition: snp_utils.cpp:230
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:3362
static bool IsSnpKnown(CScope &scope, const CMappedFeat &private_snp, const string &allele=kEmptyStr)
Check if SNP exists in GenBank database.
Definition: snp_utils.cpp:251
bool IsSetExt(void) const
user defined structure extension Check if a value has been assigned to Ext data member.
Definition: Seq_feat_.hpp:1165
one allele in the set changes to STOP codon (TER). (0x2)
ESNPPropTypes
enums to control getting a string list representation of various CVariantProperties ...
Definition: snp_utils.hpp:281
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:165
! temp here for backward compatibility; remove once a jump to SC11 is done
vector< CRef< CGb_qual > > TQual
Definition: Seq_feat_.hpp:117
USING_SCOPE(objects)
Weight 1 or 2 SNPs that map to different chromosomes on different assemblies (0x02) ...
the variant is observed in a stop codon (0x200)
Definition: Dbtag.hpp:52
CMappedFeat –.
Definition: mapped_feat.hpp:58
static bool ConvertFeat(CVariation &Variation, const CSeq_feat &SrcFeat)
legacy SNP feature conversion into a variation object
Definition: snp_utils.cpp:305
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
const CSeq_annot::TDesc & Seq_annot_GetDesc(void) const
const TVal & GetVal(void) const
Get the Val member data.
Definition: Gb_qual_.hpp:242
TEffect GetEffect(void) const
Get the Effect member data.
bool CanGetMapping(void) const
Check if it is safe to call GetMapping method.
variant is located in a conserved non-coding region (0x800)
ESubtype GetSubtype(void) const
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:897
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
Definition: ncbistr.cpp:531
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
Definition: Seq_feat_.hpp:1076
Modified on Sun Jun 25 17:47:59 2017 by modify_doxy.py rev. 533848