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

Go to the SVN repository for this file.

00001 /* $Id: Variation_ref.cpp 51607 2011-10-17 23:59:36Z dicuccio $
00002  * ===========================================================================
00003  *
00004  *                            PUBLIC DOMAIN NOTICE
00005  *               National Center for Biotechnology Information
00006  *
00007  *  This software/database is a "United States Government Work" under the
00008  *  terms of the United States Copyright Act.  It was written as part of
00009  *  the author's official duties as a United States Government employee and
00010  *  thus cannot be copyrighted.  This software/database is freely available
00011  *  to the public for use. The National Library of Medicine and the U.S.
00012  *  Government have not placed any restriction on its use or reproduction.
00013  *
00014  *  Although all reasonable efforts have been taken to ensure the accuracy
00015  *  and reliability of the software and data, the NLM and the U.S.
00016  *  Government do not and cannot warrant the performance or results that
00017  *  may be obtained by using this software or data. The NLM and the U.S.
00018  *  Government disclaim all warranties, express or implied, including
00019  *  warranties of performance, merchantability or fitness for any particular
00020  *  purpose.
00021  *
00022  *  Please cite the author in any work or product based on this material.
00023  *
00024  * ===========================================================================
00025  *
00026  * Author:  .......
00027  *
00028  * File Description:
00029  *   .......
00030  *
00031  * Remark:
00032  *   This code was originally generated by application DATATOOL
00033  *   using the following specifications:
00034  *   'seqfeat.asn'.
00035  */
00036 
00037 // standard includes
00038 #include <ncbi_pch.hpp>
00039 
00040 // generated includes
00041 #include <objects/seqfeat/Variation_ref.hpp>
00042 #include <objects/seq/Seq_literal.hpp>
00043 
00044 // generated classes
00045 
00046 BEGIN_NCBI_SCOPE
00047 
00048 BEGIN_objects_SCOPE // namespace ncbi::objects::
00049 
00050 // destructor
00051 CVariation_ref::~CVariation_ref(void)
00052 {
00053 }
00054 
00055 
00056 void CVariation_ref::PostRead()
00057 {
00058     // population-data: ignore; deprecated, drop
00059     if (Tparent::IsSetPopulation_data()) {
00060         ERR_POST(Error
00061                  << "Variation-ref.population-data is deprecated and "
00062                  "will be ignored");
00063         Tparent::ResetPopulation_data();
00064     }
00065 
00066     // validated: move to VariantProperties.other-validation
00067     if (Tparent::IsSetValidated()) {
00068         if (SetVariant_prop().IsSetOther_validation()) {
00069             ERR_POST(Error
00070                      << "Both Variation-ref.validated and "
00071                      "Variation-ref.variant-properties.other-validation are "
00072                      "set; ignoring Variation-ref.validated");
00073         }
00074         else {
00075             SetVariant_prop().SetOther_validation(Tparent::GetValidated());
00076         }
00077         Tparent::ResetValidated();
00078     }
00079 
00080     // clinical-test: should be moved to Seq-feat.dbxref; no access here!
00081     // FIXME: is this used anywhere?
00082     if (Tparent::IsSetClinical_test()) {
00083         ERR_POST(Error
00084                  << "Variation-ref.clinical-test is deprecated and "
00085                  "will be ignored");
00086         Tparent::ResetClinical_test();
00087     }
00088 
00089     // allele-origin: move to Variant-properties
00090     if (Tparent::IsSetAllele_origin()) {
00091         if (SetVariant_prop().IsSetAllele_origin()) {
00092             ERR_POST(Error
00093                      << "Both Variation-ref.allele-origin and "
00094                      "Variation-ref.variant-properties.allele-origin are "
00095                      "set; ignoring Variation-ref.validated");
00096         }
00097         else {
00098             SetVariant_prop().SetAllele_origin(Tparent::GetAllele_origin());
00099         }
00100         Tparent::ResetAllele_origin();
00101     }
00102 
00103     // allele-state: move to Variant-properties
00104     if (Tparent::IsSetAllele_state()) {
00105         if (SetVariant_prop().IsSetAllele_state()) {
00106             ERR_POST(Error
00107                      << "Both Variation-ref.allele-state and "
00108                      "Variation-ref.variant-properties.allele-state are "
00109                      "set; ignoring Variation-ref.validated");
00110         }
00111         else {
00112             SetVariant_prop().SetAllele_state(Tparent::GetAllele_state());
00113         }
00114         Tparent::ResetAllele_state();
00115     }
00116 
00117     // allele-frequency: move to Variant-properties
00118     if (Tparent::IsSetAllele_frequency()) {
00119         if (SetVariant_prop().IsSetAllele_frequency()) {
00120             ERR_POST(Error
00121                      << "Both Variation-ref.allele-frequency and "
00122                      "Variation-ref.variant-properties.allele-frequency are "
00123                      "set; ignoring Variation-ref.validated");
00124         }
00125         else {
00126             SetVariant_prop().SetAllele_frequency(Tparent::GetAllele_frequency());
00127         }
00128         Tparent::ResetAllele_frequency();
00129     }
00130 
00131     // is-ancestral-allele: move to Variant-properties
00132     if (Tparent::IsSetIs_ancestral_allele()) {
00133         if (SetVariant_prop().IsSetIs_ancestral_allele()) {
00134             ERR_POST(Error
00135                      << "Both Variation-ref.is-ancestral-allele and "
00136                      "Variation-ref.variant-properties.is-ancestral-allele are "
00137                      "set; ignoring Variation-ref.validated");
00138         }
00139         else {
00140             SetVariant_prop().SetIs_ancestral_allele(Tparent::GetIs_ancestral_allele());
00141         }
00142         Tparent::ResetIs_ancestral_allele();
00143     }
00144 
00145     // pub: move to Seq-feat.dbxref; no access here
00146     // FIXME: do we need to do this?
00147     if (Tparent::IsSetPub()) {
00148         ERR_POST(Error
00149                  << "Variation-ref.pub is deprecated and "
00150                  "will be ignored");
00151         Tparent::ResetPub();
00152     }
00153 
00154     /**
00155     // location: deprecated, drop
00156     if (Tparent::IsSetLocation()) {
00157         ERR_POST(Error
00158                  << "Variation-ref.location is deprecated and "
00159                  "will be ignored");
00160         Tparent::ResetLocation();
00161     }
00162     **/
00163 
00164     /**
00165     // ext-locs: deprecated, drop
00166     if (Tparent::IsSetExt_locs()) {
00167         ERR_POST(Error
00168                  << "Variation-ref.ext-locs is deprecated and "
00169                  "will be ignored");
00170         Tparent::ResetExt_locs();
00171     }
00172     **/
00173 
00174     /**
00175     // ext: deprecated, drop
00176     if (Tparent::IsSetExt()) {
00177         ERR_POST(Error
00178                  << "Variation-ref.ext is deprecated and "
00179                  "will be ignored");
00180         Tparent::ResetExt();
00181     }
00182     **/
00183 }
00184 
00185 
00186 //////////////////////////////////////////////////////////////////////////////
00187 
00188 bool CVariation_ref::IsSetPopulation_data(void) const
00189 {
00190     NCBI_THROW(CException, eUnknown,
00191                "CVariation_ref::IsSetPopulation_data(): "
00192                "unsupported deprecated API");
00193 }
00194 
00195 
00196 bool CVariation_ref::CanGetPopulation_data(void) const
00197 {
00198     NCBI_THROW(CException, eUnknown,
00199                "CVariation_ref::CanGetPopulation_data(): "
00200                "unsupported deprecated API");
00201 }
00202 
00203 
00204 void CVariation_ref::ResetPopulation_data(void)
00205 {
00206     NCBI_THROW(CException, eUnknown,
00207                "CVariation_ref::ResetPopulation_data(): "
00208                "unsupported deprecated API");
00209 }
00210 
00211 
00212 const CVariation_ref::TPopulation_data& CVariation_ref::GetPopulation_data(void) const
00213 {
00214     NCBI_THROW(CException, eUnknown,
00215                "CVariation_ref::GetPopulation_data(): "
00216                "unsupported deprecated API");
00217 }
00218 
00219 
00220 CVariation_ref::TPopulation_data& CVariation_ref::SetPopulation_data(void)
00221 {
00222     NCBI_THROW(CException, eUnknown,
00223                "CVariation_ref::SetPopulation_data(): "
00224                "unsupported deprecated API");
00225 }
00226 
00227 
00228 //////////////////////////////////////////////////////////////////////////////
00229 
00230 bool CVariation_ref::IsSetValidated(void) const
00231 {
00232     if (IsSetVariant_prop()) {
00233         return GetVariant_prop().IsSetOther_validation();
00234     }
00235     return Tparent::IsSetValidated();
00236 }
00237 
00238 
00239 bool CVariation_ref::CanGetValidated(void) const
00240 {
00241     if (CanGetVariant_prop()) {
00242         return GetVariant_prop().CanGetOther_validation();
00243     }
00244     return Tparent::CanGetValidated();
00245 }
00246 
00247 
00248 void CVariation_ref::ResetValidated(void)
00249 {
00250     if (IsSetVariant_prop()) {
00251         SetVariant_prop().ResetOther_validation();
00252     }
00253     Tparent::ResetValidated();
00254 }
00255 
00256 
00257 CVariation_ref::TValidated CVariation_ref::GetValidated(void) const
00258 {
00259     if (IsSetVariant_prop()) {
00260         return GetVariant_prop().GetOther_validation();
00261     }
00262     return Tparent::GetValidated();
00263 }
00264 
00265 
00266 void CVariation_ref::SetValidated(TValidated value)
00267 {
00268     if (Tparent::IsSetValidated()) {
00269         Tparent::ResetValidated();
00270     }
00271     SetVariant_prop().SetOther_validation(value);
00272 }
00273 
00274 
00275 CVariation_ref::TValidated& CVariation_ref::SetValidated(void)
00276 {
00277     if (Tparent::IsSetValidated()) {
00278         if (SetVariant_prop().IsSetOther_validation()) {
00279             ERR_POST(Error <<
00280                      "Dropping deprecated conflicting data: "
00281                      "Variation-ref.validated: "
00282                      "Variation-ref.variant-prop.other-validation set");
00283         }
00284         else {
00285             SetVariant_prop().SetOther_validation(Tparent::GetValidated());
00286         }
00287 
00288         Tparent::ResetValidated();
00289     }
00290     return SetVariant_prop().SetOther_validation();
00291 }
00292 
00293 
00294 //////////////////////////////////////////////////////////////////////////////
00295 
00296 bool CVariation_ref::IsSetClinical_test(void) const
00297 {
00298     NCBI_THROW(CException, eUnknown,
00299                "CVariation_ref::IsSetClinical_test(): "
00300                "unsupported deprecated API");
00301 }
00302 
00303 
00304 bool CVariation_ref::CanGetClinical_test(void) const
00305 {
00306     NCBI_THROW(CException, eUnknown,
00307                "CVariation_ref::CanGetClinical_test(): "
00308                "unsupported deprecated API");
00309 }
00310 
00311 
00312 void CVariation_ref::ResetClinical_test(void)
00313 {
00314     NCBI_THROW(CException, eUnknown,
00315                "CVariation_ref::ResetClinical_test(): "
00316                "unsupported deprecated API");
00317 }
00318 
00319 
00320 const CVariation_ref::TClinical_test& CVariation_ref::GetClinical_test(void) const
00321 {
00322     NCBI_THROW(CException, eUnknown,
00323                "CVariation_ref::GetClinical_test(): "
00324                "unsupported deprecated API");
00325 }
00326 
00327 
00328 CVariation_ref::TClinical_test& CVariation_ref::SetClinical_test(void)
00329 {
00330     NCBI_THROW(CException, eUnknown,
00331                "CVariation_ref::SetClinical_test(): "
00332                "unsupported deprecated API");
00333 }
00334 
00335 
00336 //////////////////////////////////////////////////////////////////////////////
00337 
00338 bool CVariation_ref::IsSetAllele_origin(void) const
00339 {
00340     if (IsSetVariant_prop()) {
00341         return GetVariant_prop().IsSetAllele_origin();
00342     }
00343     return Tparent::IsSetAllele_origin();
00344 }
00345 
00346 
00347 bool CVariation_ref::CanGetAllele_origin(void) const
00348 {
00349     if (CanGetVariant_prop()) {
00350         return GetVariant_prop().CanGetAllele_origin();
00351     }
00352     return Tparent::CanGetAllele_origin();
00353 }
00354 
00355 
00356 void CVariation_ref::ResetAllele_origin(void)
00357 {
00358     if (IsSetVariant_prop()) {
00359         SetVariant_prop().ResetAllele_origin();
00360     }
00361     Tparent::ResetAllele_origin();
00362 }
00363 
00364 
00365 CVariation_ref::TAllele_origin CVariation_ref::GetAllele_origin(void) const
00366 {
00367     if (IsSetVariant_prop()) {
00368         return GetVariant_prop().GetAllele_origin();
00369     }
00370     return Tparent::GetAllele_origin();
00371 }
00372 
00373 
00374 void CVariation_ref::SetAllele_origin(TAllele_origin value)
00375 {
00376     if (Tparent::IsSetAllele_origin()) {
00377         Tparent::ResetAllele_origin();
00378     }
00379     SetVariant_prop().SetAllele_origin(value);
00380 }
00381 
00382 
00383 CVariation_ref::TAllele_origin& CVariation_ref::SetAllele_origin(void)
00384 {
00385     if (Tparent::IsSetAllele_origin()) {
00386         if (SetVariant_prop().IsSetAllele_origin()) {
00387             ERR_POST(Error <<
00388                      "Dropping deprecated conflicting data: "
00389                      "Variation-ref.allele-origin: "
00390                      "Variation-ref.variant-prop.allele-origin set");
00391         }
00392         else {
00393             SetVariant_prop().SetAllele_origin(Tparent::GetAllele_origin());
00394         }
00395 
00396         Tparent::ResetAllele_origin();
00397     }
00398     return SetVariant_prop().SetAllele_origin();
00399 }
00400 
00401 
00402 //////////////////////////////////////////////////////////////////////////////
00403 
00404 bool CVariation_ref::IsSetAllele_state(void) const
00405 {
00406     if (IsSetVariant_prop()) {
00407         return GetVariant_prop().IsSetAllele_state();
00408     }
00409     return Tparent::IsSetAllele_state();
00410 }
00411 
00412 
00413 bool CVariation_ref::CanGetAllele_state(void) const
00414 {
00415     if (CanGetVariant_prop()) {
00416         return GetVariant_prop().CanGetAllele_state();
00417     }
00418     return Tparent::CanGetAllele_state();
00419 }
00420 
00421 
00422 void CVariation_ref::ResetAllele_state(void)
00423 {
00424     if (IsSetVariant_prop()) {
00425         SetVariant_prop().ResetAllele_state();
00426     }
00427     Tparent::ResetAllele_state();
00428 }
00429 
00430 
00431 CVariation_ref::TAllele_state CVariation_ref::GetAllele_state(void) const
00432 {
00433     if (IsSetVariant_prop()) {
00434         return GetVariant_prop().GetAllele_state();
00435     }
00436     return Tparent::GetAllele_state();
00437 }
00438 
00439 
00440 void CVariation_ref::SetAllele_state(TAllele_state value)
00441 {
00442     if (Tparent::IsSetAllele_state()) {
00443         Tparent::ResetAllele_state();
00444     }
00445     SetVariant_prop().SetAllele_state(value);
00446 }
00447 
00448 
00449 CVariation_ref::TAllele_state& CVariation_ref::SetAllele_state(void)
00450 {
00451     if (Tparent::IsSetAllele_state()) {
00452         if (SetVariant_prop().IsSetAllele_state()) {
00453             ERR_POST(Error <<
00454                      "Dropping deprecated conflicting data: "
00455                      "Variation-ref.allele-state: "
00456                      "Variation-ref.variant-prop.allele-state set");
00457         }
00458         else {
00459             SetVariant_prop().SetAllele_state(Tparent::GetAllele_state());
00460         }
00461 
00462         Tparent::ResetAllele_state();
00463     }
00464     return SetVariant_prop().SetAllele_state();
00465 }
00466 
00467 
00468 //////////////////////////////////////////////////////////////////////////////
00469 
00470 bool CVariation_ref::IsSetAllele_frequency(void) const
00471 {
00472     if (IsSetVariant_prop()) {
00473         return GetVariant_prop().IsSetAllele_frequency();
00474     }
00475     return Tparent::IsSetAllele_frequency();
00476 }
00477 
00478 
00479 bool CVariation_ref::CanGetAllele_frequency(void) const
00480 {
00481     if (CanGetVariant_prop()) {
00482         return GetVariant_prop().CanGetAllele_frequency();
00483     }
00484     return Tparent::CanGetAllele_frequency();
00485 }
00486 
00487 
00488 void CVariation_ref::ResetAllele_frequency(void)
00489 {
00490     if (IsSetVariant_prop()) {
00491         SetVariant_prop().ResetAllele_frequency();
00492     }
00493     Tparent::ResetAllele_frequency();
00494 }
00495 
00496 
00497 CVariation_ref::TAllele_frequency CVariation_ref::GetAllele_frequency(void) const
00498 {
00499     if (IsSetVariant_prop()) {
00500         return GetVariant_prop().GetAllele_frequency();
00501     }
00502     return Tparent::GetAllele_frequency();
00503 }
00504 
00505 
00506 void CVariation_ref::SetAllele_frequency(TAllele_frequency value)
00507 {
00508     if (Tparent::IsSetAllele_frequency()) {
00509         Tparent::ResetAllele_frequency();
00510     }
00511     SetVariant_prop().SetAllele_frequency(value);
00512 }
00513 
00514 
00515 CVariation_ref::TAllele_frequency& CVariation_ref::SetAllele_frequency(void)
00516 {
00517     if (Tparent::IsSetAllele_frequency()) {
00518         if (SetVariant_prop().IsSetAllele_frequency()) {
00519             ERR_POST(Error <<
00520                      "Dropping deprecated conflicting data: "
00521                      "Variation-ref.allele-frequency: "
00522                      "Variation-ref.variant-prop.allele-frequency set");
00523         }
00524         else {
00525             SetVariant_prop().SetAllele_frequency(Tparent::GetAllele_frequency());
00526         }
00527 
00528         Tparent::ResetAllele_frequency();
00529     }
00530     return SetVariant_prop().SetAllele_frequency();
00531 }
00532 
00533 //////////////////////////////////////////////////////////////////////////////
00534 
00535 bool CVariation_ref::IsSetIs_ancestral_allele(void) const
00536 {
00537     if (IsSetVariant_prop()) {
00538         return GetVariant_prop().IsSetIs_ancestral_allele();
00539     }
00540     return Tparent::IsSetIs_ancestral_allele();
00541 }
00542 
00543 
00544 bool CVariation_ref::CanGetIs_ancestral_allele(void) const
00545 {
00546     if (CanGetVariant_prop()) {
00547         return GetVariant_prop().CanGetIs_ancestral_allele();
00548     }
00549     return Tparent::CanGetIs_ancestral_allele();
00550 }
00551 
00552 
00553 void CVariation_ref::ResetIs_ancestral_allele(void)
00554 {
00555     if (IsSetVariant_prop()) {
00556         SetVariant_prop().ResetIs_ancestral_allele();
00557     }
00558     Tparent::ResetIs_ancestral_allele();
00559 }
00560 
00561 
00562 CVariation_ref::TIs_ancestral_allele CVariation_ref::GetIs_ancestral_allele(void) const
00563 {
00564     if (IsSetVariant_prop()) {
00565         return GetVariant_prop().GetIs_ancestral_allele();
00566     }
00567     return Tparent::GetIs_ancestral_allele();
00568 }
00569 
00570 
00571 void CVariation_ref::SetIs_ancestral_allele(TIs_ancestral_allele value)
00572 {
00573     if (Tparent::IsSetIs_ancestral_allele()) {
00574         Tparent::ResetIs_ancestral_allele();
00575     }
00576     SetVariant_prop().SetIs_ancestral_allele(value);
00577 }
00578 
00579 
00580 CVariation_ref::TIs_ancestral_allele& CVariation_ref::SetIs_ancestral_allele(void)
00581 {
00582     if (Tparent::IsSetIs_ancestral_allele()) {
00583         if (SetVariant_prop().IsSetOther_validation()) {
00584             ERR_POST(Error <<
00585                      "Dropping deprecated conflicting data: "
00586                      "Variation-ref.is-ancestral-allele: "
00587                      "Variation-ref.variant-prop.is-ancestral-allele set");
00588         }
00589         else {
00590             SetVariant_prop().SetIs_ancestral_allele(Tparent::GetIs_ancestral_allele());
00591         }
00592         Tparent::ResetIs_ancestral_allele();
00593     }
00594     return SetVariant_prop().SetIs_ancestral_allele();
00595 }
00596 
00597 
00598 //////////////////////////////////////////////////////////////////////////////
00599 
00600 bool CVariation_ref::IsSetPub(void) const
00601 {
00602     NCBI_THROW(CException, eUnknown,
00603                "CVariation_ref::IsSetPub(): "
00604                "unsupported deprecated API");
00605 }
00606 
00607 
00608 bool CVariation_ref::CanGetPub(void) const
00609 {
00610     NCBI_THROW(CException, eUnknown,
00611                "CVariation_ref::CanGetPub(): "
00612                "unsupported deprecated API");
00613 }
00614 
00615 
00616 void CVariation_ref::ResetPub(void)
00617 {
00618     NCBI_THROW(CException, eUnknown,
00619                "CVariation_ref::ResetPub(): "
00620                "unsupported deprecated API");
00621 }
00622 
00623 
00624 const CVariation_ref::TPub& CVariation_ref::GetPub(void) const
00625 {
00626     NCBI_THROW(CException, eUnknown,
00627                "CVariation_ref::GetPub(): "
00628                "unsupported deprecated API");
00629 }
00630 
00631 
00632 void CVariation_ref::SetPub(TPub& value)
00633 {
00634     NCBI_THROW(CException, eUnknown,
00635                "CVariation_ref::SetPub(): "
00636                "unsupported deprecated API");
00637 }
00638 
00639 
00640 CVariation_ref::TPub& CVariation_ref::SetPub(void)
00641 {
00642     NCBI_THROW(CException, eUnknown,
00643                "CVariation_ref::SetPub(): "
00644                "unsupported deprecated API");
00645 }
00646 
00647 
00648 //////////////////////////////////////////////////////////////////////////////
00649 
00650 bool CVariation_ref::IsSetLocation(void) const
00651 {
00652     return Tparent::IsSetLocation();
00653 }
00654 
00655 
00656 bool CVariation_ref::CanGetLocation(void) const
00657 {
00658     return Tparent::CanGetLocation();
00659 }
00660 
00661 
00662 void CVariation_ref::ResetLocation(void)
00663 {
00664     Tparent::ResetLocation();
00665 }
00666 
00667 
00668 const CVariation_ref::TLocation& CVariation_ref::GetLocation(void) const
00669 {
00670     return Tparent::GetLocation();
00671 }
00672 
00673 
00674 void CVariation_ref::SetLocation(TLocation& value)
00675 {
00676     Tparent::SetLocation(value);
00677 }
00678 
00679 
00680 CVariation_ref::TLocation& CVariation_ref::SetLocation(void)
00681 {
00682     return Tparent::SetLocation();
00683 }
00684 
00685 
00686 //////////////////////////////////////////////////////////////////////////////
00687 
00688 bool CVariation_ref::IsSetExt_locs(void) const
00689 {
00690     return Tparent::IsSetExt_locs();
00691 }
00692 
00693 
00694 bool CVariation_ref::CanGetExt_locs(void) const
00695 {
00696     return Tparent::CanGetExt_locs();
00697 }
00698 
00699 
00700 void CVariation_ref::ResetExt_locs(void)
00701 {
00702     Tparent::ResetExt_locs();
00703 }
00704 
00705 
00706 const CVariation_ref::TExt_locs& CVariation_ref::GetExt_locs(void) const
00707 {
00708     return Tparent::GetExt_locs();
00709 }
00710 
00711 
00712 CVariation_ref::TExt_locs& CVariation_ref::SetExt_locs(void)
00713 {
00714     return Tparent::SetExt_locs();
00715 }
00716 
00717 //////////////////////////////////////////////////////////////////////////////
00718 
00719 bool CVariation_ref::IsSetExt(void) const
00720 {
00721     return Tparent::IsSetExt();
00722 }
00723 
00724 
00725 bool CVariation_ref::CanGetExt(void) const
00726 {
00727     return Tparent::CanGetExt();
00728 }
00729 
00730 
00731 void CVariation_ref::ResetExt(void)
00732 {
00733     Tparent::ResetExt();
00734 }
00735 
00736 
00737 const CVariation_ref::TExt& CVariation_ref::GetExt(void) const
00738 {
00739     return Tparent::GetExt();
00740 }
00741 
00742 
00743 void CVariation_ref::SetExt(TExt& value)
00744 {
00745     Tparent::SetExt(value);
00746 }
00747 
00748 
00749 CVariation_ref::TExt& CVariation_ref::SetExt(void)
00750 {
00751     return Tparent::SetExt();
00752 }
00753 
00754 /////////////////////////////////////////////////////////////////////////////
00755 
00756 
00757 static void s_SetReplaces(CVariation_ref& ref,
00758                           const vector<string>& replaces,
00759                           CVariation_ref::ESeqType seq_type,
00760                           CVariation_inst::EType var_type)
00761 {
00762     list< CRef<CDelta_item> > items;
00763     bool has_del = false;
00764 
00765     ITERATE (vector<string>, it, replaces) {
00766         string rep(*it);
00767         NStr::ToUpper(rep);
00768         NStr::TruncateSpacesInPlace(rep);
00769 
00770         if (rep.empty()  ||  rep == "-") {
00771             has_del = true;
00772         } else {
00773             CRef<CDelta_item> item(new CDelta_item);
00774             item->SetSeq().SetLiteral().SetLength(rep.size());
00775             if (seq_type == CVariation_ref::eSeqType_na) {
00776                 item->SetSeq().SetLiteral().SetSeq_data().SetIupacna().Set(rep);
00777             } else {
00778                 item->SetSeq().SetLiteral().SetSeq_data().SetIupacaa().Set(rep);
00779             }
00780             items.push_back(item);
00781         }
00782     }
00783 
00784     if (has_del  &&  items.size()) {
00785         ///
00786         /// both deletion and replaces
00787         /// therefore, we are a complex set
00788         ///
00789         CRef<CVariation_ref> sub;
00790 
00791         ref.SetData().SetSet().SetType
00792             (CVariation_ref::TData::TSet::eData_set_type_compound);
00793         
00794         /// deletion first
00795         sub.Reset(new CVariation_ref);
00796         sub->SetData().SetInstance().SetType(CVariation_inst::eType_del);
00797         sub->SetData().SetInstance().SetDelta().clear();
00798         ref.SetData().SetSet().SetVariations().push_back(sub);
00799 
00800         /// then the replaces
00801         sub.Reset(new CVariation_ref);
00802         sub->SetData().SetInstance().SetType(var_type);
00803         sub->SetData().SetInstance().SetDelta()
00804             .insert(sub->SetData().SetInstance().SetDelta().end(),
00805                     items.begin(), items.end());
00806         ref.SetData().SetSet().SetVariations().push_back(sub);
00807     }
00808     else if (has_del) {
00809         ref.SetData().SetInstance().SetDelta().clear();
00810     }
00811     else if (items.size()) {
00812         ref.SetData().SetInstance().SetType(var_type);
00813         ref.SetData().SetInstance().SetDelta()
00814             .insert(ref.SetData().SetInstance().SetDelta().end(),
00815                     items.begin(), items.end());
00816     }
00817 
00818     /**
00819     ITERATE (vector<string>, it, replaces) {
00820         string rep(*it);
00821         NStr::ToUpper(rep);
00822 
00823         CRef<CVariation_ref> ref(new CVariation_ref);
00824         CVariation_inst& inst = ref->SetData().SetInstance();
00825         inst.SetType(CVariation_inst::eType_snp);
00826         inst.SetDelta().clear();
00827 
00828         CRef<CDelta_item> item(new CDelta_item);
00829         item->SetSeq().SetLiteral().SetLength(rep.size());
00830         if (seq_type == eSeqType_na) {
00831             item->SetSeq().SetLiteral().SetSeq_data().SetIupacna().Set(rep);
00832         } else {
00833             item->SetSeq().SetLiteral().SetSeq_data().SetIupacaa().Set(rep);
00834         }
00835         inst.SetDelta().push_back(item);
00836 
00837         SetData().SetSet().SetVariations().push_back(ref);
00838     }
00839     SetData().SetSet().SetType(CVariation_ref::TData::TSet::eData_set_type_population);
00840     **/
00841 }
00842 
00843 
00844 void CVariation_ref::SetSNV(const vector<string>& replaces,
00845                             ESeqType seq_type)
00846 {
00847     CVariation_inst& inst = SetData().SetInstance();
00848     inst.SetDelta().clear();
00849 
00850     s_SetReplaces(*this, replaces, seq_type,
00851                   CVariation_inst::eType_snv);
00852 }
00853 
00854 
00855 bool CVariation_ref::IsSNV() const
00856 {
00857     if (GetData().IsInstance()  &&
00858         GetData().GetInstance().IsSetType()  &&
00859         GetData().GetInstance().GetType() == CVariation_inst::eType_snv) {
00860         return true;
00861     }
00862     if (GetData().IsSet()) {
00863         ITERATE (TData::TSet::TVariations, it, GetData().GetSet().GetVariations()) {
00864             const CVariation_ref& ref = **it;
00865             if (ref.GetData().IsInstance()  &&
00866                 ref.GetData().GetInstance().IsSetType()  &&
00867                 ref.GetData().GetInstance().GetType() == CVariation_inst::eType_snv) {
00868                 return true;
00869             }
00870         }
00871     }
00872 
00873     return false;
00874 }
00875 
00876 
00877 void CVariation_ref::SetMNP(const vector<string>& replaces,
00878                             ESeqType seq_type)
00879 {
00880     CVariation_inst& inst = SetData().SetInstance();
00881     inst.SetDelta().clear();
00882 
00883     s_SetReplaces(*this, replaces, seq_type,
00884                   CVariation_inst::eType_mnp);
00885 }
00886 
00887 bool CVariation_ref::IsMNP() const
00888 {
00889     return GetData().IsInstance()  &&
00890            GetData().GetInstance().IsSetType()  &&
00891            GetData().GetInstance().GetType() == CVariation_inst::eType_mnp;
00892 }
00893 
00894 
00895 
00896 void CVariation_ref::SetDeletion()
00897 {
00898     CVariation_inst& inst = SetData().SetInstance();
00899     inst.SetDelta().clear();
00900 
00901     inst.SetType(CVariation_inst::eType_del);
00902 }
00903 
00904 bool CVariation_ref::IsDeletion() const
00905 {
00906     return GetData().IsInstance()  &&
00907            GetData().GetInstance().IsSetType()  &&
00908            GetData().GetInstance().GetType() == CVariation_inst::eType_del;
00909 }
00910 
00911 
00912 
00913 void CVariation_ref::SetInsertion(const string& sequence, ESeqType seq_type)
00914 {
00915     CVariation_inst& inst = SetData().SetInstance();
00916     inst.SetDelta().clear();
00917 
00918     CRef<CDelta_item> item(new CDelta_item);
00919     item->SetSeq().SetThis();
00920     inst.SetDelta().push_back(item);
00921 
00922     vector<string> replaces;
00923     replaces.push_back(sequence);
00924     s_SetReplaces(*this, replaces, seq_type,
00925                   CVariation_inst::eType_ins);
00926 }
00927 
00928 bool CVariation_ref::IsInsertion() const
00929 {
00930     return GetData().IsInstance()  &&
00931            GetData().GetInstance().IsSetType()  &&
00932            GetData().GetInstance().GetType() == CVariation_inst::eType_ins;
00933 }
00934 
00935 
00936 
00937 void CVariation_ref::SetInsertion()
00938 {
00939     CVariation_inst& inst = SetData().SetInstance();
00940     inst.SetType(CVariation_inst::eType_ins);
00941 
00942     CRef<CDelta_item> item(new CDelta_item);
00943     item->SetAction(CDelta_item::eAction_ins_before);
00944     inst.SetDelta().clear();
00945     inst.SetDelta().push_back(item);
00946 }
00947 
00948 
00949 void CVariation_ref::SetDeletionInsertion(const string& sequence,
00950                                           ESeqType seq_type)
00951 {
00952     CVariation_inst& inst = SetData().SetInstance();
00953     inst.SetDelta().clear();
00954 
00955     CRef<CDelta_item> item;
00956 
00957     item.Reset(new CDelta_item);
00958     item->SetAction(CDelta_item::eAction_del_at);
00959     inst.SetDelta().push_back(item);
00960 
00961     vector<string> replaces;
00962     replaces.push_back(sequence);
00963     s_SetReplaces(*this, replaces, seq_type,
00964                   CVariation_inst::eType_delins);
00965 }
00966 
00967 bool CVariation_ref::IsDeletionInsertion() const
00968 {
00969     return GetData().IsInstance()  &&
00970            GetData().GetInstance().IsSetType()  &&
00971            GetData().GetInstance().GetType() == CVariation_inst::eType_delins;
00972 }
00973 
00974 
00975 
00976 void CVariation_ref::SetMicrosatellite(const string& nucleotide_seq,
00977                                        TSeqPos min_repeats,
00978                                        TSeqPos max_repeats)
00979 {
00980     CVariation_inst& inst = SetData().SetInstance();
00981     inst.SetDelta().clear();
00982 
00983     vector<string> replaces;
00984     replaces.push_back(nucleotide_seq);
00985     s_SetReplaces(*this, replaces, eSeqType_na,
00986                   CVariation_inst::eType_microsatellite);
00987 
00988     inst.SetDelta().front()->SetMultiplier(min_repeats);
00989     inst.SetDelta().front()
00990         ->SetMultiplier_fuzz().SetRange().SetMin(min_repeats);
00991     inst.SetDelta().front()
00992         ->SetMultiplier_fuzz().SetRange().SetMax(max_repeats);
00993 }
00994 
00995 bool CVariation_ref::IsMicrosatellite() const
00996 {
00997     return GetData().IsInstance()  &&
00998            GetData().GetInstance().IsSetType()  &&
00999            GetData().GetInstance().GetType() == CVariation_inst::eType_microsatellite;
01000 }
01001 
01002 
01003 
01004 void CVariation_ref::SetMicrosatellite(const string& nucleotide_seq,
01005                                        const vector<TSeqPos>& observed_repeats)
01006 {
01007     CVariation_inst& inst = SetData().SetInstance();
01008     inst.SetDelta().clear();
01009 
01010     vector<string> replaces;
01011     replaces.push_back(nucleotide_seq);
01012     s_SetReplaces(*this, replaces, eSeqType_na,
01013                   CVariation_inst::eType_microsatellite);
01014 
01015     inst.SetDelta().front()->SetMultiplier(observed_repeats.front());
01016     if (observed_repeats.size() > 1) {
01017         std::copy(observed_repeats.begin(),
01018                   observed_repeats.end(),
01019                   back_inserter(inst.SetDelta().front()
01020                                 ->SetMultiplier_fuzz().SetAlt()));
01021     }
01022 }
01023 
01024 
01025 void CVariation_ref::SetCNV()
01026 {
01027     CVariation_inst& inst = SetData().SetInstance();
01028     inst.SetType(CVariation_inst::eType_cnv);
01029     inst.SetDelta().clear();
01030 
01031     CRef<CDelta_item> item(new CDelta_item);
01032     item->SetSeq().SetThis();
01033     item->SetMultiplier_fuzz().SetLim(CInt_fuzz::eLim_unk);
01034 
01035     inst.SetDelta().push_back(item);
01036 }
01037 
01038 bool CVariation_ref::IsCNV() const
01039 {
01040     return GetData().IsInstance()  &&
01041            GetData().GetInstance().IsSetType()  &&
01042            GetData().GetInstance().GetType() == CVariation_inst::eType_cnv;
01043 }
01044 
01045 
01046 
01047 void CVariation_ref::SetGain()
01048 {
01049     CVariation_inst& inst = SetData().SetInstance();
01050     inst.SetType(CVariation_inst::eType_cnv);
01051     inst.SetDelta().clear();
01052 
01053     CRef<CDelta_item> item(new CDelta_item);
01054     item->SetSeq().SetThis();
01055     item->SetMultiplier_fuzz().SetLim(CInt_fuzz::eLim_gt);
01056 
01057     inst.SetDelta().push_back(item);
01058 }
01059 
01060 bool CVariation_ref::IsGain() const
01061 {
01062     return GetData().IsInstance()  &&
01063            GetData().GetInstance().IsSetType()  &&
01064            GetData().GetInstance().GetType() == CVariation_inst::eType_cnv  &&
01065            GetData().GetInstance().IsSetDelta()  &&
01066            GetData().GetInstance().GetDelta().size()  &&
01067            GetData().GetInstance().GetDelta().front()->IsSetMultiplier_fuzz()  &&
01068            GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().IsLim()  &&
01069            GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().GetLim() == CInt_fuzz::eLim_gt;
01070 
01071 }
01072 
01073 
01074 
01075 void CVariation_ref::SetLoss()
01076 {
01077     CVariation_inst& inst = SetData().SetInstance();
01078     inst.SetType(CVariation_inst::eType_cnv);
01079     inst.SetDelta().clear();
01080 
01081     CRef<CDelta_item> item(new CDelta_item);
01082     item->SetSeq().SetThis();
01083     item->SetMultiplier_fuzz().SetLim(CInt_fuzz::eLim_lt);
01084 
01085     inst.SetDelta().push_back(item);
01086 }
01087 
01088 bool CVariation_ref::IsLoss() const
01089 {
01090     return GetData().IsInstance()  &&
01091            GetData().GetInstance().IsSetType()  &&
01092            GetData().GetInstance().GetType() == CVariation_inst::eType_cnv  &&
01093            GetData().GetInstance().IsSetDelta()  &&
01094            GetData().GetInstance().GetDelta().size()  &&
01095            GetData().GetInstance().GetDelta().front()->IsSetMultiplier_fuzz()  &&
01096            GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().IsLim()  &&
01097            GetData().GetInstance().GetDelta().front()->GetMultiplier_fuzz().GetLim() == CInt_fuzz::eLim_lt;
01098 
01099 }
01100 
01101 
01102 void CVariation_ref::SetCNV(TSeqPos min_copy, TSeqPos max_copy)
01103 {
01104     CVariation_inst& inst = SetData().SetInstance();
01105     inst.SetType(CVariation_inst::eType_cnv);
01106     inst.SetDelta().clear();
01107 
01108     CRef<CDelta_item> item(new CDelta_item);
01109     item->SetSeq().SetThis();
01110     item->SetMultiplier_fuzz().SetRange().SetMin(min_copy);
01111     item->SetMultiplier_fuzz().SetRange().SetMax(max_copy);
01112 
01113     inst.SetDelta().push_back(item);
01114 }
01115 
01116 
01117 void CVariation_ref::SetCNV(const vector<TSeqPos>& observed_copies)
01118 {
01119     CVariation_inst& inst = SetData().SetInstance();
01120     inst.SetType(CVariation_inst::eType_cnv);
01121     inst.SetDelta().clear();
01122 
01123     CRef<CDelta_item> item(new CDelta_item);
01124     item->SetSeq().SetThis();
01125     std::copy(observed_copies.begin(), observed_copies.end(),
01126               back_inserter(item->SetMultiplier_fuzz().SetAlt()));
01127 
01128     inst.SetDelta().push_back(item);
01129 }
01130 
01131 void CVariation_ref::SetInversion(const CSeq_loc& other_loc)
01132 {
01133     CVariation_inst& inst = SetData().SetInstance();
01134     inst.SetType(CVariation_inst::eType_inverted_copy);
01135     inst.SetDelta().clear();
01136 
01137     CRef<CDelta_item> item(new CDelta_item);
01138     item->SetSeq().SetLoc().Assign(other_loc);
01139     inst.SetDelta().push_back(item);
01140 }
01141 
01142 bool CVariation_ref::IsInversion() const
01143 {
01144     return GetData().IsInstance()  &&
01145            GetData().GetInstance().IsSetType()  &&
01146            GetData().GetInstance().GetType() == CVariation_inst::eType_inverted_copy;
01147 }
01148 
01149 
01150 
01151 void CVariation_ref::SetEversion(const CSeq_loc& other_loc)
01152 {
01153     CVariation_inst& inst = SetData().SetInstance();
01154     inst.SetType(CVariation_inst::eType_everted_copy);
01155     inst.SetDelta().clear();
01156 
01157     CRef<CDelta_item> item(new CDelta_item);
01158     item->SetSeq().SetLoc().Assign(other_loc);
01159     inst.SetDelta().push_back(item);
01160 }
01161 
01162 bool CVariation_ref::IsEversion() const
01163 {
01164     return GetData().IsInstance()  &&
01165            GetData().GetInstance().IsSetType()  &&
01166            GetData().GetInstance().GetType() == CVariation_inst::eType_everted_copy;
01167 }
01168 
01169 
01170 
01171 /// The feature represents an eversion at the specified location
01172 /// The provided location can be anywhere; a special case exists when the
01173 /// provided location is on a different chromosome, in which case the
01174 /// feature is considered a transchromosomal rearrangement
01175 void CVariation_ref::SetTranslocation(const CSeq_loc& other_loc)
01176 {
01177     CVariation_inst& inst = SetData().SetInstance();
01178     inst.SetType(CVariation_inst::eType_translocation);
01179     inst.SetDelta().clear();
01180 
01181     CRef<CDelta_item> item;
01182     item.Reset(new CDelta_item);
01183     item->SetAction(CDelta_item::eAction_del_at);
01184     inst.SetDelta().push_back(item);
01185 
01186     item.Reset(new CDelta_item);
01187     item->SetSeq().SetLoc().Assign(other_loc);
01188     inst.SetDelta().push_back(item);
01189 
01190 }
01191 
01192 bool CVariation_ref::IsTranslocation() const
01193 {
01194     return GetData().IsInstance()  &&
01195            GetData().GetInstance().IsSetType()  &&
01196            GetData().GetInstance().GetType() == CVariation_inst::eType_translocation;
01197 }
01198 
01199 
01200 
01201 /// Establish a uniparental disomy mark-up
01202 void CVariation_ref::SetUniparentalDisomy()
01203 {
01204     SetData().SetUniparental_disomy();
01205 }
01206 
01207 bool CVariation_ref::IsUniparentalDisomy() const
01208 {
01209     return GetData().IsUniparental_disomy();
01210 }
01211 
01212 
01213 
01214 /// Establish a complex undescribed variant
01215 void CVariation_ref::SetComplex()
01216 {
01217     SetData().SetComplex();
01218 }
01219 
01220 bool CVariation_ref::IsComplex() const
01221 {
01222     return GetData().IsComplex();
01223 }
01224 
01225 
01226 void CVariation_ref::SetUnknown()
01227 {
01228     SetData().SetUnknown();
01229 }
01230 
01231 bool CVariation_ref::IsUnknown() const
01232 {
01233     return GetData().IsUnknown();
01234 }
01235 
01236 
01237 void CVariation_ref::SetOther()
01238 {
01239     SetData().SetSet().SetType
01240         (CVariation_ref::TData::TSet::eData_set_type_other);
01241     SetData().SetSet().SetVariations();
01242 
01243 }
01244 
01245 bool CVariation_ref::IsOther() const
01246 {
01247     return GetData().IsSet()  &&
01248         GetData().GetSet().GetType() ==
01249         CVariation_ref::TData::TSet::eData_set_type_other;
01250 }
01251 
01252 
01253 
01254 ///
01255 /// perform necessary validation
01256 ///
01257 void CVariation_ref::Validate()
01258 {
01259 }
01260 
01261 
01262 END_objects_SCOPE // namespace ncbi::objects::
01263 
01264 END_NCBI_SCOPE
01265 
01266 /* Original file checksum: lines: 57, chars: 1736, CRC32: 48a35aa2 */
Modified on Sun Jul 13 17:39:07 2014 by modify_doxy.py rev. 426318