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/barcode__tool_8cpp_source.html below:

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

33 #include "wx/wxprec.h" 43 #include <wx/filename.h> 44 #include <wx/hyperlink.h> 45 #include <wx/graphics.h> 46 #include <wx/renderer.h> 90

: m_CmdProcessor(cmdProcessor), m_TopSeqEntry(seh), m_Workbench(wb)

94

Create(parent,

id

, caption, pos,

size

, style);

105

objects::CBioseq_CI b_iter(

m_TopSeqEntry

, objects::CSeq_inst::eMol_na);

106  for

( ; b_iter ; ++b_iter )

115

wxPanel* itemPanel1 =

new

wxPanel(

this

,

wxID_ANY

);

117

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxVERTICAL);

118

itemPanel1->SetSizer(itemBoxSizer2);

120

wxGridSizer *header =

new

wxFlexGridSizer(0, 14, 0, 0);

121

itemBoxSizer2->Add(header, 0, wxGROW|wxALL, 5);

123

wxStaticText* itemStaticHeader0 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

" "

), wxDefaultPosition, wxSize(30,-1), 0 );

124

header->Add(itemStaticHeader0, 0, wxALIGN_CENTER|wxALL, 5);

125

wxStaticText* itemStaticHeader1 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Barcode ID"

), wxDefaultPosition, wxSize(150,-1), 0 );

126

header->Add(itemStaticHeader1, 0, wxALIGN_CENTER|wxALL, 5);

127

wxStaticText* itemStaticHeader2 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Genbank Accession"

), wxDefaultPosition, wxSize(100,-1), 0 );

128

itemStaticHeader2->Wrap(100);

129

header->Add(itemStaticHeader2, 0, wxALIGN_CENTER|wxALL, 5);

130

wxStaticText* itemStaticHeader3 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Length"

), wxDefaultPosition, wxSize(80,-1), 0 );

131

header->Add(itemStaticHeader3, 0, wxALIGN_CENTER|wxALL, 5);

132

wxStaticText* itemStaticHeader4 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Primers"

), wxDefaultPosition, wxSize(80,-1), 0 );

133

header->Add(itemStaticHeader4, 0, wxALIGN_CENTER|wxALL, 5);

134

wxStaticText* itemStaticHeader5 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Country"

), wxDefaultPosition, wxSize(80,-1), 0 );

135

header->Add(itemStaticHeader5, 0, wxALIGN_CENTER|wxALL, 5);

136

wxStaticText* itemStaticHeader6 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Voucher"

), wxDefaultPosition, wxSize(80,-1), 0 );

137

header->Add(itemStaticHeader6, 0, wxALIGN_CENTER|wxALL, 5);

138

wxStaticText* itemStaticHeader7 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Structured Voucher"

), wxDefaultPosition, wxSize(80,-1), 0 );

139

itemStaticHeader7->Wrap(80);

140

header->Add(itemStaticHeader7, 0, wxALIGN_CENTER|wxALL, 5);

141

wxStaticText* itemStaticHeader8 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Percent Ns"

), wxDefaultPosition, wxSize(80,-1), 0 );

142

itemStaticHeader8->Wrap(80);

143

header->Add(itemStaticHeader8, 0, wxALIGN_CENTER|wxALL, 5);

144

wxStaticText* itemStaticHeader9 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Collection Date"

), wxDefaultPosition, wxSize(80,-1), 0 );

145

itemStaticHeader9->Wrap(80);

146

header->Add(itemStaticHeader9, 0, wxALIGN_CENTER|wxALL, 5);

147

wxStaticText* itemStaticHeader10 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Order Assignment"

), wxDefaultPosition, wxSize(80,-1), 0 );

148

itemStaticHeader10->Wrap(80);

149

header->Add(itemStaticHeader10, 0, wxALIGN_CENTER|wxALL, 5);

150

wxStaticText* itemStaticHeader11 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Low Trace"

), wxDefaultPosition, wxSize(80,-1), 0 );

151

