wxColor(
wxT(
"#D5EDF5"));
128 returnwxColor(
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 stringname(
"Open Reading Frames Search");
202 returnsl_ctx !=
NULL;
220 return "search_tool::orf_search_tool";
225 return "Datamining Tool - Open Reading Frames search";
252s.append(
"genecode=");
254s.append(
" StartOrf=");
256s.append(
" MinPairs=");
267m_GencodeCombo(
NULL),
268m_StartorfCombo(
NULL),
269m_BasepairsText(
NULL)
286 static boolkozakInitialized =
false;
287 if(!kozakInitialized) {
289kozakInitialized =
true;
329wxBoxSizer * vSz =
newwxBoxSizer(wxVERTICAL);
332wxFlexGridSizer * sz =
newwxFlexGridSizer(0, 4, 0, 0);
333sz->AddGrowableCol(1);
334sz->AddGrowableCol(3);
336 m_Sizer->Add(sz, 0, wxGROW|wxALL, 0);
339sz->Add(
newwxStaticText( parent, wxID_STATIC,
340 wxT(
"Search Context:"),
341wxDefaultPosition, wxDefaultSize, 0 ),
3420, wxALIGN_CENTER_VERTICAL|wxALL, 5);
345wxDefaultPosition, wxDefaultSize,
3460, (
constwxString*)
NULL);
348sz->Add(
m_DbCombo,1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
351sz->Add(
newwxStaticText( parent, wxID_STATIC,
wxT(
"Genetic Code:"),
352wxDefaultPosition, wxDefaultSize, 0 ),
3530, wxALIGN_CENTER_VERTICAL|wxALL, 5);
355wxDefaultPosition, wxDefaultSize,
3560, (
constwxString*)
NULL);
368sz->Add(
m_GencodeCombo,1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
371sz->Add(
newwxStaticText( parent, wxID_STATIC,
372 wxT(
"Min Number of Basepairs:"),
373wxDefaultPosition, wxDefaultSize, 0 ),
3740, wxALIGN_CENTER_VERTICAL|wxALL, 5);
376wxDefaultPosition, wxDefaultSize, 0 );
386sz->Add(
newwxStaticText( parent, wxID_STATIC,
wxT(
"Start ORFs At:"),
387wxDefaultPosition, wxDefaultSize, 0 ),
3880, wxALIGN_CENTER_VERTICAL|wxALL, 5);
390wxDefaultPosition, wxDefaultSize,
3910, (
constwxString*)
NULL);
422 if( (kozakDir =
registry.
Get(
"Patterns",
"PatternPath")).empty() ) {
423 registry.
Set(
"Patterns",
"PatternPath",
"<std>, <home>",
426kozakDir =
registry.
Get(
"Patterns",
"PatternPath");
431 ITERATE(list<string>, iter, paths) {
433 if(*iter ==
"<std>"|| *iter ==
"<home>") {
438 if( dir_name.empty() ) {
442wxFileName fname(dir_name, wxEmptyString);
443 if( !fname.DirExists(dir_name) ) {
450 boolcont = dir.GetFirst(&filename,
kKozakFile, wxDIR_FILES);
452fname.SetFullName(filename);
453wxString full_path = fname.GetFullPath();
459list<string> pat_ids;
460 patterns.EnumerateSections(&pat_ids);
463 ITERATE(list<string>, pat_id, pat_ids) {
464 if(*pat_id ==
"-") {
465fName =
patterns.Get(
"-",
"name");
474 stringpattern =
patterns.Get(*pat_id,
"pattern");
475 stringdesc =
patterns.Get(*pat_id,
"description");
480cont = dir.GetNext(&filename);
516 dynamic_cast<const CSeq_loc*
>(obj->object.GetPointer());
524 id->Assign(*(in_loc->
GetId()));
535sc_locs.push_back(sl);
544sl.
m_Loc= searchLoc;
548 id->Assign(*(searchLoc->
GetId()));
550sl.
m_Loc->SetWhole(*
id);
555sc_locs.push_back(sl);
575, m_KozakList(kozakList)
597vector<string> allowable_starts;
599allowable_starts.push_back(
"ATG");
602 boolsearchForward =
true, searchReverse =
true;
603 boolbLongestORFs =
false;
607 if(expr.find(
"Strand=") == 0 && expr.size() > 7) {
608 string value= expr.substr(7);
609 if(
value==
"'+'")
610searchReverse =
false;
611 else if(
value==
"'-'")
612searchForward =
false;
614 else if(expr ==
"LongestORFs")
615bLongestORFs =
true;;
618 if(!searchForward && !searchReverse)
619searchForward = searchReverse =
true;
646handles.push_back(seq_id_h);
649 if(taxid_vector.size() > 0) {
650tax_id = taxid_vector[0];
655 if(tax_client.
Init()) {
657tax_client.
LoadNode(tax_id, &node);
658 if(node) gc_id = node->
GetGC();
677vector< CRef<CSeq_loc> > orfs;
685 sort(orfs.begin(), orfs.end());
704start1 =
max(start - 6, 0);
705stop1 =
min(bioseqLength - 1, stop + 6);
707loc_new->
SetInt().SetFrom(start1);
708loc_new->
SetInt().SetTo (stop1);
709loc_new->
SetInt().SetStrand(strand);
710loc_new->
SetId(*(**it2).GetId());
719 strings1 = seq_iupac.substr(0,
delta);
720 strings2 = seq_iupac.substr(
delta, 3);
721 strings3 = seq_iupac.substr(
delta+ 3, 2);
724seq_iupac = seq_iupac.substr(
delta, stop - start + 1);
727 stringseq_tran =
"";
731feat->
SetData().SetCdregion().SetOrf(
true);
734feat->
SetTitle(
"Open reading frame");
744 stringkozakSignal =
"None";
745 intkozakPosition = -1;
747 stringstrStrand = bMinus ?
"-":
"+";
749 if((bMinus && !searchReverse) || (!bMinus && !searchForward))
752 boolcdsExtension =
false;
756it2 = neg_feats.
find(start);
757 while(it2 != neg_feats.
end() && it2->first == start) {
758 if(stop > it2->second) {
759cdsExtension =
true;
767it2 = pos_feats.
find(stop);
768 while(it2 != pos_feats.
end() && it2->first == stop) {
769 if(start < it2->second) {
770cdsExtension =
true;
778 intcodon_pos = koz->m_Codon_pos;
779 if(codon_pos > start)
782loc_new->
SetInt().SetFrom(start - codon_pos);
783loc_new->
SetInt().SetTo (
min(bioseqLength - 1, start + 4));
784loc_new->
SetInt().SetStrand(strand);
785loc_new->
SetId(*(**it2).GetId());
794 if(!
match.empty()) {
795kozakPosition = start - codon_pos;
796kozakSignal = koz->m_Name;
802kozakSignal +=
" [CDS Extension]";
812(
int)(*it2)->GetTotalRange().GetFrom()+1,
813(
int)(*it2)->GetTotalRange().GetTo()+1,
815(
int)(*it2)->GetTotalRange().GetLength(),
816max<int>(0,
static_cast<int>(seq_tran.length() - 1)),
817seq_iupac.substr(0, 3),
818seq_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 intkUpdateIncrement = 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 §ion, const string &name, TFlags flags=0) const
Get the parameter value.
bool Set(const string §ion, 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