,
101 "https://www.ncbi.nlm.nih.gov/tools/gbench/tutorial13/",
102 "Alignment Creation"),
129 return "prosplign_tool";
135 return "ProSPLIGN Tool";
182 copy(vec.begin(), vec.end(), back_inserter(protein));
186 copy(vec.begin(), vec.end(), back_inserter(na));
209 const CSeq_loc* loc =
dynamic_cast<const CSeq_loc*
>(it2->object.GetPointer());
210 if( !loc )
continue;
216protein.push_back(*it2);
218 else if(bsh.
IsNa()) {
223 if(!protein.empty()) {
225 copy(protein.begin(), protein.end(), back_inserter(vec));
229 copy(na.begin(), na.end(), back_inserter(vec));
240: m_Params(params), m_Protein(protein), m_NA(na)
284 const intkCutoff = 9;
289 const CSeq_loc& na_loc =
dynamic_cast<const CSeq_loc&
>(it->object.GetObject());
295orig_genomic_loc.
SetInt().SetId(*seqid);
296orig_genomic_loc.
SetInt().SetFrom(0);
316vector<CRef<CSeq_align>> align_result;
320 if(
IsCanceled() || comparts.empty())
return;
322 for(
auto&& it : comparts) {
328align_result.push_back(align);
338 const intkMaxCompartCount = 25;
346 typedefpair<SKey, CRef<CSeq_annot>> TItem;
347 typedefdeque<TItem> TAlignInfo;
351 booloperator() (
constTItem& item1,
constTItem& item2)
const 353 if(item1.first.protein < item2.first.protein) {
356 if(item2.first.protein < item1.first.protein) {
359 return(item1.first.bit_score > item2.first.bit_score);
365SKey operator() (
const CSeq_annot& compartment)
const 369 boolfound_protein =
false;
370 boolfound_score =
false;
373 switch(desc.
Which()) {
381found_protein =
true;
386 const char* kBitScore =
"bit_score";
407 if(!found_protein) {
430 if(comparts.size() > kMaxCompartCount) {
449opts_hndl->SetEvalueThreshold(0.001);
450opts_hndl->SetMatrixName(
"BLOSUM80");
451opts_hndl->SetSegFiltering(
true);
452opts_hndl->SetMaskAtHash(
true);
453opts_hndl->SetWordThreshold(12);
458opts_hndl->GetOptions().DebugDumpText(
NcbiCout,
"tBLASTn Options", 5);
464opts_hndl->Validate();
480vector<CRef<CSeq_align>> align_list;
488align_list.push_back(align);
491 LOG_POST(
Error<<
"Result from tBlastn is not a Seq-align.segs.std alignment");
498 if(align_list.empty()) {
507hit_refs.push_back(hitref);
516prosplign::CCompartOptions compart_opts;
524 function<SKey(
const CSeq_annot&)> extractor = SExtractor();
526TAlignInfo alignment_info;
528SKey
key= extractor(**compart_it);
529alignment_info.emplace_back(
key, *compart_it);
534 function<
bool(
constTItem&,
constTItem&)> sorter = SKey_Less();
535 sort(alignment_info.begin(), alignment_info.end(), sorter);
540 for(
size_tindex = 0; index < alignment_info.size() && index < kMaxCompartCount; ++index) {
541sorted_comparts.emplace_back(alignment_info[index].second);
544comparts.swap(sorted_comparts);
553 switch(desc.
Which()) {
574 if(!new_genomic_loc) {
613 catch(
constexception& e) {
624 if(align_result.empty())
return;
628 for(
auto&& align_it : align_result) {
629 if(align_it->GetSegs().IsSpliced() &&
630align_it->GetSegs().GetSpliced().IsSetExons() &&
631!align_it->GetSegs().GetSpliced().GetExons().empty()) {
632seqannot_align.push_back(align_it);
636 if(seqannot_align.empty())
return;
643 str+=
": ProSPLIGN alignment";
650item->
SetItem().SetAnnot(*annot);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Declares the CBl2Seq (BLAST 2 Sequences) class.
Interface for converting blast-related command line arguments into blast options.
Definitions used throughout BLAST.
vector< CRef< objects::CSeq_align_set > > TSeqAlignVector
Vector of Seq-align-sets.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
@ eTblastn
Protein-Translated nucl.
Runs the BLAST algorithm between 2 sequences.
Defines BLAST error codes (user errors included)
CDataLoadingAppJob - a base class for Jobs loading data into projects.
void AddProjectItem(objects::CProjectItem &item)
void DebugDumpText(ostream &out, const string &bundle, unsigned int depth) const
blast::TSeqAlignVector x_SetupAndRuntBlastn(const CSeq_loc &protein_loc, const CSeq_loc &genomic_loc)
prosplign::TCompartments x_GetCompartments(const CSeq_loc &protein_loc, const CSeq_loc &genomic_loc)
virtual void x_CreateProjectItems()
override this function in derived classes and populate m_Items.
CProSplignJob(const CProSplignParams ¶ms, const TConstScopedObjects &protein, const TConstScopedObjects &nucleotide)
CProSplignJob.
static Boolean s_BlastInterrupt(SBlastProgress *prog)
static callback for BLAST interruption this must match the API in CBl2Seq and BLAST
CRef< CSeq_align > x_RunProSplign(const CSeq_id &protein_id, const CSeq_loc &genomic_loc)
void x_CreateOneProjectItem(const vector< CRef< CSeq_align >> &align_result, const CSeq_loc &protein_loc, const CSeq_loc &genomic_loc)
CRef< CSeq_align > x_ProcessCompartment(CRef< CSeq_annot > compartment)
CProSplignParams m_Params
static bool s_ProSplignInterruptCallback(void *user_data)
void x_FilterCompartments(prosplign::TCompartments &comparts)
TConstScopedObjects m_Protein
prosplign::TCompartments x_GenerateCompartments(const blast::TSeqAlignVector &blast_results)
const CProSplignParams & GetData() const
virtual void LoadSettings()
void SetObjects(map< string, TConstScopedObjects > *protein, map< string, TConstScopedObjects > *nucleotide)
SConstScopedObject GetProteinSeq() const
void SetData(const CProSplignParams &data)
virtual void SetRegistryPath(const string &path)
CAlgoToolManagerParamsPanel.
TConstScopedObjects GetNucleotideSeqs() const
CRef< CProSplignScoring > GetScoringParams() const
CRef< CProSplignOutputOptions > GetOutputOptions() const
spliced protein to genomic alignment
void AssignGeneticCode(objects::CScope &scope, const objects::CSeq_id &gid, int gcode)
void SetInterruptCallback(TInterruptFnPtr prg_callback, void *data)
CRef< objects::CSeq_align > FindAlignment(objects::CScope &scope, const objects::CSeq_id &protein, const objects::CSeq_loc &genomic, CProSplignOutputOptions output_options=CProSplignOutputOptions())
Aligns protein to a region on genomic sequence.
void SetNameDesc(const string &name)
void SetCreateDate(const CTime &dt)
vector< THitRef > THitRefs
Handle to the protein-translated nucleotide options to the BLAST algorithm.
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
TCompartments SelectCompartmentsHits(const THitRefs &hitrefs, CCompartOptions compart_options, const vector< pair< THit::TCoord, THit::TCoord > > *gaps=NULL)
Composition of first two functions.
list< CRef< CSeq_annot > > TCompartments
@ eNoCompositionBasedStats
Don't use composition based statistics.
static const char * str(char *buf, int n)
TInterruptFnPtr SetInterruptCallback(TInterruptFnPtr fnptr, void *user_data=NULL)
Set a function callback to be invoked by the CORE of BLAST to allow interrupting a BLAST search in pr...
virtual TSeqAlignVector Run()
Perform BLAST search Assuming N queries and M subjects, the structure of the returned vector is as fo...
#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 ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
virtual void x_SelectCompatibleInputObjects()
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
bool Create(wxWindow *parent, wxWindowID id=ID_CSPLIGNPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCLIP_CHILDREN|wxTAB_TRAVERSAL, bool visibale=true)
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
TObjects m_ProteinObjects
virtual bool x_ValidateParams()
validates user input in Parameters panel, report errors if any
CProSplignPanel * m_Panel
virtual void InitUI()
override this function in a derived class and initialize extra members
CProSplignTool()
CProSplignTool.
CProSplignParams m_Params
virtual wxPanel * GetMaxPanel()
Return the panel that occupies max size on display, to calculate dialog window size.
virtual IRegSettings * x_GetParamsAsRegSetting()
return a pointer to Parameters object as IRegSettings interface
virtual CAlgoToolManagerParamsPanel * x_GetParamsPanel()
returns a pointer to the parameters panel, override in derived classes
virtual void CleanUI()
override this function in a derived class and clean extra members
virtual bool x_CreateParamsPanelIfNeeded()
returns / creates Parameters panel, override in derived classes see cpp file for example
virtual CDataLoadingAppJob * x_CreateLoadingJob()
factory method for creating the job that executes the tool algorithm override in derived classes
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
string m_Descr
mutex to sync our internals
virtual bool IsCanceled() const override
virtual void x_SetStatusText(const string &text)
vector< SConstScopedObject > TConstScopedObjects
C & SerialAssign(C &dest, const C &src, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators â.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
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,...
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
CTime CurrentTime(CTime::ETimeZone tz=CTime::eLocal, CTime::ETimeZonePrecision tzp=CTime::eTZPrecisionDefault)
void SetLabel(const TLabel &value)
Assign a value to Label data member.
void SetItem(TItem &value)
Assign a value to Item data member.
const TData & GetData(void) const
Get the Data member data.
const TStr & GetStr(void) const
Get the variant data.
TReal GetReal(void) const
Get the variant data.
bool IsReal(void) const
Check if variant Real is selected.
const TType & GetType(void) const
Get the Type member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
bool IsStd(void) const
Check if variant Std is selected.
list< CRef< CSeq_align > > Tdata
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsInt(void) const
Check if variant Int is selected.
void SetData(TData &value)
Assign a value to Data data member.
const Tdata & Get(void) const
Get the member data.
list< CRef< CSeq_align > > TAlign
const TUser & GetUser(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
const TDesc & GetDesc(void) const
Get the Desc member data.
const TRegion & GetRegion(void) const
Get the variant data.
const TIds & GetIds(void) const
Get the Ids member data.
const TAlign & GetAlign(void) const
Get the variant data.
list< CRef< CAnnotdesc > > Tdata
@ e_Align
definition of the SeqAligns
@ e_Region
all contents cover this region
@ e_User
user defined object
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::KEY key
Uint1 Boolean
bool replacment for C
#define TRUE
bool replacment for C indicating true.
#define FALSE
bool replacment for C indicating false.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
#define SYMBOL_CPROSPLIGNPANEL_STYLE
Progress monitoring structure.
Structure to represent a single sequence to be fed to BLAST.
Main argument class for TBLASTN application.
Declares the CTBlastnOptionsHandle class.
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