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

Go to the SVN repository for this file.

1 /*
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: Andrei Shkeda
27  *
28  * File Description:
29  *
30  * ===========================================================================
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/test_boost.hpp>
38 //#include <objects/genomecoll/GC_AssemblyDesc.hpp>
39 
40 #if BOOST_VERSION >= 105900
41 # include <boost/test/tools/output_test_stream.hpp>
42 #else
43 # include <boost/test/output_test_stream.hpp>
44 #endif
45 using boost::test_tools::output_test_stream;
46 
49 
50 
51 BOOST_AUTO_TEST_SUITE(TestSuiteAssemblyInfo)
52 
53 // CRmtIdMapper with assembly accession
54 BOOST_AUTO_TEST_CASE(TestCaseGrch38)
55 {
57  {
58  CRef<CGC_Assembly> gc_assm(GCService.GetAssembly("GCF_000001405.38", "AssemblyOnly"));
59  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "hg38") == true);
60  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "hg19") == false);
61  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "grch38") == true);
62  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "grch37") == false);
63  }
64 }
65 BOOST_AUTO_TEST_CASE(TestCaseGrch37)
66 {
68  {
69  CRef<CGC_Assembly> gc_assm(GCService.GetAssembly("GCF_000001405.13", "AssemblyOnly"));
70  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "hg38") == false);
71  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "hg19") == true);
72  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "grch38") == false);
73  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "grch37") == true);
74  }
75 }
76 BOOST_AUTO_TEST_CASE(TestCaseRefseqAssmAcc)
77 {
79  {
80  CRef<CGC_Assembly> gc_assm(GCService.GetAssembly("GCF_000001635.26", "AssemblyOnly"));
81  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "GRCm38") == true);
82  BOOST_CHECK(CAssemblyInfo::IsSameAssembly(*gc_assm, "GCF_000001635.24") == true);
83  }
84 }
85 
87 
static bool IsSameAssembly(const objects::CGC_Assembly &gc_assm, const string &term)
Check if assembly name (e.g. hg19, grch37) matches CGC_Assembly.
CRef< CGC_Assembly > GetAssembly(const string &acc, const string &mode)
User-defined methods of the data storage class.
BOOST_AUTO_TEST_SUITE(psiblast_iteration)
Utility stuff for more convenient using of Boost.Test library.
USING_SCOPE(objects)
BOOST_AUTO_TEST_CASE(TestCaseGrch38)
BOOST_AUTO_TEST_SUITE_END()
Auxiliary class to convert a string into an argument count and vector.
Modified on Tue Jul 23 17:57:25 2024 by modify_doxy.py rev. 669887