TestUtil Namespace Reference


Classes

struct  CRandomIntGen
class  CBlastOM
 Class which registers the BLAST database and Genbank data loaders as a non-default data loaders with the object manager upon construction. More...

Functions

objects::CSeq_id * GenerateRandomSeqid_Gi ()
vector< EBlastProgramTypeGetAllBlastProgramTypes ()
CRef< CSeq_align_setFlattenSeqAlignSet (const CSeq_align_set &sset)
void PrintSequence (const Uint1 *seq, TSeqPos len, ostream &out, bool show_markers, TSeqPos chars_per_line)
void PrintSequence (const CSeqVector svector, ostream &out, bool show_markers, TSeqPos chars_per_line)
char GetResidue (unsigned int res)
 Returns character representation of a residue from ncbistdaa.
BlastQueryInfoCreateProtQueryInfo (unsigned int query_size)
 Creates and initializes a BlastQueryInfo structure for a single protein sequence.
void CheckForBlastSeqSrcErrors (const BlastSeqSrc *seqsrc) THROWS((CBlastException))
Uint4 EndianIndependentBufferHash (const char *buffer, Uint4 byte_length, Uint4 swap_size=1, Uint4 hash_seed=1)
 Endianness independent hash function.
template<class T>
ncbi::CRef< T > ReadObject (const std::string &filename)
ncbi::CRef< ncbi::objects::CSeq_align_set > FlattenSeqAlignSet (const ncbi::objects::CSeq_align_set &sset)
 Converts bl2seq and blast style seq-align-sets to the seq-align-set format that the new formatter understands (same flat format as C toolkit seq-aligns).
void PrintSequence (const Uint1 *seq, ncbi::TSeqPos len, std::ostream &out, bool show_markers=true, ncbi::TSeqPos chars_per_line=80)
void PrintSequence (const ncbi::objects::CSeqVector &svector, std::ostream &out, bool show_markers=true, ncbi::TSeqPos chars_per_line=80)
void PrintFormattedSeqAlign (ostream &out, const CSeq_align_set *sas, CScope &scope)
void PrintFormattedSeqAlign (std::ostream &out, const ncbi::objects::CSeq_align_set *sas, ncbi::objects::CScope &scope)
 Assumes that the sas argument is a bl2seq and blast style seq-align-set.

Variables

void CheckForBlastSeqSrcErrors(const BlastSeqSrc *seqsrc)
THROWS((ncbi voi 
PrintTextAsn1Object )(std::string filename, T *obj)
 Convenience template function to print ASN.1 objects to a new file.
void CheckForBlastSeqSrcErrors(const BlastSeqSrc *seqsrc)
THROWS((ncbi voi 
PrintTextAsn1Object )(std::string filename, T *obj)
 Convenience template function to print ASN.1 objects to a new file.


Function Documentation

void TestUtil::CheckForBlastSeqSrcErrors const BlastSeqSrc seqsrc  ) 
 

Definition at line 227 of file blast_test_util.cpp.

References BlastSeqSrcGetInitError(), NCBI_THROW, and sfree.

Referenced by BOOST_AUTO_TEST_CASE(), and CRedoAlignmentTestFixture::runRedoAlignmentCoreUnitTest().

BlastQueryInfo * TestUtil::CreateProtQueryInfo unsigned int  query_size  ) 
 

Creates and initializes a BlastQueryInfo structure for a single protein sequence.

Definition at line 216 of file blast_test_util.cpp.

References BlastQueryInfoNew(), BlastQueryInfo::contexts, eBlastTypeBlastp, BlastQueryInfo::max_length, and BlastContextInfo::query_length.

Referenced by InitializeBlastScoreBlk().

Uint4 TestUtil::EndianIndependentBufferHash const char *  buffer,
Uint4  byte_length,
Uint4  swap_size = 1,
Uint4  hash_seed = 1
 

Endianness independent hash function.

This function computes a hash value for an array of any primitive type. The hash assumes the data is the array is in "host" order with respect to endianness and should produce the same value on any platform for the same numerical values of the array elements.

The algorithm attempts to be robust against changes in values in the array, the length of the array, zeroes appended to the array), and will not normally be fooled by naturally occurring patterns in the buffer. 9However, it is not intended to be secure against deliberate attempts to produce a collision).

The size of an element of the array must be uniform and is specified as an argument to the function. It must exactly divide the byte length of the array. If the size element is specified as 1, no swapping will be done. This can be used to hash a string.

Parameters:
buffer Points to the beginning of the array.
byte_length The length of the array in bytes.
swap_size The size of one array element (specify 1 to disable swapping).
hash_seed. The starting value of the hash.

