NCBI C++ ToolKit
Functions | Variables
unit_test_seq_loc_util.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbi_system.hpp>
#include <corelib/test_boost.hpp>
#include <objects/seqloc/seqloc__.hpp>
#include <objects/general/general__.hpp>
#include <objects/seqfeat/Feat_id.hpp>
#include <objmgr/object_manager.hpp>
#include <objmgr/util/seq_loc_util.hpp>
#include <objmgr/util/sequence.hpp>
#include <objmgr/seq_vector.hpp>
#include <objects/misc/sequence_macros.hpp>
+ Include dependency graph for unit_test_seq_loc_util.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

 USING_SCOPE (objects)
 
 USING_SCOPE (sequence)
 
CScopeGetScope ()
 
CRef< CSeq_locMakeBond (TIntId giA, TSeqPos posA, TIntId giB=0, TSeqPos posB=0)
 
CRef< CSeq_locMakeInterval (TIntId gi, TSeqPos from, TSeqPos to, ENa_strand strand=eNa_strand_unknown)
 
CRef< CSeq_locMakeInterval (CRef< CSeq_id > id, TSeqPos from, TSeqPos to, ENa_strand strand=eNa_strand_unknown)
 
CRef< CSeq_locMakePoint (TIntId gi, TSeqPos pos)
 
template<class C >
CRef< Cs_Parse (const string &asn)
 
template<class C >
bool s_Equals (const C &obj1, const C &obj2)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_whole)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_interval)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_packed_interval)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_packed_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_mix)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_whole_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_interval_vs_interval)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_interval_vs_packed_interval)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_interval_vs_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_interval_vs_packed_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_interval_vs_mix)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_interval_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_interval_vs_packed_interval)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_interval_vs_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_interval_vs_packed_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_interval_vs_mix)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_interval_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_point_vs_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_point_vs_packed_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_point_vs_mix)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_point_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_point_vs_packed_point)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_point_vs_mix)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_packed_point_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_mix_vs_mix)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_mix_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_Compare_bond_vs_bond)
 
 BOOST_AUTO_TEST_CASE (Test_TestForOverlap)
 
 BOOST_AUTO_TEST_CASE (Test_TestForOverlap_Multiseq)
 
 BOOST_AUTO_TEST_CASE (Test_TestForOverlap_Multistrand)
 
 BOOST_AUTO_TEST_CASE (Test_TestForOverlap64_Circular)
 
 BOOST_AUTO_TEST_CASE (Test_TestForOverlapEx_Circular)
 
static void TestOneCDS (CRef< CSeq_feat > feat, CScope *scope, int expected_frame)
 
 BOOST_AUTO_TEST_CASE (Test_SourceToProductFrame)
 
 BOOST_AUTO_TEST_CASE (Test_RevCompBioseq)
 
 BOOST_AUTO_TEST_CASE (Test_Add1)
 
 BOOST_AUTO_TEST_CASE (Test_Add2)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract1)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract2)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract3)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract4)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract5)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract6)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract7)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract8)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract9)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract10)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract11)
 
 BOOST_AUTO_TEST_CASE (Test_Subtract12)
 
 BOOST_AUTO_TEST_CASE (Test_Merge1)
 
 BOOST_AUTO_TEST_CASE (Test_Merge2)
 
 BOOST_AUTO_TEST_CASE (Test_Merge3)
 
 BOOST_AUTO_TEST_CASE (Test_Merge4)
 

Variables

 USING_NCBI_SCOPE
 
const string sc_TestEntry
 
static const string sc_TestFramePlus
 
const string sc_TestRevCmpEntryRaw
 
const string sc_TestRevCmpEntryDelta
 
const string sc_TestRevCmpEntryDeltaFar
 
const string sc_TestRevCmpError
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/53]

BOOST_AUTO_TEST_CASE ( Test_Add1  )

Definition at line 4622 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Add().

◆ BOOST_AUTO_TEST_CASE() [2/53]

BOOST_AUTO_TEST_CASE ( Test_Add2  )

Definition at line 4638 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Add().

