(
const string& accession,
const string& assembly,
const string&
context)
71 return "dev.ncbi.nlm.nih.gov";
73 return "www.ncbi.nlm.nih.gov";
79 return "/projects/sviewer/seqconfig.cgi";
84 if(!tracks.
CanGet())
return;
88 for(
const auto&
i: tracks.
Get()) {
90 if(
i->CanGetId()) trackId =
i->GetId();
96 stringaccession,
subkey, annotType,
key=
i->GetKey();
97 if(
key==
"alignment_track") annotType =
"align";
98 else if(
key==
"graph_track") annotType =
"graph";
99 else if(
key==
"feature_track") annotType =
"ftable";
100 else if(
key==
"gene_model_track") annotType =
"ftable",
subkey=
"gene";
101 else if(
key==
"SNP_track") annotType =
"ftable";
102 else if(
key==
"SNP_Bins_track") annotType =
"seq-table",
subkey=
"citedvar";
103 else if(
key==
"dbvar_track") annotType =
"ftable",
subkey=
"variation";
104 else if(
key==
"aggregate_feature_track") annotType =
"biological_region";
110 if(
key==
"SNP_track") {
111 if(
i->CanGetFilter()) {
112accession =
i->GetFilter();
115 if(!
i->CanGetAnnots() ||
i->GetAnnots().empty()) {
119 subkey=
i->GetAnnots().front();
123 if(accession.empty()) {
128 if(!
i->CanGetAnnots() ||
i->GetAnnots().empty()) {
132accession =
i->GetAnnots().front();
137track->
m_Name= accession;
140 if(
i->CanGetDisplay_name())
143 if(
i->CanGetHelp())
146 if(
i->CanGetCategory())
147track->
m_xClass=
i->GetCategory().GetName();
149 if(
i->CanGetSubcategory())
155 if(
i->CanGetSubkey()) {
161 if(
i->CanGetShown())
164 if((
key==
"aggregate_feature_track") && !
subkey.empty()) {
166 if((
subkey!=
"biological_region") && (
subkey!=
"aggregate_features")) {
167 if(
i->CanGetId() &&
i->CanGetDisplay_name()) {
168 LOG_POST(
Warning<<
"CTMSUtils: ignored track "<<
i->GetId() <<
" - \""<<
i->GetDisplay_name() <<
"\", due to invalid subkey - "<<
subkey);
177 data.push_back(track);
188 stringparams =
s_GetParams(accession, assembly, tms_context);
189 stringurl =
"https://"+ host + path +
"?"+ params;
196}
NCBI_CATCH(
"CTMSUtils::GetTrackMetaData()");
198 if(!res->CanGetSuccess()) {
199 LOG_POST(
Error<<
"CTMSUtils: failed to get valid response from server");
203 if(!res->GetSuccess()) {
205 if(res->CanGetErr_msg())
206errMsg = res->GetErr_msg();
208errMsg =
"Unknown error";
209 LOG_POST(
Error<<
"CTMSUtils: failed to get TMS tracks. "<< errMsg);
213 if(res->CanGetTrack_config_set())
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CNcbiIstream & GetResponseStream()
iterator_bool insert(const value_type &val)
The NCBI C++ standard methods for dealing with std::string.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_CATCH(message)
Catch CExceptions as well This macro is deprecated - use *_X or *_XX variant instead of it.
void Warning(CExceptionArgs_Base &args)
string m_AssmAcc
GenColl assembly accession.
string m_AnnotType
annot type, such as ftable, seq-table, align
string m_xClass
annotation category
set< string > m_Subtypes
feature/track types (track-specific)
string m_SubCategory
annotation subcategory
string m_Descr
annotation description (or comment)
static void GetTrackMetaData(vector< CRef< CAnnotMetaData > > &data, const string &accession, const string &assembly, const string &context)
string m_Title
annotation title
static bool IsExtendedNAA(const string &annot, bool isStrict=false)
check if a given annotation is an extended NAA (named accession[.version][number],...
string m_Name
annotation name, e.g. named annotation accession
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string HtmlDecode(const CTempString str, EEncoding encoding=eEncoding_Unknown, THtmlDecode *result_flags=NULL)
Decode HTML entities and character references.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
@ eNocase
Case insensitive compare.
const Tdata & Get(void) const
Get the member data.
Tdata & Set(void)
Assign a value to data member.
bool CanGet(void) const
Check if it is safe to call Get method.
const struct ncbi::grid::netcache::search::fields::KEY key
const struct ncbi::grid::netcache::search::fields::SUBKEY subkey
static string s_GetParams(const string &accession, const string &assembly, const string &context)
static string s_GetHost()
static string s_GetPath()
static void s_ConvertMetaData(vector< CRef< CAnnotMetaData > > &data, const CTrackConfigSet &tracks, const string &assembly)
static CS_CONTEXT * context
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