51 #define THIS_FILE "gb_index.cpp"
123 for (; tlen > 0; tlen--) {
125 if (! (
'0' <= c && c <=
'9'))
134 if (len2 > len1 &&
str[
i] ==
'0') {
137 for (tlen = len2 - len1; tlen > 0 &&
str[
i] ==
'0';
i--)
144 for (q = &
str[
i + 1], p = q; *p ==
'0';)
147 int j = atoi(segnum);
162 if (stoken->num >= 4) {
163 auto ptr2 =
next(stoken->list.begin());
164 auto ptr4 =
next(ptr2, 2);
198 for (p = line; *p !=
'\0' && *p !=
' ' && *p !=
'\t';)
200 gi = (*p ==
'\0') ?
false :
true;
214 for (
r = q + 1; *
r >=
'0' && *
r <=
'9';)
235 entry->
vernum = atoi(q + 1);
246 for (*p++ =
ch1; *p ==
' ' || *p ==
'\t';)
250 if (*p !=
'\0' && ! ign_toks) {
265 for (q = p; *q >=
'0' && *q <=
'9';)
285 for (p = line; *p ==
' ' || *p ==
'\t';)
305 for (q =
str + 5; *q >=
'0' && *q <=
'9';)
311 for (q = p + 5; *q >=
'0' && *q <=
'9';)
318 for (q =
str + 5; *q ==
'0';)
321 for (q = p + 5; *q ==
'0';)
330 ibp->
bases = to - from + 1;
384 while (! end_of_file) {
398 after_DEFNTN =
false;
399 after_SOURCE =
false;
402 after_ORIGIN =
false;
403 after_COMMENT =
false;
404 after_VERSION =
false;
410 line_locus =
nullptr;
419 while (currentKeyword !=
ParFlat_END && ! end_of_file) {
420 switch (currentKeyword) {
435 after_COMMENT =
true;
440 if (p && atol(p + 3) > 0)
449 after_VERSION =
true;
451 while (*p ==
' ' || *p ==
'\t')
453 for (q = p; *q !=
'\0' && *q !=
'\r' && *q !=
'\n';)
457 if (*q !=
' ' && *q !=
'\t') {
471 while (*p ==
' ' || *p ==
'\t')
473 for (q = p; *q !=
'\0' && *q !=
' ' && *q !=
'\t' &&
474 *q !=
'\r' && *q !=
'\n';)
485 }
else if (after_LOCUS ==
false) {
496 }
else if (after_LOCUS ==
false || after_DEFNTN ==
false) {
514 if (entry->
is_mga ==
false) {
529 (after_LOCUS ==
false ||
530 after_DEFNTN ==
false ||
531 after_SOURCE ==
false)) {
544 (after_LOCUS ==
false ||
545 after_DEFNTN ==
false ||
546 after_SOURCE ==
false ||
547 after_FEAT ==
false)) {
556 if (acwflag ==
false)
579 if (entry->
is_tpa ==
false &&
608 while (! end_of_file && (finfo.
str[0] ==
' ' || finfo.
str[0] ==
'\t')) {
641 if (finfo.
str[0] !=
' ' && finfo.
str[0] !=
'\t' &&
656 if (entry->
is_mga && after_MGA ==
false)
659 if (after_LOCUS ==
false)
662 if (after_VERSION ==
false && pp->
accver)
665 if (after_DEFNTN ==
false)
668 if (after_SOURCE ==
false)
678 if (after_FEAT ==
false) {
702 line_locus =
nullptr;
714 if (acwflag ==
false &&
742 for (
int j = 0; j < indx && tibnp; j++, tibnp = ibnp) {
748 return (end_of_file);
bool QSIndex(ParserPtr pp, IndBlkNextPtr ibnp)
#define ERR_FORMAT_LineTypeOrder
bool StringEquN(const char *s1, const char *s2, size_t n)
bool StringEqu(const char *s1, const char *s2)
void StringNCpy(char *d, const char *s, size_t n)
size_t StringLen(const char *s)
char * StringRChr(char *s, const char c)
char * StringNew(size_t sz)
void FtaDeletePrefix(int prefix)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
vector< string > genbankKeywords
static void ParseGenBankVersion(IndexblkPtr entry, char *line, char *nid, Parser::ESource source, Parser::EMode mode, bool ign_toks)
static bool gb_err_field(const char *str)
static bool DelSegnum(IndexblkPtr entry, const char *segnum, size_t len2)
bool GenBankIndex(ParserPtr pp)
static bool fta_check_mga_line(char *line, IndexblkPtr ibp)
static void GetSegment(const char *str, IndexblkPtr entry)
int32_t Int4
4-byte (32-bit) signed integer
uint16_t Uint2
2-byte (16-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
bool FindNextEntryBuf(bool end_of_file, FileBuf &fbuf, FinfoBlk &finfo, const CTempString &keyword)
IndexblkPtr InitialEntry(ParserPtr pp, FinfoBlk &finfo)
bool SkipTitleBuf(FileBuf &fbuf, FinfoBlk &finfo, const CTempString &keyword)
bool XReadFileBuf(FileBuf &fbuf, FinfoBlk &finfo)
bool CkLocusLinePos(char *offset, Parser::ESource source, LocusContPtr lcp, bool is_mga)
void MsgSkipTitleFail(const char *flatfile, FinfoBlk &finfo)
#define ERR_VERSION_NonDigitVerNum
#define ERR_VERSION_MissingVerNum
#define ERR_ACCESSION_NoAccessNum
#define ERR_SEGMENT_BadLocusName
#define ERR_FORMAT_ContigInSegset
#define ERR_SEGMENT_IncompSeg
#define ERR_FORMAT_IncorrectMGALine
#define ERR_VERSION_IncorrectGIInVersion
#define ERR_VERSION_NonDigitGI
#define ERR_VERSION_BadVersionLine
#define ERR_VERSION_InvalidVersion
#define ERR_FORMAT_MissingField
#define ERR_ENTRY_InvalidLineType
#define ERR_VERSION_AccessionsDontMatch
if(yy_accept[yy_current_state])
const CharType(& source)[N]
static const BitmapCharRec ch1
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
const CConstRef< CSeq_id > GetAccession(const CSeq_id_Handle &id_handle)
vector< IndexblkPtr > entrylist
int SrchKeyword(const CTempString &ptr, const vector< string > &keywordList)
bool CheckLineType(char *ptr, Int4 line, const vector< string > &keywordList, bool after_origin)
void check_est_sts_gss_tpa_kwds(ValNodePtr kwds, size_t len, IndexblkPtr entry, bool tpa_check, bool &specialist_db, bool &inferential, bool &experimental, bool &assembly)
unique_ptr< TokenStatBlk > TokenString(const char *str, Char delimiter)
ValNodePtr ConstructValNode(CSeq_id::E_Choice choice, const char *data)
ValNodePtr ValNodeNew(ValNodePtr prev, const char *data)
ValNodePtr ValNodeFreeData(ValNodePtr vnp)