vector< string >& parts )
54 boolinQuote(
false);
55 const charjoiner(
'#');
57 for(
size_t i=0;
i<
str.size(); ++
i) {
63inQuote = inQuote ^
true;
79 for(
size_tj=0; j < parts.size(); ++j) {
80 for(
size_t i=0;
i< parts[j].size(); ++
i) {
81 if(parts[j][
i] == joiner) {
90 const string& givenId,
100 if(string::npos == rawId.find_first_not_of(
"0987654321") &&
182 const stringsTrackDataClass(
"Track Data");
188 for(CAnnot_descr::Tdata::const_iterator ait = descr.begin();
189ait != descr.end(); ++ait) {
199 if(!oid.
IsStr() || oid.
GetStr() != sTrackDataClass) {
206 for(CUser_object::TData::const_iterator fit = fields.begin();
207fit != fields.end(); ++fit) {
232 string& evidenceCodes)
245vector<CTempString> fields; fields.reserve(4);
247 while(fields.size() < 4) {
248fields.push_back(
"");
250 if(fields.size() != 4) {
251pErr->PatchErrorMessage(
"GO term contains too many columns");
254 for(
auto& field: fields) {
265goId = goId.substr(3);
267 if(goId.size() > 7) {
268pErr->PatchErrorMessage(
"GO ID (column 2) must be at most seven digits long");
271 if(goId.find_first_not_of(
"0123456789") != string::npos) {
272pErr->PatchErrorMessage(
"GO ID (column 2) can only contain digits");
276 while(goId.size() < 7) {
277goId =
string(
"000000") + goId;
278goId = goId.substr(goId.size() - 7);
285 if(pmId.find_first_not_of(
"0123456789") != string::npos) {
286pErr->PatchErrorMessage(
"Pubmed ID (column 3) may only contain digits");
291evidenceCodes = fields[3];
302 static const stringk_GoQuals[] = {
"go_process",
"go_component",
"go_function"};
303 static const intk_NumGoQuals =
sizeof(k_GoQuals) /
sizeof(
string);
305 if(qual.
empty())
return;
311 if(j == k_NumGoQuals) {
320 "GO_ qualifier not recognized"));
324 stringcomment, goId, pmId, evidenceCodes;
331feature.
SetExt().SetType().SetStr(
"GeneOntology");
335wrap.
SetData().SetFields().push_back(new_field);
339text_field->
SetLabel().SetStr(
"text string");
341field.
SetData().SetFields().push_back(text_field);
345goid->
SetLabel().SetStr(
"go id");
347field.
SetData().SetFields().push_back(goid);
360pubmed->
SetLabel().SetStr(
"pubmed id");
362field.
SetData().SetFields().push_back(pubmed);
367evidence->
SetLabel().SetStr(
"evidence");
369field.
SetData().SetFields().push_back(evidence);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static CLineError * Create(EProblem eProblem, EDiagSev eSeverity, const std::string &strSeqId, unsigned int uLine, const std::string &strFeatureName=string(""), const std::string &strQualifierName=string(""), const std::string &strQualifierValue=string(""), const std::string &strErrorMessage=string(""), const TVecOfLines &vecOfOtherLines=TVecOfLines())
Use this because the constructor is protected.
static void Tokenize(const string &instr, const string &delim, vector< string > &tokens)
Tokenize a given string, respecting quoted substrings an atomic units.
static bool GetTrackName(const CSeq_annot &annot, string &value)
Extract track information that should be present if the data originated from a UCSC data file.
static void AddGeneOntologyTerm(CSeq_feat &feature, const CTempString &qual, const CTempString &val)
static bool GetTrackOffset(const CSeq_annot &annot, int &value)
static bool GetTrackAssembly(const CSeq_annot &annot, string &value)
static bool GetTrackValue(const CSeq_annot &annot, const string &key, string &value)
static CRef< CSeq_id > AsSeqId(const string &rawId, long flags=0, bool localInts=true)
Convert a raw ID string to a Seq-id, based in given customization flags.
@ fNumericIdsAsLocal
numeric identifiers are local IDs
@ fAllIdsAsLocal
all identifiers are local IDs
namespace ncbi::objects::
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
@ eProblem_InvalidQualifier
@ eProblem_QualifierBadValue
static const char * str(char *buf, int n)
@ eDiag_Error
Error message.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
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 bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static string URLDecode(const CTempString str, EUrlDecode flag=eUrlDec_All)
URL-decode string.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
bool empty(void) const
Return true if the represented string is empty (i.e., the length is zero)
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
void Copy(string &dst, size_type pos, size_type len) const
Copy a substring into a string Somewhat similar to basic_string::assign()
static const size_type npos
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
@ eUrlDec_Percent
Decode only XX.
static const char label[]
const TStr & GetStr(void) const
Get the variant data.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
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 TData & GetData(void) const
Get the Data member data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
const TStr & GetStr(void) const
Get the variant data.
void SetLabel(TLabel &value)
Assign a value to Label data member.
TStr & SetStr(void)
Select the variant.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
TId & SetId(void)
Select the variant.
vector< CRef< CUser_field > > TData
void SetExt(TExt &value)
Assign a value to Ext data member.
TGi GetGi(void) const
Get the variant data.
TLocal & SetLocal(void)
Select the variant.
bool IsGi(void) const
Check if variant Gi is selected.
const Tdata & Get(void) const
Get the member data.
const TUser & GetUser(void) const
Get the variant data.
const TDesc & GetDesc(void) const
Get the Desc member data.
bool IsSetDesc(void) const
used only for stand alone Seq-annots Check if a value has been assigned to Desc data member.
bool IsUser(void) const
Check if variant User is selected.
list< CRef< CAnnotdesc > > Tdata
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
void sParseGeneOntologyTerm(const CTempString &qual, const CTempString &rawVal, string &comment, string &goId, string &pmId, string &evidenceCodes)
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