A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/remove__features__dlg_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/packages/pkg_sequence_edit/remove_features_dlg.cpp Source File

57 #include <wx/button.h> 58 #include <wx/statbox.h> 59 #include <wx/msgdlg.h> 80

wxWindowID

id

,

const

wxString& caption,

const

wxPoint& pos,

const

wxSize&

size

,

long

style )

84  Create

(parent,

id

, caption, pos,

size

, style);

90

SetExtraStyle(wxWS_EX_BLOCK_EVENTS);

96

GetSizer()->SetSizeHints(

this

);

100

SetSize(wxSize(280, 750));

122  ITERATE

(vector<const CFeatListItem *>, ft_it, feat_list) {

125  int

feat_type = item.

GetType

();

127  m_Types

[pair<int,int>(feat_type,feat_subtype)] = desc;

128  if

(existing.

find

(desc) == existing.

end

())

151

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxVERTICAL);

152

itemDialog1->SetSizer(itemBoxSizer2);

154

wxBoxSizer* itemBoxSizer3 =

new

wxBoxSizer(wxHORIZONTAL);

155

itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

158

itemBoxSizer3->Add(

m_ListCtrl

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

160  m_ListCtrl

->InsertColumn(0,

" Feature"

,wxLIST_FORMAT_LEFT,237);

165

wxBoxSizer* itemBoxSizer5 =

new

wxBoxSizer(wxHORIZONTAL);

166

itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

168

wxBoxSizer* itemBoxSizer6 =

new

wxBoxSizer(wxVERTICAL);

169

itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

171

wxStaticBox* itemStaticBoxSizer7Static =

new

wxStaticBox(itemDialog1,

wxID_ANY

,

_

(

"Optional String Constraint"

));

172

wxStaticBoxSizer* itemStaticBoxSizer7 =

new

wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);

173

itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxALIGN_LEFT|wxALL, 5);

177

itemStaticBoxSizer7->Add(

m_RadioButton

, 0, wxALIGN_LEFT|wxALL, 5);

180

itemRadioButton9->SetValue(

false

);

181

itemStaticBoxSizer7->Add(itemRadioButton9, 0, wxALIGN_LEFT|wxALL, 5);

184

itemStaticBoxSizer7->Add(

m_TextCtrl

, 0, wxALIGN_LEFT|wxALL, 5);

188

itemStaticBoxSizer7->Add(

m_CheckBox

, 0, wxALIGN_LEFT|wxALL, 5);

190

wxStaticBox* itemStaticBoxSizer15Static =

new

wxStaticBox(itemDialog1,

wxID_ANY

,

_

(

"Optional Seq-id Constraint"

));

191

wxStaticBoxSizer* itemStaticBoxSizer15 =

new

wxStaticBoxSizer(itemStaticBoxSizer15Static, wxVERTICAL);

192

itemBoxSizer6->Add(itemStaticBoxSizer15, 0, wxALIGN_LEFT|wxALL, 5);

199

itemRadioButton16->SetValue(

false

);

200

itemStaticBoxSizer15->Add(itemRadioButton16, 0, wxALIGN_LEFT|wxALL, 5);

203

itemStaticBoxSizer15->Add(

m_TextCtrl_id

, 0, wxALIGN_LEFT|wxALL, 5);

207

itemStaticBoxSizer15->Add(

m_CheckBox_id

, 0, wxALIGN_LEFT|wxALL, 5);

209

wxStaticBox* itemStaticBoxSizer17Static =

new

wxStaticBox(itemDialog1,

wxID_ANY

,

_

(

"Optional Location Constraint"

));

210

wxStaticBoxSizer* itemStaticBoxSizer17 =

new

wxStaticBoxSizer(itemStaticBoxSizer17Static, wxVERTICAL);

211

itemBoxSizer6->Add(itemStaticBoxSizer17, 0, wxALIGN_LEFT|wxALL, 5);

213

wxArrayString strands,

types

;

214

strands.Add(

wxT

(

"Any Strand"

));

215

strands.Add(

wxT

(

"Plus Strand"

));

216

strands.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"

));

223

itemStaticBoxSizer17->Add(

m_ChoiceStrand

, 0, wxALIGN_LEFT|wxALL, 5);

226

itemStaticBoxSizer17->Add(

m_ChoiceType

, 0, wxALIGN_LEFT|wxALL, 5);

229

itemBoxSizer2->Add(OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

268  bool

modified =

false

;

277  bool

remove_orphans =

true

;

282

item =

m_ListCtrl

->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);

283  if

( item == -1 )

break

;

292  cmd

->AddCommand(*cmd_remove_orphans);

315

list<string> non_refseq;

319

refseq.push_back(*it);

321

