57 #include <wx/button.h>
58 #include <wx/statbox.h>
59 #include <wx/msgdlg.h>
82 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
92 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
98 GetSizer()->SetSizeHints(
this);
102 SetSize(wxSize(280, 750));
124 ITERATE(vector<const CFeatListItem *>, ft_it, feat_list) {
127 int feat_type = item.
GetType();
129 m_Types[pair<int,int>(feat_type,feat_subtype)] = desc;
130 if (existing.
find(desc) == existing.
end())
153 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
154 itemDialog1->SetSizer(itemBoxSizer2);
156 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
157 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
160 itemBoxSizer3->Add(
m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
162 m_ListCtrl->InsertColumn(0,
" Feature",wxLIST_FORMAT_LEFT,237);
167 wxBoxSizer* itemBoxSizer5 =
new wxBoxSizer(wxHORIZONTAL);
168 itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
170 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer(wxVERTICAL);
171 itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
173 wxStaticBox* itemStaticBoxSizer7Static =
new wxStaticBox(itemDialog1,
wxID_ANY,
_(
"Optional String Constraint"));
174 wxStaticBoxSizer* itemStaticBoxSizer7 =
new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
175 itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);
179 itemStaticBoxSizer7->Add(
m_RadioButton, 0, wxALIGN_LEFT|wxALL, 5);
182 itemRadioButton9->SetValue(
false);
183 itemStaticBoxSizer7->Add(itemRadioButton9, 0, wxALIGN_LEFT|wxALL, 5);
186 itemStaticBoxSizer7->Add(
m_TextCtrl, 0, wxALIGN_LEFT|wxALL, 5);
190 itemStaticBoxSizer7->Add(
m_CheckBox, 0, wxALIGN_LEFT|wxALL, 5);
192 wxStaticBox* itemStaticBoxSizer15Static =
new wxStaticBox(itemDialog1,
wxID_ANY,
_(
"Optional Seq-id Constraint"));
193 wxStaticBoxSizer* itemStaticBoxSizer15 =
new wxStaticBoxSizer(itemStaticBoxSizer15Static, wxVERTICAL);
194 itemBoxSizer6->Add(itemStaticBoxSizer15, 0, wxALIGN_LEFT|wxALL, 5);
201 itemRadioButton16->SetValue(
false);
202 itemStaticBoxSizer15->Add(itemRadioButton16, 0, wxALIGN_LEFT|wxALL, 5);
205 itemStaticBoxSizer15->Add(
m_TextCtrl_id, 0, wxALIGN_LEFT|wxALL, 5);
209 itemStaticBoxSizer15->Add(
m_CheckBox_id, 0, wxALIGN_LEFT|wxALL, 5);
211 wxStaticBox* itemStaticBoxSizer17Static =
new wxStaticBox(itemDialog1,
wxID_ANY,
_(
"Optional Location Constraint"));
212 wxStaticBoxSizer* itemStaticBoxSizer17 =
new wxStaticBoxSizer(itemStaticBoxSizer17Static, wxVERTICAL);
213 itemBoxSizer6->Add(itemStaticBoxSizer17, 0, wxALIGN_LEFT|wxALL, 5);
215 wxArrayString strands,
types;
216 strands.Add(
wxT(
"Any Strand"));
217 strands.Add(
wxT(
"Plus Strand"));
218 strands.Add(
wxT(
"Minus Strand"));
219 types.Add(
wxT(
"Nucleotide and protein sequences"));
220 types.Add(
wxT(
"Nucleotide sequences only"));
221 types.Add(
wxT(
"Protein sequences only"));
225 itemStaticBoxSizer17->Add(
m_ChoiceStrand, 0, wxALIGN_LEFT|wxALL, 5);
228 itemStaticBoxSizer17->Add(
m_ChoiceType, 0, wxALIGN_LEFT|wxALL, 5);
231 itemBoxSizer2->Add(OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
270 bool modified =
false;
275 item =
m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
276 if ( item == -1 )
break;
297 list<string> non_refseq;
301 refseq.push_back(*it);
303 non_refseq.push_back(*it);
312 if (non_refseq.size()) {
313 if ( !accs.empty() ) {
319 if ( !accs.empty() ) {
327 if ( !lines.empty() ) {
328 ITERATE (list<string>, iter, lines) {
329 if (iter != lines.begin()) {
330 ostream <<
" " << *iter << endl;
332 ostream << *iter << endl;
345 list< CConstRef<CUser_object> > objs;
352 objs.push_back(sub_o);
378 ostream <<
"Model Generation Method: ";
381 method =
f->GetData().GetStr();
384 ostream <<
"<unknown>";
391 if (method ==
"Chainer" || method ==
"Gnomon") {
401 if ( !core.empty() ) {
407 if ( !core.empty() ) {
408 s =
"Model Based On: ";
410 ostream << s << endl;
432 stringstream& ostream,
const objects::CSeq_feat& feat, objects::CScope& scope)
438 ostream <<
text << endl;
442 ostream <<
"Total Range: ";
459 ostream <<
"Total Length: "
463 ostream <<
"Processed Length: "
468 if (feat.IsSetProduct()) {
473 ostream <<
"Product Length: "
493 CFeat_CI feat_it(scope, feat.GetLocation(), sel);
494 for (; feat_it ; ++feat_it) {
500 string::size_type pos = s.find_first_not_of(
" \n\r\t");
501 if( pos != string::npos ){
505 string::size_type lpos = string::npos;
508 lpos = s.find_first_of(
"\n\r", pos );
510 if( lpos == string::npos ){
511 text = s.substr( pos );
513 text = s.substr( pos, lpos - pos );
515 ostream <<
text << endl;
517 }
while( lpos != string::npos );
529 for (
CFeat_CI feat (tse); feat; ++feat)
536 else if (subtypeAnyFlag)
538 int type = feat->GetOriginalFeature().GetData().Which();
540 string desc =
m_Types[pair<int,int>(
type,subtype)];
544 else if (feat->GetOriginalFeature().CanGetData())
546 int type = feat->GetOriginalFeature().GetData().Which();
547 int subtype = feat->GetOriginalFeature().GetData().GetSubtype();
548 string desc =
m_Types[pair<int,int>(
type,subtype)];
560 CScope &scope = tse.GetScope();
562 string pattern =
m_TextCtrl->GetLineText(0).ToStdString();
574 string pattern =
m_TextCtrl_id->GetLineText(0).ToStdString();
581 for (CBioseq_Handle::TId::const_iterator idh = bsh.
GetId().begin(); idh != bsh.
GetId().end(); ++idh)
588 }
catch(
const CException&) {}
catch (
const exception&) {}
609 if (strand ==
wxT(
"Plus Strand") && feat->GetOriginalFeature().IsSetLocation() && feat->GetOriginalFeature().GetLocation().GetStrand() ==
eNa_strand_plus) go =
true;
610 if (strand ==
wxT(
"Minus Strand") && feat->GetOriginalFeature().IsSetLocation() && feat->GetOriginalFeature().GetLocation().GetStrand() ==
eNa_strand_minus) go =
true;
618 if (
type ==
wxT(
"Nucleotide sequences only") && feat->GetOriginalFeature().IsSetLocation())
624 if (
type ==
wxT(
"Protein sequences only") && feat->GetOriginalFeature().IsSetLocation())
637 new_feat->
Assign(feat->GetOriginalFeature());
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)
~CCorrectIntervalOrder()
Destructor.
wxCheckBox * m_CheckBox_id
vector< string > m_Descriptions
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
vector< bool > m_SubtypeAnyFlag
void ApplyToCSeq_entry(objects::CSeq_entry_Handle tse, CRef< CCmdComposite > composite, const string &name, bool subtypeAnyFlag, bool &modified)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static bool ShowToolTips()
Should we show tooltips?
wxChoice * m_ChoiceStrand
void CreateControls()
Creates the controls and sizers.
map< pair< int, int >, string > m_Types
virtual CRef< CCmdComposite > GetCommand()
wxTextCtrl * m_TextCtrl_id
bool Create(wxWindow *parent, wxWindowID id=11000, const wxString &caption=_("Correct Interval Order"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxRadioButton * m_RadioButton
void Init()
Initialises member variables.
wxRadioButton * m_RadioButton_id
CCorrectIntervalOrder()
Constructors.
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)
namespace ncbi::objects::
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
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 void s_Render_SeqFeat(stringstream &ostream, const objects::CSeq_feat &feat, objects::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_CORRECT_INTERVAL_ORDER_TEXTCTRL
#define ID_CORRECT_INTERVAL_ORDER_CHECKBOX1
#define ID_CORRECT_INTERVAL_ORDER_CHECKBOX
#define ID_CORRECT_INTERVAL_ORDER_RADIOBUTTON3
#define ID_LISTCTRL_CORRECT_INTERVAL_ORDER
#define ID_CORRECT_INTERVAL_ORDER_RADIOBUTTON1
#define ID_CORRECT_INTERVAL_ORDER_TEXTCTRL1
#define ID_CORRECT_INTERVAL_ORDER_CHOICE2
#define ID_CORRECT_INTERVAL_ORDER_RADIOBUTTON2
#define ID_CORRECT_INTERVAL_ORDER_RADIOBUTTON
#define ID_CORRECT_INTERVAL_ORDER_CHOICE1
#define ID_CORRECT_INTERVAL_ORDER_OKCANCEL
#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)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
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.
EAccessionInfo
For IdentifyAccession (below)
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.
TSeqPos GetBioseqLength(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
const TId & GetId(void) const
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
#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.
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
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.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsSetExts(void) const
set of extensions; will replace 'ext' field Check if a value has been assigned to Exts data member.
const TExt & GetExt(void) const
Get the Ext member data.
@ e_Other
for historical reasons, 'other' = 'refseq'
bool CorrectIntervalOrder(CSeq_loc &loc)
Correct the order of consecutive intervals with the same Seq-id on the same strand.
static void text(MDB_val *v)
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
double f(double x_, const double &y_)
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
static const char * str(char *buf, int n)
static const struct type types[]
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)