63 #define THIS_FILE "buf_data_loader.cpp"
144 if (
id.IsGenbank() ||
id.IsEmbl() ||
id.IsPir() ||
id.IsSwissprot() ||
id.IsDdbj() ||
145 id.IsTpg() ||
id.IsTpe() ||
id.IsTpd()) {
154 }
else if (
id.IsGeneral()) {
155 if (
id.GetGeneral().IsSetDb() &&
id.GetGeneral().GetDb() ==
"GSDB" &&
id.GetGeneral().IsSetTag() &&
id.GetGeneral().GetTag().IsId()) {
168 for (;
i < pp->
indx;
i++) {
181 cur_block->
vernum = vernum;
190 if (
StringLen(q) > 78 && q[28] ==
' ' && q[63] ==
' ' &&
240 while (div < eptr && *div ==
' ')
242 ibp->
bases = atoi(div);
256 while (*eptr ==
' ' && eptr >
offset)
260 ibp->
bases = atoi(eptr + 1);
261 while (*eptr ==
' ' && eptr >
offset)
282 eptr = ptr + entry->
len;
287 bioseq->
SetId().push_back(new_id);
375 int ix =
add_entry(pp, accession.c_str(), ver, entry),
419 static const string name(
"FF2ASN_BUF_BASED_LOADER");
447 old_indx = pp->curindx;
452 char* eptr = ptr + entry->
len;
460 pp->entrylist[pp->curindx]->drop =
true;
467 if (pp->entrylist[ix]->bases == 0) {
472 pp->curindx = old_indx;
473 return pp->entrylist[ix]->bases;
User-defined methods of the data storage class.
unique_ptr< unsigned char[]> GetDNAConv(void)
unique_ptr< unsigned char[]> GetProteinConv(void)
char * GetEmblBlock(DataBlkPtr *chain, char *ptr, short *retkw, Parser::EFormat format, char *eptr)
char * GetGenBankBlock(DataBlkPtr *chain, char *ptr, Int2 *retkw, char *eptr)
bool GetSeqData(ParserPtr pp, const DataBlk &entry, CBioseq &bioseq, Int4 nodetype, unsigned char *seqconv, Uint1 seq_data_type)
bool GetEmblInstContig(const DataBlk &entry, objects::CBioseq &bioseq, ParserPtr pp)
static void AddToIndexBlk(DataBlkPtr entry, IndexblkPtr ibp, Parser::EFormat format)
CRef< CBioseq > get_bioseq(ParserPtr pp, DataBlkPtr entry, const CSeq_id &id)
static bool get_accession_from_id(const CSeq_id &id, string &accession, int &version)
static CRef< CBioseq > parse_entry(ParserPtr pp, char *entry_str, const string &accession, int ver, const CSeq_id &id)
static char * get_sequence_text(ParserPtr parser, const string &accession, int version)
static DataBlkPtr make_entry(char *entry_str)
size_t CheckOutsideEntry(ParserPtr pp, const char *acc, Int2 vernum)
static int add_entry(ParserPtr pp, const char *acc, Int2 vernum, DataBlkPtr entry)
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, Parser *params, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
void x_LoadData(const CSeq_id_Handle &idh, CTSE_LoadLock &lock)
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
static const string & GetLoaderNameFromArgs(Parser *)
virtual bool CanGetBlobById() const
CTSE_LoadLock GetTSE_LoadLock(const TBlobId &blob_id)
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
bool IsLoaded(void) const
iterator_bool insert(const value_type &val)
#define ERR_FORMAT_MissingEnd
#define ParFlat_ENTRYNODE
bool StringEquN(const char *s1, const char *s2, size_t n)
bool StringEqu(const char *s1, const char *s2)
void StringCpy(char *d, const char *s)
void StringNCpy(char *d, const char *s, size_t n)
size_t StringLen(const char *s)
bool GetGenBankInstContig(const DataBlk &entry, CBioseq &bsp, ParserPtr pp)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CConstRef< CSeq_id > GetSeqId(void) const
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
const value_type & GetValue(void) const
CBlobIdFor< CSeq_id_Handle > CBlobIdSeq_id
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
CDataSource * GetDataSource(void) const
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
EIsDefault
Flag defining if the data loader is included in the "default" group.
TRegisterInfo GetRegisterInfo(void)
static void RegisterInObjectManager(CObjectManager &om, CLoaderMaker_Base &loader_maker, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
Register the loader only if the name is not yet registered in the object manager.
@ eAll
all blobs (main and external)
@ eCore
?only seq-entry core?
@ eBioseq
main blob with complete bioseq
@ eBioseqCore
main blob with bioseq core (no seqdata and annots)
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.
int16_t Int2
2-byte (16-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
@ eSeq_code_type_iupacna
IUPAC 1 letter nuc acid code.
bool IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
TVersion GetVersion(void) const
Get the Version member data.
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
const TAccession & GetAccession(void) const
Get the Accession member data.
TSeq & SetSeq(void)
Select the variant.
TId & SetId(void)
Assign a value to Id data member.
void SetInst(TInst &value)
Assign a value to Inst data member.
@ eRepr_raw
continuous sequence
@ eMol_na
just a nucleic acid
@ eStrand_ss
single strand
@ ParFlat_COL_MOLECULE_NEW
@ ParFlat_COL_TOPOLOGY_NEW
CRef< objects::CObjectManager > om
char *(* ff_get_entry_v_pp)(const char *accession, Int2 vernum, Parser *pp)
char *(* ff_get_entry)(const char *accession)
char *(* ff_get_entry_pp)(const char *accession, Parser *pp)
vector< IndexblkPtr > entrylist
char *(* ff_get_entry_v)(const char *accession, Int2 vernum)