itemStaticHeader11->Wrap(80);

152

header->Add(itemStaticHeader11, 0, wxALIGN_CENTER|wxALL, 5);

153

wxStaticText* itemStaticHeader12 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Frame Shift"

), wxDefaultPosition, wxSize(80,-1), 0 );

154

itemStaticHeader12->Wrap(80);

155

header->Add(itemStaticHeader12, 0, wxALIGN_CENTER|wxALL, 5);

156

wxStaticText* itemStaticHeader13 =

new

wxStaticText( itemPanel1, wxID_STATIC,

_

(

"Has BARCODE Keyword"

), wxDefaultPosition, wxSize(80,-1), 0 );

157

itemStaticHeader13->Wrap(80);

158

header->Add(itemStaticHeader13, 0, wxALIGN_CENTER|wxALL, 5);

161

wxBoxSizer* itemBoxSizer3 =

new

wxBoxSizer(wxHORIZONTAL);

162

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

165

itemBoxSizer3->Add(

m_scrolled

, 1, wxGROW|wxALL, 0);

167

wxBoxSizer* itemBoxSizer17 =

new

wxBoxSizer(wxHORIZONTAL);

168

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

171

wxArrayString radioboxStrings;

172

radioboxStrings.Add(

_

(

"Check features where"

));

173

radioboxStrings.Add(

_

(

"Uncheck features where"

));

174  m_Radiobox

=

new

wxRadioBox( itemPanel1,

wxID_ANY

, wxEmptyString, wxDefaultPosition, wxDefaultSize, radioboxStrings, 0, wxRA_SPECIFY_ROWS );

176

itemBoxSizer17->Add(

m_Radiobox

, 0, wxALIGN_TOP|wxRIGHT|wxLEFT, 5);

178

wxArrayString choice_strings;

179

choice_strings.Add(

_

(

"Barcode ID"

));

180

choice_strings.Add(

_

(

"Genbank Accession"

));

181

choice_strings.Add(

_

(

"Percent Ns"

));

182  m_Choice

=

new

wxChoice( itemPanel1,

wxID_ANY

, wxDefaultPosition, wxDefaultSize, choice_strings, 0 );

184

itemBoxSizer17->Add(

m_Choice

, 0, wxALIGN_TOP|wxALL, 7);

191

wxBoxSizer* itemBoxSizer12 =

new

wxBoxSizer(wxHORIZONTAL);

192

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

194

wxButton* itemButton13 =

new

wxButton(itemPanel1,

ID_BARCODE_TOOL_SELECT

,

_

(

"Select"

), wxDefaultPosition, wxDefaultSize, 0);

195

itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

197

wxButton* itemButton14 =

new

wxButton(itemPanel1,

ID_BARCODE_TOOL_SELECT_ALL

,

_

(

"Select All"

), wxDefaultPosition, wxDefaultSize, 0);

198

itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

201

