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

NCBI C++ ToolKit: src/gui/packages/pkg_sequence/orf_search_tool.cpp Source File

64 #include <wx/stattext.h> 65 #include <wx/choice.h> 66 #include <wx/srchctrl.h> 67 #include <wx/filename.h> 71 #define ID_COMBOBOX 10003 73 #define ID_COMBOBOX_UPDATE 10111 126  return

wxColor(

wxT

(

"#D5EDF5"

));

128  return

wxColor(

wxT

(

"#D5EDF5"

));

158  m_Filters

.

filters

.push_back(pair<string,string>(

"Show only positive strand results"

,

161  m_Filters

.

filters

.push_back(pair<string,string>(

"Show only negative strand results"

,

164  m_Filters

.

filters

.push_back(pair<string,string>(

"Show only longest ORFs"

,

174  static string

name(

"Open Reading Frames Search"

);

202  return

sl_ctx !=

NULL

;

220  return "search_tool::orf_search_tool"

;

225  return "Datamining Tool - Open Reading Frames search"

;

252

s.append(

"genecode="

);

254

s.append(

" StartOrf="

);

256

s.append(

" MinPairs="

);

267

m_GencodeCombo(

NULL

),

268

m_StartorfCombo(

NULL

),

269

m_BasepairsText(

NULL

)

286  static bool

kozakInitialized =

false

;

287  if

(!kozakInitialized) {

289

kozakInitialized =

true

;

329

wxBoxSizer * vSz =

new

wxBoxSizer(wxVERTICAL);

332

wxFlexGridSizer * sz =

new

wxFlexGridSizer(0, 4, 0, 0);

333

sz->AddGrowableCol(1);

334

sz->AddGrowableCol(3);

336  m_Sizer

->Add(sz, 0, wxGROW|wxALL, 0);

339

sz->Add(

new

wxStaticText( parent, wxID_STATIC,

340  wxT

(

"Search Context:"

),

341

wxDefaultPosition, wxDefaultSize, 0 ),

342

0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

345

wxDefaultPosition, wxDefaultSize,

346

0, (

const

wxString*)

NULL

);

348

sz->Add(

m_DbCombo

,1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

351

sz->Add(

new

wxStaticText( parent, wxID_STATIC,

wxT

(

"Genetic Code:"

),

352

wxDefaultPosition, wxDefaultSize, 0 ),

353

0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

355

wxDefaultPosition, wxDefaultSize,

356

0, (

const

wxString*)

NULL

);

368

sz->Add(

m_GencodeCombo

,1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);

371

sz->Add(

new

wxStaticText( parent, wxID_STATIC,

372  wxT

(

"Min Number of Basepairs:"

),

373

wxDefaultPosition, wxDefaultSize, 0 ),

374

0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

376

wxDefaultPosition, wxDefaultSize, 0 );

386

sz->Add(

new

wxStaticText( parent, wxID_STATIC,

wxT

(

"Start ORFs At:"

),

387

wxDefaultPosition, wxDefaultSize, 0 ),

388

0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

390

wxDefaultPosition, wxDefaultSize,

391

0, (

const

wxString*)

NULL

);

422  if

( (kozakDir =

registry

.

Get

(

"Patterns"

,

"PatternPath"

)).empty() ) {

423  registry

.

Set

(

"Patterns"

,

"PatternPath"

,

"<std>, <home>"

,

426

kozakDir =

registry

.

Get

(

"Patterns"

,

"PatternPath"

);

431  ITERATE

(list<string>, iter, paths) {

433  if

(*iter ==

"<std>"

|| *iter ==

"<home>"

) {

438  if

( dir_name.empty() ) {

442

wxFileName fname(dir_name, wxEmptyString);

443  if

( !fname.DirExists(dir_name) ) {

450  bool

cont = dir.GetFirst(&filename,

kKozakFile

, wxDIR_FILES);

452

fname.SetFullName(filename);

453

wxString full_path = fname.GetFullPath();

459

list<string> pat_ids;

460  patterns

.EnumerateSections(&pat_ids);

463  ITERATE

(list<string>, pat_id, pat_ids) {

464  if

(*pat_id ==

"-"

) {

465

fName =

patterns

.Get(

"-"

,

"name"

);

474  string

pattern =

patterns

.Get(*pat_id,

"pattern"

);

475  string

desc =

patterns

.Get(*pat_id,

"description"

);

480

cont = dir.GetNext(&filename);

516  dynamic_cast<const CSeq_loc

*

>

(obj->object.GetPointer());

524  id

->Assign(*(in_loc->

GetId

()));

535

sc_locs.push_back(sl);

544

sl.

m_Loc

= searchLoc;

548  id

->Assign(*(searchLoc->

GetId

()));

550

sl.

m_Loc

->SetWhole(*

id

);

555

sc_locs.push_back(sl);

575

, m_KozakList(kozakList)

597

vector<string> allowable_starts;

599

allowable_starts.push_back(

"ATG"

);

602  bool

searchForward =

true

, searchReverse =

true

;

603  bool

bLongestORFs =

false

;

607  if

(expr.find(

"Strand="

) == 0 && expr.size() > 7) {

608  string value

= expr.substr(7);

609  if

(

value

==

"'+'"

)

610

searchReverse =

false

;

611  else if

(

value

==

"'-'"

)

612

searchForward =

false

;

614  else if

(expr ==

"LongestORFs"

)

615

bLongestORFs =

true

;;

618  if

(!searchForward && !searchReverse)

619

searchForward = searchReverse =

true

;

646

handles.push_back(seq_id_h);

649  if

(taxid_vector.size() > 0) {

650

tax_id = taxid_vector[0];

655  if

(tax_client.

Init

()) {

657

tax_client.

LoadNode

(tax_id, &node);

658  if

(node) gc_id = node->

GetGC

();

677

vector< CRef<CSeq_loc> > orfs;

685  sort

(orfs.begin(), orfs.end());

704

start1 =

max

(start - 6, 0);

705

stop1 =

min

(bioseqLength - 1, stop + 6);

707

loc_new->

SetInt

().SetFrom(start1);

708

loc_new->

SetInt

().SetTo (stop1);

709

loc_new->

SetInt

().SetStrand(strand);

710

loc_new->

SetId

(*(**it2).GetId());

719  string

s1 = seq_iupac.substr(0,

delta

);

720  string

s2 = seq_iupac.substr(

delta

, 3);

721  string

s3 = seq_iupac.substr(

delta

+ 3, 2);

724

seq_iupac = seq_iupac.substr(

delta

, stop - start + 1);

727  string

seq_tran =

""

;

731

feat->

SetData

().SetCdregion().SetOrf(

true

);

734

feat->

SetTitle

(

"Open reading frame"

);

744  string

kozakSignal =

"None"

;

745  int

kozakPosition = -1;

747  string

strStrand = bMinus ?

"-"

:

"+"

;

749  if

((bMinus && !searchReverse) || (!bMinus && !searchForward))

752  bool

cdsExtension =

false

;

756

it2 = neg_feats.

find

(start);

757  while

(it2 != neg_feats.

end

() && it2->first == start) {

758  if

(stop > it2->second) {

759

cdsExtension =

true

;

767

it2 = pos_feats.

find

(stop);

768  while

(it2 != pos_feats.

end

() && it2->first == stop) {

769  if

(start < it2->second) {

770

cdsExtension =

true

;

778  int

codon_pos = koz->m_Codon_pos;

779  if

(codon_pos > start)

782

loc_new->

SetInt

().SetFrom(start - codon_pos);

783

loc_new->

SetInt

().SetTo (

min

(bioseqLength - 1, start + 4));

784

loc_new->

SetInt

().SetStrand(strand);

785

loc_new->

SetId

(*(**it2).GetId());

794  if

(!

match

.empty()) {

795

kozakPosition = start - codon_pos;

796

kozakSignal = koz->m_Name;

802

kozakSignal +=

" [CDS Extension]"

;

812

(

int

)(*it2)->GetTotalRange().GetFrom()+1,

813

(

int

)(*it2)->GetTotalRange().GetTo()+1,

815

(

int

)(*it2)->GetTotalRange().GetLength(),

816

max<int>(0,

static_cast<int>

(seq_tran.length() - 1)),

817

seq_iupac.substr(0, 3),

818

seq_iupac.substr(seq_iupac.length()-3),

828

}

NCBI_CATCH

(

"Error processing location \""

+ locLabel +

"\"."

);

864  if

((*code)->GetName() == s) {

865  return

(*code)->GetId();

870  "CAlgoPlugin_FindOrfs: no genetic code matched "

+ s);

877  const string

& strand,

880  const string

& start_cdn,

881  const string

& stop_cdn,

882  const string

& translated_seq,

883  const string

& nucleotide_seq,

884  const string

& start_context,

885  const string

& ctx_name,

886  const string

& kozak,

890  static const int

kUpdateIncrement = 250;

914  if

(

count

>= kUpdateIncrement) {

User-defined methods of the data storage class.

@ eExtreme_Positional

numerical value

CAppJobError Default implementation for IAppJobError - encapsulates a text error message.

CObjectList * GetObjectList()

static const CGenetic_code_table & GetCodeTable(void)

static CNcbiApplication * Instance(void)

Singleton method.

CRef< CObjectList > m_ObjectList

virtual int GetNumColumns() const

Returns the number of columns in the model.

CObjectList Data structure representing a list of CObjects with associated Scopes and other optional ...

int AddRow(CObject *obj, objects::CScope *scope)

void AddObjectLabel(const string &name, CLabel::ELabelType type)

void SetString(int col, int row, const string &val)

void SetInteger(int col, int row, int val)

void Append(const CObjectList &list)

adds rows from the given list, the lists must have identical sets of columns

int AddColumn(EColumnType type, const string &name, int col=-1)

int GetInteger(int col, int row) const

virtual wxColor GetBackgroundColor(int row) const

virtual int GetNumColumns() const

Returns the number of columns in the model.

void SetColorColumn(int col)

static void FindOrfs(const string &seq, TLocVec &results, unsigned int min_length_bp=3, int genetic_code=1, const vector< string > &allowable_starts=vector< string >(), bool longest_orfs=true, size_t max_seq_gap=k_default_max_seq_gap)

Find ORFs in both orientations.

class CRegistryReadView provides a nested hierarchical view at a particular key.

void GetIntVec(const string &key, vector< int > &val) const

string GetString(const string &key, const string &default_val=kEmptyStr) const

void Set(const string &key, int val)

access a named key at this level, with no recursion

void UpdateContextCombo(wxChoice *combo)

CRef< CDMSearchResult > m_TempResult

holds temporary results, guarded by Mutex

IDMSearchTool::TFilters m_Filters

holds the final results

CMutex m_Mutex

synchronizes access to the Job members

CRef< CAppJobError > m_Error

CObjectList m_AccList

accumulates found objects before they are transferred to m_ResultList

TScopedLocs & GetScopedLocs()

vector< SScopedLoc > TScopedLocs

@ eSubtype_transit_peptide

@ eSubtype_sig_peptide_aa

@ eSubtype_mat_peptide_aa

namespace ncbi::objects::

static wxString ResolvePath(const wxString &path, const wxString &rel_name)

Utility function to hide the platform specifics of locating our standard directories and files.

bool LoadNode(TTaxId tax_id, const ITaxon1Node **ppNode=NULL)

IDMSearchQuery - abstract data mining query.

IDataMiningContext IDataMiningContext represents an abstract context for a Search.

virtual string GetDMContextName()=0

returns Name of the context to be used in UI

virtual void GetMultiple(TConstScopedObjects &)

virtual CRef< objects::CScope > GetSearchScope()=0

virtual CRef< objects::CSeq_loc > GetSearchLoc()=0

virtual TTaxGeneticCode GetGC() const =0

container_type::const_iterator const_iterator

const_iterator find(const key_type &key) const

const_iterator end() const

iterator insert(const value_type &val)

container_type::value_type value_type

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

#define NCBI_CATCH(message)

Catch CExceptions as well This macro is deprecated - use *_X or *_XX variant instead of it.

static CRef< objects::CSeq_loc > RemapChildToParent(const objects::CSeq_loc &parent, const objects::CSeq_loc &child, objects::CScope *scope=NULL)

remap a location to a parent location.

COrfSearchJob(COrfSearchQuery &query, const COrfSearchForm::TKozakList &kozakList)

COrfSearchJob.

void x_AddToResults(CObject &obj, objects::CScope &scope, int start, int stop, const string &strand, int length, int p_length, const string &start_cdn, const string &stop_cdn, const string &translated_seq, const string &nucleotide_seq, const string &start_context, const string &ctx_name, const string &kozak, int k_loc, int color)

virtual IUITool * Clone() const

virtual CIRef< IDMSearchForm > CreateSearchForm()

factory method for creating a form representing the tool

COrfSearchQuery::TScopedLocs TScopedLocs

vector< ISeqLocSearchContext * > m_SeqLocContexts

COrfSearchForm::TKozakList m_KozakList

int x_DecodeGeneticCode(const string &s)

virtual bool x_ValidateParams()

returns true if Job params are correct, implement in derived classes

COrfSearchTool()

COrfSearchTool.

virtual CRef< CSearchJobBase > x_CreateJob(IDMSearchQuery &query)

implementing CSearchToolBase pure virtual function

virtual string GetName() const

returns unique name of the method that is used in UI to identify it

virtual void x_LoadSettings(const CRegistryReadView &view)

virtual wxSizer * GetWidget(wxWindow *parent)

return a widget associated with the form; the form controls the lifetime of the widget (do not delete...

virtual IDMSearchTool * x_GetTool()

virtual IAppJob::EJobState x_DoSearch()

performs searching, assuming that params are correct; Implement in derived classes

COrfSearchQuery::TScopedLocs TScopedLocs

list< TKozakPattern > TKozakList

struct SKozakPattern TKozakPattern

CRef< COrfSearchQuery > m_Query

virtual string GetExtensionIdentifier() const

returns the unique human-readable identifier for the extension the id should use lowercase letters se...

COrfSearchQuery(TScopedLocs &locs, const string &gc, const string &so, const string &mp)

COrfSearchQuery.

virtual string ToString() const

Prepare a string representation of a query (for logging and debugging)

virtual string GetDescription() const

returns a detailed description of the method that is used in UI

COrfSearchForm(COrfSearchTool &tool)

COrfSearchForm.

wxChoice * m_GencodeCombo

virtual void x_SetupColumns(CObjectList &obj_list)

add custom columns if needed

virtual IDMSearchTool::TUIToolFlags GetFlags(void)

special flags

virtual void x_SaveSettings(CRegistryWriteView view) const

virtual CIRef< IDMSearchQuery > ConstructQuery()

static TKozakList m_Kozak

wxTextCtrl * m_BasepairsText

virtual CObjectListTableModel * x_GetNewOLTModel() const

factory method creating new column handler for CObjectListWidget

virtual string GetExtensionLabel() const

returns a displayable label for this extension ( please capitalize the key words - "My Extension" )

CRef< COrfSearchTool > m_Tool

virtual bool IsCompatible(IDataMiningContext *context)

retuns true if the tool is compatible with the provided Search Context

wxChoice * m_StartorfCombo

static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)

virtual bool IsCanceled() const override

EJobState

Job states (describe FSM)

vector< SConstScopedObject > TConstScopedObjects

void SetId(CSeq_id &id)

set the 'id' field in all parts of this location

TRange GetTotalRange(void) const

const CSeq_id * GetId(void) const

Get the id of the location return NULL if has multiple ids or no id at all.

void GetLabel(string *label) const

Appends a label suitable for display (e.g., error messages) label must point to an existing string ob...

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

static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)

Translate a string using a specified genetic code.

vector< TTaxId > TTaxIds

Get taxonomy ids of sequences Return -1 for sequences that aren't found Return 0 for sequences that d...

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

TTaxIds GetTaxIds(const TSeq_id_Handles &idhs, TGetFlags flags=0)

vector< CSeq_id_Handle > TSeq_id_Handles

Bulk retrieval methods Common argument typedef - vector of requested ids.

TSeqPos GetBioseqLength(void) const

@ eCoding_Ncbi

Set coding to binary coding (Ncbi4na or Ncbistdaa)

@ eCoding_Iupac

Set coding to printable coding (Iupacna or Iupacaa)

const CSeq_loc & GetLocation(void) const

void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const

Fill the buffer string with the sequence data for the interval [start, stop).

void SetCoding(TCoding coding)

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

bool IsNull(void) const THROWS_NONE

Check if pointer is null – same effect as Empty().

CTempString GetMatch(CTempString str, size_t offset=0, size_t idx=0, TMatch flags=fMatch_default, bool noreturn=false)

Get matching pattern and subpatterns.

virtual const string & Get(const string &section, const string &name, TFlags flags=0) const

Get the parameter value.

bool Set(const string &section, const string &name, const string &value, TFlags flags=0, const string &comment=kEmptyStr)

Set the configuration parameter value.

@ eReturn

Return default value.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static string & ToUpper(string &str)

Convert string to upper case – string& version.

static string & ToLower(string &str)

Convert string to lower case – string& version.

@ fSplit_Tokenize

All delimiters are merged and trimmed, to get non-empty tokens only.

@ fWithCommas

Use commas as thousands separator.

static const char label[]

TTo GetTo(void) const

Get the To member data.

TFrom GetFrom(void) const

Get the From member data.

void SetLocation(TLocation &value)

Assign a value to Location data member.

list< CRef< CGenetic_code > > Tdata

void SetTitle(const TTitle &value)

Assign a value to Title data member.

void SetData(TData &value)

Assign a value to Data data member.

void SetExp_ev(TExp_ev value)

Assign a value to Exp_ev data member.

const Tdata & Get(void) const

Get the member data.

@ eExp_ev_not_experimental

similarity, pattern, etc

ENa_strand

strand of nucleic acid

@ e_Iupacna

IUPAC 1 letter nuc acid code.

unsigned int

A callback function used to compare two keys in a database.

constexpr auto sort(_Init &&init)

const GenericPointer< typename T::ValueType > T2 value

Defines the CNcbiApplication and CAppException classes for creating NCBI applications.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

Process information in the NCBI Registry, including working with configuration files.

Int4 delta(size_t dimension_, const Int4 *score_)

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)

#define row(bind, expected)

CRef< objects::CScope > m_Scope

CRef< objects::CSeq_loc > m_Loc

static CS_CONTEXT * context

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