Definition at line 243 of file blast_test_util.cpp.

References _ASSERT.

ncbi::CRef< ncbi::objects::CSeq_align_set > TestUtil::FlattenSeqAlignSet const ncbi::objects::CSeq_align_set &  sset  ) 
 

Converts bl2seq and blast style seq-align-sets to the seq-align-set format that the new formatter understands (same flat format as C toolkit seq-aligns).

CRef< CSeq_align_set > TestUtil::FlattenSeqAlignSet const CSeq_align_set sset  ) 
 

Definition at line 99 of file blast_test_util.cpp.

References ASSERT, CSeq_align_set_Base::Get(), and ITERATE.

Referenced by PrintFormattedSeqAlign().

ncbi::objects::CSeq_id * TestUtil::GenerateRandomSeqid_Gi  ) 
 

Definition at line 71 of file blast_test_util.cpp.

References CSeq_id_Base::e_Gi.

Referenced by x_TestGetSeqLocInfoVector().

std::vector< EBlastProgramType > TestUtil::GetAllBlastProgramTypes  ) 
 

Definition at line 77 of file blast_test_util.cpp.

References eBlastTypeBlastn, eBlastTypeBlastp, eBlastTypeBlastx, eBlastTypePhiBlastn, eBlastTypePhiBlastp, eBlastTypePsiBlast, eBlastTypePsiTblastn, eBlastTypeRpsBlast, eBlastTypeRpsTblastn, eBlastTypeTblastn, and eBlastTypeTblastx.

Referenced by BOOST_AUTO_TEST_CASE().

char TestUtil::GetResidue unsigned int  res  ) 
 

Returns character representation of a residue from ncbistdaa.

Definition at line 204 of file blast_test_util.cpp.

References BLASTAA_SIZE, and NCBISTDAA_TO_AMINOACID.

Referenced by BOOST_AUTO_TEST_CASE(), and PrintSequence().

void TestUtil::PrintFormattedSeqAlign std::ostream &  out,
const ncbi::objects::CSeq_align_set *  sas,
ncbi::objects::CScope &  scope
 

Assumes that the sas argument is a bl2seq and blast style seq-align-set.

void TestUtil::PrintFormattedSeqAlign ostream &  out,
const CSeq_align_set sas,
CScope scope
 

Definition at line 117 of file blast_test_util.cpp.

References ASSERT, CDisplaySeqalign::DisplaySeqalign(), CDisplaySeqalign::eShowBlastInfo, CDisplaySeqalign::eShowBlastStyleId, CDisplaySeqalign::eShowGi, CDisplaySeqalign::eShowMiddleLine, FlattenSeqAlignSet(), and CDisplaySeqalign::SetAlignOption().

void TestUtil::PrintSequence const ncbi::objects::CSeqVector &  svector,
std::ostream &  out,
bool  show_markers = true,
ncbi::TSeqPos  chars_per_line = 80
 

void TestUtil::PrintSequence const Uint1 seq,
ncbi::TSeqPos  len,
std::ostream &  out,
bool  show_markers = true,
ncbi::TSeqPos  chars_per_line = 80
 

void TestUtil::PrintSequence const CSeqVector  svector,
ostream &  out,
bool  show_markers,
TSeqPos  chars_per_line
 

Definition at line 170 of file blast_test_util.cpp.

References GetResidue(), and CSeqVector::size().

void TestUtil::PrintSequence const Uint1 seq,
TSeqPos  len,
ostream &  out,
bool  show_markers,
TSeqPos  chars_per_line
 

Definition at line 136 of file blast_test_util.cpp.

References GetResidue().

template<class T>
ncbi::CRef< T > TestUtil::ReadObject const std::string &  filename  ) 
 

Definition at line 94 of file blast_test_util.hpp.

References MSerial_AsnBinary(), MSerial_AsnText(), and MSerial_Xml().

Referenced by BEGIN_SCOPE().


Variable Documentation

void CheckForBlastSeqSrcErrors (const BlastSeqSrc* seqsrc) THROWS((ncbi voi TestUtil::PrintTextAsn1Object)(std::string filename, T *obj)
 

Convenience template function to print ASN.1 objects to a new file.

Definition at line 121 of file blast_test_util.hpp.

void CheckForBlastSeqSrcErrors (const BlastSeqSrc* seqsrc) THROWS((ncbi voi TestUtil::PrintTextAsn1Object)(std::string filename, T *obj)
 

Convenience template function to print ASN.1 objects to a new file.

Definition at line 122 of file blast_test_util.hpp.


Generated on Mon Dec 7 16:17:20 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:40 2009 by modify_doxy.py rev. 173732