itemBoxSizer12->Add(itemButton15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

203

wxBoxSizer* itemBoxSizer16 =

new

wxBoxSizer(wxHORIZONTAL);

204

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

207

itemBoxSizer16->Add(itemButton16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

209

wxButton* itemButton17 =

new

wxButton( itemPanel1,

ID_BARCODE_TOOL_REMOVE_KEYWORD

,

_

(

"Remove BARCODE Keyword from Selected"

), wxDefaultPosition, wxDefaultSize, 0 );

210

itemBoxSizer16->Add(itemButton17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

212

wxButton* itemButton18 =

new

wxButton( itemPanel1,

ID_BARCODE_TOOL_ADD_KEYWORD

,

_

(

"Add BARCODE Keyword to BARCODE Tech"

), wxDefaultPosition, wxDefaultSize, 0 );

213

itemBoxSizer16->Add(itemButton18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

215

wxButton* itemButton19 =

new

wxButton( itemPanel1,

ID_BARCODE_TOOL_DISMISS

,

_

(

"Dismiss"

), wxDefaultPosition, wxDefaultSize, 0 );

216

itemBoxSizer16->Add(itemButton19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

225  bool

has_keyword(

false

);

230  const string

&keyword = *qual_it;

244

validator::SBarcode

b

;

272  bool

select =

m_Radiobox

->GetSelection() == 0;

273  string

choice =

m_Choice

->GetStringSelection().ToStdString();

280  if

(choice ==

"Barcode ID"

)

284  else if

(choice ==

"Genbank Accession"

)

288  else if

(choice ==

"Percent Ns"

)

294  if

(constraint->DoesTextMatch(

value

))

323 bool CBarcodeTool::Create

( wxWindow* parent, wxWindowID

id

,

const

wxString& caption,

const

wxPoint& pos,

const

wxSize&

size

,

long

style)

325

wxFrame::Create( parent,

id

, caption, pos,

size

, style );

329

GetSizer()->SetSizeHints(

this

);

343

objects::CBioseq_CI b_iter(

m_TopSeqEntry

, objects::CSeq_inst::eMol_na);

344  for

( ; b_iter ; ++b_iter )

357

new_desc->

Assign

(*desc_ci);

360  cmd

->AddCommand(*ecmd);

377  bool

selected_all(

false

);

380  int

answer = wxMessageBox(

_

(

"You have not selected any Bioseqs - remove BARCODE keyword from all?"

),

wxT

(

"Remove from all"

), wxYES_NO | wxICON_QUESTION,

this

);

387

selected_all =

true

;

406

new_desc->

Assign

(*desc_ci);

409  const string

&keyword = *qual_it;

414  cmd

->AddCommand (*ecmd);

440

vector<string> values;

442

values.push_back(

"Too Short"

);

444

values.push_back(

"Missing Primers"

);

446

values.push_back(

"Missing Country"

);

448

values.push_back(

"Missing Voucher"

);

449  if

(

b

.structured_voucher)

450

values.push_back(

"Structured Voucher"

);

451  if

(!

b

.percent_n.empty())

452

values.push_back(

"Too Many Ns:"

+

b

.percent_n+

"%"

);

453  if

(

b

.collection_date)

454

values.push_back(

"Bad Collection Date"

);

455  if

(

b

.order_assignment)

456

values.push_back(

"Missing Order Assignment"

);

458

values.push_back(

"Low Trace"

);

460

values.push_back(

"Frame Shift"

);

470

report->SetTitle(

wxT

(

"BARCODE Keywords Removed"

));

472

report->Show(

true

);

486  for

( objects::CBioseq_CI b_iter(seh, objects::CSeq_inst::eMol_na); b_iter ; ++b_iter )

491  for

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

GetId

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

GetId

().end(); ++it)

493  const CSeq_id

&

id

= *(it->GetSeqId());

494  if

(

id

.IsGeneral() &&

id

.GetGeneral().IsSetDb() &&

NStr::EqualNocase

(

id

.GetGeneral().GetDb(),

"uoguelph"

) &&

id

.GetGeneral().IsSetTag())

496  const CObject_id

&obj_id =

id

.GetGeneral().GetTag();

497  if

(obj_id.

IsStr

())

498

barcode = obj_id.

GetStr

();

510  if

(source_ci->GetSource().IsSetOrg())

514  if

((*dbxref)->IsSetDb() && (*dbxref)->GetDb() ==

"BOLD"

&& (*dbxref)->IsSetTag())

517  const CObject_id

&obj_id = (*dbxref)->GetTag();

518  if

(obj_id.

IsStr

())

530

new_desc->

Assign

(*source_ci);

532

dbtag->

SetDb

(

"BOLD"

);

533

dbtag->

SetTag

().SetStr(barcode);

536  cmd

->AddCommand (*ecmd);

577

: wxVScrolledWindow(parent,

id

, pos,

size

, wxFULL_REPAINT_ON_RESIZE), m_barcode(barcode), m_selected(selected)

579

SetBackgroundStyle(wxBG_STYLE_PAINT);

580

wxGraphicsContext *gc = wxGraphicsContext::Create();

581

gc->SetFont(GetFont(), *wxBLACK);

585

wxDouble externalLeading;

586

gc->GetTextExtent(

_

(

"A"

), &width, &height, &descent, &externalLeading);

587

m_RowHeight = ceil(height) + 3;

589

SetRowCount(m_barcode->size());

621

wxAutoBufferedPaintDC dc(

this

);

623

wxGraphicsContext *gc = wxGraphicsContext::Create( dc );

624

wxColour backgroundColour = GetBackgroundColour();

625  if

(!backgroundColour.Ok())

626

backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);

627

wxSize sz = GetClientSize();

628

wxRect windowRect(wxPoint(0,0), sz);

629

gc->SetBrush(wxBrush(backgroundColour));

630

gc->SetPen(wxPen(backgroundColour, 1));

631

gc->DrawRectangle(windowRect.GetX(),windowRect.GetY(),windowRect.GetWidth(),windowRect.GetHeight());

639  auto

start = GetVisibleRowsBegin();

640  auto

stop = GetVisibleRowsEnd();

647

wxRect rect(wxPoint(5, 5), renderer.GetCheckBoxSize(

this

));

648  for

(

size_t i

= start;

i

<= stop;

i

++)

654  const

validator::SBarcode &

b

= (*m_barcode)[

i

];

656

dc.DrawLabel(wxString(

b

.barcode), rect);

662

dc.DrawLabel(wxString(

b

.genbank), rect);

663  m_links

.push_back(pair<size_t, wxRect>(

i

, rect));

667

renderer.DrawCheckBox(

this

, dc, rect,

b

.length ? wxCONTROL_CHECKED : 0);

670

renderer.DrawCheckBox(

this

, dc, rect,

b

.primers ? wxCONTROL_CHECKED : 0);

673

renderer.DrawCheckBox(

this

, dc, rect,

b

.country ? wxCONTROL_CHECKED : 0);

676

renderer.DrawCheckBox(

this

, dc, rect,

b

.voucher ? wxCONTROL_CHECKED : 0);

679

renderer.DrawCheckBox(

this

, dc, rect,

b

.structured_voucher ? wxCONTROL_CHECKED : 0);

683

dc.DrawLabel(wxString(

b

.percent_n), rect);

687

renderer.DrawCheckBox(

this

, dc, rect,

b

.collection_date ? wxCONTROL_CHECKED : 0);

690

renderer.DrawCheckBox(

this

, dc, rect,

b

.order_assignment ? wxCONTROL_CHECKED : 0);

693

renderer.DrawCheckBox(

this

, dc, rect,

b

.low_trace ? wxCONTROL_CHECKED : 0);

696

renderer.DrawCheckBox(

this

, dc, rect,

b

.frame_shift ? wxCONTROL_CHECKED : 0);

699

renderer.DrawCheckBox(

this

, dc, rect,

b

.has_keyword ? wxCONTROL_CHECKED : 0);

709

wxPoint p = evt.GetPosition();

710

wxWindow *win = GetGrandParent();

723

parent->

CheckRow

(

static_cast<int>

(

i

));

731  for

(

size_t

k = 0; k <

m_links

.size(); k++)

733  if

(

m_links

[k].second.Contains(p))

750

objects::CBioseq_CI b_iter(seh, objects::CSeq_inst::eMol_na);

751  for

( ; b_iter ; ++b_iter )

756  for

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

GetId

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

GetId

().end(); ++it)

758  const CSeq_id

&

id

= *(it->GetSeqId());

759  if

(

id

.IsGeneral() &&

id

.GetGeneral().IsSetDb() &&

NStr::EqualNocase

(

id

.GetGeneral().GetDb(),

"FBOL"

) &&

id

.GetGeneral().IsSetTag())

761  const CObject_id

&obj_id =

id

.GetGeneral().GetTag();

762  if

(obj_id.

IsStr

())

775  if

(source_ci->GetSource().IsSetOrg())

779  if

((*dbxref)->IsSetDb() && (*dbxref)->GetDb() ==

"FBOL"

)

788

new_desc->

Assign

(*source_ci);

790

dbtag->

SetDb

(

"FBOL"

);

791

dbtag->

SetTag

().SetStr(fbol);

794  cmd

->AddCommand (*ecmd);

User-defined methods of the data storage class.

static CRef< CCmdComposite > apply(objects::CSeq_entry_Handle seh)

void OnResize(wxSizeEvent &)

vector< pair< size_t, wxRect > > m_links

virtual void OnPaint(wxPaintEvent &event)

void OnMouseClick(wxMouseEvent &evt)

vector< pair< size_t, wxRect > > m_checkboxes

virtual void OnUpdate()

Notification for the derived class that moment is good for doing its update and drawing stuff.

virtual wxCoord OnGetRowHeight(size_t row) const

validator::TBarcodeResults * m_barcode

virtual void OnEraseBackground(wxEraseEvent &event)

void SetText(const wxString &text)

CProjectService - a service providing API for operations with Workspaces and Projects.

void SetStringSelection(const wxString &str)

CRef< edit::CStringConstraint > GetStringConstraint()

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 begin() const

const_iterator find(const key_type &key) const

const_iterator end() const

CIRef< T > GetServiceByType()

retrieves a typed reference to a service, the name of C++ type is used as the name of the service.

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Set object to copy of another one.

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

@ eContent

Untagged human-readable accession or the like.

const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)

If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...

@ eGetId_Best

return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function

TBioseqCore GetBioseqCore(void) const

Get bioseq core structure.

CSeq_entry_Handle GetSeq_entry_Handle(void) const

Get parent Seq-entry handle.

CConstRef< TObject > GetObjectCore(void) const

const TId & GetId(void) const

CSeq_entry_Handle GetSeq_entry_Handle(void) const

TObjectType * GetPointer(void) const THROWS_NONE

Get pointer,.

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

#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.

TKeywords & SetKeywords(void)

Assign a value to Keywords data member.

void SetOrg(TOrg &value)

Assign a value to Org data member.

bool IsStr(void) const

Check if variant Str is selected.

void SetTag(TTag &value)

Assign a value to Tag data member.

bool IsId(void) const

Check if variant Id is selected.

const TStr & GetStr(void) const

Get the variant data.

void SetDb(const TDb &value)

Assign a value to Db data member.

TId GetId(void) const

Get the variant data.

TGenbank & SetGenbank(void)

Select the variant.

TSource & SetSource(void)

Select the variant.

@ e_Genbank

GenBank specific info.

@ e_Source

source of materials, includes Org-ref

const TYPE & Get(const CNamedParameterList *param)

void ReportUsage(const wxString &dialog_name)

Report opening & accepting events in the editing package.

const string version

version string

const struct ncbi::grid::netcache::search::fields::SIZE size

const GenericPointer< typename T::ValueType > T2 value

Utility macros and typedefs for exploring NCBI objects from seqblock.asn.

#define FOR_EACH_KEYWORD_ON_GENBANKBLOCK(Itr, Var)

FOR_EACH_KEYWORD_ON_GENBANKBLOCK EDIT_EACH_KEYWORD_ON_GENBANKBLOCK.

#define ERASE_KEYWORD_ON_GENBANKBLOCK(Itr, Var)

ERASE_KEYWORD_ON_GENBANKBLOCK.

#define EDIT_EACH_KEYWORD_ON_GENBANKBLOCK(Itr, Var)

#define FOR_EACH_DBXREF_ON_ORGREF(Itr, Var)

FOR_EACH_DBXREF_ON_ORGREF EDIT_EACH_DBXREF_ON_ORGREF.

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

#define row(bind, expected)

bool BarcodeTestFails(const SBarcode &b)

bool IsTechBarcode(CBioseq_Handle bsh)

vector< SBarcode > TBarcodeResults

void BarcodeTestBioseq(CBioseq_Handle bsh, SBarcode &b)


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