61 #include "../blast/blast_app_util.hpp"
68 #ifndef SKIP_DOXYGEN_PROCESSING
114 vector<ESupportedInputFormats>
116 vector<string>& blastdbs);
197 fg.GetFormatHints().DisableAllNonpreferred();
215 arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
216 "Application to create BLAST databases, version "
219 string dflt(
"Default = input file name provided to -");
220 dflt +=
kInput +
" argument";
222 arg_desc->SetCurrentGroup(
"Input options");
223 arg_desc->AddDefaultKey(
kInput,
"input_file",
224 "Input file/database name",
226 arg_desc->AddDefaultKey(
"input_type",
"type",
227 "Type of the data specified in input_file",
239 arg_desc->SetCurrentGroup(
"Configuration options");
240 arg_desc->AddOptionalKey(
kArgDbTitle,
"database_title",
241 "Title for BLAST database\n" + dflt,
244 arg_desc->AddFlag(
"parse_seqids",
245 "Option to parse seqid for FASTA input if set, for all other input types seqids are parsed automatically",
true);
247 arg_desc->AddFlag(
"hash_index",
248 "Create index of sequence hash values.",
251 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
252 (!defined(NCBI_COMPILER_MIPSPRO)) )
253 arg_desc->SetCurrentGroup(
"Sequence masking options");
254 arg_desc->AddOptionalKey(
"mask_data",
"mask_data_files",
255 "Comma-separated list of input files containing "
256 "masking data as produced by NCBI masking "
257 "applications (e.g. dustmasker, segmasker, "
261 arg_desc->AddOptionalKey(
"mask_id",
"mask_algo_ids",
262 "Comma-separated list of strings to uniquely "
263 "identify the masking algorithm",
266 arg_desc->AddOptionalKey(
"mask_desc",
"mask_algo_descriptions",
267 "Comma-separated list of free form strings to "
268 "describe the masking algorithm details",
274 arg_desc->AddFlag(
"gi_mask",
275 "Create GI indexed masking data.",
true);
279 arg_desc->AddOptionalKey(
"gi_mask_name",
"gi_based_mask_names",
280 "Comma-separated list of masking data output files.",
287 arg_desc->SetCurrentGroup(
"Output options");
288 arg_desc->AddOptionalKey(
kOutput,
"database_name",
289 "Name of BLAST database to be created\n" + dflt +
290 "Required if multiple file(s)/database(s) are "
293 arg_desc->AddDefaultKey(
"blastdb_version",
"version",
294 "Version of BLAST database to be created",
297 arg_desc->SetConstraint(
"blastdb_version",
299 arg_desc->AddDefaultKey(
"max_file_sz",
"number_of_bytes",
300 "Maximum file size for BLAST database files",
302 arg_desc->AddOptionalKey(
"metadata_output_prefix",
"",
304 arg_desc->AddOptionalKey(
"logfile",
"File_Name",
305 "File to which the program log should be redirected",
309 arg_desc->AddFlag(
"verbose",
"Produce verbose output",
true);
310 arg_desc->AddFlag(
"limit_defline",
"limit_defline",
true);
313 arg_desc->SetCurrentGroup(
"Taxonomy options");
314 arg_desc->AddOptionalKey(
"taxid",
"TaxID",
315 "Taxonomy ID to assign to all sequences",
320 arg_desc->AddOptionalKey(
"taxid_map",
"TaxIDMapFile",
321 "Text file mapping sequence IDs to taxonomy IDs.\n"
322 "Format:<SequenceId> <TaxonomyId><newline>",
326 arg_desc->AddOptionalKey(
"oid_masks",
"oid_masks",
338 static string kMods =
"KMGTPEZY";
341 for(
i = 0;
i < kMods.size();
i++) {
342 if (v <
Uint8(minprec)*1024) {
350 rv.append(kMods,
i, 1);
365 while (p_ptr !=
NULL)
410 const string unv(
"Unverified");
443 (ch ==
' ' || ch ==
'\t' || ch ==
'\n' || ch ==
'\r')) {
452 if (ch ==
'B' || ch ==
'0') {
465 for (it_bio_set =
Begin(*
m_entry); it_bio_set; ++it_bio_set) {
470 if (it_bio_set->CanGetDescr() &&
IsUnverified(it_bio_set->GetDescr())) {
471 for (it_bio =
Begin(*it_bio_set); it_bio; ++it_bio) {
507 if (!
m_bio)
return rv;
511 const sequence::CDeflineGenerator::TUserFlags
flags = sequence::CDeflineGenerator::fUseAutoDef;
512 sequence::CDeflineGenerator
gen;
518 old_title =
i->GetTitle();
524 des->SetTitle(title);
526 desr.
Set().push_back(
des);
533 des->SetOrg().SetTaxId(taxid);
590 vector<SBlastDbMaskData> & mask_range,
591 vector<int> & column_ids,
592 vector<CTempString> & column_blobs);
594 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
595 (!defined(NCBI_COMPILER_MIPSPRO)) )
624 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
625 (!defined(NCBI_COMPILER_MIPSPRO)) )
635 : m_Sequence(
NULL), m_Oid(0)
641 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
642 (!defined(NCBI_COMPILER_MIPSPRO)) )
647 string algo_opts, algo_name;
666 vector<SBlastDbMaskData> & mask_range,
667 vector<int> & column_ids,
668 vector<CTempString> & column_blobs)
678 int slength(0), alength(0);
687 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
688 (!defined(NCBI_COMPILER_MIPSPRO)) )
699 mask_data.
offsets.push_back(pair<TSeqPos, TSeqPos>(
range->first,
range->second));
702 mask_range.push_back(mask_data);
708 column_blobs.resize(column_ids.size());
709 m_Blobs.resize(column_ids.size());
711 for(
int i = 0;
i < (
int)column_ids.size();
i++) {
754 if (args[
"input_type"].
HasValue()) {
755 const string& input_type = args[
"input_type"].AsString();
756 if (input_type ==
"fasta") {
758 }
else if (input_type ==
"asn1_bin") {
760 }
else if (input_type ==
"asn1_txt") {
762 }
else if (input_type ==
"blastdb") {
786 string error_msg =
"File " + seq_file +
" does not exist";
790 string error_msg =
"File " + seq_file +
" is empty";
796 string msg =
"\nInput file " + seq_file +
" does NOT appear to be FASTA (processing anyway).\n" \
797 +
"Advise validating database with 'blastdbcheck -dbtype [prot|nucl] -db ${DBNAME}'\n";
811 fg.GetFormatHints().DisableAllNonpreferred();
812 return fg.GuessFormat();
829 string msg(
"Input format not supported (");
831 msg +=
"Use -input_type to specify the input type being used.";
836 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
837 (!defined(NCBI_COMPILER_MIPSPRO)) )
843 const CArgValue & files = args[
"mask_data"];
845 const CArgValue & descs = args[
"mask_desc"];
846 const CArgValue & gi_names = args[
"gi_mask_name"];
848 vector<string> file_list;
849 vector<string> id_list;
850 vector<string> desc_list;
851 vector<string> gi_mask_names;
855 if (! file_list.size()) {
857 "mask_data option found, but no files were specified.");
862 if (file_list.size() != id_list.size()) {
864 "the size of mask_id does not match that of mask_data.");
867 for (
unsigned int i = 0;
i < id_list.size(); ++
i) {
871 "mask_id can not be numeric.");
878 if (file_list.size() != desc_list.size()) {
880 "the size of mask_desc does not match that of mask_data.");
884 vector<string> default_desc(id_list.size(),
"");
885 desc_list.swap(default_desc);
890 if (file_list.size() != gi_mask_names.size()) {
892 "the size of gi_mask_name does not match that of mask_data.");
896 for (
unsigned int i = 0;
i < file_list.size(); ++
i) {
897 if ( !
CFile(file_list[
i]).Exists() ) {
899 <<
"' as it does not exist.");
909 fg.GetFormatHints().DisableAllNonpreferred();
910 mask_file_format =
fg.GuessFormat();
918 s_ReadObject(mask_file, mask_file_format, first_obj,
"mask data in '" + file_list[
i] +
"'");
926 *
m_LogFile <<
"Mask file: " << file_list[
i] << endl;
927 string opts = first_obj->GetAlgo_options();
928 if (id_list.size()) {
933 string name = gi_mask_names.size() ? gi_mask_names[
i] : file_list[
i];
952 "Cannot get masked range Seq-id");
961 s_ReadObject(mask_file, mask_file_format, masks,
"mask data (continuation)");
971 if (
"fasta" != args[
"input_type"].AsString())
973 else if (args[
"parse_seqids"])
982 vector<CTempString>
names;
984 vector<string> blastdb;
990 if (
names[0] ==
"-") {
995 for (
size_t i = 0;
i <
names.size();
i++) {
996 string seq_file =
names[
i];
1003 vector<string> blastdb;
1007 vector<string> final_blastdb;
1010 ASSERT(blastdb.size()==1);
1011 CSeqDB db(blastdb[0], seqtype);
1012 vector<string> paths;
1016 if (paths.size() > 1) {
1018 "Modifying an alias BLAST db is currently not supported.");
1020 final_blastdb.push_back(blastdb[0]);
1022 ITERATE(vector<string>, iter, blastdb) {
1023 const string & s = *iter;
1030 << s <<
" as BLAST db");
1032 final_blastdb.push_back(s);
1036 if (final_blastdb.size()) {
1045 for (
int oid = 0; oid < numoids; ++oid) {
1050 if (!leafs.
empty()) {
1052 bdl->GetSeqid().front()->AsFastaString();
1055 leafTaxIds[id] = ids;
1067 "No valid input FASTA file or BLAST db is found.");
1074 const string env_skip =
1078 const string dont_scan_bioseq =
1079 GetEnvironment().
Get(
"NCBI_MAKEBLASTDB_DONT_SCAN_BIOSEQ_FOR_CFASTAREADER_USER_OBJECTS");
1080 const bool scan_bioseq_4_cfastareader_usrobj =
static_cast<bool>(dont_scan_bioseq.empty());
1086 bool is_protein = (args[
kArgDbType].AsString() ==
"prot");
1092 : args[
kInput]).AsString();
1096 "Cannot create a BLAST database from an existing one without "
1097 "changing the output name, please provide a (different) database name "
1101 vector<string> input_files;
1103 if (
dbname ==
"-" || input_files.size() > 1) {
1105 "Please provide a database name using -" +
kOutput);
1117 : args[
kInput]).AsString();
1119 vector<CTempString>
names;
1121 if (
names.size() > 1) {
1123 "Please provide a title using -title");
1136 "Please provide a title using -title");
1139 m_LogFile = & (args[
"logfile"].HasValue()
1140 ? args[
"logfile"].AsOutputFile()
1144 bool hash_index = args[
"hash_index"];
1145 bool use_gi_mask = args[
"gi_mask"];
1151 bool long_seqids =
false;
1155 long_seqids = (
registry.
Get(
"BLAST",
"LONG_SEQID") ==
"1");
1161 bool limit_defline =
false;
1163 if(args[
"limit_defline"]) {
1164 limit_defline =
true;
1167 Uint8 oid_masks = 0;
1168 if(args[
"oid_masks"]) {
1169 oid_masks = args[
"oid_masks"].AsInteger();
1181 scan_bioseq_4_cfastareader_usrobj));
1184 if (args[
"verbose"]) {
1208 static const Uint8 MAX_VOL_FILE_SIZE = 0x100000000;
1209 if (bytes >= MAX_VOL_FILE_SIZE) {
1211 "max_file_sz must be < 4 GiB");
1222 }
else if (args[
"taxid_map"].
HasValue()) {
1230 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
1231 (!defined(NCBI_COMPILER_MIPSPRO)) )
1241 string output_prefix = args[
"metadata_output_prefix"]
1242 ? args[
"metadata_output_prefix"].AsString()
1249 string metadata_filename = new_db +
"." + extn;
1250 ofstream
out(metadata_filename.c_str());
1253 json_out->PreserveKeyNames();
1255 json_out->WriteObject(obj_info);
1278 if (args[
"input_type"].
HasValue()) {
1287 if(args[
"parse_seqids"].
HasValue()) {
1293 else if(args[
"mask_data"].
HasValue()) {
1299 #ifndef SKIP_DOXYGEN_PROCESSING
1300 int main(
int argc,
const char* argv[] )
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Declares singleton objects to store the version and reference for the BLAST engine.
#define CATCH_ALL(exit_code)
Standard catch statement for all BLAST command line programs.
Code to build a database given various sources of sequence data.
Class to constrain the values of an argument to those greater than or equal to the value specified in...
CSeq_entry * GetParentEntry(void) const
TTaxId GetTaxId() const
Determine the tax-id for this bioseq.
void AddParam(EUsageParams p, int val)
Keeps track of the version of the BLAST engine in the NCBI C++ toolkit.
Build BlastDB format databases from various data sources.
bool AddSequences(IBioseqSource &src, bool add_pig=false)
Add sequences from an IBioseqSource object.
bool AddFasta(CNcbiIstream &fasta_file)
Add sequences from a file containing FASTA data.
void SetVerbosity(bool v)
Specify level of output verbosity.
void SetMaskDataSource(IMaskDataSource &ranges)
Specify an object mapping Seq-id to subject masking data.
void SetMembBits(const TLinkoutMap &membbits, bool keep_mbits)
Specify a membership bit lookup object.
int RegisterMaskingAlgorithm(EBlast_filter_program program, const string &options, const string &name="")
Define a masking algorithm.
void SetTaxids(CTaxIdSet &taxids)
Specify a mapping of sequence ids to taxonomic ids.
string GetOutputDbName() const
bool EndBuild(bool erase=false)
Finish building a new database.
void SetMaxFileSize(Uint8 max_file_size)
Set the maximum size of database component files.
void SetLeafTaxIds(const TIdToLeafs &taxids, bool keep_taxids)
Specify a leaf-taxids object.
Defines invalid user input exceptions.
The main application class.
CRef< CMaskedRangeSet > m_Ranges
void x_ProcessInputData(const string &paths, bool is_protein)
void x_AddSeqEntries(CNcbiIstream &data, TFormat fmt)
CFormatGuess::EFormat TFormat
Convenience typedef.
void x_AddFasta(CNcbiIstream &data)
void x_AddSequenceData(CNcbiIstream &input, TFormat fmt)
virtual void Init()
@inheritDoc
CRef< CBuildDatabase > m_DB
bool x_ShouldParseSeqIds(void)
CMakeBlastDBApp()
@inheritDoc
virtual int Run()
@inheritDoc
ESupportedInputFormats x_GetUserInputTypeHint(void)
CBlastUsageReport m_UsageReport
TFormat x_ConvertToCFormatGuessType(ESupportedInputFormats fmt)
ESupportedInputFormats x_ConvertToSupportedType(TFormat fmt)
vector< ESupportedInputFormats > x_GuessInputType(const vector< CTempString > &filenames, vector< string > &blastdbs)
void x_VerifyInputFilesType(const vector< CTempString > &filenames, CMakeBlastDBApp::ESupportedInputFormats input_type)
TFormat x_GuessFileType(CNcbiIstream &input)
void Insert(int algo_id, const CSeq_id &id, const CSeq_loc &v)
static CNcbiApplication * Instance(void)
Singleton method.
virtual ~CRawSeqDBSource()
virtual int GetColumnId(const string &name)
Get the column ID for a column mentioned by name.
virtual const map< string, string > & GetColumnMetaData(int id)
Get metadata for the column with the specified Column ID.
CRef< CSeqDBExpert > m_Source
CRawSeqDBSource(const string &name, bool protein, CBuildDatabase *outdb)
vector< CBlastDbBlob > m_Blobs
virtual bool GetNext(CTempString &sequence, CTempString &ambiguities, CRef< CBlast_def_line_set > &deflines, vector< SBlastDbMaskData > &mask_range, vector< int > &column_ids, vector< CTempString > &column_blobs)
vector< string > m_ColumnNames
vector< int > m_ColumnIds
virtual void GetColumnNames(vector< string > &names)
Get the names of all columns defined by this sequence source.
map< int, int > m_MaskIdMap
void GetRawSeqAndAmbig(int oid, const char **buffer, int *seq_length, int *ambig_length) const
Raw Sequence and Ambiguity Data.
void GetColumnBlob(int col_id, int oid, CBlastDbBlob &blob)
Fetch the data blob for the given column and oid.
static void FindVolumePaths(const string &dbname, ESeqType seqtype, vector< string > &paths, vector< string > *alias_paths=NULL, bool recursive=true, bool expand_links=true)
Find volume paths.
int GetNumOIDs() const
Returns the size of the (possibly sparse) OID range.
void GetAvailableMaskAlgorithms(vector< int > &algorithms)
Get a list of algorithm IDs for which mask data exists.
ESeqType
Sequence types (eUnknown tries protein, then nucleotide).
void GetMaskAlgorithmDetails(int algorithm_id, objects::EBlast_filter_program &program, string &program_name, string &algo_opts)
Get information about one type of masking available here.
void RetSequence(const char **buffer) const
Returns any resources associated with the sequence.
string GetTitle() const
Returns the database title.
CRef< CBlast_db_metadata > GetDBMetaData(string user_path=kEmptyStr)
void ListColumns(vector< string > &titles)
List columns titles found in this database.
bool CheckOrFindOID(int &next_oid) const
Find an included OID, incrementing next_oid if necessary.
int GetColumnId(const string &title)
Get an ID number for a given column title.
CRef< CBlast_def_line_set > GetHdr(int oid) const
Get the ASN.1 header for the sequence.
void GetMaskData(int oid, const vector< int > &algo_ids, TSequenceRanges &ranges)
Get masked ranges of a sequence.
const map< string, string > & GetColumnMetaData(int column_id)
Get all metadata for the specified column.
virtual CConstRef< CBioseq > GetNext()
Get a Bioseq object if there are any more to get.
CRef< CObjectManager > m_objmgr
set< CBioseq * > m_bio_skipped
CTypeIterator< CBioseq > m_bio
CSeqEntrySource(CNcbiIstream &is, TFormat fmt, bool skip_unver)
CRef< CSeq_entry > m_entry
CFormatGuess::EFormat TFormat
Convenience typedef.
bool IsUnverified(const CSeq_descr &descr)
@Seq_descr.hpp User-defined methods of the data storage class.
const CSeq_descr & GetDescr(void) const
bool IsSetDescr(void) const
CSeq_entry * GetParentEntry(void) const
void SetMappingFromFile(CNcbiIstream &f)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Template class for iteration on objects of class C.
@ eFullIndex
Use several forms of each Seq-id in the string index.
@ eAddHash
Add an index from sequence hash to OID.
@ eNoIndex
Build a database without any indices.
int TIndexType
Bitwise OR of "EIndexType".
Interface to a source of Bioseq objects.
Interface to a source of raw sequence data.
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
const string kArgDbTitle
Title for the BLAST database.
const string kArgDbType
BLAST database molecule type.
void Print(const CCompactSAMApplication::AlignInfo &ai)
API (CDeflineGenerator) for computing sequences' titles ("definitions").
static const struct name_t names[]
std::ofstream out("events_result.xml")
main entry point for tests
void SetFullVersion(CRef< CVersionAPI > version)
Set version data for the program.
void HideStdArgs(THideStdArgs hide_mask)
Set the hide mask for the Hide Std Flags.
const CNcbiEnvironment & GetEnvironment(void) const
Get the application's cached environment.
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
CVersionInfo GetVersion(void) const
Get the program version information.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
#define TAX_ID_FROM(T, value)
@ fHideXmlHelp
Hide XML help description.
@ fHideFullVersion
Hide full version description.
@ fHideDryRun
Hide dryrun description.
@ fHideConffile
Hide configuration file description.
@ eNoOwnership
No ownership is assumed.
virtual const string & AsString(void) const =0
Get the argument's string value.
virtual bool HasValue(void) const =0
Check if argument holds a value.
@ fAppend
Append to end-of-file; for eOutputFile or eIOFile.
@ eRequires
One argument requires another.
@ eExcludes
One argument excludes another.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
@ eInteger
Convertible into an integer number (int or Int8)
void SetDiagPostPrefix(const char *prefix)
Specify a string to prefix all subsequent error postings with.
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
@ eDiag_Warning
Warning message.
const string & Get(const string &name, bool *found=NULL) const
Get environment value by name.
void Error(CExceptionArgs_Base &args)
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
#define MSerial_AsnBinary
#define MSerial_AsnText
I/O stream manipulators –.
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty – not pointing to any object which means having a null value.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
int32_t Int4
4-byte (32-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
bool IsEnabled(void)
Indicates whether application usage statistics collection is enabled for a current reporter instance.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static Uint8 StringToUInt8_DataSize(const CTempString str, TStringToNumFlags flags=0)
Convert string that can contain "software" qualifiers to Uint8.
static TNumeric StringToNumeric(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to a numeric value.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
static string UInt8ToString(Uint8 value, TNumToStringFlags flags=0, int base=10)
Convert UInt8 to string.
@ fConvErr_NoThrow
Do not throw an exception on error.
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
void Start(void)
Start the timer.
const TOrg & GetOrg(void) const
Get the Org member data.
list< CRef< CSeq_loc > > TMasks
const TMasks & GetMasks(void) const
Get the Masks member data.
EBlast_filter_program
This defines the possible sequence filtering algorithms to be used in a BLAST database.
const Tdata & Get(void) const
Get the member data.
list< CRef< CBlast_def_line > > Tdata
TMore GetMore(void) const
Get the More member data.
@ eBlast_filter_program_other
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
const TStr & GetStr(void) const
Get the variant data.
const TType & GetType(void) const
Get the Type member data.
TSet & SetSet(void)
Select the variant.
@ eClass_nuc_prot
nuc acid and coded proteins
list< CRef< CSeqdesc > > Tdata
const TUser & GetUser(void) const
Get the variant data.
bool IsOrg(void) const
Check if variant Org is selected.
const TSource & GetSource(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
const Tdata & Get(void) const
Get the member data.
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
const TOrg & GetOrg(void) const
Get the variant data.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
Tdata & Set(void)
Assign a value to data member.
bool IsTitle(void) const
Check if variant Title is selected.
const TDescr & GetDescr(void) const
Get the Descr member data.
bool IsUser(void) const
Check if variant User is selected.
char * dbname(DBPROCESS *dbproc)
Get name of current database.
unsigned int
A callback function used to compare two keys in a database.
static TTaxId s_GetTaxId(const CBioseq &bio)
static bool s_HasTitle(const CBioseq &bio)
static const string kOutput("out")
Command line flag to represent the output.
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)
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....
int main(int argc, const char *argv[])
static const string kInputSeparators(" ")
Defines token separators when multiple inputs are present.
static const string kInput("in")
Command line flag to represent the input.
range(_Ty, _Ty) -> range< _Ty >
#define ASSERT
macro for assert.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
double f(double x_, const double &y_)
Defines BLAST database access classes.
Defines exception class and several constants for SeqDB.
EBlastDbVersion
BLAST database version.
void SeqDB_GetMetadataFileExtension(bool db_is_protein, string &extn)
void SeqDB_SplitQuoted(const string &dbname, vector< CSeqDB_Substring > &dbs, bool keep_quote=false)
Combine and quote list of database names.
void SeqDB_CombineAndQuote(const vector< string > &dbs, string &dbname)
Combine and quote list of database names.
static const char * str(char *buf, int n)
List of sequence offset ranges.
Structure describing filtered regions created using a particular sequence filtering algorithm.
int algorithm_id
Identifies the algorithm used.
vector< pair< TSeqPos, TSeqPos > > offsets
Start and end offsets of the filtered area.
static void des(const char *src, const char *out)
Defines BLAST database construction classes.
Defines exception class for WriteDB.