82 ITERATE(vector<TGi>, GiIter, GiList) {
91 ITERATE(vector<TGi>, GiIter, GiList) {
102 "CreateQueryFactory is not supported for type BlastDb");
113 "CreateQueryFactory is not supported for type BlastDb");
124 "CBLastDb::CreateLocalDbAdapter: BlastDb is empty.");
173 int BestRank = QuerySet->GetBestRank();
174 if(BestRank != -1 && BestRank <= Threshold) {
182 GiList.push_back(Gi);
192 unique_ptr<CSeqMasker::TMaskList> Masks, DustMasks;
207 Masks.reset((*SeqMasker)(
Vector));
208 DustMasks = DustMasker(
Vector);
214 if(!DustMasks->empty()) {
215 copy(DustMasks->begin(), DustMasks->end(),
216 insert_iterator<CSeqMasker::TMaskList>(*Masks, Masks->end()));
226 IntLoc.
SetInt().SetId().Assign(Id);
227 IntLoc.
SetInt().SetFrom() = IntIter->first;
228 IntLoc.
SetInt().SetTo() = IntIter->second;
229 MaskLoc->
Add(IntLoc);
245 cerr <<
"s_GetClipLoc: Could not get Handle for " <<
MSerial_AsnText << Id << endl;
259 AnnotIter->
GetName() ==
"NCBI_GPIPE") {
283 if( (*AnnotIter)->GetData().IsLocs() ) {
285 LocIter, (*AnnotIter)->GetData().GetLocs()) {
286 if( (*LocIter)->IsInt() &&
287 (*LocIter)->GetInt().GetId().Equals(Id) ) {
289 ClipLoc->
Assign(**LocIter);
306 cerr <<
"s_GetUngapLoc: Could not get Handle for " <<
MSerial_AsnText << Id << endl;
314 if(!
Handle.IsSetInst_Ext()) {
342 IntLoc.
SetInt().SetId().Assign(Id);
343 IntLoc.
SetInt().SetFrom() = Curr;
344 IntLoc.
SetInt().SetTo() = Curr + Length - 1;
345 UngapLoc->
Add(IntLoc);
365 "CSeqIdListSet::CreateQueryFactory: Id List is empty.");
376 WholeLoc->
SetWhole().Assign(**IdIter);
380 SSeqLoc WholeSLoc(*WholeLoc, Scope);
381 FastaLocVec.push_back(WholeSLoc);
387 SSeqLoc WholeSLoc(*WholeLoc, Scope);
388 FastaLocVec.push_back(WholeSLoc);
390 SSeqLoc MaskSLoc(*WholeLoc, Scope, *MaskLoc);
391 FastaLocVec.push_back(MaskSLoc);
397 if(!FastaLocVec.empty())
410 "CSeqIdListSet::CreateQueryFactory: Id List is empty.");
418 int BestRank = QuerySet->GetBestRank();
419 if(BestRank != -1 && BestRank <= Threshold) {
424 _TRACE(
"Blast Including ID: " << (*IdIter)->GetSeqIdString(
true));
432 WholeLoc->
SetWhole().Assign(**IdIter);
437 SSeqLoc WholeSLoc(*WholeLoc, Scope);
438 FastaLocVec.push_back(WholeSLoc);
444 SSeqLoc WholeSLoc(*WholeLoc, Scope);
445 FastaLocVec.push_back(WholeSLoc);
447 SSeqLoc MaskSLoc(*WholeLoc, Scope, *MaskLoc);
448 FastaLocVec.push_back(MaskSLoc);
454 if(!FastaLocVec.empty())
467 "CSeqIdListSet::CreateLocalDbAdapter: Id List is empty.");
502 const CSeq_id* Id = (*LocIter)->GetId();
509 int BestRank = QuerySet->GetBestRank();
510 if(BestRank != -1 && BestRank <= Threshold) {
520 GiList.push_back(Gi);
532 "CSeqLocListSet::CreateQueryFactory: Loc List is empty.");
537 const CSeq_id* Id = (*LocIter)->GetId();
544 BaseLoc->Assign(**LocIter);
556 SSeqLoc BaseSLoc(*BaseLoc, Scope);
557 FastaLocVec.push_back(BaseSLoc);
563 SSeqLoc BaseSLoc(*BaseLoc, Scope);
564 FastaLocVec.push_back(BaseSLoc);
566 SSeqLoc MaskSLoc(*BaseLoc, Scope, *MaskLoc);
567 FastaLocVec.push_back(MaskSLoc);
573 if(!FastaLocVec.empty())
586 "CSeqLocListSet::CreateQueryFactory: Loc List is empty.");
591 const CSeq_id* Id = (*LocIter)->GetId();
597 int BestRank = QuerySet->GetBestRank();
598 if(BestRank != -1 && BestRank <= Threshold) {
607 BaseLoc->
Assign(**LocIter);
619 SSeqLoc BaseSLoc(*BaseLoc, Scope);
620 FastaLocVec.push_back(BaseSLoc);
626 SSeqLoc BaseSLoc(*BaseLoc, Scope);
627 FastaLocVec.push_back(BaseSLoc);
629 SSeqLoc MaskSLoc(*BaseLoc, Scope, *MaskLoc);
630 FastaLocVec.push_back(MaskSLoc);
637 if(!FastaLocVec.empty())
649 "CSeqLocListSet::CreateLocalDbAdapter: Loc List is empty.");
662 : m_FastaStream(FastaStream), m_LowerCaseMasking(
true),
663 m_Start(-1), m_Count(-1)
670 : m_FastaStream(FastaStream), m_LowerCaseMasking(
true),
671 m_Start(Start), m_Count(Count)
689 "CFastaFileSet::CreateQueryFactory: Fasta Stream is NULL.");
700 InputConfig.SetBelieveDeflines(
true);
728 "CFastaFileSet::CreateQueryFactory: Fasta Stream is NULL.");
736 bool PreExisting =
false;
737 if(
Entry->IsSet() &&
Entry->GetSet().GetSeq_set().front()->GetSeq().GetFirstId() !=
NULL) {
738 const CSeq_id& Id = *
Entry->GetSet().GetSeq_set().front()->GetSeq().GetFirstId();
746 ERR_POST(
Info <<
"Eating the Scope Fasta Dup Insert Exception");
751 InputConfig.SetBelieveDeflines(
true);
763 TSeqLocVector::iterator Curr;
764 for(Curr = FastaLocVec.begin(); Curr != FastaLocVec.end(); ) {
767 Curr = FastaLocVec.erase(Curr);
772 Curr = FastaLocVec.erase(Curr);
786 TSeqLocVector::iterator Curr;
787 for(Curr = FastaLocVec.begin(); Curr != FastaLocVec.end(); ) {
788 if(Alignments.
QueryExists(*Curr->seqloc->GetId())) {
790 int BestRank = QuerySet->GetBestRank();
791 if(BestRank != -1 && BestRank <= Threshold) {
792 Curr = FastaLocVec.erase(Curr);
803 if(FastaLocVec.empty())
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CRef< CSeq_loc > s_GetMaskLoc(const CSeq_id &Id, CSeqMasker *SeqMasker, CScope &Scope)
CRef< CSeq_loc > s_GetClipLoc(const CSeq_id &Id, CScope &Scope)
CRef< CSeq_loc > s_GetUngapLoc(const CSeq_id &Id, CScope &Scope)
Data loader implementation that uses the blast databases.
Declares the CBl2Seq (BLAST 2 Sequences) class.
Declares the CBlastNucleotideOptionsHandle class.
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
Declares CBlastScopeSource class to create properly configured CScope objects to invoke the BLAST dat...
Definitions of special type used in BLAST.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
@ eBlastn
Nucl-Nucl (traditional blastn)
CRef< CQuerySet > GetQuerySet(const objects::CSeq_id &Id)
bool QueryExists(const objects::CSeq_id &Id) const
void SetPositiveGiList(const vector< TGi > &GiList)
CRef< CInputGiList > m_PositiveGiList
CRef< blast::CLocalDbAdapter > CreateLocalDbAdapter(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
CRef< CInputGiList > m_NegativeGiList
CRef< blast::IQueryFactory > CreateQueryFactory(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
void SetNegativeGiList(const vector< TGi > &GiList)
Handle to the options to the BLAST algorithm.
CFastaFileSet(CNcbiIstream *FastaStream)
void EnableLowerCaseMasking(bool LowerCaseMasking)
CRef< blast::CLocalDbAdapter > CreateLocalDbAdapter(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
CRef< blast::IQueryFactory > CreateQueryFactory(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
CNcbiIstream * m_FastaStream
Base class for reading FASTA sequences.
Interface to create a BlastSeqSrc suitable for use in CORE BLAST from a a variety of BLAST database/s...
NCBI C++ Object Manager dependant implementation of IQueryFactory.
bool NotEmpty() const
Return true if there are elements present.
list< CRef< objects::CSeq_id > > & SetIdList()
CRef< blast::IQueryFactory > CreateQueryFactory(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
CRef< blast::CLocalDbAdapter > CreateLocalDbAdapter(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
list< CRef< objects::CSeq_id > > m_SeqIdList
void GetGiList(vector< TGi > &GiList, objects::CScope &Scope, const CAlignResultsSet &Alignments, int Threshold)
void SetSeqMasker(CSeqMasker *SeqMasker)
CRef< blast::IQueryFactory > CreateQueryFactory(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
list< CRef< objects::CSeq_loc > > m_SeqLocList
void SetSeqMasker(CSeqMasker *SeqMasker)
list< CRef< objects::CSeq_loc > > & SetLocList()
CRef< blast::CLocalDbAdapter > CreateLocalDbAdapter(objects::CScope &Scope, const blast::CBlastOptionsHandle &BlastOpts)
void GetGiList(vector< TGi > &GiList, objects::CScope &Scope, const CAlignResultsSet &Alignments, int Threshold)
Main interface to window based masker functionality.
vector< TMaskedInterval > TMaskList
A type representing the total of masking information about a sequence.
TSeqPos GetLength(void) const
Looks for low complexity parts of sequences according to the symmetric version of DUST algorithm.
Declares the CDiscNucleotideOptionsHandle class.
Operators to edit gaps in sequences.
void SetNegativeGiList(CSeqDBGiList *gilist)
Mutator for the negative gi list.
void SetFilteringAlgorithm(int filt_algorithm_id)
Temporary fix for backwards compatibility with other 6.0 SCs.
char * GetFilterString() const
Returns FilterString.
void SetGiList(CSeqDBGiList *gilist)
Mutator for the gi list.
@ eBlastDbIsNucleotide
nucleotide
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
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.
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
void Info(CExceptionArgs_Base &args)
#define MSerial_AsnText
I/O stream manipulators –.
const string AsFastaString(void) const
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
void ChangeToPackedInt(void)
Works only if location is currently an interval, point, packed-int (handled trivially),...
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
void Add(const CSeq_loc &other)
Simple adding of seq-locs.
CRef< CSeq_loc > Intersect(const CSeq_loc &other, TOpFlags flags, ISynonymMapper *syn_mapper) const
Find the intersection with the seq-loc, merge/sort resulting ranges depending on flags.
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
TGi GetGiForId(const objects::CSeq_id &id, CScope &scope, EGetIdType flags=0)
Given a Seq-id retrieve the corresponding GI.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
bool IsFtable(void) const
CConstRef< CSeq_annot > GetCompleteSeq_annot(void) const
Complete and return const reference to the current seq-annot.
const string & GetName(void) const
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
const TRegion & GetRegion(void) const
Get the variant data.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
bool CanGetData(void) const
Check if it is safe to call GetData method.
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
bool IsRegion(void) const
Check if variant Region is selected.
@ e_Region
named region (globin locus)
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
const TLiteral & GetLiteral(void) const
Get the variant data.
const TAnnot & GetAnnot(void) const
Get the Annot member data.
bool IsLoc(void) const
Check if variant Loc is selected.
TLength GetLength(void) const
Get the Length member data.
bool IsDelta(void) const
Check if variant Delta is selected.
bool IsSetLength(void) const
must give a length in residues Check if a value has been assigned to Length data member.
list< CRef< CSeq_loc > > TLocs
const TDelta & GetDelta(void) const
Get the variant data.
const TLoc & GetLoc(void) const
Get the variant data.
const TFtable & GetFtable(void) const
Get the variant data.
list< CRef< CSeq_feat > > TFtable
const Tdata & Get(void) const
Get the member data.
const TData & GetData(void) const
Get the Data member data.
bool IsLiteral(void) const
Check if variant Literal is selected.
list< CRef< CSeq_annot > > TAnnot
list< CRef< CDelta_seq > > Tdata
Magic spell ;-) needed for some weird compilers... very empiric.
Defines NCBI C++ exception handling.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Defines exception class and several constants for SeqDB.
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Configuration structure for the CBlastScopeSource.
Structure to represent a single sequence to be fed to BLAST.