NCBI C++ ToolKit
Classes | Macros | Functions | Variables
cobalt_unit_test.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbi_system.hpp>
#include <objmgr/object_manager.hpp>
#include <objmgr/util/sequence.hpp>
#include <objmgr/util/seq_loc_util.hpp>
#include <serial/iterator.hpp>
#include <objects/biotree/NodeSet.hpp>
#include <objects/blast/Blast4_request.hpp>
#include <objects/blast/Blast4_request_body.hpp>
#include <objects/blast/Blast4_queue_search_reques.hpp>
#include <objects/blast/Blast4_queries.hpp>
#include <objects/blast/Blas_get_searc_resul_reply.hpp>
#include <objects/scoremat/PssmWithParameters.hpp>
#include <objects/scoremat/Pssm.hpp>
#include <algo/cobalt/cobalt.hpp>
#include <algo/cobalt/options.hpp>
#include "cobalt_test_util.hpp"
#include <unordered_set>
#include <corelib/test_boost.hpp>
#include <common/test_assert.h>
+ Include dependency graph for cobalt_unit_test.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SHit
 Representation of a hit for computing constraints. More...
 
class  CMultiAlignerTest
 Test class for accessing CMultiAligner private attributes and methods. More...
 
class  CMultiAlignerFixture
 Fixture class initialized for each multialigner test. More...
 

Macros

#define NCBI_BOOST_NO_AUTO_TEST_MAIN
 
#define STATIC_ARRAY_SIZE(array)   (sizeof(array)/sizeof(*array))
 Calculate the size of a static array. More...
 

Functions

 USING_SCOPE (cobalt)
 
 USING_SCOPE (objects)
 
static void s_TestQueriesAsSeq_locs (const vector< CRef< CSeq_loc > > &seqlocs, CRef< CScope > scope)
 
static void s_TestQueriesAsBioseqs (const vector< CRef< CBioseq > > &bioseqs)
 
static void s_MakeBioseqs (const vector< CRef< CSeq_loc > > &seqlocs, CRef< CScope > scope, vector< CRef< CBioseq > > &bioseqs)
 
 NCBITEST_AUTO_INIT ()
 
 NCBITEST_AUTO_FINI ()
 
 BOOST_AUTO_TEST_CASE (TestSetQueries)
 
 BOOST_AUTO_TEST_CASE (TestBadQueries)
 
 BOOST_AUTO_TEST_CASE (TestBadUserConstraints)
 
 BOOST_AUTO_TEST_CASE (TestNoResults)
 
static bool s_Interrupt (CMultiAligner::SProgress *progress)
 
 BOOST_AUTO_TEST_CASE (TestInterrupt)
 
static void s_TestTree (vector< bool > &queries, const TPhyTreeNode *node)
 
static void s_TestResultTree (int num_queries, const TPhyTreeNode *tree)
 
static void s_TestResultTreeContainer (int num_queries, const CBioTreeContainer &btc)
 
static void s_TestResultClusters (int num_queries, const CClusterer::TClusters &clusters, const CMultiAlignerOptions::TConstraints &constraints)
 
static void s_TestResultAlignment (const vector< CRef< CSeq_loc > > &queries, const CRef< CSeq_align > &seqalign, const vector< CSequence > &seqs, CRef< CScope > scope, const string &aln_ref="")
 
static void s_TestResults (CMultiAligner &aligner, const string &ref_aln="")
 
 BOOST_AUTO_TEST_CASE (TestResultsForDefaultOpts)
 
 BOOST_AUTO_TEST_CASE (TestResultsForZeroClusterDiam)
 
 BOOST_AUTO_TEST_CASE (TestResultsForMaxClusterDiam)
 
 BOOST_AUTO_TEST_CASE (TestResultsForNoClusters)
 
 BOOST_AUTO_TEST_CASE (TestResultsForClustersAndUserConstraints)
 
 BOOST_AUTO_TEST_CASE (TestTwoSequences)
 
 BOOST_AUTO_TEST_CASE (TestLargeAlignment)
 
