NCBI C++ ToolKit
Classes | Functions | Variables
makeblastdb.cpp File Reference

Command line tool to create BLAST databases. More...

#include <ncbi_pch.hpp>
#include <serial/objostrjson.hpp>
#include <algo/blast/api/version.hpp>
#include <algo/blast/blastinput/blast_input_aux.hpp>
#include <corelib/ncbiapp.hpp>
#include <serial/iterator.hpp>
#include <objmgr/util/create_defline.hpp>
#include <objmgr/util/sequence.hpp>
#include <objects/seq/Seqdesc.hpp>
#include <objects/general/User_object.hpp>
#include <objects/seqfeat/Org_ref.hpp>
#include <objects/blastdb/Blast_db_mask_info.hpp>
#include <objects/blastdb/Blast_mask_list.hpp>
#include <objtools/blast/seqdb_reader/seqdb.hpp>
#include <objtools/blast/seqdb_reader/seqdbcommon.hpp>
#include <objtools/blast/seqdb_writer/writedb.hpp>
#include <objtools/blast/seqdb_writer/writedb_error.hpp>
#include <util/format_guess.hpp>
#include <util/util_exception.hpp>
#include <objtools/blast/seqdb_writer/build_db.hpp>
#include <algo/blast/blastinput/blast_input.hpp>
#include "../blast/blast_app_util.hpp"
#include "masked_range_set.hpp"
#include <iostream>
#include <sstream>
#include <fstream>
+ Include dependency graph for makeblastdb.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CMakeBlastDBApp
 The main application class. More...
 
class  CSeqEntrySource
 
class  CRawSeqDBSource
 

Functions

 USING_SCOPE (blast)
 
 USING_SCOPE (objects)
 
template<class TObj >
void s_ReadObject (CNcbiIstream &file, CFormatGuess::EFormat fmt, CRef< TObj > &obj, const string &msg)
 Reads an object defined in a NCBI ASN.1 spec from a stream in multiple formats: binary and text ASN.1 and XML. More...
 
template<class TObj >
void s_ReadObject (CNcbiIstream &file, CRef< TObj > &obj, const string &msg)
 Overloaded version of s_ReadObject which uses CFormatGuess to determine the encoding of the object in the file. More...
 
static const string kInput ("in")
 Command line flag to represent the input. More...
 
static const string kInputSeparators (" ")
 Defines token separators when multiple inputs are present. More...
 
static const string kOutput ("out")
 Command line flag to represent the output. More...
 
static string Uint8ToString_DataSize (Uint8 v, unsigned minprec=10)
 Converts a Uint8 into a string which contains a data size (converse to NStr::StringToUInt8_DataSize) More...
 
static TTaxId s_GetTaxId (const CBioseq &bio)
 
static bool s_HasTitle (const CBioseq &bio)
 
int main (int argc, const char *argv[])
 

Variables

 USING_NCBI_SCOPE
 

Detailed Description

Command line tool to create BLAST databases.

This is the successor to formatdb from the C toolkit

Definition in file makeblastdb.cpp.

Function Documentation

◆ kInput()

static const string kInput ( "in"  )
static

Command line flag to represent the input.

Referenced by CMakeBlastDBApp::Init(), and CMakeBlastDBApp::x_BuildDatabase().

◆ kInputSeparators()

static const string kInputSeparators ( " "  )
static

Defines token separators when multiple inputs are present.

Referenced by CMakeBlastDBApp::x_BuildDatabase().

◆ kOutput()

static const string kOutput ( "out"  )
static

Command line flag to represent the output.

Referenced by CMakeBlastDBApp::Init(), and CMakeBlastDBApp::x_BuildDatabase().

◆ main()

int main ( int  argc,
const char *  argv[] 
)

Definition at line 1300 of file makeblastdb.cpp.

References CNcbiApplicationAPI::AppMain().

◆ s_GetTaxId()

static TTaxId s_GetTaxId ( const CBioseq bio)
static

◆ s_HasTitle()

static bool s_HasTitle ( const CBioseq bio)
static

◆ s_ReadObject() [1/2]

template<class TObj >
void s_ReadObject ( CNcbiIstream file,
CFormatGuess::EFormat  fmt,
CRef< TObj > &  obj,
const string msg 
)

Reads an object defined in a NCBI ASN.1 spec from a stream in multiple formats: binary and text ASN.1 and XML.

Parameters
filestream to read the object from [in]
fmtspecifies the format in which the object is encoded [in]
objon input is an empty CRef<> object, on output it's populated with the object read [in|out]
msgerror message to display if reading fails [in]

Definition at line 162 of file makeblastdb.cpp.

References CFormatGuess::eBinaryASN, CFormatGuess::eTextASN, file, MSerial_AsnBinary, MSerial_AsnText, NCBI_THROW, and CRef< C, Locker >::Reset().

Referenced by CSeqEntrySource::CSeqEntrySource(), s_ReadObject(), and CMakeBlastDBApp::x_ProcessMaskData().

◆ s_ReadObject() [2/2]

template<class TObj >
void s_ReadObject ( CNcbiIstream file,
CRef< TObj > &  obj,
const string msg 
)

Overloaded version of s_ReadObject which uses CFormatGuess to determine the encoding of the object in the file.

Parameters
filestream to read the object from [in]
objon input is an empty CRef<> object, on output it's populated with the object read [in|out]
msgerror message to display if reading fails [in]

Definition at line 190 of file makeblastdb.cpp.

References CFormatGuess::eBinaryASN, CFormatGuess::eTextASN, file, and s_ReadObject().

◆ Uint8ToString_DataSize()

static string Uint8ToString_DataSize ( Uint8  v,
unsigned  minprec = 10 
)
static

Converts a Uint8 into a string which contains a data size (converse to NStr::StringToUInt8_DataSize)

Parameters
vvalue to convert [in]
minprecminimum precision [in]

Definition at line 336 of file makeblastdb.cpp.

References i, and NStr::UInt8ToString().

Referenced by CMakeBlastDBApp::x_BuildDatabase().

◆ USING_SCOPE() [1/2]

USING_SCOPE ( blast  )

◆ USING_SCOPE() [2/2]

USING_SCOPE ( objects  )

Variable Documentation

◆ USING_NCBI_SCOPE

USING_NCBI_SCOPE

Definition at line 69 of file makeblastdb.cpp.

Modified on Fri Jun 14 16:54:42 2024 by modify_doxy.py rev. 669887