143 result_iter, results->Get()) {
145 assm_iter, result_iter->second->Get()) {
147 query_iter, assm_iter->second) {
149 query_iter->second->Set()) {
182 bool is_splittable_sequences =
false
185 (
new blast::CBlastNucleotideOptionsHandle);
187 opts->SetTraditionalBlastnDefaults();
188 blast::CBlastOptions& options = opts->SetOptions();
190 options.SetWordSize (
static_cast<int>(params.
GetWordSize()));
191 options.SetEvalueThreshold (params.
GetEValue());
193 unique_ptr<CAutoEnvironmentVariable> p_wm_path;
197 options.SetWindowMaskerTaxId(params.
GetWMTaxId());
201 ERR_POST(
Error <<
"BLAST window masker tax-id filtering ignored. WindowMasker DB directory not set.");
206 options.SetBestHitScoreEdge(0.1);
207 options.SetBestHitOverhang(0.1);
211 if (!advParams.empty()) {
212 static const string s_whitespace(
" \n\t\r");
218 unique_ptr<CArgDescriptions> arg_descs( blast_args->SetCommandLine() );
219 unique_ptr<CArgs> args( arg_descs->CreateArgs( argv.size(), argv ) );
224 blast::CGenericSearchArgs search_args(
false ,
227 search_args.ExtractAlgorithmOptions(*args, options);
229 blast::CFilteringArgs filter_args(
false );
230 filter_args.ExtractAlgorithmOptions(*args, options);
232 blast::CNuclArgs nucl_args;
233 nucl_args.ExtractAlgorithmOptions(*args, options);
235 blast::CGappedArgs gapped_args;
236 gapped_args.ExtractAlgorithmOptions(*args, options);
239 blast::CHspFilteringArgs cull_args;
240 cull_args.ExtractAlgorithmOptions(*args, options);
243 blast::CWindowSizeArg window_args;
244 window_args.ExtractAlgorithmOptions(*args, options);
258 if( aSplitter && is_splittable_sequences ){
268 if (filterMode == 0 || filterMode == 1) {
270 "pct_identity_gapopen_only >= 99.5 AND pct_coverage >= 99"));
272 "pct_identity_gapopen_only >= 95 AND pct_coverage >= 95"));
274 "pct_identity_gapopen_only >= 95 AND pct_coverage >= 50"));
276 "pct_identity_gapopen_only >= 80 AND pct_coverage >= 25"));
280 "pct_identity_gapopen_only >= 99.5 AND pct_coverage >= 99 AND align_length_ratio <= 2"));
282 "pct_identity_gapopen_only >= 95 AND pct_coverage >= 95"));
284 "pct_identity_gapopen_only >= 95 AND pct_coverage >= 50"));
286 "pct_identity_gapopen_only >= 80 AND pct_coverage >= 25"));
298 return aligner.
Align();
312 list< CRef<CSeq_loc> > subject_locs;
314 if( seq_id !=
NULL ){
316 loc->
SetId( *seq_id );
318 subject_locs.push_back( loc );
321 if( seq_loc !=
NULL ){
325 LOG_POST(
Error <<
"CNGAlignJob::x_CreateProjectItems(): invalid (non Seq-id/Seq-loc) subject sequence!");
331 subject->SetLocList().insert(
subject->SetLocList().end(), subject_locs.begin(), subject_locs.end() );
334 list< CRef<CSeq_loc> > query_locs;
337 const CSeq_id* seq_id =
dynamic_cast<const CSeq_id*
>( iter->object.GetPointer() );
338 if( seq_id !=
NULL ){
340 loc->
SetId( *seq_id );
342 query_locs.push_back( loc );
344 const CSeq_loc* seq_loc =
dynamic_cast<const CSeq_loc*
>( iter->object.GetPointer() );
345 if( seq_loc !=
NULL ){
349 LOG_POST(
Error <<
"CNGAlignJob::x_CreateProjectItems(): invalid (non Seq-id/Seq-loc) query sequence!");
357 unique_ptr<CUnorderedSplitter> splitter;
370 queries->AddSeqLoc(*it);
385 if( sas && sas->
IsSet() ){
389 alignments->Set().insert(
390 alignments->Set().end(),
403 queries->SetLocList().insert( queries->SetLocList().end(), query_locs.begin(), query_locs.end() );
411 if( sas && sas->
IsSet() ){
415 alignments->Set().insert(
416 alignments->Set().end(),
424 if (alignments && ! alignments->Get().empty()) {
429 TAlign& seqannot_align = annot->
SetData().SetAlign();
437 seqannot_align.push_back(*align);
440 title +=
": Genomic Alignment";
448 item->
SetItem().SetAnnot(*annot);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eBlastn
Nucl-Nucl (traditional blastn)
Main argument class for BLASTN application.
@ eSkipUnsupportedAlignments
void AddProjectItem(objects::CProjectItem &item)
void ScoreAlignments(TAlignResultsRef results, CScope &scope)
Base class to build jobs with cancel functionality.
void SetQuery(ISequenceSet *Set)
void SetSubject(ISequenceSet *Set)
void AddFilter(IAlignmentFilter *Filter)
void AddAligner(IAlignmentFactory *Aligner)
void AddScorer(IAlignmentScorer *Scorer)
int GetGapCount(const CSeq_align &align)
Compute the number of gaps in the alignment.
void AddScore(CScope &scope, CSeq_align &align, EScoreType score)
deprecated: use CSeq_align::EScoreType directly
@ eScore_PercentIdentity_GapOpeningOnly
@ eScore_PercentIdentity_Gapped
@ eScore_PercentIdentity_Ungapped
void SetNamedScore(const string &id, int score)
void SetNameDesc(const string &name)
void SetCreateDate(const CTime &dt)
void SetTitleDesc(const string &title)
Operators to edit gaps in sequences.
string EProgramToTaskName(EProgram p)
Convert a EProgram enumeration value to a task name (as those used in the BLAST command line binaries...
int WindowMaskerPathInit(const string &window_masker_path)
Initialize the path to the windowmasker data files.
#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)
virtual void x_CreateProjectItems()
override this function in derived classes and populate m_Items.
CNGAlignJob(const CNGAlignParams ¶ms)
CNGAlignJob.
TConstScopedObjects & SetQueries()
wxString GetAdvParams() const
int GetFilterMode() const
const SConstScopedObject & GetSubject() const
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
CRef< objects::CScope > scope
string m_Descr
mutex to sync our internals
virtual bool IsCanceled() const override
CConstRef< CObject > object
vector< SConstScopedObject > TConstScopedObjects
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
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.
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.
Tdata & Set(void)
Assign a value to data member.
bool IsSet(void) const
Check if a value has been assigned to data member.
list< CRef< CSeq_align > > Tdata
void SetData(TData &value)
Assign a value to Data data member.
list< CRef< CSeq_align > > TAlign
Uint1 Boolean
bool replacment for C
#define TRUE
bool replacment for C indicating true.
#define FALSE
bool replacment for C indicating false.
Defines a portable execute class.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
static Boolean s_BlastInterruptCallback(SBlastProgress *prog)
@ fScore_GapCount
add a 'gap_count' score
@ fScore_Identities
add BLAST-style 'num_ident' score
@ fScore_Default
default flags: everything
@ fScore_Mismatches
add a 'mismatch' core with a count of mismatches
@ fScore_PercentCoverage
add a score for percent coverage of query (sequence 0)
@ fScore_PercentIdentity
add scores for ungapped and gapped percent identity
static CRef< CSeq_align_set > s_CallAligner(CNGAlignParams ¶ms, CNgAligner &aligner, CJobCancelable *job, CUnorderedSplitter *aSplitter=NULL, bool is_splittable_sequences=false)
void AddStandardAlignmentScores(CScope &scope, CSeq_align &align, TAlignScoreFlags flags=fScore_Default)
Progress monitoring structure.
Interface to retrieve list of available windowmasker filtering.
string ToStdString(const wxString &s)