34 #ifndef _BLAST_TEST_UTIL_HPP
35 #define _BLAST_TEST_UTIL_HPP
84 throw std::runtime_error(
"Failed to open " + filename);
86 ncbi::CRef<T> retval(
new T);
88 switch (ncbi::CFormatGuess().
Format(
in)) {
89 case ncbi::CFormatGuess::eTextASN:
92 case ncbi::CFormatGuess::eBinaryASN:
95 case ncbi::CFormatGuess::eXml:
99 throw std::runtime_error(
"Unsupported format");
105 THROWS((ncbi::blast::CBlastException));
110 std::ofstream
out(filename.c_str());
112 throw std::runtime_error(
"Could not open " + filename);
119 ncbi::CRef<ncbi::objects::CSeq_align_set>
125 const ncbi::objects::CSeq_align_set* sas,
126 ncbi::objects::CScope& scope);
130 bool show_markers =
true,
133 std::ostream&
out,
bool show_markers =
true,
174 Uint4 hash_seed = 1);
Data loader implementation that uses the blast databases.
Definitions used throughout BLAST.
Declares the BLAST exception class.
Definitions and functions associated with the BlastQueryInfo structure.
Declaration of ADT to retrieve sequences for the BLAST engine.
Definitions of special type used in BLAST.
Include a standard set of the NCBI C++ Toolkit most basic headers.
Ensure direct dependencies on enough of the core xncbi library to satisfy shared libraries that depen...
std::ofstream out("events_result.xml")
main entry point for tests
unsigned int TSeqPos
Type for sequence locations and lengths.
#define MSerial_AsnBinary
#define MSerial_AsnText
I/O stream manipulators –.
uint8_t Uint1
1-byte (8-bit) unsigned integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
void PrintFormattedSeqAlign(ostream &out, const CSeq_align_set *sas, CScope &scope)
objects::CSeq_id * GenerateRandomSeqid_Gi()
vector< EBlastProgramType > GetAllBlastProgramTypes()
BlastQueryInfo * CreateProtQueryInfo(unsigned int query_size)
Creates and initializes a BlastQueryInfo structure for a single protein sequence.
char GetResidue(unsigned int res)
Returns character representation of a residue from ncbistdaa.
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.
CRef< CSeq_align_set > FlattenSeqAlignSet(const CSeq_align_set &sset)
ncbi::CRef< T > ReadObject(const std::string &filename)
void CheckForBlastSeqSrcErrors(const BlastSeqSrc *seqsrc)
Uint4 EndianIndependentBufferHash(const char *buffer, Uint4 byte_length, Uint4 swap_size, Uint4 hash_seed)
Endianness independent hash function.
void PrintSequence(const Uint1 *seq, TSeqPos len, ostream &out, bool show_markers, TSeqPos chars_per_line)
Magic spell ;-) needed for some weird compilers... very empiric.
std::istream & in(std::istream &in_, double &x_)
The query related information.
Complete type definition of Blast Sequence Source ADT.
Structure to represent a single sequence to be fed to BLAST.