null_byte = 0;
71 Uint8total_num_ids = 0;
73 charcreate_date_size = 0;
74 Uint8total_length = 0;
76 Uint4vol_names_size = 0;
77 Uint4title_size = title.size();
79 chardb_date_size = 0;
80 const unsigned charbyte_max = 0xFF;
82vector<string> tmplist;
83tmplist.reserve(idlist.size());
91 ITERATE(vector<string>, itr, vols) {
92 if(itr != vols.begin()) {
99vol_names_size = vol_names.size();
102db_date_size = db_date.size();
106 for(
unsigned int i=0;
i< idlist.size();
i++) {
109 if(seqid.
IsGi()) {
115tmplist.push_back(
id);
126 if(tmplist.size() == 0) {
130 sort(tmplist.begin(), tmplist.end());
131vector<string>::iterator it = unique (tmplist.begin(), tmplist.end());
132tmplist.resize(distance(tmplist.begin(),it));
133 if(seqdb !=
NULL) {
134vector<blastdb::TOid> oids;
135vector<string> check_ids(tmplist);
138 for(
unsigned int i=0;
i< check_ids.size();
i++) {
140tmplist.push_back(check_ids[
i]);
145total_num_ids = tmplist.size();
148create_date_size = create_date.size();
150os.write(&null_byte, 1);
151os.write((
char*)&file_size, 8);
152os.write((
char*)&total_num_ids, 8);
153os.write((
char*) &title_size, 4);
154os.write(title.c_str(), title_size);
155os.write(&create_date_size, 1);
156os.write(create_date.c_str(), create_date_size);
157os.write((
char*)&total_length, 8);
159os.write(&db_date_size, 1);
160os.write(db_date.c_str(), db_date_size);
161os.write((
char*) &vol_names_size, 4);
162os.write(vol_names.c_str(), vol_names_size);
165 for(
unsigned int i=0;
i< tmplist.size();
i++) {
166 Uint4id_len = tmplist[
i].size();
168 if(id_len >= byte_max) {
169os.write((
char*)&byte_max, 1);
170os.write((
char*)&id_len, 4);
173 char l= byte_max & id_len;
176os.write(tmplist[
i].c_str(), id_len);
180file_size = (
Uint8) os.tellp();
182os.write((
char*)&file_size, 8);
CSeqDB_Substring FindBaseName() const
Returns the portion of this path containing the base name.
void GetString(string &s) const
Return the data by assigning it to a string.
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.
Uint8 GetVolumeLength() const
Returns the sum of the lengths of all volumes.
string GetDate() const
Returns the construction date of the database.
static const char * kBlastDbDateFormat
Format string for the date returned by CSeqDB::GetDate.
EBlastDbVersion GetBlastDbVersion() const
Return blast db version.
void AccessionsToOids(const vector< string > &accs, vector< blastdb::TOid > &oids) const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
const string AsFastaString(void) const
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
@ fParse_RawText
Try to ID raw non-numeric accessions.
@ fParse_PartialOK
Warn rather than throwing an exception when a FASTA-style ID set contains unparsable portions,...
@ fParse_AnyLocal
Treat otherwise unidentified strings as local accessions as long as they don't resemble FASTA-style I...
uint32_t Uint4
4-byte (32-bit) unsigned integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
@ eCurrent
Use current time. See also CCurrentTime.
bool IsPrf(void) const
Check if variant Prf is selected.
bool IsGi(void) const
Check if variant Gi is selected.
bool IsPir(void) const
Check if variant Pir is selected.
constexpr auto sort(_Init &&init)
Defines exception class and several constants for SeqDB.
const blastdb::TOid kSeqDBEntryNotFound
This file defines several SeqDB utility functions related to byte order and file system portability.
int WriteBlastSeqidlistFile(const vector< string > &idlist, CNcbiOstream &os, const string &title, const CSeqDB *seqdb)
static SLJIT_INLINE sljit_ins l(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4