void s_TestAlignmentFromMSAs (CRef< CSeq_align > result, CRef< CSeq_align > in_first, CRef< CSeq_align > in_second)
 
 BOOST_AUTO_TEST_CASE (TestAlignMSAs)
 
 BOOST_AUTO_TEST_CASE (TestAlignMSAWithSequence)
 
 BOOST_AUTO_TEST_CASE (TestAlignMSAsWithRepresentatives)
 
 BOOST_AUTO_TEST_CASE (TestAlignMSAsWithWrongRepresentatives)
 
 BOOST_AUTO_TEST_CASE (TestSetPrecomputedDomainHitsWithQueriesAsBioseqset)
 
 BOOST_AUTO_TEST_CASE (TestSetPrecomputedDomainHitsWithQueriesAsSeqLocs)
 
 BOOST_AUTO_TEST_CASE (TestSetPrecomputedDomainHitsWithNoMatchingQueries)
 
 BOOST_AUTO_TEST_CASE (TestSetPrecomputedDomainHitsAboveEThresh)
 
 BOOST_AUTO_TEST_CASE (TestAlignSequencesWithPrecomputedDomainHits)
 
 BOOST_AUTO_TEST_CASE (TestAlignMSAsWithPrecomputedDomainHits)
 
 BOOST_AUTO_TEST_CASE (TestPrecomputedDomainSubjectNotInDatabase)
 
 BOOST_AUTO_TEST_CASE (TestSetDomainHitsWithUnsupportedQueries)
 

Variables

 USING_NCBI_SCOPE
 

Macro Definition Documentation

◆ NCBI_BOOST_NO_AUTO_TEST_MAIN

#define NCBI_BOOST_NO_AUTO_TEST_MAIN

Definition at line 71 of file cobalt_unit_test.cpp.

◆ STATIC_ARRAY_SIZE

#define STATIC_ARRAY_SIZE (   array)    (sizeof(array)/sizeof(*array))

Calculate the size of a static array.

Definition at line 81 of file cobalt_unit_test.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/24]

BOOST_AUTO_TEST_CASE ( TestAlignMSAs  )

Definition at line 1106 of file cobalt_unit_test.cpp.

References m_Scope, and s_TestAlignmentFromMSAs().

◆ BOOST_AUTO_TEST_CASE() [2/24]

BOOST_AUTO_TEST_CASE ( TestAlignMSAsWithPrecomputedDomainHits  )

◆ BOOST_AUTO_TEST_CASE() [3/24]

BOOST_AUTO_TEST_CASE ( TestAlignMSAsWithRepresentatives  )

◆ BOOST_AUTO_TEST_CASE() [4/24]

BOOST_AUTO_TEST_CASE ( TestAlignMSAsWithWrongRepresentatives  )

◆ BOOST_AUTO_TEST_CASE() [5/24]

BOOST_AUTO_TEST_CASE ( TestAlignMSAWithSequence  )

◆ BOOST_AUTO_TEST_CASE() [6/24]

BOOST_AUTO_TEST_CASE ( TestAlignSequencesWithPrecomputedDomainHits  )

Definition at line 1561 of file cobalt_unit_test.cpp.

References m_Scope, and s_TestResults().

◆ BOOST_AUTO_TEST_CASE() [7/24]

BOOST_AUTO_TEST_CASE ( TestBadQueries  )

◆ BOOST_AUTO_TEST_CASE() [8/24]

BOOST_AUTO_TEST_CASE ( TestBadUserConstraints  )

◆ BOOST_AUTO_TEST_CASE() [9/24]

BOOST_AUTO_TEST_CASE ( TestInterrupt  )

Definition at line 575 of file cobalt_unit_test.cpp.

References CMultiAligner::eInterrupt, m_Scope, and s_Interrupt().

◆ BOOST_AUTO_TEST_CASE() [10/24]

BOOST_AUTO_TEST_CASE ( TestLargeAlignment  )

◆ BOOST_AUTO_TEST_CASE() [11/24]

BOOST_AUTO_TEST_CASE ( TestNoResults  )

Definition at line 562 of file cobalt_unit_test.cpp.

◆ BOOST_AUTO_TEST_CASE() [12/24]

BOOST_AUTO_TEST_CASE ( TestPrecomputedDomainSubjectNotInDatabase  )

◆ BOOST_AUTO_TEST_CASE() [13/24]

BOOST_AUTO_TEST_CASE ( TestResultsForClustersAndUserConstraints  )

Definition at line 942 of file cobalt_unit_test.cpp.

References CMultiAligner::eSuccess, m_Scope, and s_TestResults().

◆ BOOST_AUTO_TEST_CASE() [14/24]

BOOST_AUTO_TEST_CASE ( TestResultsForDefaultOpts  )

Definition at line 867 of file cobalt_unit_test.cpp.

References CMultiAligner::eSuccess, m_Scope, and s_TestResults().

◆ BOOST_AUTO_TEST_CASE() [15/24]

BOOST_AUTO_TEST_CASE ( TestResultsForMaxClusterDiam  )

Definition at line 903 of file cobalt_unit_test.cpp.

References CMultiAligner::eSuccess, m_Scope, and s_TestResults().

◆ BOOST_AUTO_TEST_CASE() [16/24]

BOOST_AUTO_TEST_CASE ( TestResultsForNoClusters  )

◆ BOOST_AUTO_TEST_CASE() [17/24]

