68 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
78 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
84 GetSizer()->SetSizeHints(
this);
109 ITERATE(vector<const CFeatListItem *>, ft_it, feat_list) {
112 int feat_type = item.
GetType();
114 m_Types[pair<int,int>(feat_type,feat_subtype)] = desc;
115 if (existing.
find(desc) == existing.
end())
137 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
138 itemDialog1->SetSizer(itemBoxSizer2);
140 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
141 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
144 itemBoxSizer3->Add(
m_ListCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
146 m_ListCtrl->InsertColumn(0,
" Feature",wxLIST_FORMAT_LEFT,237);
151 wxBoxSizer* itemBoxSizer5 =
new wxBoxSizer(wxHORIZONTAL);
152 itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
154 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer(wxVERTICAL);
155 itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
157 wxStaticBox* itemStaticBoxSizer7Static =
new wxStaticBox(itemDialog1,
wxID_ANY,
_(
"Remove Gene Xrefs that are"));
158 wxStaticBoxSizer* itemStaticBoxSizer7 =
new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
159 itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);
163 itemStaticBoxSizer7->Add(
m_Suppressing, 0, wxALIGN_LEFT|wxALL, 5);
171 itemStaticBoxSizer7->Add(
m_Unnecessary, 0, wxALIGN_LEFT|wxALL, 5);
173 wxStaticBox* itemStaticBoxSizer17Static =
new wxStaticBox(itemDialog1,
wxID_ANY, wxEmptyString);
174 wxStaticBoxSizer* itemStaticBoxSizer17 =
new wxStaticBoxSizer(itemStaticBoxSizer17Static, wxHORIZONTAL);
175 itemBoxSizer2->Add(itemStaticBoxSizer17, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
177 wxStaticText* itemStaticText4 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Where feature text"), wxDefaultPosition, wxDefaultSize, 0 );
178 itemStaticBoxSizer17->Add(itemStaticText4, 0, wxALIGN_TOP|wxALL, 5);
186 itemBoxSizer2->Add(OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
223 if (!
f.IsSetXref()) {
226 bool any_removed =
false;
227 CSeq_feat::TXref::iterator xit =
f.SetXref().begin();
228 while (xit !=
f.SetXref().end()) {
229 if ((*xit)->IsSetData() && (*xit)->GetData().IsGene() &&
230 (*xit)->GetData().GetGene().IsSuppressed()) {
231 xit =
f.SetXref().erase(xit);
238 if (
f.IsSetXref() &&
f.GetXref().empty()) {
255 list<string> non_refseq;
259 refseq.push_back(*it);
261 non_refseq.push_back(*it);
270 if (non_refseq.size()) {
271 if ( !accs.empty() ) {
277 if ( !accs.empty() ) {
285 if ( !lines.empty() ) {
286 ITERATE (list<string>, iter, lines) {
287 if (iter != lines.begin()) {
288 ostream <<
" " << *iter << endl;
290 ostream << *iter << endl;
303 list< CConstRef<CUser_object> > objs;
310 objs.push_back(sub_o);
336 ostream <<
"Model Generation Method: ";
339 method =
f->GetData().GetStr();
342 ostream <<
"<unknown>";
349 if (method ==
"Chainer" || method ==
"Gnomon") {
359 if ( !core.empty() ) {
365 if ( !core.empty() ) {
366 s =
"Model Based On: ";
368 ostream << s << endl;
390 stringstream& ostream,
const objects::CSeq_feat& feat, objects::CScope& scope)
396 ostream <<
text << endl;
400 ostream <<
"Total Range: ";
417 ostream <<
"Total Length: "
421 ostream <<
"Processed Length: "
426 if (feat.IsSetProduct()) {
431 ostream <<
"Product Length: "
451 CFeat_CI feat_it(scope, feat.GetLocation(), sel);
452 for (; feat_it ; ++feat_it) {
458 string::size_type pos = s.find_first_not_of(
" \n\r\t");
459 if( pos != string::npos ){
463 string::size_type lpos = string::npos;
466 lpos = s.find_first_of(
"\n\r", pos );
468 if( lpos == string::npos ){
469 text = s.substr( pos );
471 text = s.substr( pos, lpos - pos );
473 ostream <<
text << endl;
475 }
while( lpos != string::npos );
495 item =
m_ListCtrl->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
496 if ( item == -1 )
break;
506 else if (subtypeAnyFlag)
508 int type = feat->GetOriginalFeature().GetData().Which();
510 string desc =
m_Types[pair<int,int>(
type,subtype)];
514 else if (feat->GetOriginalFeature().CanGetData())
516 int type = feat->GetOriginalFeature().GetData().Which();
517 int subtype = feat->GetOriginalFeature().GetData().GetSubtype();
518 string desc =
m_Types[pair<int,int>(
type,subtype)];
531 go = constraint->DoesTextMatch(
str.str());
539 bool modified =
false;
567 for (
CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
572 bool modified =
false;
575 if ((*xref)->IsSetData() && (*xref)->GetData().IsGene())
595 for (
CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
612 for (
CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
629 for (
CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
654 for (
CFeat_CI feat_ci(seh); feat_ci; ++feat_ci)
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()
static bool RemoveOrphanLocus_tagGeneXrefs(CSeq_feat &f, CBioseq_Handle bsh)
Removes orphaned locus_tag Gene-xrefs.
static bool RemoveOrphanLocusGeneXrefs(CSeq_feat &f, CBioseq_Handle bsh)
Removes orphaned locus Gene-xrefs.
static bool RemoveUnnecessaryGeneXrefs(CSeq_feat &f, CScope &scope)
Removes unnecessary Gene-xrefs.
static bool RemoveNonsuppressingGeneXrefs(CSeq_feat &f)
Removes non-suppressing Gene-xrefs.
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)
wxCheckBox * m_Suppressing
CRemoveGeneXrefs()
Constructors.
static CRef< CCmdComposite > RemoveNonsuppressing(CSeq_entry_Handle seh)
wxCheckBox * m_Nonsuppressing
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CRemoveGeneXrefs()
Destructor.
map< pair< int, int >, string > m_Types
static bool ShowToolTips()
Should we show tooltips?
vector< bool > m_SubtypeAnyFlag
CStringConstraintPanel * m_StringConstraintPanel
static CRef< CCmdComposite > RemoveOrphanLocus_tag(CSeq_entry_Handle seh)
static CRef< CCmdComposite > RemoveAll(CSeq_entry_Handle seh)
void Init()
Initialises member variables.
static CRef< CCmdComposite > RemoveUnnecessary(CSeq_entry_Handle seh)
virtual CRef< CCmdComposite > GetCommand()
bool Create(wxWindow *parent, wxWindowID id=14000, const wxString &caption=_("Remove Gene Xrefs"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
static CRef< CCmdComposite > RemoveOrphanLocus(CSeq_entry_Handle seh)
wxCheckBox * m_Unnecessary
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
bool RemoveSuppressingGeneXrefs(CSeq_feat &f)
vector< string > m_Descriptions
namespace ncbi::objects::
void SetStringSelection(const wxString &str)
CRef< edit::CStringConstraint > GetStringConstraint()
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
#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...
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...
TSeqPos GetBioseqLength(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
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 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 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.
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref 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 TXref & GetXref(void) const
Get the Xref member data.
void ResetXref(void)
Reset Xref data member.
const TExt & GetExt(void) const
Get the Ext member data.
@ e_Other
for historical reasons, 'other' = 'refseq'
@ eMol_na
just a nucleic acid
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
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 void s_Render_SeqFeat(stringstream &ostream, const objects::CSeq_feat &feat, objects::CScope &scope)
USING_SCOPE(ncbi::objects)
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_SUPPRESSING_CHECKBOX
#define ID_UNNECESSARY_CHECKBOX
#define ID_REMOVE_GENE_XREFS_LISTCTRL
#define ID_REMOVE_GENE_XREFS_OKCANCEL
#define ID_NONSUPPRESSING_CHECKBOX
Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.
#define ERASE_SEQFEATXREF_ON_SEQFEAT(Itr, Var)
ERASE_SEQFEATXREF_ON_SEQFEAT.
#define EDIT_EACH_SEQFEATXREF_ON_SEQFEAT(Itr, Var)
static const char * str(char *buf, int n)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)