wxPanel::Create( parent,
id, pos,
size, style );
97GetSizer()->SetSizeHints(
this);
128wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
129itemPanel1->SetSizer(itemBoxSizer2);
131wxStaticText* itemStaticText3 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Accessions to load:"), wxDefaultPosition, wxDefaultSize, 0 );
132itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_LEFT|wxALL, 5);
134wxStaticText* itemStaticText4 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Separate accessions with spaces, tabs, commas or semicolons.\nAdd a range to accession after colon (NT_029999:5k-10k)."), wxDefaultPosition, wxDefaultSize, 0 );
135itemBoxSizer2->Add(itemStaticText4, 0, wxGROW|wxALL, 5);
137 m_AccInput=
new CRichTextCtrl( itemPanel1,
ID_ACC_INPUT, wxEmptyString, wxDefaultPosition, itemPanel1->ConvertDialogToPixels(wxSize(250, 100)), wxWANTS_CHARS|wxTE_RICH2|wxTE_MULTILINE );
138itemBoxSizer2->Add(
m_AccInput, 1, wxGROW|wxALL, 5);
140wxStaticText* itemStaticText6 =
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Recently loaded accessions:"), wxDefaultPosition, wxDefaultSize, 0 );
141itemBoxSizer2->Add(itemStaticText6, 0, wxALIGN_LEFT|wxALL, 5);
143 m_MRUWindow=
new CwxHtmlWindow( itemPanel1,
ID_HTMLWINDOW2, wxDefaultPosition, itemPanel1->ConvertDialogToPixels(wxSize(250, 100)), wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL );
144itemBoxSizer2->Add(
m_MRUWindow, 1, wxGROW|wxALL, 5);
148 m_ErrStyle.SetBackgroundColour(wxColour(255, 200, 200));
169wxStringOutputStream strstrm;
170wxTextOutputStream os(strstrm);
172os <<
wxT(
"<html><body>");
174 for( TMap::const_reverse_iterator it =
map.rbegin(); it !=
map.rend(); ++it) {
175time_t
t= it->first;
177 stringacc = it->second.GetAccession();
179os <<
wxT(
"<b><a href=\"") << acc <<
wxT(
"\">") << acc
180<<
wxT(
"</a></b> ")
181<<
wxT(
"<font color=#808080>last loaded ")
186os <<
wxT(
"</body></html>");
189 m_MRUWindow->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
206 #define GB_LOADER_ERR "GenBank - Error in input" 208 #define INVALID_ELEMS_MSG " elements are not valid sequence identifiers and so cannot be loaded.\ 209 \nWould you like to proceed?" 211 #define INVALID_INPUT "Input does not contain valid sequence identifiers." 213 #define EMPTY_INPUT "Please specify one or more sequence identifiers to load!" 224wxOK | wxICON_ERROR,
this);
228wxOK | wxICON_ERROR,
this);
233wxYES_NO | wxICON_EXCLAMATION,
this);
241 const char*
sRangeRegexp=
"[0-9,]+[kKmM]?([-:]|\\.\\.)[0-9,]+[kKmM]?";
260from = NStr::StringToNumeric<CSeq_interval::TFrom>(pos.front()) - 1;
261to = NStr::StringToNumeric<CSeq_interval::TTo>(pos.back()) - 1;
282vector<string> splits;
283vector<SIZE_TYPE> split_pos;
285 size_t size= splits.size();
286tokens.resize(
size);
288 for(
size_t i= 0;
i<
size;
i++) {
289tokens[
i].m_Pos = (
int)split_pos[
i];
290tokens[
i].m_Size = (
int)splits[
i].
size();
291tokens[
i].m_Valid =
false;
297 CRegexpregexGenAcc(
"GC(A|F)_\\d{9}(.\\d+)");
299 size_tprocessed = 0;
301 for(; processed <
size; processed++) {
305 strings_id = splits[processed];
311 if(na.find(
".") == string::npos)
313 m_NAs.push_back(na);
314tokens[processed].m_Valid =
true;
319 size_tpos = s_id.find(
':');
321 boolseq_id_valid =
true;
323 if(pos != string::npos) {
324range = s_id.substr(pos + 1);
325s_id = s_id.substr(0, pos);
328seq_id_valid = re.
IsMatch(range);
336seq_id_valid =
false;
355ival.
SetId().Assign(*id_copy);
360seq_id_valid =
false;
364seq_id_valid =
false;
369 if(!regexGenAcc.
IsMatch(s_id))
370seq_id_valid =
false;
372seq_id_valid =
true;
373tokens[processed].m_GenomicAccession =
true;
381tokens[processed].m_Valid = seq_id_valid;
387 return(
int)processed;
392 static boolfReentry =
false;
401vector<Token> tokens;
405},
wxT(
"Validating accessions..."));
413 boolrestoreFocus = (wxWindow::FindFocus() ==
m_AccInput);
417 for(
size_t i= 0;
i< (size_t)processed;
i++) {
418 if(!tokens[
i].m_Valid) {
420 intstart = tokens[
i].m_Pos;
421 intend = start + tokens[
i].m_Size;
422 if(valid_start < start)
427 string value=
text.substr(tokens[
i].m_Pos, tokens[
i].m_Size);
433 intstart = tokens[processed].m_Pos;
434 intend = (
int)
text.size();
435 if(valid_start < start)
440 if(valid_start < (
int)
text.size())
452 constwxHtmlLinkInfo
info=
event.GetLinkInfo();
458vector<string> tokens;
461 for(vector<string>::iterator it = tokens.begin(); it != tokens.end(); ++it) {
464tokens.push_back(acc);
471 if(!
input.empty())
477 static const char*
kPanelTag=
"GenBankLoadOptionPanel";
489 if(encoded.size() < 10000) {
505vector<string> values;
511 CTimetime(it->first);
514 stringaccession = it->second.GetAccession();
515values.push_back(s_time);
516values.push_back(accession);
534vector<string> values;
538 for(
size_t i= 0;
i+ 1 < values.size() ; ) {
539 strings_time = values[
i++];
540 stringaccession = values[
i++];
547}
catch(
constexception&) {
562 static boolfReentry =
false;
std::invoke_result< _Fty, ICanceled & >::type GUI_AsyncExec(_Fty &&_Fnarg, const wxString &msg=wxT("Accessing network..."))
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
class CRegistryReadView provides a nested hierarchical view at a particular key.
string GetString(const string &key, const string &default_val=kEmptyStr) const
void GetStringVec(const string &key, vector< string > &val) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
CRichTextCtrl - a wrapper for wxRichTextCtrl that handles additional keyboard events (such as Clipboa...
CAccDescriptor value_type
const TTimeToTMap & GetMap() const
void Add(T elem, time_t time=0)
Interface for testing cancellation request in a long lasting operation.
const char * sRangeRegexp
static string sFormatTimePeriod(CTime &t_now, CTime &t_before)
#define INVALID_ELEMS_MSG
static string sDelim(" \t,;\n\r")
static bool sParseRange(CSeq_interval &ival, const string &range)
static const char * kIdsInputTag
static const char * kMRUTag
static const char * kPanelTag
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static bool IsNAA(const string &annot, bool isStrict=false)
check if a given annotation is a named annotation accession[.version][number] when isSctrict == false...
void SaveMruAccessions(const string ®Path)
vector< string > m_ValidTokens
vector< CRef< CObject > > TIdsVec
void SaveSettings(const string ®Path)
void SetInput(const string &input)
static bool ShowToolTips()
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnRecentAccClicked(wxHtmlLinkEvent &event)
wxEVT_COMMAND_HTML_LINK_CLICKED event handler for ID_HTMLWINDOW2
vector< string > m_GenomicAccessions
~CGenBankLoadOptionPanel()
CRichTextCtrl * m_AccInput
void OnAccInputUpdated(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_UPDATED event handler for ID_ACC_INPUT
int x_ProccessText(const string &text, vector< Token > &tokens, ICanceled &canceled)
CGenBankLoadOptionPanel()
CwxHtmlWindow * m_MRUWindow
bool Create(wxWindow *parent, wxWindowID id=ID_CGENBANKLOADOPTIONPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(266, 184), long style=wxTAB_TRAVERSAL)
void LoadSettings(const string ®Path)
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
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
EAccessionInfo
For IdentifyAccession (below)
static E_Choice GetAccType(EAccessionInfo info)
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
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,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
bool IsMatch(CTempString str, TMatch flags=fMatch_default)
Check existence substring which match a specified pattern.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
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 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)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
CTime & ToLocalTime(void)
Convert the time into local time.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
time_t GetTimeT(void) const
Get time in time_t format.
static CTimeFormat GetPredefined(EPredefined fmt, TFlags flags=fDefault)
Get predefined format.
@ eCurrent
Use current time. See also CCurrentTime.
@ eISO8601_DateTimeSec
Y-M-DTh:m:s (eg 1997-07-16T19:20:30)
void SetTo(TTo value)
Assign a value to To data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetFrom(TFrom value)
Assign a value to From data member.
E_Choice
Choice variants.
unsigned int
A callback function used to compare two keys in a database.
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
static void text(MDB_val *v)
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
C++ wrappers for the Perl-compatible regular expression (PCRE) library.
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
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