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

Go to the SVN repository for this file.

1 /* $Id: Variation_ref.cpp 74562 2016-09-13 13:46:29Z 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  * Author: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using the following specifications:
34  * 'seqfeat.asn'.
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 
40 // generated includes
43 
44 // generated classes
45 
47 
48 BEGIN_objects_SCOPE // namespace ncbi::objects::
49 
50 // destructor
52 {
53 }
54 
55 
57 {
58  // population-data: ignore; deprecated, drop
61  << "Variation-ref.population-data is deprecated and "
62  "will be ignored");
64  }
65 
66  // validated: move to VariantProperties.other-validation
68  if (SetVariant_prop().IsSetOther_validation()) {
70  << "Both Variation-ref.validated and "
71  "Variation-ref.variant-properties.other-validation are "
72  "set; ignoring Variation-ref.validated");
73  }
74  else {
76  }
78  }
79 
80  // clinical-test: should be moved to Seq-feat.dbxref; no access here!
81  // FIXME: is this used anywhere?
84  << "Variation-ref.clinical-test is deprecated and "
85  "will be ignored");
87  }
88 
89  // allele-origin: move to Variant-properties
93  << "Both Variation-ref.allele-origin and "
94  "Variation-ref.variant-properties.allele-origin are "
95  "set; ignoring Variation-ref.validated");
96  }
97  else {
99  }
101  }
102 
103  // allele-state: move to Variant-properties
107  << "Both Variation-ref.allele-state and "
108  "Variation-ref.variant-properties.allele-state are "
109  "set; ignoring Variation-ref.validated");
110  }
111  else {
113  }
115  }
116 
117  // allele-frequency: move to Variant-properties
121  << "Both Variation-ref.allele-frequency and "
122  "Variation-ref.variant-properties.allele-frequency are "
123  "set; ignoring Variation-ref.validated");
124  }
125  else {
127  }
129  }
130 
131  // is-ancestral-allele: move to Variant-properties
135  << "Both Variation-ref.is-ancestral-allele and "
136  "Variation-ref.variant-properties.is-ancestral-allele are "
137  "set; ignoring Variation-ref.validated");
138  }
139  else {
141  }
143  }
144 
145  // pub: move to Seq-feat.dbxref; no access here
146  // FIXME: do we need to do this?
147  if (Tparent::IsSetPub()) {
149  << "Variation-ref.pub is deprecated and "
150  "will be ignored");
152  }
153 
154  /**
155  // location: deprecated, drop
156  if (Tparent::IsSetLocation()) {
157  ERR_POST(Error
158  << "Variation-ref.location is deprecated and "
159  "will be ignored");
160  Tparent::ResetLocation();
161  }
162  **/
163 
164  /**
165  // ext-locs: deprecated, drop
166  if (Tparent::IsSetExt_locs()) {
167  ERR_POST(Error
168  << "Variation-ref.ext-locs is deprecated and "
169  "will be ignored");
170  Tparent::ResetExt_locs();
171  }
172  **/
173 
174  /**
175  // ext: deprecated, drop
176  if (Tparent::IsSetExt()) {
177  ERR_POST(Error
178  << "Variation-ref.ext is deprecated and "
179  "will be ignored");
180  Tparent::ResetExt();
181  }
182  **/
183 }
184 
185 
186 //////////////////////////////////////////////////////////////////////////////
187 
189 {
191  "CVariation_ref::IsSetPopulation_data(): "
192  "unsupported deprecated API");
193 }
194 
195 
197 {
199  "CVariation_ref::CanGetPopulation_data(): "
200  "unsupported deprecated API");
201 }
202 
203 
205 {
207  "CVariation_ref::ResetPopulation_data(): "
208  "unsupported deprecated API");
209 }
210 
211 
213 {
215  "CVariation_ref::GetPopulation_data(): "
216  "unsupported deprecated API");
217 }
218 
219 
221 {
223  "CVariation_ref::SetPopulation_data(): "
224  "unsupported deprecated API");
225 }
226 
227 
228 //////////////////////////////////////////////////////////////////////////////
229 
231 {
232  if (IsSetVariant_prop()) {
234  }
235  return Tparent::IsSetValidated();
236 }
237 
238 
240 {
241  if (CanGetVariant_prop()) {
243  }
244  return Tparent::CanGetValidated();
245 }
246 
247 
249 {
250  if (IsSetVariant_prop()) {
252  }
254 }
255 
256 
258 {
259  if (IsSetVariant_prop()) {
261  }
262  return Tparent::GetValidated();
263 }
264 
265 
267 {
268  if (Tparent::IsSetValidated()) {
270  }
272 }
273 
274 
276 {
277  if (Tparent::IsSetValidated()) {
278  if (SetVariant_prop().IsSetOther_validation()) {
279  ERR_POST(Error <<
280  "Dropping deprecated conflicting data: "
281  "Variation-ref.validated: "
282  "Variation-ref.variant-prop.other-validation set");
283  }
284  else {
286  }
287 
289  }
291 }
292 
293 
294 //////////////////////////////////////////////////////////////////////////////
295 
297 {
299  "CVariation_ref::IsSetClinical_test(): "
300  "unsupported deprecated API");
301 }
302 
303 
305 {
307  "CVariation_ref::CanGetClinical_test(): "
308  "unsupported deprecated API");
309 }
310 
311 
313 {
315  "CVariation_ref::ResetClinical_test(): "
316  "unsupported deprecated API");
317 }
318 
319 
321 {
323  "CVariation_ref::GetClinical_test(): "
324  "unsupported deprecated API");
325 }
326 
327 
329 {
331  "CVariation_ref::SetClinical_test(): "
332  "unsupported deprecated API");
333 }
334 
335 
336 //////////////////////////////////////////////////////////////////////////////
337 
339 {
340  if (IsSetVariant_prop()) {
342  }
344 }
345 
346 
348 {
349  if (CanGetVariant_prop()) {
351  }
353 }
354 
355 
357 {
358  if (IsSetVariant_prop()) {
360  }
362 }
363 
364 
366 {
367  if (IsSetVariant_prop()) {
369  }
370  return Tparent::GetAllele_origin();
371 }
372 
373 
375 {
378  }
380 }
381 
382 
384 {
387  ERR_POST(Error <<
388  "Dropping deprecated conflicting data: "
389  "Variation-ref.allele-origin: "
390  "Variation-ref.variant-prop.allele-origin set");
391  }
392  else {
394  }
395 
397  }
399 }
400 
401 
402 //////////////////////////////////////////////////////////////////////////////
403 
405 {
406  if (IsSetVariant_prop()) {
408  }
410 }
411 
412 
414 {
415  if (CanGetVariant_prop()) {
417  }
419 }
420 
421 
423 {
424  if (IsSetVariant_prop()) {
426  }
428 }
429 
430 
432 {
433  if (IsSetVariant_prop()) {
434  return GetVariant_prop().GetAllele_state();
435  }
436  return Tparent::GetAllele_state();
437 }
438 
439 
441 {
444  }
446 }
447 
448 
450 {
453  ERR_POST(Error <<
454  "Dropping deprecated conflicting data: "
455  "Variation-ref.allele-state: "
456  "Variation-ref.variant-prop.allele-state set");
457  }
458  else {
460  }
461 
463  }
464  return SetVariant_prop().SetAllele_state();
465 }
466 
467 
468 //////////////////////////////////////////////////////////////////////////////
469 
471 {
472  if (IsSetVariant_prop()) {
474  }
476 }
477 
478 
480 {
481  if (CanGetVariant_prop()) {
483  }
485 }
486 
487 
489 {
490  if (IsSetVariant_prop()) {
492  }
494 }
495 
496 
498 {
499  if (IsSetVariant_prop()) {
501  }
503 }
504 
505 
507 {
510  }
512 }
513 
514 
516 {
519  ERR_POST(Error <<
520  "Dropping deprecated conflicting data: "
521  "Variation-ref.allele-frequency: "
522  "Variation-ref.variant-prop.allele-frequency set");
523  }
524  else {
526  }
527 
529  }
531 }
532 
533 //////////////////////////////////////////////////////////////////////////////
534 
536 {
537  if (IsSetVariant_prop()) {
539  }
541 }
542 
543 
545 {
546  if (CanGetVariant_prop()) {
548  }
550 }
551 
552 
554 {
555  if (IsSetVariant_prop()) {
557  }
559 }
560 
561 
563 {
564  if (IsSetVariant_prop()) {
566  }
568 }
569 
570 
572 {
575  }
577 }
578 
579 
581 {
583  if (SetVariant_prop().IsSetOther_validation()) {
584  ERR_POST(Error <<
585  "Dropping deprecated conflicting data: "
586  "Variation-ref.is-ancestral-allele: "
587  "Variation-ref.variant-prop.is-ancestral-allele set");
588  }
589  else {
591  }
593  }
595 }
596 
597 
598 //////////////////////////////////////////////////////////////////////////////
599 
600 bool CVariation_ref::IsSetPub(void) const
601 {
603  "CVariation_ref::IsSetPub(): "
604  "unsupported deprecated API");
605 }
606 
607 
609 {
611  "CVariation_ref::CanGetPub(): "
612  "unsupported deprecated API");
613 }
614 
615 
617 {
619  "CVariation_ref::ResetPub(): "
620  "unsupported deprecated API");
621 }
622 
623 
625 {
627  "CVariation_ref::GetPub(): "
628  "unsupported deprecated API");
629 }
630 
631 
632 void CVariation_ref::SetPub(TPub& /*value*/)
633 {
635  "CVariation_ref::SetPub(): "
636  "unsupported deprecated API");
637 }
638 
639 
641 {
643  "CVariation_ref::SetPub(): "
644  "unsupported deprecated API");
645 }
646 
647 
648 void CVariation_ref::SetSNV(const CSeq_data& nucleotide,
649  const CRef<CDelta_item> offset)
650 {
651  auto& inst = SetData().SetInstance();
653  inst.SetDelta().clear();
654 
655  if (offset.NotNull()) {
656  inst.SetDelta().push_back(offset);
657  }
658 
659  auto delta_item = Ref(new CDelta_item());
660  auto& seq_literal = delta_item->SetSeq().SetLiteral();
661  seq_literal.SetSeq_data().Assign(nucleotide);
662  seq_literal.SetLength(1);
663  inst.SetDelta().push_back(delta_item);
664 }
665 
666 
667 void CVariation_ref::SetMNP(const CSeq_data& nucleotide,
668  const TSeqPos length,
670 {
671  auto& inst = SetData().SetInstance();
673  inst.SetDelta().clear();
674 
675  if (offset.NotNull()) {
676  inst.SetDelta().push_back(offset);
677  }
678 
679  auto delta_item = Ref(new CDelta_item());
680  auto& seq_literal = delta_item->SetSeq().SetLiteral();
681  seq_literal.SetSeq_data().Assign(nucleotide);
682  seq_literal.SetLength(length);
683  inst.SetDelta().push_back(delta_item);
684 }
685 
686 
687 void CVariation_ref::SetMissense(const CSeq_data& amino_acid)
688 {
689  auto& inst = SetData().SetInstance();
691  inst.SetDelta().clear();
692  auto delta_item = Ref(new CDelta_item());
693  delta_item->SetSeq().SetLiteral().SetSeq_data().Assign(amino_acid);
694  delta_item->SetSeq().SetLiteral().SetLength() = 1;
695  inst.SetDelta().push_back(delta_item);
696 }
697 
698 
699 
701  const CRef<CDelta_item> stop_offset)
702 {
703  auto& inst = SetData().SetInstance();
705  inst.SetDelta().clear();
706  if (start_offset.NotNull()) {
707  inst.SetDelta().push_back(start_offset);
708  }
709 
710  auto delta_item = Ref(new CDelta_item());
711  delta_item->SetDuplication();
712  inst.SetDelta().push_back(delta_item);
713  if (stop_offset.NotNull()) {
714  inst.SetDelta().push_back(stop_offset);
715  }
716 }
717 
718 
719 
721  const CRef<CDelta_item> start_offset,
722  const CRef<CDelta_item> stop_offset)
723 {
724  auto& inst = SetData().SetInstance();
726  if (seq_literal->IsSetSeq_data()) {
727  inst.SetObservation(CVariation_inst::eObservation_asserted);
728  }
729  inst.SetDelta().clear();
730 
731  if (start_offset.NotNull()) {
732  inst.SetDelta().push_back(start_offset);
733  }
734 
735  auto delta_item = Ref(new CDelta_item());
736  delta_item->SetSeq().SetLiteral(*seq_literal);
737  inst.SetDelta().push_back(delta_item);
738 
739  if (stop_offset.NotNull()) {
740  inst.SetDelta().push_back(stop_offset);
741  }
742 }
743 
744 
745 //////////////////////////////////////////////////////////////////////////////
746 
748 {
749  return Tparent::IsSetLocation();
750 }
751 
752 
754 {
755  return Tparent::CanGetLocation();
756 }
757 
758 
760 {
762 }
763 
764 
766 {
767  return Tparent::GetLocation();
768 }
769 
770 
772 {
774 }
775 
776 
778 {
779  return Tparent::SetLocation();
780 }
781 
782 
783 //////////////////////////////////////////////////////////////////////////////
784 
786 {
787  return Tparent::IsSetExt_locs();
788 }
789 
790 
792 {
793  return Tparent::CanGetExt_locs();
794 }
795 
796 
798 {
800 }
801 
802 
804 {
805  return Tparent::GetExt_locs();
806 }
807 
808 
810 {
811  return Tparent::SetExt_locs();
812 }
813 
814 //////////////////////////////////////////////////////////////////////////////
815 
816 bool CVariation_ref::IsSetExt(void) const
817 {
818  return Tparent::IsSetExt();
819 }
820 
821 
823 {
824  return Tparent::CanGetExt();
825 }
826 
827 
829 {
831 }
832 
833 
835 {
836  return Tparent::GetExt();
837 }
838 
839 
841 {
843 }
844 
845 
847 {
848  return Tparent::SetExt();
849 }
850 
851 /////////////////////////////////////////////////////////////////////////////
852 
853 
854 static void s_SetReplaces(CVariation_ref& ref,
855  const vector<string>& replaces,
856  CVariation_ref::ESeqType seq_type,
857  CVariation_inst::EType var_type)
858 {
859  list< CRef<CDelta_item> > items;
860  bool has_del = false;
861 
862  ITERATE (vector<string>, it, replaces) {
863  string rep(*it);
864  NStr::ToUpper(rep);
866 
867  if (rep.empty() || rep == "-") {
868  has_del = true;
869  } else {
870  CRef<CDelta_item> item(new CDelta_item);
871  item->SetSeq().SetLiteral().SetLength(TSeqPos(rep.size()));
872  if (seq_type == CVariation_ref::eSeqType_na) {
873  item->SetSeq().SetLiteral().SetSeq_data().SetIupacna().Set(rep);
874  } else {
875  item->SetSeq().SetLiteral().SetSeq_data().SetIupacaa().Set(rep);
876  }
877  items.push_back(item);
878  }
879  }
880 
881  if (has_del && items.size()) {
882  ///
883  /// both deletion and replaces
884  /// therefore, we are a complex set
885  ///
887 
888  ref.SetData().SetSet().SetType
890 
891  /// deletion first
892  sub.Reset(new CVariation_ref);
893  sub->SetData().SetInstance().SetType(CVariation_inst::eType_del);
894  sub->SetData().SetInstance().SetDelta().clear();
895  ref.SetData().SetSet().SetVariations().push_back(sub);
896 
897  /// then the replaces
898  sub.Reset(new CVariation_ref);
899  sub->SetData().SetInstance().SetType(var_type);
900  sub->SetData().SetInstance().SetDelta()
901  .insert(sub->SetData().SetInstance().SetDelta().end(),
902  items.begin(), items.end());
903  ref.SetData().SetSet().SetVariations().push_back(sub);
904  }
905  else if (has_del) {
906  ref.SetData().SetInstance().SetDelta().clear();
907  }
908  else if (items.size()) {
909  ref.SetData().SetInstance().SetType(var_type);
910  ref.SetData().SetInstance().SetDelta()
911  .insert(ref.SetData().SetInstance().SetDelta().end(),
912  items.begin(), items.end());
913  }
914 
915  /**
916  ITERATE (vector<string>, it, replaces) {
917  string rep(*it);
918  NStr::ToUpper(rep);
919 
920  CRef<CVariation_ref> ref(new CVariation_ref);
921  CVariation_inst& inst = ref->SetData().SetInstance();
922  inst.SetType(CVariation_inst::eType_snp);
923  inst.SetDelta().clear();
924 
925  CRef<CDelta_item> item(new CDelta_item);
926  item->SetSeq().SetLiteral().SetLength(rep.size());
927  if (seq_type == eSeqType_na) {
928  item->SetSeq().SetLiteral().SetSeq_data().SetIupacna().Set(rep);
929  } else {
930  item->SetSeq().SetLiteral().SetSeq_data().SetIupacaa().Set(rep);
931  }
932  inst.SetDelta().push_back(item);
933 
934  SetData().SetSet().SetVariations().push_back(ref);
935  }
936  SetData().SetSet().SetType(CVariation_ref::TData::TSet::eData_set_type_population);
937  **/
938 }
939 
940 
941 void CVariation_ref::SetSNV(const vector<string>& replaces,
942  ESeqType seq_type)
943 {
944  CVariation_inst& inst = SetData().SetInstance();
945  inst.SetDelta().clear();
946 
947  s_SetReplaces(*this, replaces, seq_type,
949 }
950 
951 
953 {
954  if (GetData().IsInstance() &&
955  GetData().GetInstance().IsSetType() &&
956  GetData().GetInstance().GetType() == CVariation_inst::eType_snv) {
957  return true;
958  }
959  if (GetData().IsSet()) {
960  ITERATE (TData::TSet::TVariations, it, GetData().GetSet().GetVariations()) {
961  const CVariation_ref& ref = **it;
962  if (ref.GetData().IsInstance() &&
963  ref.GetData().GetInstance().IsSetType() &&
965  return true;
966  }
967  }
968  }
969 
970  return false;
971 }
972 
973 
974 void CVariation_ref::SetMNP(const vector<string>& replaces,
975  ESeqType seq_type)
976 {
977  CVariation_inst& inst = SetData().SetInstance();
978  inst.SetDelta().clear();
979 
980  s_SetReplaces(*this, replaces, seq_type,
982 }
983 
984 
985 
987 {
988  return GetData().IsInstance() &&
989  GetData().GetInstance().IsSetType() &&
991 }
992 
993 
994 
996 {
997  CVariation_inst& inst = SetData().SetInstance();
998  inst.SetDelta().clear();
999 
1001 }
1002 
1004 {
1005  return GetData().IsInstance() &&
1006  GetData().GetInstance().IsSetType() &&
1008 }
1009 
1010 
1011 
1012 void CVariation_ref::SetInsertion(const string& sequence, ESeqType seq_type)
1013 {
1014  CVariation_inst& inst = SetData().SetInstance();
1015  inst.SetDelta().clear();
1016 
1017  CRef<CDelta_item> item(new CDelta_item);
1018  item->SetSeq().SetThis();
1019  inst.SetDelta().push_back(item);
1020 
1021  vector<string> replaces;
1022  replaces.push_back(sequence);
1023  s_SetReplaces(*this, replaces, seq_type,
1025 }
1026 
1028 {
1029  return GetData().IsInstance() &&
1030  GetData().GetInstance().IsSetType() &&
1032 }
1033 
1034 
1035 
1037 {
1038  CVariation_inst& inst = SetData().SetInstance();
1040 
1041  CRef<CDelta_item> item(new CDelta_item);
1042  item->SetAction(CDelta_item::eAction_ins_before);
1043  inst.SetDelta().clear();
1044  inst.SetDelta().push_back(item);
1045 }
1046 
1047 
1048 void CVariation_ref::SetDeletionInsertion(const string& sequence,
1049  ESeqType seq_type)
1050 {
1051  CVariation_inst& inst = SetData().SetInstance();
1052  inst.SetDelta().clear();
1053 
1054  CRef<CDelta_item> item;
1055 
1056  item.Reset(new CDelta_item);
1057  item->SetAction(CDelta_item::eAction_del_at);
1058  inst.SetDelta().push_back(item);
1059 
1060  vector<string> replaces;
1061  replaces.push_back(sequence);
1062  s_SetReplaces(*this, replaces, seq_type,
1064 }
1065 
1067 {
1068  return GetData().IsInstance() &&
1069  GetData().GetInstance().IsSetType() &&
1071 }
1072 
1073 
1074 
1075 void CVariation_ref::SetMicrosatellite(const string& nucleotide_seq,
1076  TSeqPos min_repeats,
1077  TSeqPos max_repeats)
1078 {
1079  CVariation_inst& inst = SetData().SetInstance();
1080  inst.SetDelta().clear();
1081 
1082  vector<string> replaces;
1083  replaces.push_back(nucleotide_seq);
1084  s_SetReplaces(*this, replaces, eSeqType_na,
1086 
1087  inst.SetDelta().front()->SetMultiplier(min_repeats);
1088  inst.SetDelta().front()
1089  ->SetMultiplier_fuzz().SetRange().SetMin(min_repeats);
1090  inst.SetDelta().front()
1091  ->SetMultiplier_fuzz().SetRange().SetMax(max_repeats);
1092 }
1093 
1095 {
1096  return GetData().IsInstance() &&
1097  GetData().GetInstance().IsSetType() &&
1099 }
1100 
1101 
1102 
1103 void CVariation_ref::SetMicrosatellite(const string& nucleotide_seq,
1104  const vector<TSeqPos>& observed_repeats)
1105 {
1106  CVariation_inst& inst = SetData().SetInstance();
1107  inst.SetDelta().clear();
1108 
1109  vector<string> replaces;
1110  replaces.push_back(nucleotide_seq);
1111  s_SetReplaces(*this, replaces, eSeqType_na,
1113 
1114  inst.SetDelta().front()->SetMultiplier(observed_repeats.front());
1115  if (observed_repeats.size() > 1) {
1116  std::copy(observed_repeats.begin(),
1117  observed_repeats.end(),
1118  back_inserter(inst.SetDelta().front()
1119  ->SetMultiplier_fuzz().SetAlt()));
1120  }
1121 }
1122 
1123 
1125 {
1126  CVariation_inst& inst = SetData().SetInstance();
1128  inst.SetDelta().clear();
1129 
1130  CRef<CDelta_item> item(new CDelta_item);
1131  item->SetSeq().SetThis();
1132  item->SetMultiplier_fuzz().SetLim(CInt_fuzz::eLim_unk);
1133 
1134  inst.SetDelta().push_back(item);
1135 }
1136 
1138 {
1139  return GetData().IsInstance() &&
1140  GetData().GetInstance().IsSetType() &&
1142 }
1143 
1144 
1145 
1147 {
1148  CVariation_inst& inst = SetData().SetInstance();
1150  inst.SetDelta().clear();
1151 
1152  CRef<CDelta_item> item(new CDelta_item);
1153  item->SetSeq().SetThis();
1154  item->SetMultiplier_fuzz().SetLim(CInt_fuzz::eLim_gt);
1155 
1156  inst.SetDelta().push_back(item);
1157 }
1158 
1160 {
1161  return GetData().IsInstance() &&
1162  GetData().GetInstance().IsSetType() &&
1164  GetData().GetInstance().IsSetDelta() &&
1165  GetData().GetInstance().GetDelta().size() &&
1166  GetData().GetInstance().GetDelta().front()->IsSetMultiplier_fuzz() &&
1167  GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().IsLim() &&
1168  GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().GetLim() == CInt_fuzz::eLim_gt;
1169 
1170 }
1171 
1172 
1173 
1175 {
1176  CVariation_inst& inst = SetData().SetInstance();
1178  inst.SetDelta().clear();
1179 
1180  CRef<CDelta_item> item(new CDelta_item);
1181  item->SetSeq().SetThis();
1182  item->SetMultiplier_fuzz().SetLim(CInt_fuzz::eLim_lt);
1183 
1184  inst.SetDelta().push_back(item);
1185 }
1186 
1188 {
1189  return GetData().IsInstance() &&
1190  GetData().GetInstance().IsSetType() &&
1192  GetData().GetInstance().IsSetDelta() &&
1193  GetData().GetInstance().GetDelta().size() &&
1194  GetData().GetInstance().GetDelta().front()->IsSetMultiplier_fuzz() &&
1195  GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().IsLim() &&
1196  GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().GetLim() == CInt_fuzz::eLim_lt;
1197 
1198 }
1199 
1200 
1201 void CVariation_ref::SetCNV(TSeqPos min_copy, TSeqPos max_copy)
1202 {
1203  CVariation_inst& inst = SetData().SetInstance();
1205  inst.SetDelta().clear();
1206 
1207  CRef<CDelta_item> item(new CDelta_item);
1208  item->SetSeq().SetThis();
1209  item->SetMultiplier_fuzz().SetRange().SetMin(min_copy);
1210  item->SetMultiplier_fuzz().SetRange().SetMax(max_copy);
1211 
1212  inst.SetDelta().push_back(item);
1213 }
1214 
1215 
1216 void CVariation_ref::SetCNV(const vector<TSeqPos>& observed_copies)
1217 {
1218  CVariation_inst& inst = SetData().SetInstance();
1220  inst.SetDelta().clear();
1221 
1222  CRef<CDelta_item> item(new CDelta_item);
1223  item->SetSeq().SetThis();
1224  std::copy(observed_copies.begin(), observed_copies.end(),
1225  back_inserter(item->SetMultiplier_fuzz().SetAlt()));
1226 
1227  inst.SetDelta().push_back(item);
1228 }
1229 
1231 {
1232  CVariation_inst& inst = SetData().SetInstance();
1234  inst.SetDelta().clear();
1235 
1236  CRef<CDelta_item> item(new CDelta_item);
1237  item->SetSeq().SetLoc().Assign(other_loc);
1238  inst.SetDelta().push_back(item);
1239 }
1240 
1242 {
1243  return GetData().IsInstance() &&
1244  GetData().GetInstance().IsSetType() &&
1246 }
1247 
1248 
1249 
1251 {
1252  CVariation_inst& inst = SetData().SetInstance();
1254  inst.SetDelta().clear();
1255 
1256  CRef<CDelta_item> item(new CDelta_item);
1257  item->SetSeq().SetLoc().Assign(other_loc);
1258  inst.SetDelta().push_back(item);
1259 }
1260 
1262 {
1263  return GetData().IsInstance() &&
1264  GetData().GetInstance().IsSetType() &&
1266 }
1267 
1268 
1269 
1270 /// The feature represents an eversion at the specified location
1271 /// The provided location can be anywhere; a special case exists when the
1272 /// provided location is on a different chromosome, in which case the
1273 /// feature is considered a transchromosomal rearrangement
1275 {
1276  CVariation_inst& inst = SetData().SetInstance();
1278  inst.SetDelta().clear();
1279 
1280  CRef<CDelta_item> item;
1281  item.Reset(new CDelta_item);
1282  item->SetAction(CDelta_item::eAction_del_at);
1283  inst.SetDelta().push_back(item);
1284 
1285  item.Reset(new CDelta_item);
1286  item->SetSeq().SetLoc().Assign(other_loc);
1287  inst.SetDelta().push_back(item);
1288 
1289 }
1290 
1292 {
1293  return GetData().IsInstance() &&
1294  GetData().GetInstance().IsSetType() &&
1296 }
1297 
1298 
1299 
1300 /// Establish a uniparental disomy mark-up
1302 {
1304 }
1305 
1307 {
1308  return GetData().IsUniparental_disomy();
1309 }
1310 
1311 
1312 
1313 /// Establish a complex undescribed variant
1315 {
1316  SetData().SetComplex();
1317 }
1318 
1320 {
1321  return GetData().IsComplex();
1322 }
1323 
1324 
1326 {
1327  SetData().SetUnknown();
1328 }
1329 
1331 {
1332  return GetData().IsUnknown();
1333 }
1334 
1335 
1337 {
1338  SetData().SetSet().SetType
1341 
1342 }
1343 
1345 {
1346  return GetData().IsSet() &&
1347  GetData().GetSet().GetType() ==
1349 }
1350 
1351 
1352 
1353 ///
1354 /// perform necessary validation
1355 ///
1357 {
1358 }
1359 
1360 
1361 END_objects_SCOPE // namespace ncbi::objects::
1362 
1364 
1365 /* Original file checksum: lines: 57, chars: 1736, CRC32: 48a35aa2 */
User-defined methods of the data storage class.
static void s_SetReplaces(CVariation_ref &ref, const vector< string > &replaces, CVariation_ref::ESeqType seq_type, CVariation_inst::EType var_type)
User-defined methods of the data storage class.
Definition: Pub.hpp:56
CRef –.
Definition: ncbiobj.hpp:618
CVariation_inst –.
bool CanGetExt_locs(void) const
void SetCNV()
Make this variant a copy number variant.
TValidated GetValidated(void) const
TAllele_state & SetAllele_state(void)
TLocation & SetLocation(void)
const TPub & GetPub(void) const
bool CanGetAllele_state(void) const
void SetEversion(const CSeq_loc &other_loc)
The feature represents an eversion at the specified location The provided location should be downstre...
TPub & SetPub(void)
void ResetPopulation_data(void)
bool IsSetIs_ancestral_allele(void) const
TIs_ancestral_allele GetIs_ancestral_allele(void) const
bool IsLoss() const
const TExt & GetExt(void) const
const TClinical_test & GetClinical_test(void) const
TExt & SetExt(void)
void ResetPub(void)
void SetInsertion()
Make this variant an insertion of unknown sequence.
TAllele_origin & SetAllele_origin(void)
void SetDeletionInsertion(const string &sequence, ESeqType seq_type)
Make this variant an insertion.
const TExt_locs & GetExt_locs(void) const
bool IsSetAllele_origin(void) const
bool IsSetPopulation_data(void) const
Prohibited deprecated functions Due to limitations in ASN spec-land, we cannot officially remove thes...
void PostRead()
PostRead() hooks to establish correct, non-deprecated data layout.
TPopulation_data & SetPopulation_data(void)
void ResetAllele_frequency(void)
const TLocation & GetLocation(void) const
TAllele_frequency & SetAllele_frequency(void)
bool IsSetExt(void) const
bool IsUnknown() const
void ResetExt(void)
void SetOther()
Create a variant of type 'other'.
bool IsMicrosatellite() const
TAllele_origin GetAllele_origin(void) const
bool IsOther() const
bool IsComplex() const
void ResetExt_locs(void)
void SetUnknown()
Create a variant of unknown type.
void ResetAllele_origin(void)
TValidated & SetValidated(void)
bool CanGetAllele_frequency(void) const
void SetDeletion()
Make this variant a deletion.
bool IsEversion() const
bool CanGetPub(void) const
bool IsUniparentalDisomy() const
TAllele_state GetAllele_state(void) const
bool IsSetClinical_test(void) const
void SetSNV(const CSeq_data &nucleotide, CRef< CDelta_item > offset=null)
void ResetAllele_state(void)
bool IsDeletionInsertion() const
ESeqType
Enum governing sequence types for supplied sequence strings.
bool IsGain() const
void SetUniparentalDisomy()
Establish a uniparental disomy mark-up.
bool IsSetLocation(void) const
NOTE: THESE ARE GOING AWAY SOON!!
bool IsSetValidated(void) const
bool IsTranslocation() const
bool CanGetValidated(void) const
bool IsInversion() const
void ResetValidated(void)
void SetGain()
Special subtype of CNV: 'gain' - an unspecified increase in copy number.
TClinical_test & SetClinical_test(void)
bool CanGetAllele_origin(void) const
void SetIdentity(CRef< CSeq_literal > seq_literal, CRef< CDelta_item > start_offset=null, CRef< CDelta_item > stop_offset=null)
TExt_locs & SetExt_locs(void)
bool IsInsertion() const
bool IsSetAllele_frequency(void) const
bool IsDeletion() const
TAllele_frequency GetAllele_frequency(void) const
bool CanGetPopulation_data(void) const
void ResetLocation(void)
bool CanGetClinical_test(void) const
bool CanGetLocation(void) const
bool IsSetExt_locs(void) const
void ResetIs_ancestral_allele(void)
void SetLoss()
Special subtype of CNV: 'loss' - an unspecified decrease in copy number.
void SetMissense(const CSeq_data &amino_acid)
const TPopulation_data & GetPopulation_data(void) const
void SetMicrosatellite(const string &nucleotide_seq, TSeqPos min_repeats, TSeqPos max_repeats)
Set the standard fields for a microsatellite.
bool IsSetPub(void) const
void SetTranslocation(const CSeq_loc &other_loc)
The feature represents a translocation event The provided location can be anywhere; a special case ex...
bool CanGetExt(void) const
bool IsSNV() const
bool IsMNP() const
bool IsSetAllele_state(void) const
void SetMNP(const CSeq_data &nucleotide, TSeqPos length, CRef< CDelta_item > offset=null)
void SetInversion(const CSeq_loc &other_loc)
The feature represents an inversion at the specified location The provided location should be upstrea...
TIs_ancestral_allele & SetIs_ancestral_allele(void)
void SetComplex()
Create a complex undescribed variant.
bool CanGetIs_ancestral_allele(void) const
void SetDuplication(CRef< CDelta_item > start_offset=null, CRef< CDelta_item > stop_offset=null)
void Validate()
Validate that all semantic fields are correct.
bool IsCNV() const
void ResetClinical_test(void)
int offset
Definition: replacements.h:160
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
bool NotNull(void) const THROWS_NONE
Check if pointer is not null – same effect as NotEmpty().
Definition: ncbiobj.hpp:744
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:3201
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
@ eLim_gt
greater than
Definition: Int_fuzz_.hpp:211
@ eLim_unk
unknown
Definition: Int_fuzz_.hpp:210
@ eLim_lt
less than
Definition: Int_fuzz_.hpp:212
bool IsSetSeq_data(void) const
may have the data Check if a value has been assigned to Seq_data data member.
void ResetClinical_test(void)
Reset Clinical_test data member.
TType GetType(void) const
Get the Type member data.
TAllele_origin GetAllele_origin(void) const
Get the Allele_origin member data.
const TInstance & GetInstance(void) const
Get the variant data.
const TVariant_prop & GetVariant_prop(void) const
Get the Variant_prop member data.
void ResetPopulation_data(void)
Reset Population_data data member.
void SetComplex(void)
Select the variant.
bool CanGetIs_ancestral_allele(void) const
Check if it is safe to call GetIs_ancestral_allele method.
list< CRef< CVariation_ref > > TVariations
bool CanGetAllele_frequency(void) const
Check if it is safe to call GetAllele_frequency method.
void ResetOther_validation(void)
Reset Other_validation data member.
void ResetValidated(void)
Reset Validated data member.
TAllele_state GetAllele_state(void) const
Get the Allele_state member data.
void SetAllele_state(TAllele_state value)
Assign a value to Allele_state data member.
bool IsSetAllele_state(void) const
Check if a value has been assigned to Allele_state data member.
const TSet & GetSet(void) const
Get the variant data.
bool IsSetDelta(void) const
Sequence that replaces the location, in biological order.
bool CanGetExt_locs(void) const
Check if it is safe to call GetExt_locs method.
void ResetAllele_frequency(void)
Reset Allele_frequency data member.
bool CanGetExt(void) const
Check if it is safe to call GetExt method.
bool IsSetVariant_prop(void) const
variant properties bit fields Check if a value has been assigned to Variant_prop data member.
bool IsSetAllele_origin(void) const
Check if a value has been assigned to Allele_origin data member.
void ResetAllele_state(void)
Reset Allele_state data member.
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
TType GetType(void) const
Get the Type member data.
void ResetAllele_frequency(void)
Reset Allele_frequency data member.
void ResetAllele_origin(void)
Reset Allele_origin data member.
void SetType(TType value)
Assign a value to Type data member.
bool CanGetAllele_state(void) const
Check if it is safe to call GetAllele_state method.
bool CanGetValidated(void) const
Check if it is safe to call GetValidated method.
bool IsSetAllele_origin(void) const
Check if a value has been assigned to Allele_origin data member.
bool IsSetPopulation_data(void) const
Note about SNP representation and pretinent fields: allele-frequency, population, quality-codes: The ...
TIs_ancestral_allele GetIs_ancestral_allele(void) const
Get the Is_ancestral_allele member data.
bool CanGetVariant_prop(void) const
Check if it is safe to call GetVariant_prop method.
bool CanGetAllele_origin(void) const
Check if it is safe to call GetAllele_origin method.
const TDelta & GetDelta(void) const
Get the Delta member data.
TLocation & SetLocation(void)
Assign a value to Location data member.
void SetUnknown(void)
Select the variant.
bool IsSetPub(void) const
publication support.
void ResetLocation(void)
Reset Location data member.
void ResetExt(void)
Reset Ext data member.
void SetData(TData &value)
Assign a value to Data data member.
void ResetAllele_state(void)
Reset Allele_state data member.
bool IsSetAllele_frequency(void) const
NOTE: 'allele-frequency' here refers to the minor allele frequency of the default population DEPRECAT...
const TData & GetData(void) const
Get the Data member data.
TData & SetData(void)
Assign a value to Data data member.
bool CanGetOther_validation(void) const
Check if it is safe to call GetOther_validation method.
const TLocation & GetLocation(void) const
Get the Location member data.
TValidated GetValidated(void) const
Get the Validated member data.
TVariant_prop & SetVariant_prop(void)
Assign a value to Variant_prop data member.
TExt_locs & SetExt_locs(void)
Assign a value to Ext_locs data member.
bool CanGetAllele_origin(void) const
Check if it is safe to call GetAllele_origin method.
bool CanGetAllele_state(void) const
Check if it is safe to call GetAllele_state method.
void ResetExt_locs(void)
Reset Ext_locs data member.
void SetAllele_origin(TAllele_origin value)
Assign a value to Allele_origin data member.
bool IsInstance(void) const
Check if variant Instance is selected.
TOther_validation GetOther_validation(void) const
Get the Other_validation member data.
bool IsSetAllele_state(void) const
Check if a value has been assigned to Allele_state data member.
list< CRef< CPopulation_data > > TPopulation_data
bool CanGetAllele_frequency(void) const
Check if it is safe to call GetAllele_frequency method.
bool IsSetIs_ancestral_allele(void) const
is this variant the ancestral allele? DEPRECATED: new field = VariantProperties.is-ancestral-allele C...
bool IsUniparental_disomy(void) const
Check if variant Uniparental_disomy is selected.
bool IsSet(void) const
Check if variant Set is selected.
void SetType(TType value)
Assign a value to Type data member.
bool IsSetClinical_test(void) const
link-outs to GeneTests database DEPRECATED - do not use Check if a value has been assigned to Clinica...
TAllele_frequency GetAllele_frequency(void) const
Get the Allele_frequency member data.
void SetIs_ancestral_allele(TIs_ancestral_allele value)
Assign a value to Is_ancestral_allele data member.
void ResetAllele_origin(void)
Reset Allele_origin data member.
TSet & SetSet(void)
Select the variant.
void ResetPub(void)
Reset Pub data member.
bool IsUnknown(void) const
Check if variant Unknown is selected.
TVariations & SetVariations(void)
Assign a value to Variations data member.
void ResetIs_ancestral_allele(void)
Reset Is_ancestral_allele data member.
bool IsSetLocation(void) const
Observed location, if different from the parent set or feature.location.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
bool IsSetIs_ancestral_allele(void) const
is this variant the ancestral allele? Check if a value has been assigned to Is_ancestral_allele data ...
bool IsSetOther_validation(void) const
has this variant been validated? While a boolean flag offers no subtle distinctions of validation met...
bool IsSetValidated(void) const
has this variant been validated? DEPRECATED: new field = VariantProperties.other-validation Check if ...
void SetUniparental_disomy(void)
Select the variant.
TIs_ancestral_allele GetIs_ancestral_allele(void) const
Get the Is_ancestral_allele member data.
void SetOther_validation(TOther_validation value)
Assign a value to Other_validation data member.
list< CRef< CExt_loc > > TExt_locs
TAllele_frequency GetAllele_frequency(void) const
Get the Allele_frequency member data.
void ResetIs_ancestral_allele(void)
Reset Is_ancestral_allele data member.
TInstance & SetInstance(void)
Select the variant.
const TExt_locs & GetExt_locs(void) const
Get the Ext_locs member data.
bool IsSetExt_locs(void) const
reference other locs, e.g.
bool CanGetIs_ancestral_allele(void) const
Check if it is safe to call GetIs_ancestral_allele method.
void SetAllele_frequency(TAllele_frequency value)
Assign a value to Allele_frequency data member.
TDelta & SetDelta(void)
Assign a value to Delta data member.
const TExt & GetExt(void) const
Get the Ext member data.
TExt & SetExt(void)
Assign a value to Ext data member.
list< CRef< CDbtag > > TClinical_test
bool IsSetAllele_frequency(void) const
NOTE: 'allele-frequency' here refers to the minor allele frequency of the default population Check if...
bool IsSetExt(void) const
DEPRECATED - do not use; use Seq-feat.exts instead Check if a value has been assigned to Ext data mem...
TAllele_origin GetAllele_origin(void) const
Get the Allele_origin member data.
bool IsComplex(void) const
Check if variant Complex is selected.
TAllele_state GetAllele_state(void) const
Get the Allele_state member data.
@ eType_snv
delta=[morph of length 1] NOTE: this is snV not snP; the latter requires frequency-based validation t...
@ eType_inverted_copy
delta=[ins.seq= upstream location on the opposite strand]
@ eType_mnp
delta=[morph of length >1]
@ eType_microsatellite
delta=[del, ins.seq= repeat-unit with fuzzy multiplier] variation-location is the microsat expansion ...
@ eType_delins
delta=[del, ins]
@ eType_everted_copy
delta=[ins.seq= downstream location on the opposite strand]
@ eType_cnv
delta=[del, ins= 'this' with fuzzy multiplier]
@ eType_prot_missense
delta=[morph of length 1]
@ eType_translocation
delta=like delins
@ eAction_del_at
excise sequence at location if multiplier is specified, delete len(location)*multiplier positions dow...
@ eAction_ins_before
insert seq before the location.start
@ eData_set_type_compound
complex change at the same location on the same molecule
@ eObservation_asserted
inst represents the asserted base at a position
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
Modified on Mon May 13 04:35:56 2024 by modify_doxy.py rev. 669887