wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
84 Create(parent,
id, caption, pos,
size, style);
90SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
96GetSizer()->SetSizeHints(
this);
100SetSize(wxSize(280, 750));
122 ITERATE(vector<const CFeatListItem *>, ft_it, feat_list) {
125 intfeat_type = item.
GetType();
127 m_Types[pair<int,int>(feat_type,feat_subtype)] = desc;
128 if(existing.
find(desc) == existing.
end())
151wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
152itemDialog1->SetSizer(itemBoxSizer2);
154wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
155itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
158itemBoxSizer3->Add(
m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
160 m_ListCtrl->InsertColumn(0,
" Feature",wxLIST_FORMAT_LEFT,237);
165wxBoxSizer* itemBoxSizer5 =
newwxBoxSizer(wxHORIZONTAL);
166itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
168wxBoxSizer* itemBoxSizer6 =
newwxBoxSizer(wxVERTICAL);
169itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
171wxStaticBox* itemStaticBoxSizer7Static =
newwxStaticBox(itemDialog1,
wxID_ANY,
_(
"Optional String Constraint"));
172wxStaticBoxSizer* itemStaticBoxSizer7 =
newwxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
173itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);
177itemStaticBoxSizer7->Add(
m_RadioButton, 0, wxALIGN_LEFT|wxALL, 5);
180itemRadioButton9->SetValue(
false);
181itemStaticBoxSizer7->Add(itemRadioButton9, 0, wxALIGN_LEFT|wxALL, 5);
184itemStaticBoxSizer7->Add(
m_TextCtrl, 0, wxALIGN_LEFT|wxALL, 5);
188itemStaticBoxSizer7->Add(
m_CheckBox, 0, wxALIGN_LEFT|wxALL, 5);
190wxStaticBox* itemStaticBoxSizer15Static =
newwxStaticBox(itemDialog1,
wxID_ANY,
_(
"Optional Seq-id Constraint"));
191wxStaticBoxSizer* itemStaticBoxSizer15 =
newwxStaticBoxSizer(itemStaticBoxSizer15Static, wxVERTICAL);
192itemBoxSizer6->Add(itemStaticBoxSizer15, 0, wxALIGN_LEFT|wxALL, 5);
199itemRadioButton16->SetValue(
false);
200itemStaticBoxSizer15->Add(itemRadioButton16, 0, wxALIGN_LEFT|wxALL, 5);
203itemStaticBoxSizer15->Add(
m_TextCtrl_id, 0, wxALIGN_LEFT|wxALL, 5);
207itemStaticBoxSizer15->Add(
m_CheckBox_id, 0, wxALIGN_LEFT|wxALL, 5);
209wxStaticBox* itemStaticBoxSizer17Static =
newwxStaticBox(itemDialog1,
wxID_ANY,
_(
"Optional Location Constraint"));
210wxStaticBoxSizer* itemStaticBoxSizer17 =
newwxStaticBoxSizer(itemStaticBoxSizer17Static, wxVERTICAL);
211itemBoxSizer6->Add(itemStaticBoxSizer17, 0, wxALIGN_LEFT|wxALL, 5);
213wxArrayString strands,
types;
214strands.Add(
wxT(
"Any Strand"));
215strands.Add(
wxT(
"Plus Strand"));
216strands.Add(
wxT(
"Minus Strand"));
217 types.Add(
wxT(
"Nucleotide and protein sequences"));
218 types.Add(
wxT(
"Nucleotide sequences only"));
219 types.Add(
wxT(
"Protein sequences only"));
223itemStaticBoxSizer17->Add(
m_ChoiceStrand, 0, wxALIGN_LEFT|wxALL, 5);
226itemStaticBoxSizer17->Add(
m_ChoiceType, 0, wxALIGN_LEFT|wxALL, 5);
229itemBoxSizer2->Add(OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
268 boolmodified =
false;
277 boolremove_orphans =
true;
282item =
m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
283 if( item == -1 )
break;
292 cmd->AddCommand(*cmd_remove_orphans);
315list<string> non_refseq;
319refseq.push_back(*it);
321non_refseq.push_back(*it);
330 if(non_refseq.size()) {
331 if( !accs.empty() ) {
337 if( !accs.empty() ) {
345 if( !lines.empty() ) {
346 ITERATE(list<string>, iter, lines) {
347 if(iter != lines.begin()) {
348ostream <<
" "<< *iter << endl;
350ostream << *iter << endl;
363list< CConstRef<CUser_object> > objs;
370objs.push_back(sub_o);
396ostream <<
"Model Generation Method: ";
399method =
f->GetData().GetStr();
402ostream <<
"<unknown>";
409 if(method ==
"Chainer"|| method ==
"Gnomon") {
419 if( !core.empty() ) {
425 if( !core.empty() ) {
426s =
"Model Based On: ";
428ostream << s << endl;
456ostream <<
text<< endl;
460ostream <<
"Total Range: ";
477ostream <<
"Total Length: " 481ostream <<
"Processed Length: " 491ostream <<
"Product Length: " 512 for(; feat_it ; ++feat_it) {
518string::size_type pos = s.find_first_not_of(
" \n\r\t");
519 if( pos != string::npos ){
523string::size_type lpos = string::npos;
526lpos = s.find_first_of(
"\n\r", pos );
528 if( lpos == string::npos ){
529 text= s.substr( pos );
531 text= s.substr( pos, lpos - pos );
533ostream <<
text<< endl;
535}
while( lpos != string::npos );
553 boolfilter =
false;
558 else if(subtypeAnyFlag)
562 stringdesc =
m_Types[pair<int,int>(
type,subtype)];
570 stringdesc =
m_Types[pair<int,int>(
type,subtype)];
585 stringpattern =
m_TextCtrl->GetLineText(0).ToStdString();
586 bool match(
false);
597 stringpattern =
m_TextCtrl_id->GetLineText(0).ToStdString();
604 for(CBioseq_Handle::TId::const_iterator idh = bsh.
GetId().begin(); idh != bsh.
GetId().end(); ++idh)
663set_of_proteins.
insert(
id);
713set_of_proteins.
insert(
id);
718 return static_cast<int>(set_of_proteins.
size());
729 if( fi->IsSetProduct())
734proteins.
insert(prot_bsh);
739 for( ; b_iter ; ++b_iter )
742 if(proteins.
find(bsh) == proteins.
end())
753remove_proteins =
false;
754remove_orphans =
false;
755 if(num_proteins + num_orphans == 0)
758 if(num_orphans == 0)
760remove_proteins =
true;
763 if(num_proteins == 0)
765remove_orphans =
true;
768remove_proteins =
true;
769remove_orphans =
true;
777 boolremove_proteins =
true;
778 boolremove_orphans =
true;
784 cmd->AddCommand(*cmd_remove_orphans);
789wxMessageBox(
_(
"No features found!"),
wxT(
"Error"),
790wxOK | wxICON_ERROR,
NULL);
800 boolremove_proteins =
true;
807wxMessageBox(
_(
"No features found!"),
wxT(
"Error"),
808wxOK | wxICON_ERROR,
NULL);
814 boolremove_proteins =
true;
815 boolremove_orphans =
true;
820 boolmodified =
false;
822 for(
CFeat_CIfeat1(tse); feat1; ++feat1)
824 for(
CFeat_CIfeat2(tse.
GetScope(),feat1->GetLocation()); feat2; ++feat2)
826 if(feat1->GetSeq_feat_Handle() < feat2->GetSeq_feat_Handle() &&
827deleted_feats.
find(feat1->GetSeq_feat_Handle()) == deleted_feats.
end() &&
828deleted_feats.
find(feat2->GetSeq_feat_Handle()) == deleted_feats.
end()) {
832deleted_feats.
insert(feat2->GetSeq_feat_Handle());
841 cmd->AddCommand(*cmd_remove_orphans);
859 if(fi->IsSetProduct()) {
861 if(prot_bsh && prot_bsh.
IsProtein()) {
862proteins.
insert(prot_bsh);
868 for( ; b_iter ; ++b_iter ) {
870 if(proteins.
find(bsh) == proteins.
end()) {
909 Create(parent,
id, caption, pos,
size, style);
920SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
921wxDialog::Create( parent,
id, caption, pos,
size, style );
926GetSizer()->SetSizeHints(
this);
969wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
970itemDialog1->SetSizer(itemBoxSizer2);
972 m_Proteins=
newwxCheckBox( itemDialog1,
ID_RMVPROTEINS_CHECKBOX,
_(
"Remove proteins orphaned due to deleted features? "), wxDefaultPosition, wxDefaultSize, 0 );
974itemBoxSizer2->Add(
m_Proteins, 0, wxALIGN_LEFT|wxALL, 5);
978itemBoxSizer2->Add(
m_Orphans, 0, wxALIGN_LEFT|wxALL, 5);
980wxBoxSizer* itemBoxSizer5 =
newwxBoxSizer(wxHORIZONTAL);
981itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
983wxButton* itemButton6 =
newwxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
984itemBoxSizer5->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
986wxButton* itemButton7 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
987itemBoxSizer5->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1011 returnwxNullBitmap;
~CAskToRemoveOrphansAndProteins()
Destructor.
CAskToRemoveOrphansAndProteins()
Constructors.
void Init()
Initialises member variables.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Warning"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
objects::CSeq_entry_Handle m_TopSeqEntry
bool Create(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
bool GetTopLevelSeqEntryAndProcessor()
void AddCommand(IEditCommand &command)
CFeatListItem - basic configuration data for one "feature" type.
string GetDescription() const
CFlatFileConfig & SetNeverTranslateCDS(bool val=true)
static string GetSeqFeatText(const CMappedFeat &feat, CScope &scope, const CFlatFileConfig &cfg, CRef< feature::CFeatTree > ftree=null)
static void RemoveDuplicateFeatures(objects::CSeq_entry_Handle tse, ICommandProccessor *processor)
static int CountProteinsBeforeRemoval(objects::CSeq_entry_Handle seh)
static void RemoveAllFeatures(CSeq_entry_Handle seh, ICommandProccessor *processor)
virtual CRef< CCmdComposite > GetCommand()
map< pair< int, int >, string > m_Types
static void RemoveAllFeatures_Ex(CSeq_entry_Handle seh, ICommandProccessor *processor)
wxTextCtrl * m_TextCtrl_id
CRemoveFeaturesDlg()
Constructors.
bool m_CollectInfoAboutProteins
static bool ShowToolTips()
Should we show tooltips?
vector< bool > m_SubtypeAnyFlag
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
static CSeq_id_Handle GetProductId(objects::CSeq_feat_Handle fh)
wxRadioButton * m_RadioButton_id
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxCheckBox * m_CheckBox_id
static CRef< CCmdComposite > RemoveOrphansRenormalizeNucProtSets(objects::CSeq_entry_Handle seh)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=11000, const wxString &caption=_("Remove Features"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void ApplyToCSeq_entry(objects::CSeq_entry_Handle tse, CCmdComposite *composite, string name, bool subtypeAnyFlag, bool &modified, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
wxRadioButton * m_RadioButton
wxChoice * m_ChoiceStrand
~CRemoveFeaturesDlg()
Destructor.
static int CountOrphanedProteins(objects::CSeq_entry_Handle seh)
vector< string > m_Descriptions
static void AskUser(int num_proteins, int num_orphans, bool &remove_proteins, bool &remove_orphans)
ESubtype GetSubtype(void) const
namespace ncbi::objects::
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
IWorkbench is the central interface in the application framework.
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
static const char * str(char *buf, int n)
static const struct type types[]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static objects::SAnnotSelector GetAnnotSelector(TAnnotFlags flags=0)
request an annotation selector for a given type
vector< const objects::CFeatListItem * > GetSortedFeatList(objects::CSeq_entry_Handle seh, size_t max=numeric_limits< size_t >::max())
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
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...
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
CConstRef< CSeq_id > GetSeqId(void) const
EAccessionInfo
For IdentifyAccession (below)
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
ENa_strand GetStrand(void) const
Get the location's strand.
TRange GetTotalRange(void) const
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
virtual CSeq_id_Handle GetLocationId(void) const
TSeqPos GetBioseqLength(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
virtual const CSeq_loc & GetProduct(void) const
bool IsSetProduct(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
bool IsProtein(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
const TId & GetId(void) const
virtual CSeq_id_Handle GetProductId(void) const
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
const CSeq_loc & GetLocation(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
CConstRef< CSeq_feat > GetSeq_feat(void) const
Get current seq-feat.
position_type GetLength(void) const
#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 string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
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 void Wrap(const string &str, SIZE_TYPE width, IWrapDest &dest, TWrapFlags flags, const string *prefix, const string *prefix1)
@ fWithCommas
Use commas as thousands separator.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TStr & GetStr(void) const
Get the variant data.
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.
vector< CRef< CUser_field > > TFields
const TStr & GetStr(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TObject & GetObject(void) const
Get the variant data.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
vector< CStringUTF8 > TStrs
vector< CRef< CUser_field > > TData
E_Choice Which(void) const
Which variant is currently selected.
const TExts & GetExts(void) const
Get the Exts member data.
bool IsSetExt(void) const
user defined structure extension Check if a value has been assigned to Ext data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
bool CanGetData(void) const
Check if it is safe to call GetData method.
const TProduct & GetProduct(void) const
Get the Product member data.
bool IsSetExts(void) const
set of extensions; will replace 'ext' field Check if a value has been assigned to Exts data member.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
@ e_Other
for historical reasons, 'other' = 'refseq'
@ eMol_na
just a nucleic acid
static void text(MDB_val *v)
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
static void s_Render_SeqFeat(stringstream &ostream, const CSeq_feat &feat, CScope &scope)
static void s_RenderAccList(stringstream &ostream, const CUser_field::TData::TStrs &item_data, const string &title)
static void s_Render_Feat_Evidence(stringstream &ostream, const CSeq_feat &feat, CScope &)
#define ID_RMVPROTEINS_CHECKBOX
#define ID_REMOVE_FEATURES_RADIOBUTTON
#define ID_REMOVE_FEATURES_CHECKBOX1
#define ID_REMOVE_FEATURES_CHECKBOX
#define ID_REMOVE_FEATURES_TEXTCTRL1
#define ID_REMOVE_FEATURES_RADIOBUTTON2
#define ID_REMOVE_FEATURES_OKCANCEL
#define ID_REMOVE_FEATURES_RADIOBUTTON1
#define ID_REMOVE_FEATURES_CHOICE2
#define ID_REMOVE_FEATURES_CHOICE1
#define ID_REMOVE_FEATURES_TEXTCTRL
#define ID_REMOVE_FEATURES_RADIOBUTTON3
#define ID_RMVPROTEINS_CHECKBOX1
void GetProductToCDSMap(objects::CScope &scope, map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > &product_to_cds)
CRef< CCmdComposite > GetDeleteAllFeaturesCommand(objects::CSeq_entry_Handle seh, size_t &count, bool remove_proteins=true)
CRef< CCmdComposite > GetDeleteAllFeaturesCommand_Ex(objects::CSeq_entry_Handle seh, size_t &count, bool remove_proteins=true)
CRef< CCmdComposite > GetDeleteFeatureCommand(const objects::CSeq_feat_Handle &fh, bool remove_proteins=true)
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