◆ BOOST_AUTO_TEST_CASE() [3/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_bond_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [4/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_interval_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [5/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_interval_vs_interval  )

◆ BOOST_AUTO_TEST_CASE() [6/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_interval_vs_mix  )

◆ BOOST_AUTO_TEST_CASE() [7/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_interval_vs_packed_interval  )

◆ BOOST_AUTO_TEST_CASE() [8/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_interval_vs_packed_point  )

◆ BOOST_AUTO_TEST_CASE() [9/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_interval_vs_point  )

◆ BOOST_AUTO_TEST_CASE() [10/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_mix_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [11/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_mix_vs_mix  )

◆ BOOST_AUTO_TEST_CASE() [12/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_interval_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [13/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_interval_vs_mix  )

◆ BOOST_AUTO_TEST_CASE() [14/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_interval_vs_packed_interval  )

◆ BOOST_AUTO_TEST_CASE() [15/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_interval_vs_packed_point  )

◆ BOOST_AUTO_TEST_CASE() [16/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_interval_vs_point  )

◆ BOOST_AUTO_TEST_CASE() [17/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_point_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [18/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_point_vs_mix  )

◆ BOOST_AUTO_TEST_CASE() [19/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_packed_point_vs_packed_point  )

◆ BOOST_AUTO_TEST_CASE() [20/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_point_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [21/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_point_vs_mix  )

◆ BOOST_AUTO_TEST_CASE() [22/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_point_vs_packed_point  )

◆ BOOST_AUTO_TEST_CASE() [23/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_point_vs_point  )

◆ BOOST_AUTO_TEST_CASE() [24/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_bond  )

◆ BOOST_AUTO_TEST_CASE() [25/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_interval  )

◆ BOOST_AUTO_TEST_CASE() [26/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_mix  )

◆ BOOST_AUTO_TEST_CASE() [27/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_packed_interval  )

◆ BOOST_AUTO_TEST_CASE() [28/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_packed_point  )

◆ BOOST_AUTO_TEST_CASE() [29/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_point  )

◆ BOOST_AUTO_TEST_CASE() [30/53]

BOOST_AUTO_TEST_CASE ( Test_Compare_whole_vs_whole  )

◆ BOOST_AUTO_TEST_CASE() [31/53]

BOOST_AUTO_TEST_CASE ( Test_Merge1  )

Definition at line 4855 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Add().

◆ BOOST_AUTO_TEST_CASE() [32/53]

BOOST_AUTO_TEST_CASE ( Test_Merge2  )

Definition at line 4872 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Add().

◆ BOOST_AUTO_TEST_CASE() [33/53]

BOOST_AUTO_TEST_CASE ( Test_Merge3  )

Definition at line 4889 of file unit_test_seq_loc_util.cpp.

References CSeq_loc::fSort, s_Equals(), and Seq_loc_Add().

◆ BOOST_AUTO_TEST_CASE() [34/53]

BOOST_AUTO_TEST_CASE ( Test_Merge4  )

Definition at line 4906 of file unit_test_seq_loc_util.cpp.

References CSeq_loc::fSort, s_Equals(), and Seq_loc_Add().

◆ BOOST_AUTO_TEST_CASE() [35/53]

BOOST_AUTO_TEST_CASE ( Test_RevCompBioseq  )

◆ BOOST_AUTO_TEST_CASE() [36/53]

BOOST_AUTO_TEST_CASE ( Test_SourceToProductFrame  )

◆ BOOST_AUTO_TEST_CASE() [37/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract1  )

Definition at line 4654 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [38/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract10  )

Definition at line 4804 of file unit_test_seq_loc_util.cpp.

References CSeq_loc::fSort, s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [39/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract11  )

Definition at line 4821 of file unit_test_seq_loc_util.cpp.

References CSeq_loc::fSort, s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [40/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract12  )

Definition at line 4838 of file unit_test_seq_loc_util.cpp.

References CSeq_loc::fSort, s_Equals(), and CSeq_loc::Subtract().

◆ BOOST_AUTO_TEST_CASE() [41/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract2  )

Definition at line 4670 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [42/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract3  )

◆ BOOST_AUTO_TEST_CASE() [43/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract4  )

◆ BOOST_AUTO_TEST_CASE() [44/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract5  )

Definition at line 4718 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [45/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract6  )

Definition at line 4734 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [46/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract7  )

◆ BOOST_AUTO_TEST_CASE() [47/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract8  )

◆ BOOST_AUTO_TEST_CASE() [48/53]

BOOST_AUTO_TEST_CASE ( Test_Subtract9  )

Definition at line 4788 of file unit_test_seq_loc_util.cpp.

References s_Equals(), and Seq_loc_Subtract().

◆ BOOST_AUTO_TEST_CASE() [49/53]

BOOST_AUTO_TEST_CASE ( Test_TestForOverlap  )

◆ BOOST_AUTO_TEST_CASE() [50/53]

BOOST_AUTO_TEST_CASE ( Test_TestForOverlap64_Circular  )

◆ BOOST_AUTO_TEST_CASE() [51/53]

BOOST_AUTO_TEST_CASE ( Test_TestForOverlap_Multiseq  )

◆ BOOST_AUTO_TEST_CASE() [52/53]

BOOST_AUTO_TEST_CASE ( Test_TestForOverlap_Multistrand  )

◆ BOOST_AUTO_TEST_CASE() [53/53]

BOOST_AUTO_TEST_CASE ( Test_TestForOverlapEx_Circular  )

◆ GetScope()

CScope& GetScope ( void  )

◆ MakeBond()

CRef<CSeq_loc> MakeBond ( TIntId  giA,
TSeqPos  posA,
TIntId  giB = 0,
TSeqPos  posB = 0 
)

Definition at line 84 of file unit_test_seq_loc_util.cpp.

References GI_FROM, and CSeq_loc::SetBond().

Referenced by BOOST_AUTO_TEST_CASE().

◆ MakeInterval() [1/2]

CRef<CSeq_loc> MakeInterval ( CRef< CSeq_id id,
TSeqPos  from,
TSeqPos  to,
ENa_strand  strand = eNa_strand_unknown 
)

Definition at line 113 of file unit_test_seq_loc_util.cpp.

References eNa_strand_unknown, and CSeq_loc::SetInt().

◆ MakeInterval() [2/2]

CRef<CSeq_loc> MakeInterval ( TIntId  gi,
TSeqPos  from,
TSeqPos  to,
ENa_strand  strand = eNa_strand_unknown 
)

Definition at line 97 of file unit_test_seq_loc_util.cpp.

References eNa_strand_unknown, GI_FROM, and CSeq_loc::SetInt().

Referenced by BOOST_AUTO_TEST_CASE().

◆ MakePoint()

CRef<CSeq_loc> MakePoint ( TIntId  gi,
TSeqPos  pos 
)

Definition at line 129 of file unit_test_seq_loc_util.cpp.

References GI_FROM, and CSeq_loc::SetPnt().

Referenced by BOOST_AUTO_TEST_CASE().

◆ s_Equals()

template<class C >
bool s_Equals ( const C obj1,
const C obj2 
)

Definition at line 148 of file unit_test_seq_loc_util.cpp.

References MSerial_AsnText, and NcbiCout.

Referenced by BOOST_AUTO_TEST_CASE().

◆ s_Parse()

template<class C >
CRef<C> s_Parse ( const string asn)

Definition at line 139 of file unit_test_seq_loc_util.cpp.

References asn, C, and MSerial_AsnText.

◆ TestOneCDS()

static void TestOneCDS ( CRef< CSeq_feat feat,
CScope scope,
int  expected_frame 
)
static

◆ USING_SCOPE() [1/2]

USING_SCOPE ( objects  )

◆ USING_SCOPE() [2/2]

USING_SCOPE ( sequence  )

Variable Documentation

◆ sc_TestEntry

const string sc_TestEntry

Definition at line 4090 of file unit_test_seq_loc_util.cpp.

Referenced by GetScope().

◆ sc_TestFramePlus

const string sc_TestFramePlus
static

Definition at line 4198 of file unit_test_seq_loc_util.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ sc_TestRevCmpEntryDelta

const string sc_TestRevCmpEntryDelta
Initial value:
= "\
Seq-entry ::= seq { \
id {\
local str \"seq_2\" } , \
inst { \
repr delta,\
mol dna,\
length 40,\
ext delta {\
literal {\
length 8,\
seq-data iupacna \"ATGCATGC\"},\
literal {\
length 5},\
literal {\
length 12,\
seq-data iupacna \"AAATTTGGGCCC\"},\
literal {\
length 7,\
seq-data gap { type unknown } },\
literal {\
length 8,\
seq-data iupacna \"AATTGGCC\"}\
}\
}\
}\
"

Definition at line 4457 of file unit_test_seq_loc_util.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ sc_TestRevCmpEntryDeltaFar

const string sc_TestRevCmpEntryDeltaFar
Initial value:
= "\
Seq-entry ::= seq { \
id {\
local str \"seq_3\" } , \
inst { \
repr delta,\
mol dna,\
length 16,\
ext delta {\
loc int {\
from 0,\
to 3,\
id local str \"seq_1\" },\
literal {\
length 5},\
loc int {\
from 13,\
to 19,\
id local str \"seq_1\" }\
}\
}\
}\
"

Definition at line 4486 of file unit_test_seq_loc_util.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ sc_TestRevCmpEntryRaw

const string sc_TestRevCmpEntryRaw
Initial value:
= "\
Seq-entry ::= seq {\
id {\
local str \"seq_1\" } , \
inst {\
repr raw,\
mol dna,\
length 20,\
seq-data iupacna \"ATGCATGCAAATTTGGGCCC\"\
}\
}\
"

Definition at line 4443 of file unit_test_seq_loc_util.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ sc_TestRevCmpError

const string sc_TestRevCmpError

Definition at line 4511 of file unit_test_seq_loc_util.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ USING_NCBI_SCOPE

USING_NCBI_SCOPE

Definition at line 63 of file unit_test_seq_loc_util.cpp.

Modified on Sat Mar 02 10:56:04 2024 by modify_doxy.py rev. 669887