non_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()) {

348

ostream <<

" "

<< *iter << endl;

350

ostream << *iter << endl;

363

list< CConstRef<CUser_object> > objs;

370

objs.push_back(sub_o);

396

ostream <<

"Model Generation Method: "

;

399

method =

f

->GetData().GetStr();

402

ostream <<

"<unknown>"

;

409  if

(method ==

"Chainer"

|| method ==

"Gnomon"

) {

419  if

( !core.empty() ) {

425  if

( !core.empty() ) {

426

s =

"Model Based On: "

;

428

ostream << s << endl;

456

ostream <<

text

<< endl;

460

ostream <<

"Total Range: "

;

477

ostream <<

"Total Length: " 481

ostream <<

"Processed Length: " 491

ostream <<

"Product Length: " 512  for

(; feat_it ; ++feat_it) {

518

string::size_type pos = s.find_first_not_of(

" \n\r\t"

);

519  if

( pos != string::npos ){

523

string::size_type lpos = string::npos;

526

lpos = s.find_first_of(

"\n\r"

, pos );

528  if

( lpos == string::npos ){

529  text

= s.substr( pos );

531  text

= s.substr( pos, lpos - pos );

533

ostream <<

text

<< endl;

535

}

while

( lpos != string::npos );

553  bool

filter =

false

;

558  else if

(subtypeAnyFlag)

562  string

desc =

m_Types

[pair<int,int>(

type

,subtype)];

570  string

desc =

m_Types

[pair<int,int>(

type

,subtype)];

585  string

pattern =

m_TextCtrl

->GetLineText(0).ToStdString();

586  bool match

(

false

);

597  string

pattern =

m_TextCtrl_id

->GetLineText(0).ToStdString();

604  for

(CBioseq_Handle::TId::const_iterator idh = bsh.

GetId

().begin(); idh != bsh.

GetId

().end(); ++idh)

663

set_of_proteins.

insert

(

id

);

713

set_of_proteins.

insert

(

id

);

718  return static_cast<int>

(set_of_proteins.

size

());

729  if

( fi->IsSetProduct())

734

proteins.

insert

(prot_bsh);

739  for

( ; b_iter ; ++b_iter )

742  if

(proteins.

find

(bsh) == proteins.

end

())

753

remove_proteins =

false

;

754

remove_orphans =

false

;

755  if

(num_proteins + num_orphans == 0)

758  if

(num_orphans == 0)

760

remove_proteins =

true

;

763  if

(num_proteins == 0)

765

remove_orphans =

true

;

768

remove_proteins =

true

;

769

remove_orphans =

true

;

777  bool

remove_proteins =

true

;

778  bool

remove_orphans =

true

;

784  cmd

->AddCommand(*cmd_remove_orphans);

789

wxMessageBox(

_

(

"No features found!"

),

wxT

(

"Error"

),

790

wxOK | wxICON_ERROR,

NULL

);

800  bool

remove_proteins =

true

;

807

wxMessageBox(

_

(

"No features found!"

),

wxT

(

"Error"

),

808

wxOK | wxICON_ERROR,

NULL

);

814  bool

remove_proteins =

true

;

815  bool

remove_orphans =

true

;

820  bool

modified =

false

;

822  for

(

CFeat_CI

feat1(tse); feat1; ++feat1)

824  for

(

CFeat_CI

feat2(tse.

GetScope

(),feat1->GetLocation()); feat2; ++feat2)

826  if

(feat1->GetSeq_feat_Handle() < feat2->GetSeq_feat_Handle() &&

827

deleted_feats.

find

(feat1->GetSeq_feat_Handle()) == deleted_feats.

end

() &&

828

deleted_feats.

find

(feat2->GetSeq_feat_Handle()) == deleted_feats.

end

()) {

832

deleted_feats.

insert

(feat2->GetSeq_feat_Handle());

841  cmd

->AddCommand(*cmd_remove_orphans);

859  if

(fi->IsSetProduct()) {

861  if

(prot_bsh && prot_bsh.

IsProtein

()) {

862

proteins.

insert

(prot_bsh);

868  for

( ; b_iter ; ++b_iter ) {

870  if

(proteins.

find

(bsh) == proteins.

end

()) {

909  Create

(parent,

id

, caption, pos,

size

, style);

920 

SetExtraStyle(wxWS_EX_BLOCK_EVENTS);

921

wxDialog::Create( parent,

id

, caption, pos,

size

, style );

926

GetSizer()->SetSizeHints(

this

);

969

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxVERTICAL);

970

itemDialog1->SetSizer(itemBoxSizer2);

972  m_Proteins

=

new

wxCheckBox( itemDialog1,

ID_RMVPROTEINS_CHECKBOX

,

_

(

"Remove proteins orphaned due to deleted features? "

), wxDefaultPosition, wxDefaultSize, 0 );

974

itemBoxSizer2->Add(

m_Proteins

, 0, wxALIGN_LEFT|wxALL, 5);

978

itemBoxSizer2->Add(

m_Orphans

, 0, wxALIGN_LEFT|wxALL, 5);

980

wxBoxSizer* itemBoxSizer5 =

new

wxBoxSizer(wxHORIZONTAL);

981

itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);

983

wxButton* itemButton6 =

new

wxButton( itemDialog1, wxID_OK,

_

(

"Accept"

), wxDefaultPosition, wxDefaultSize, 0 );

984

itemBoxSizer5->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

986

wxButton* itemButton7 =

new

wxButton( itemDialog1, wxID_CANCEL,

_

(

"Cancel"

), wxDefaultPosition, wxDefaultSize, 0 );

987

itemBoxSizer5->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

1011  return

wxNullBitmap;

~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