wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
93: m_TopSeqEntry(seh), m_Workbench(workbench)
96 Create(parent,
id, caption, pos,
size, style);
105 bool CUnculTaxTool::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
108SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
109wxFrame::Create( parent,
id, caption, pos,
size, style );
114GetSizer()->SetSizeHints(
this);
116Centre(wxBOTH|wxCENTRE_ON_SCREEN);
152wxBoxSizer* itemBoxSizer1 =
newwxBoxSizer(wxVERTICAL);
153SetSizer(itemBoxSizer1);
155wxPanel* itemDialog1 =
newwxPanel( itemFrame1,
wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
156itemBoxSizer1->Add(itemDialog1, 1, wxGROW, 0);
159wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
160itemDialog1->SetSizer(itemBoxSizer2);
162wxArrayString itemChoiceStrings, itemChoiceStringsWritable;
164wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
165itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5);
173wxMessageBox(
wxT(
"No bad taxnames"),
wxT(
"Error"), wxOK | wxICON_ERROR);
180wxMessageBox(
wxT(
"No bad taxnames"),
wxT(
"Error"), wxOK | wxICON_ERROR);
186itemBoxSizer3->Add(
m_GridPanel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2);
190 m_Grid->SetTable(gridAdapter,
true);
191 m_Grid->AutoSizeColumns();
192 intl_height =
m_Grid->GetColLabelSize();
193 m_Grid->SetColLabelSize( 2 * l_height );
200 if((*it)->IsSetHeader() && (*it)->GetHeader().IsSetTitle() )
202 stringtitle = (*it)->GetHeader().GetTitle();
205itemChoiceStrings.Add(wxString(title));
207itemChoiceStringsWritable.Add(wxString(title));
216 if(glyph_col >= 0 && glyph_col+2 <
m_Grid->GetNumberCols())
222wxBoxSizer* itemBoxSizer4 =
newwxBoxSizer(wxHORIZONTAL);
223itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);
226itemBoxSizer4->Add(itemStringConstraintPanel, 0, wxALIGN_CENTER_VERTICAL|wxALL|
wxFIXED_MINSIZE, 0);
229itemBoxSizer2->Add(itemAecrPanel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|
wxFIXED_MINSIZE, 1);
231wxBoxSizer* itemBoxSizer15 =
newwxBoxSizer(wxHORIZONTAL);
232itemBoxSizer2->Add(itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 2);
234wxButton* itemButton13 =
newwxButton( itemDialog1,
ID_APPLY_BTN,
_(
"Apply Corrections"), wxDefaultPosition, wxDefaultSize, 0 );
235itemBoxSizer15->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
237wxButton* itemButton15 =
newwxButton( itemDialog1,
ID_REFRESH_BTN,
_(
"Refresh"), wxDefaultPosition, wxDefaultSize, 0 );
238itemBoxSizer15->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
240wxButton* itemButton11 =
newwxButton( itemDialog1,
ID_ADD_SP_UNCUL_TAXTOOL,
_(
"Add sp."), wxDefaultPosition, wxDefaultSize, 0 );
241itemBoxSizer15->Add(itemButton11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
244itemBoxSizer15->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
246wxButton* itemButton16 =
newwxButton( itemDialog1,
ID_TRIM_BTN,
_(
"Trim Suggestion"), wxDefaultPosition, wxDefaultSize, 0 );
247itemBoxSizer15->Add(itemButton16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
249wxButton* itemButton14 =
newwxButton( itemDialog1,
ID_CANCEL_BTN,
_(
"Dismiss"), wxDefaultPosition, wxDefaultSize, 0 );
250itemBoxSizer15->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
262expand_col->
SetHeader().SetTitle(
"");
263expand_col->
SetHeader().SetField_name(
"expand");
264expand_col->
SetData().SetString();
267current_col->
SetHeader().SetTitle(
"Taxname");
268current_col->
SetHeader().SetField_name(
"current");
269current_col->
SetData().SetString();
272suggested_col->
SetHeader().SetTitle(
"Suggested Correction");
273suggested_col->
SetHeader().SetField_name(
"suggested");
274suggested_col->
SetData().SetString();
280bogus_col->
SetHeader().SetField_name(
"");
281bogus_col->
SetData().SetString();
284 table->SetColumns().push_back(id_col);
285 table->SetColumns().push_back(expand_col);
286 table->SetColumns().push_back(current_col);
287 table->SetColumns().push_back(suggested_col);
288 table->SetColumns().push_back(bogus_col);
291vector<string> suggestions;
292vector<bool> verified;
298 stringtaxname =
m_BioSource[
i].second->GetSource().GetTaxname();
299 stringsuggested = suggestions[
i];
300 if(taxname == suggested && verified[
i])
304id_col->
SetData().SetId().push_back(
id);
305expand_col->
SetData().SetString().push_back(
"");
306current_col->
SetData().SetString().push_back(taxname);
307suggested_col->
SetData().SetString().push_back(suggested);
308bogus_col->
SetData().SetString().push_back(
"");
353 boolselect_all =
false;
356 if(wxMessageBox(
ToWxString(
"Select All?"),
wxT(
"Nothing is selected"), wxOK | wxCANCEL,
NULL) == wxOK)
363 for(
unsigned int i= 0;
i< values_table->
GetColumn(
"current").GetData().GetString().
size();
i++)
367 if(!current.empty() && !suggested.empty() && current != suggested && (
m_Grid->IsInSelection(
i,0) || select_all))
369current_to_suggested[current] = suggested;
378 stringtaxname =
m_BioSource[
i].second->GetSource().GetTaxname();
379 if(current_to_suggested.
find(taxname) != current_to_suggested.
end())
385edited_biosource.
SetOrg().SetTaxname(current_to_suggested[taxname]);
402orig_obj->
Assign(biosource);
424 while(old != taxname)
427 const stringuncultured =
"uncultured ";
428 const stringsp =
" sp";
429 const stringspdot =
" sp.";
432taxname = taxname.substr(uncultured.length());
436taxname = taxname.substr(0,taxname.length()-sp.length());
440taxname = taxname.substr(0,taxname.length()-spdot.length());
449 "[BankIt_uncultured16S_wizard]; [species_specific primers]; [tgge]",
450 "[BankIt_uncultured16S_wizard]; [species_specific primers]; [dgge]",
451 "[BankIt_uncultured16S_wizard]; [species_specific primers]",
452 "[uncultured (with species-specific primers)]",
453 "[uncultured]; [amplified with species-specific primers]",
454 "[uncultured (using species-specific primers) bacterial source]",
455 "amplified with species-specific primers",
462 for(CBioSource::TSubtype::const_iterator subtype = biosource.
GetSubtype().begin(); subtype != biosource.
GetSubtype().end(); ++subtype)
465 stringname = (*subtype)->GetName();
481CBioSource::TSubtype::iterator subtype = biosource.
SetSubtype().begin();
482 while( subtype != biosource.
SetSubtype().end())
484 boolerased =
false;
487 stringname = (*subtype)->GetName();
493 if(new_note.empty())
495subtype = biosource.
SetSubtype().erase(subtype);
499(*subtype)->SetName(new_note);
517vector<CRef<COrg_ref> > rq_list;
521rq_list.push_back(org);
528 if(reply->IsSetReply() && !reply->GetReply().empty())
530t3reply = reply->GetReply().front();
543 if((*status)->IsSetProperty() && (*status)->GetProperty() ==
"rank"&& (*status)->IsSetValue() && (*status)->GetValue().IsStr())
544rank = (*status)->GetValue().GetStr();
552 if(reply && reply->
IsData())
575 return "uncultured "+taxname+suffix;
581 stringrank2 =
GetRank(reply2);
582 if(rank2 ==
"species")
607 if(rank ==
"species")
609 if( is_species_specific )
627 if( is_species_specific)
631 if(rank ==
"genus")
657 const auto& bsrc =
m_BioSource[
i].second->GetSource();
659submit.
insert(bsrc.GetTaxname());
663 if(standard_taxname.empty())
666submit.
insert(standard_taxname);
675standard_taxname = name2;
676submit.
insert(standard_taxname);
685vector<CRef<COrg_ref> > rq_list;
690rq_list.push_back(org);
696 if(reply->IsSetReply())
699 for(CTaxon3_reply::TReply::const_iterator reply_it = reply->GetReply().begin(); reply_it != reply->GetReply().end(); ++reply_it)
721 if(reply_orig && reply_orig->
IsData()) {
728 if(standard_taxname.empty())
743suggestions[
i] =
TryRankFix(reply,
i,standard_taxname);
764 for(
unsigned int i= 0;
i< values_table->
GetColumn(
"suggested").GetData().GetString().
size();
i++)
767 if(suggested.empty())
772 boolno_fix =
false;
777values_table->
SetColumns()[3]->SetData().SetString()[
i] = suggested.substr(0,pos);
781 if(glyph_col >= 0 && glyph_col+2 <
m_Grid->GetNumberCols())
814 booltaxon_present =
false;
820taxon_present =
true;
826 if(!taxon_present || !begins_with_uncultured)
834 if((*it)->IsSource()) {
860 for(
int i=0;
i<
m_Grid->GetNumberCols();
i++)
861 if(
m_Grid->GetColLabelValue(
i) ==
_(
"Suggested Correction"))
875 for(
int i=0;
i<
m_Grid->GetNumberRows();
i++)
888 for(
int i=0;
i<
m_Grid->GetNumberRows();
i++)
948sel_srv->GetActiveObjects(
objects);
968 m_Grid->SetTable(gridAdapter,
true);
969 m_Grid->AutoSizeColumns();
973 if(glyph_col >= 0 && glyph_col+2 <
m_Grid->GetNumberCols())
const string & GetTaxname(void) const
bool IsSetTaxname(void) const
void AddCommand(IEditCommand &command)
CUndoManager & GetUndoManager()
CProjectService - a service providing API for operations with Workspaces and Projects.
void MakeColumnReadOnly(int pos, bool val=true)
void InitColumnCollapse(int col)
void SetValuesTable(CRef< objects::CSeq_table > table)
CRef< objects::CSeq_table > GetValuesTable()
const CSeqTable_column & GetColumn(CTempString column_name) const
virtual CRef< CTaxon3_reply > SendOrgRefList(const vector< CRef< COrg_ref > > &list, COrg_ref::fOrgref_parts result_parts=COrg_ref::eOrgref_default, fT3reply_parts t3result_parts=eT3reply_default)
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
IWorkbench is the central interface in the application framework.
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 find(const key_type &key) const
const_iterator end() const
const char * kSequenceIdColLabel
static void cleanup(void)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
void CleanupForTaxnameChange(CObjectInfo oi)
objects::CSeq_entry_Handle GetTopSeqEntryFromScopedObject(SConstScopedObject &obj)
vector< SConstScopedObject > TConstScopedObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
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 SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
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 bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for 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.
@ eNocase
Case insensitive compare.
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
bool IsSetSubtype(void) const
Check if a value has been assigned 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.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
const TLineage & GetLineage(void) const
Get the Lineage member data.
bool IsSetLineage(void) const
lineage with semicolon separators Check if a value has been assigned to Lineage data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
void SetTaxname(const TTaxname &value)
Assign a value to Taxname data member.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname 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.
const TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
TColumns & SetColumns(void)
Assign a value to Columns data member.
@ eField_id_location_id
location Seq-id
const TSet & GetSet(void) const
Get the variant data.
bool IsSet(void) const
Check if variant Set is selected.
const TSource & GetSource(void) const
Get the variant data.
TSource & SetSource(void)
Select the variant.
bool IsData(void) const
Check if variant Data is selected.
const TData & GetData(void) const
Get the variant data.
bool IsSetStatus(void) const
Check if a value has been assigned to Status data member.
const TStatus & GetStatus(void) const
Get the Status member data.
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
bool IsError(void) const
Check if variant Error is selected.
const TError & GetError(void) const
Get the variant data.
const TOrg & GetOrg(void) const
Get the Org member data.
const TMessage & GetMessage(void) const
Get the Message member data.
bool IsSetMessage(void) const
Check if a value has been assigned to Message data member.
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
void GetViewObjects(IWorkbench *workbench, TConstScopedObjects &objects)
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
#define FOR_EACH_DBXREF_ON_ORGREF(Itr, Var)
FOR_EACH_DBXREF_ON_ORGREF EDIT_EACH_DBXREF_ON_ORGREF.
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
#define FOR_EACH_SEQDESC_ON_SEQENTRY(Itr, Var)
FOR_EACH_SEQDESC_ON_SEQENTRY EDIT_EACH_SEQDESC_ON_SEQENTRY.
#define row(bind, expected)
CRef< CCmdComposite > CleanupCommand(objects::CSeq_entry_Handle orig_seh, bool extended, bool do_tax)
wxString ToWxString(const string &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