57 #include <wx/msgdlg.h>
58 #include <wx/filedlg.h>
59 #include <wx/filename.h>
61 #include <wx/scrolwin.h>
91 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
92 : m_TopSeqEntry(seh), m_CmdProcessor(cmdProcessor), m_all_records(all_records)
108 size_t num_processed;
109 vector<string> unprocessed_ids;
111 bool use_dev_server(
false);
112 bool compare_structured_comments(
false);
118 for (
auto diff : diff_vec)
120 string seq_id = diff->GetSequenceId();
121 string field = diff->GetFieldName();
122 string source = diff->GetSrcVal();
123 string sample = diff->GetPureSampleVal();
124 string sample_id = diff->GetBioSample();
127 tie(set_source, set_sample) =
m_DiffVec[{sample_id, field}][seq_id];
131 set_sample.
insert(sample);
132 m_DiffVec[{sample_id, field}][seq_id] = make_pair(set_source, set_sample);
137 vector<CRef <CSeq_id> > id_list;
146 id_list.push_back(ic);
154 id->GetLabel(&
label);
165 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
166 wxFrame::Create( parent,
id, caption, pos,
size, style );
167 wxVisualAttributes attr = wxPanel::GetClassDefaultAttributes();
168 if (attr.colBg != wxNullColour) {
169 SetOwnBackgroundColour(attr.colBg);
174 GetSizer()->SetSizeHints(
this);
211 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
212 itemDialog1->SetSizer(itemBoxSizer2);
214 m_ScrolledWindow =
new wxScrolledWindow(itemDialog1,
wxID_ANY, wxDefaultPosition, wxSize(840, 870), wxHSCROLL| wxVSCROLL);
219 wxBoxSizer* top_sizer =
new wxBoxSizer(wxVERTICAL);
227 wxMessageBox(
wxT(
"No differences found for resolved Biosample IDs"),
wxT(
"Info"), wxOK);
234 wxMessageBox(
wxT(
"No differences found for resolved Biosample IDs"),
wxT(
"Info"), wxOK);
239 wxArrayString itemChoiceStrings, itemChoiceStringsWritable;
245 if ((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
247 string title = (*it)->GetHeader().GetTitle();
250 itemChoiceStrings.Add(wxString(title));
252 itemChoiceStringsWritable.Add(wxString(title));
259 wxBoxSizer* itemBoxSizer16 =
new wxBoxSizer(wxHORIZONTAL);
260 top_sizer->Add(itemBoxSizer16, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
263 itemBoxSizer16->Add(itemButton24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
265 itemButton24->SetToolTip(
_(
"Append to BioSource values"));
268 itemBoxSizer16->Add(itemButton17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
270 itemButton17->SetToolTip(
_(
"Overwrite BioSource values"));
273 itemBoxSizer16->Add(itemButton18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
275 itemButton18->SetToolTip(
_(
"Fill the blanks in either BioSample or BioSource values"));
278 itemBoxSizer16->Add(itemButton19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
280 itemButton19->SetToolTip(
_(
"Overwrite BioSample values"));
283 itemBoxSizer16->Add(itemButton25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
285 itemButton25->SetToolTip(
_(
"Append to BioSample values"));
287 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxHORIZONTAL);
288 top_sizer->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
293 wxBoxSizer* itemBoxSizer5 =
new wxBoxSizer(wxHORIZONTAL);
294 top_sizer->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
299 wxBoxSizer* itemBoxSizer13 =
new wxBoxSizer(wxHORIZONTAL);
300 top_sizer->Add(itemBoxSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
303 itemBoxSizer13->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
306 itemBoxSizer13->Add(itemButton20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
309 itemBoxSizer13->Add(itemButton21, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
312 itemBoxSizer13->Add(
m_RefreshButton, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
316 itemBoxSizer13->Add(itemButton23, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
318 wxButton* itemButton15 =
new wxButton(
m_ScrolledWindow, wxID_CANCEL,
_(
"Close"), wxDefaultPosition, wxDefaultSize, 0 );
319 itemBoxSizer13->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
334 m_Grid->SetTable(gridAdapter,
true);
335 m_Grid->AutoSizeColumns();
336 int l_height =
m_Grid->GetColLabelSize();
337 m_Grid->SetColLabelSize( 2 * l_height );
344 if ((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
346 string title = (*it)->GetHeader().GetTitle();
354 if (glyph_col >= 0 && glyph_col+1 <
m_Grid->GetNumberCols())
370 expand_col->
SetHeader().SetField_name(
"expand");
371 expand_col->
SetData().SetString();
375 name_col->
SetHeader().SetField_name(
"field");
376 name_col->
SetData().SetString();
379 source_col->
SetHeader().SetTitle(
"Source");
380 source_col->
SetHeader().SetField_name(
"source");
381 source_col->
SetData().SetString();
384 sample_col->
SetHeader().SetTitle(
"Sample");
385 sample_col->
SetHeader().SetField_name(
"Sample");
386 sample_col->
SetData().SetString();
389 sample_id_col->
SetHeader().SetTitle(
"Biosample Id");
390 sample_id_col->
SetHeader().SetField_name(
"biosample_id");
391 sample_id_col->
SetData().SetString();
395 table->SetColumns().push_back(expand_col);
396 table->SetColumns().push_back(name_col);
397 table->SetColumns().push_back(source_col);
398 table->SetColumns().push_back(sample_col);
399 table->SetColumns().push_back(sample_id_col);
408 string field, sample_id;
409 tie(sample_id, field) = diff.first;
410 for (
const auto &
row : diff.second)
412 string seq_id =
row.first;
414 tie(set_source, set_sample) =
row.second;
423 id->Assign(*
m_ids[seq_id]);
430 m_id_col->SetData().SetId().push_back(
id);
431 expand_col->
SetData().SetString().push_back(
"");
432 name_col->
SetData().SetString().push_back(field);
434 sample_col->
SetData().SetString().push_back(sample);
435 sample_id_col->
SetData().SetString().push_back(sample_id);
453 auto num_rows =
m_Grid->GetNumberRows();
454 for (
auto row = 0;
row < num_rows; ++
row)
459 values[bsh][field] =
value;
471 new_desc->
Assign(*src_desc_ci);
476 string field = fi->first;
477 string value = fi->second;
487 biosource.
SetOrg().ResetTaxname();
491 biosource.
SetOrg().SetOrgname().ResetName();
498 biosource.
SetOrg().SetTaxId(taxid);
510 for (
const auto &v : vals)
517 mod->SetSubtype(subtype);
519 biosource.
SetOrg().SetOrgname().SetMod().push_back(
mod);
527 catch (
const exception&)
537 for (
const auto &v : vals)
555 catch (
const exception&)
562 wxMessageBox(
wxT(
"Unknown field name ") + wxString(field),
wxT(
"Error"), wxOK);
581 return "Invalid operation in Compare with Biosample";
624 wxMessageDialog dlg(
this,
_(
"Discard modifications?"),
_(
"Attention"),wxOK|wxCANCEL|wxCENTRE);
625 if (dlg.ShowModal() == wxID_OK) {
636 if (!
m_Grid->IsSelection())
640 wxArrayInt wx_selected =
m_Grid->GetSelectedRows();
641 if (wx_selected.IsEmpty())
643 if (
m_Grid->GetSelectionBlockTopLeft().size() == 1 &&
m_Grid->GetSelectionBlockTopLeft().size() ==
m_Grid->GetSelectionBlockBottomRight().size())
645 int top_row =
m_Grid->GetSelectionBlockTopLeft()[0].GetRow();
646 int bot_row =
m_Grid->GetSelectionBlockBottomRight()[0].GetRow();
647 for (
int i = top_row;
i <= bot_row;
i++)
655 for (
unsigned int i = 0;
i < wx_selected.GetCount();
i++)
657 selected.insert(wx_selected.Item(
i));
668 std::set<int> selected;
670 if (selected.empty())
672 wxMessageBox(
wxT(
"Nothing selected"),
wxT(
"Info"), wxOK);
679 for (std::set<int>::const_iterator
i = selected.begin();
i != selected.end(); ++
i)
685 if (sample_value.IsEmpty() && !source_value.IsEmpty())
692 if (!sample_value.IsEmpty() && source_value.IsEmpty())
710 std::set<int> selected;
712 if (selected.empty())
714 wxMessageBox(
wxT(
"Nothing selected"),
wxT(
"Info"), wxOK);
721 for (std::set<int>::const_iterator
i = selected.begin();
i != selected.end(); ++
i)
727 if (!sample_value.IsEmpty() && source_value != sample_value)
745 std::set<int> selected;
747 if (selected.empty())
749 wxMessageBox(
wxT(
"Nothing selected"),
wxT(
"Info"), wxOK);
756 for (std::set<int>::const_iterator
i = selected.begin();
i != selected.end(); ++
i)
762 if (sample_value != source_value && !source_value.IsEmpty())
781 std::set<int> selected;
783 if (selected.empty())
785 wxMessageBox(
wxT(
"Nothing selected"),
wxT(
"Info"), wxOK);
792 for (std::set<int>::const_iterator
i = selected.begin();
i != selected.end(); ++
i)
799 if (!sample_value.IsEmpty() && source_value != sample_value && field !=
_(
"Organism Name") && field !=
_(
"Tax ID"))
801 list<string> old_vals;
803 list<string> new_vals;
805 set<string> vals(old_vals.begin(), old_vals.end());
806 vals.
insert(new_vals.begin(), new_vals.end());
808 if (new_val != source_value)
827 std::set<int> selected;
829 if (selected.empty())
831 wxMessageBox(
wxT(
"Nothing selected"),
wxT(
"Info"), wxOK);
838 for (std::set<int>::const_iterator
i = selected.begin();
i != selected.end(); ++
i)
845 if (sample_value != source_value && !source_value.IsEmpty() && field !=
_(
"Organism Name") && field !=
_(
"Tax ID"))
847 list<string> old_vals;
849 list<string> new_vals;
851 set<string> vals(old_vals.begin(), old_vals.end());
852 vals.
insert(new_vals.begin(), new_vals.end());
854 if (new_val != sample_value)
872 msg <<
"Seq-id\tField\tSource\tSample\tBiosample Id\n";
875 string field, sample_id;
876 tie(sample_id, field) = diff.first;
877 for (
const auto &
row : diff.second)
879 string seq_id =
row.first;
881 tie(set_source, set_sample) =
row.second;
886 msg << seq_id <<
"\t"<<field<<
"\t"<<
source<<
"\t"<<sample<<
"\t"<<sample_id<<
"\n";
891 report->SetTitle(
wxT(
"Compare with Biosample Report"));
897 static const char*
kRegPath =
"Dialogs.Edit.CompareWithBiosample";
929 wxMessageBox(
wxT(
"Current BioSample API key is empty. Please specify a new one."),
wxT(
"Error"), wxOK);
940 auto num_rows =
m_Grid->GetNumberRows();
941 for (
auto row = 0;
row < num_rows; ++
row)
943 string seq_id_str =
m_id_col->GetData().GetId()[
row]->GetSeqIdString();
947 list<string> sample_list;
950 new_values[pair<string, string>(sample_id, field)] = sample_list;
957 unordered_map<string, map<string, vector<string> > > delete_value, add_value;
959 unordered_map<string, string> change_organism;
962 string field, sample_id;
963 tie(sample_id, field) = diff.first;
964 list<string> new_sample;
965 if (new_values.
find(diff.first) != new_values.
end())
966 new_sample = new_values[diff.first];
969 tie(set_source, old_sample) = diff.second.
begin()->second;
974 vector<string> deleted_values;
975 set_difference(old_sample.
begin(), old_sample.
end(), new_sample.begin(), new_sample.end(), inserter(deleted_values, deleted_values.end()));
977 vector<string> added_values;
978 set_difference(new_sample.begin(), new_sample.end(), old_sample.
begin(), old_sample.
end(), inserter(added_values, added_values.end()));
980 if (field ==
"Organism Name")
982 if (added_values.size() == 1 && deleted_values.size() == 1)
984 change_organism[sample_id] = added_values.front();
989 if (!deleted_values.empty())
991 delete_value[sample_id][field] = deleted_values;
995 if (!added_values.empty())
997 add_value[sample_id][field] = added_values;
1001 for (
const auto &diff : new_values)
1003 string field, sample_id;
1004 tie(sample_id, field) = diff.first;
1005 vector<string> new_sample(diff.second.begin(), diff.second.end());
1012 if (new_sample.empty())
1018 add_value[sample_id][field] = new_sample;
1023 string sUrl =
"https://api-int.ncbi.nlm.nih.gov/biosample/update/";
1024 string sContentType =
"application/json; charset=utf-8";
1026 auto sample_id_it = ids.
begin();
1027 while (sample_id_it != ids.
end())
1035 auto sample_id = *sample_id_it;
1037 obj1.
insert(
"samples", sample_id);
1038 if (!delete_value[sample_id].
empty())
1041 for (
const auto &kv : delete_value[sample_id])
1043 const string &field = kv.first;
1044 for (
const auto &v : kv.second)
1047 obj2.
insert(
"name", field);
1048 obj2.
insert(
"old_value", v);
1053 if ( !change_organism[sample_id].
empty())
1057 chg_org.
insert(
"new_value", change_organism[sample_id]);
1060 if (!add_value[sample_id].
empty())
1063 for (
const auto &kv : add_value[sample_id])
1065 const string &field = kv.first;
1066 for (
const auto &v : kv.second)
1069 obj2.
insert(
"name", field);
1070 obj2.
insert(
"new_value", v);
1089 string err = ss.str();
1091 err =
"Unable to connect - server down?";
1092 wxMessageBox(wxString(err),
wxT(
"Error"), wxOK);
1098 bool has_error =
false;
1101 wxMessageBox(
wxT(
"Current BioSample API key was not recognized. Please specify a new one."),
wxT(
"Error"), wxOK);
1111 if (!
msg.IsEmpty()) {
1113 report->SetTitle(
wxT(
"Biosample Update Report"));
1120 wxWindow *win = FindWindowByLabel(
wxT(
"Biosample Update Report"),
this);
1139 if (dlg.ShowModal() == wxID_OK) {
1171 wxMessageBox(
wxT(
"No differences found for resolved Biosample IDs"),
wxT(
"Info"), wxOK);
1178 wxMessageBox(
wxT(
"No differences found for resolved Biosample IDs"),
wxT(
"Info"), wxOK);
1197 wxWindow *win = FindWindowByLabel(
wxT(
"Biosample Update Report"),
this);
1229 auto error_it = obj.
find(
"has_error");
1231 auto msg_it = obj.
find(
"messages");
1232 if (msg_it != obj.
end() && msg_it->
value.
IsArray() && !msg_it->value.GetArray().empty()) {
1234 for (
const auto& resp_it : messages) {
1235 if (resp_it.IsObject()) {
1236 const auto& resp_obj = resp_it.
GetObject();
1237 auto level_it = resp_obj.
find(
"level");
1238 auto message_it = resp_obj.find(
"message");
1239 if ((level_it != resp_obj.end()) &&
1240 (message_it != resp_obj.end()) &&
1241 (level_it->value.GetValue().GetString() ==
"error") &&
1255 unordered_map<string, vector<string> > messages;
1259 if (obj2.
find(
"level") != obj2.
end() && obj2.
find(
"message") != obj2.
end())
1263 messages[level].push_back(
msg);
1268 it = obj.
find(
"validation_report");
1274 string name(it2->name);
1278 if (obj2.
find(
"message") == obj2.
end())
1283 string validation_msg;
1284 if (obj2.
find(
"type") != obj2.
end())
1287 if (
type ==
"attribute_error" && obj2.
find(
"attribute_name") != obj2.
end())
1290 validation_msg +=
" " + attribute_name;
1291 if (obj2.
find(
"attribute_value") != obj2.
end())
1294 if (!attribute_value.empty())
1295 validation_msg +=
":" + attribute_value;
1301 bool is_warning =
false;
1302 if (obj2.
find(
"is_warning") != obj2.
end())
1304 if (obj2.
find(
"name") != obj2.
end())
1307 msg +=
" (" + short_name +
")";
1308 if (short_name ==
"taxonomy_error_warning" || short_name ==
"tax_consult_warning" || short_name ==
"taxonomy_service_failure_warning")
1310 wxMessageBox(wxString(
msg),
wxT(
"Taxonomy Consult Warning"), wxOK);
1314 validation_warning[
msg][name] = validation_msg;
1316 validation_error[
msg][name] = validation_msg;
1319 for (
const auto &m : validation_error)
1321 messages[
"error"].push_back(m.first);
1322 for (
const auto &name : m.second)
1324 string str = name.first;
1325 if (!name.second.empty())
1326 str +=
" - " + name.second;
1327 messages[
"error"].push_back(
str);
1330 for (
const auto &m : validation_warning)
1332 messages[
"warning"].push_back(m.first);
1333 for (
const auto &name : m.second)
1335 string str = name.first;
1336 if (!name.second.empty())
1337 str +=
" - " + name.second;
1338 messages[
"warning"].push_back(
str);
1343 if (messages.empty())
1346 if (!messages[
"error"].
empty())
1348 report <<
"Error:\n";
1349 for (
const auto &m : messages[
"error"])
1350 report << m <<
"\n";
1353 if (!messages[
"warning"].
empty())
1355 report <<
"Warning:\n";
1356 for (
const auto &m : messages[
"warning"])
1357 report << m <<
"\n";
1360 if (!messages[
"info"].
empty())
1362 report <<
"Info:\n";
1363 for (
const auto &m : messages[
"info"])
1364 report << m <<
"\n";
1395 Create(parent,
id, caption, pos,
size, style);
1401 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
1402 wxDialog::Create(parent,
id, caption, pos,
size, style);
1407 GetSizer()->SetSizeHints(
this);
1423 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
1424 itemDialog1->SetSizer(itemBoxSizer2);
1426 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxHORIZONTAL);
1427 itemBoxSizer2->Add(itemBoxSizer4, 0, wxEXPAND | wxALL, 0);
1430 itemBoxSizer4->Add(
m_Filename, 1, wxALIGN_LEFT | wxALL, 5);
1432 wxButton* itemButton5 =
new wxBitmapButton(itemDialog1,
wxID_ANY, wxArtProvider::GetBitmap(
wxT(
"menu::open")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW);
1433 itemButton5->SetToolTip(
wxT(
"Choose a file..."));
1434 itemBoxSizer4->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL | wxTOP |wxBOTTOM | wxRIGHT, 5);
1438 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer(wxHORIZONTAL);
1439 itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
1441 wxButton* itemButton7 =
new wxButton(itemDialog1, wxID_OK,
_(
"OK"), wxDefaultPosition, wxDefaultSize, 0);
1442 itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
1444 wxButton* itemButton8 =
new wxButton(itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0);
1445 itemBoxSizer6->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
1450 wxFileDialog dlg(
this,
wxT(
"Select file"), wxEmptyString, wxEmptyString,
_(
"All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
1452 if (dlg.ShowModal() == wxID_OK) {
1482 return wxNullBitmap;
vector< CRef< CBiosampleFieldDiff > > TBiosampleFieldDiffList
map< string, CRef< CSeq_descr > > TBioSamples
TBiosampleFieldDiffList GetBioseqDiffs(CBioseq_Handle bh, const string &biosample_accession, size_t &num_processed, vector< string > &unprocessed_ids, bool use_dev_server=false, bool compare_structured_comments=false, const string &expected_prefix="", TBioSamples *cache=NULL)
static bool IsStopWord(const string &value)
bool RemoveOrgMod(int subtype)
bool RemoveSubSource(int subtype)
void AddCommand(IEditCommand &command)
void SetButton(wxButton *button)
void OnAddToSample(wxCommandEvent &event)
void OnAddToSource(wxCommandEvent &event)
CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
CStringConstraintSelect * m_StringConstraintPanel
wxScrolledWindow * m_ScrolledWindow
void OnSyncButtonClick(wxCommandEvent &event)
ICommandProccessor * m_CmdProcessor
void CreateBiosampleUpdateWebService(wxCommandEvent &event)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CRef< objects::CSeq_table > GetValuesTableFromSeqEntry()
CRef< objects::CSeqTable_column > m_id_col
void OnRefresh(wxCommandEvent &event)
void OnClickCancel(wxCommandEvent &event)
void x_AddTablePanel(CRef< objects::CSeq_table > values_table)
map< pair< string, string >, unordered_map< string, pair< set< string >, set< string > > > > m_DiffVec
~CCompareWithBiosample()
Destructor.
void Init()
Initialises member variables.
CSeqTableGridPanel * m_GridPanel
void OnCopyToSourceButtonClick(wxCommandEvent &event)
void OnNewAPIKey(wxCommandEvent &event)
wxButton * m_RefreshButton
map< string, CConstRef< CSeq_id > > m_ids
wxBoxSizer * m_GridPanelSizer
wxString x_ReportBiosampleUpdate(const string &str, bool &has_error)
CSeq_entry_Handle m_TopSeqEntry
bool IsReadOnlyColumn(string column_name)
void GetSelectedRows(std::set< int > &selected)
biosample_util::TBioSamples m_Cache
void CreateControls()
Creates the controls and sizers.
void OnCopyToSampleButtonClick(wxCommandEvent &event)
void x_ReadBioSampleApiKey()
CApplyEditconvertPanel * m_AecrPanel
CCompareWithBiosample()
Constructors.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Compare with Biosample"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxCAPTION|wxCLIP_CHILDREN|wxRESIZE_BORDER)
Creation.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void MakeReport(wxCommandEvent &event)
void SaveSettings() const
void OnClickOk(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
void OnOpenFile(wxCommandEvent &event)
string GetFilename() const
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CFileLocDialog()
Constructors.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=13000, const wxString &caption=_("Select File with BioSample API Key"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void SetText(const wxString &text)
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.
int GetInt(const string &key, int default_val=0) const
retrieve values by section and key.
CJson_Object push_back_object(void)
Add object type element to the end of the array.
Random-access iterator to access const JSON array element.
const_iterator begin(void) const
Return a random-access iterator to the first element in the array.
bool empty(void) const
Test if the array is empty.
const_iterator end(void) const
Return a random-access iterator that points just beyond the end of the array.
bool IsObject(void) const
CJson_ConstObject GetObject(void) const
Get JSON object contents of the node.
CJson_ConstArray GetArray(void) const
Get JSON array contents of the node.
std::string ToString(TJson_Write_Flags flags=fJson_Write_IndentWithSpace, unsigned int indent_char_count=4) const
Convert the contents of the node into string.
CJson_ConstValue GetValue(void) const
Get JSON value contents of the node.
Bidirectional iterator to access const JSON object element.
const CJson_ConstNode value
bool empty(void) const
Test if the object is empty.
const_iterator find(const CJson_Node::TKeyType &name) const
Return an iterator that points to the location of the element.
const_iterator begin(void) const
Return an iterator that points to the first element in the object.
const_iterator end(void) const
Return an iterator that points to the location after the last element.
bool GetBool(void) const
Get primitive value data.
TStringType GetString(void) const
bool ParseString(const TStringType &v)
Read JSON data from a UTF8 string.
bool ReadSucceeded(void) const
Test if the most recent read was successful.
CJson_Object SetObject(void)
Get JSON object contents of the node.
CJson_Array insert_array(const CJson_Node::TKeyType &name)
Insert array type element into the object.
void insert(const CJson_Node::TKeyType &name)
Insert null element into the object.
CJson_Object insert_object(const CJson_Node::TKeyType &name)
Insert object type element into the object.
@OrgMod.hpp User-defined methods of the data storage class.
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
class CRegistryReadView provides a nested hierarchical view at a particular key.
string GetString(const string &key, const string &default_val=kEmptyStr) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
void MakeColumnReadOnly(int pos, bool val=true)
void CollapseByCol(int col)
int GetCollapseColAndExpand(void)
void InitColumnCollapse(int col)
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
const_iterator begin() const
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
static const int chunk_size
static const char * kRegPath
static const char * kApiKeyPath
#define ID_COPY_TO_SAMPLE
#define ID_CREATE_BIOSAMPLE
#define ID_UPDATE_BIOSOURCE
#define ID_FILELOCTEXTCTRL
#define ID_REFRESH_BIOSAMPLE
#define ID_COPY_TO_SOURCE
#define ID_APIKEY_BIOSAMPLE
const char * kSequenceIdColLabel
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CNcbiIstream & ContentStream(void) const
Get input stream.
int GetStatusCode(void) const
Get response status code.
void SetValue(CHeaderNameConverter name, CTempString value)
Remove all existing values with the name, set the new value.
CNcbiIstream & ErrorStream(void) const
Get input stream containing error message (e.g.
CHttpResponse g_HttpPost(const CUrl &url, CTempString data, const CHttpParam ¶m=CHttpParam())
Shortcut for POST request.
static int BestRank(const CRef< CSeq_id > &id)
@ fParse_Default
By default in ParseIDs and IsValid, allow raw parsable non-numeric accessions and plausible local acc...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
vector< CSeq_id_Handle > TId
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
bool NcbiStreamCopy(CNcbiOstream &os, CNcbiIstream &is)
Copy the entire contents of stream "is" to stream "os".
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 Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
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 & 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.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ eNocase
Case insensitive compare.
C::value_type FindBestChoice(const C &container, F score_func)
Find the best choice (lowest score) for values in a container.
static const char label[]
void SetSubtype(TSubtype value)
Assign a value to Subtype data member.
const TOrg & GetOrg(void) const
Get the Org member data.
void SetOrg(TOrg &value)
Assign a value to Org data member.
void SetName(const TName &value)
Assign a value to Name data member.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
const TColumns & GetColumns(void) const
Get the Columns member data.
void SetHeader(THeader &value)
Assign a value to Header data member.
vector< CRef< CSeqTable_column > > TColumns
void SetData(TData &value)
Assign a value to Data data member.
TNum_rows GetNum_rows(void) const
Get the Num_rows member data.
@ eField_id_location_id
location Seq-id
bool IsGenbank(void) const
Check if variant Genbank is selected.
TSource & SetSource(void)
Select the variant.
@ e_Source
source of materials, includes Org-ref
@ eMol_na
just a nucleic acid
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
wxString GetAbsolutePath(const wxString &localpath)
string ToStdString(const wxString &s)