BOOST_AUTO_TEST_CASE ( TestResultsForZeroClusterDiam  )

Definition at line 883 of file cobalt_unit_test.cpp.

References CMultiAligner::eSuccess, m_Scope, and s_TestResults().

◆ BOOST_AUTO_TEST_CASE() [18/24]

BOOST_AUTO_TEST_CASE ( TestSetDomainHitsWithUnsupportedQueries  )

◆ BOOST_AUTO_TEST_CASE() [19/24]

BOOST_AUTO_TEST_CASE ( TestSetPrecomputedDomainHitsAboveEThresh  )

◆ BOOST_AUTO_TEST_CASE() [20/24]

BOOST_AUTO_TEST_CASE ( TestSetPrecomputedDomainHitsWithNoMatchingQueries  )

◆ BOOST_AUTO_TEST_CASE() [21/24]

BOOST_AUTO_TEST_CASE ( TestSetPrecomputedDomainHitsWithQueriesAsBioseqset  )

◆ BOOST_AUTO_TEST_CASE() [22/24]

BOOST_AUTO_TEST_CASE ( TestSetPrecomputedDomainHitsWithQueriesAsSeqLocs  )

◆ BOOST_AUTO_TEST_CASE() [23/24]

BOOST_AUTO_TEST_CASE ( TestSetQueries  )

◆ BOOST_AUTO_TEST_CASE() [24/24]

BOOST_AUTO_TEST_CASE ( TestTwoSequences  )

Definition at line 979 of file cobalt_unit_test.cpp.

References CMultiAligner::eSuccess, m_Scope, and s_TestResults().

◆ NCBITEST_AUTO_FINI()

NCBITEST_AUTO_FINI ( )

Definition at line 419 of file cobalt_unit_test.cpp.

References CMultiAlignerFixture::Finalize().

◆ NCBITEST_AUTO_INIT()

NCBITEST_AUTO_INIT ( )

Definition at line 414 of file cobalt_unit_test.cpp.

References CMultiAlignerFixture::Initialize().

◆ s_Interrupt()

static bool s_Interrupt ( CMultiAligner::SProgress progress)
static

Definition at line 570 of file cobalt_unit_test.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ s_MakeBioseqs()

static void s_MakeBioseqs ( const vector< CRef< CSeq_loc > > &  seqlocs,
CRef< CScope scope,
vector< CRef< CBioseq > > &  bioseqs 
)
static

◆ s_TestAlignmentFromMSAs()

void s_TestAlignmentFromMSAs ( CRef< CSeq_align result,
CRef< CSeq_align in_first,
CRef< CSeq_align in_second 
)

◆ s_TestQueriesAsBioseqs()

static void s_TestQueriesAsBioseqs ( const vector< CRef< CBioseq > > &  bioseqs)
static

◆ s_TestQueriesAsSeq_locs()

static void s_TestQueriesAsSeq_locs ( const vector< CRef< CSeq_loc > > &  seqlocs,
CRef< CScope scope 
)
static

◆ s_TestResultAlignment()

static void s_TestResultAlignment ( const vector< CRef< CSeq_loc > > &  queries,
const CRef< CSeq_align > &  seqalign,
const vector< CSequence > &  seqs,
CRef< CScope scope,
const string aln_ref = "" 
)
static

◆ s_TestResultClusters()

static void s_TestResultClusters ( int  num_queries,
const CClusterer::TClusters clusters,
const CMultiAlignerOptions::TConstraints constraints 
)
static

Definition at line 700 of file cobalt_unit_test.cpp.

References int, and ITERATE.

Referenced by s_TestResults().

◆ s_TestResults()

static void s_TestResults ( CMultiAligner aligner,
const string ref_aln = "" 
)
static

◆ s_TestResultTree()

static void s_TestResultTree ( int  num_queries,
const TPhyTreeNode tree 
)
static

Definition at line 623 of file cobalt_unit_test.cpp.

References ITERATE, and s_TestTree().

Referenced by s_TestResults().

◆ s_TestResultTreeContainer()

static void s_TestResultTreeContainer ( int  num_queries,
const CBioTreeContainer btc 
)
static

◆ s_TestTree()

static void s_TestTree ( vector< bool > &  queries,
const TPhyTreeNode node 
)
static

◆ USING_SCOPE() [1/2]

USING_SCOPE ( cobalt  )

◆ USING_SCOPE() [2/2]

USING_SCOPE ( objects  )

Variable Documentation

◆ USING_NCBI_SCOPE

USING_NCBI_SCOPE

Definition at line 83 of file cobalt_unit_test.cpp.

Modified on Fri Sep 20 14:57:59 2024 by modify_doxy.py rev. 669887