61 m_QueryId->Assign(*Results.GetSeqId());
62 Insert(*Results.GetSeqAlign());
68 if(Results.Get().empty()) {
69 cerr << __FILE__<<
":"<<__LINE__<<
" : "<<
"Inserting Empty Seq-align-set?"<<endl;
72 m_QueryId->Assign(Results.Get().front()->GetSeq_id(0));
80 cerr << __FILE__<<
":"<<__LINE__<<
" : "<<
"Inserting Null Alignment?"<<endl;
100 if(Results.Get().empty()) {
101 cerr << __FILE__<<
":"<<__LINE__<<
" : "<<
"Inserting Empty Seq-align-set?"<<endl;
106 m_QueryId->Assign(Results.Get().front()->GetSeq_id(0));
114 cerr << __FILE__<<
":"<<__LINE__<<
" : "<<
"Inserting Null Alignment?"<<endl;
131 Out->Set().push_back( *AlignIter );
144 if(!
Out->IsSet() ||
Out->Get().empty())
157 _TRACE(
"Best Rank: " << BestRank
158 <<
" in " << AssemIter->first
159 <<
" for " <<
m_QueryId->GetSeqIdString(
true)
160 <<
" of " << AssemIter->second.size());
168 if(CurrRank == BestRank) {
169 Out->Set().push_back(*AlignIter);
176 if(!
Out->IsSet() ||
Out->Get().empty())
207 Insert(*SubjectIter->second);
229 <<
" tried to be inserted into set for "
253 Seq = SeqList.front();
257 Unit = Seq->GetAssemblyUnit();
259 AssemblyAcc = Unit->GetAccession();
268 if(CurrSubjectSet.find(IdString) == CurrSubjectSet.end()) {
270 CurrSubjectSet[IdString] = AlignSet;
273 CurrSubjectSet[IdString]->
Set().push_back(Alignment);
295 bool NeverRanked =
true;
299 if(!AssemblyAcc.empty() && AssemIter->first != AssemblyAcc) {
307 BestRank =
min(BestRank, CurrRank);
339 if( (*AlignIter)->GetSeqStart(0) == New.
GetSeqStart(0) &&
340 (*AlignIter)->GetSeqStop(0) == New.
GetSeqStop(0) &&
341 (*AlignIter)->GetSeqStart(1) == New.
GetSeqStart(1) &&
342 (*AlignIter)->GetSeqStop(1) == New.
GetSeqStop(1) &&
343 (*AlignIter)->GetSegs().Which() == New.
GetSegs().
Which() &&
344 (*AlignIter)->Equals(New) ) {
346 }
else if( (*AlignIter)->GetSegs().Equals(New.
GetSegs()) ) {
362 Source.
Set().reverse();
364 CSeq_align_set::Tdata::iterator Outer, Inner;
365 for(Outer = Source.
Set().begin(); Outer != Source.
Set().end(); ++Outer) {
367 const CSeq_id& OuterSubjId = (*Outer)->GetSeq_id(1);
369 for(Inner = Outer, ++Inner; Inner != Source.
Set().end(); ) {
371 const CSeq_id& InnerSubjId = (*Inner)->GetSeq_id(1);
372 if(!OuterSubjId.
Equals(InnerSubjId)) {
378 if(IsInnerContained) {
385 Inner = Source.
Set().erase(Inner);
403 bool AccumResults =
false;
409 bool AccumResults =
false;
441 int OuterSegIdx, InnerSegIdx;
443 bool AllMatch =
true;
445 for(InnerSegIdx = 0; InnerSegIdx < InnerSeg.
GetNumseg(); InnerSegIdx++) {
447 bool InnerMatched =
false;
454 for(OuterSegIdx = 0; OuterSegIdx < OuterSeg.
GetNumseg(); OuterSegIdx++) {
526 return Found->second;
539 return Found->second;
551 Out->Set().push_back( *AlignIter );
566 CurrSet = QueryIter->second->ToBestSeqAlignSet();
572 Out->Set().push_back(*AlignIter);
581 string IdString = QuerySet->
GetQueryId()->AsFastaString();
592 !Alignments->
Get().empty()) {
603 Insert(QueryIter->second);
612 string IdString = (*Iter)->GetSeqId()->AsFastaString();
636 if(!AlignSet.
CanGet() || AlignSet.
Get().empty())
Definition of classes which constitute the results of running a BLAST search.
void Insert(CRef< CQuerySet > QuerySet)
void DropQuery(const objects::CSeq_id &Id)
TQueryToSubjectSet m_QueryMap
CRef< CQuerySet > GetQuerySet(const objects::CSeq_id &Id)
bool QueryExists(const objects::CSeq_id &Id) const
CRef< objects::CSeq_align_set > ToBestSeqAlignSet() const
CRef< objects::CGC_Assembly > m_GenColl
CRef< objects::CSeq_align_set > ToSeqAlignSet() const
list< CConstRef< CGC_Sequence > > TSequenceList
bool x_ContainsAlignment(const objects::CSeq_align &Outer, const objects::CSeq_align &Inner) const
int GetBestRank(const string AssemblyAcc="") const
TAssemblyToSubjectSet m_AssemblyMap
CRef< objects::CSeq_align_set > ToSeqAlignSet() const
CRef< objects::CSeq_align_set > ToBestSeqAlignSet() const
bool x_AlreadyContains(const objects::CSeq_align_set &Set, const objects::CSeq_align &New) const
TAssemblyToSubjectSet & Get()
void Insert(CRef< CQuerySet > QuerySet)
CRef< objects::CGC_Assembly > m_GenColl
map< string, CRef< objects::CSeq_align_set > > TSubjectToAlignSet
void x_FilterStrictSubAligns(objects::CSeq_align_set &Source) const
CRef< objects::CSeq_id > m_QueryId
CQuerySet(const blast::CSearchResults &Results)
CConstRef< objects::CSeq_id > GetQueryId() const
Search Results for All Queries.
Search Results for One Query.
CRange< TSeqPos > GetSeqRange(TDim row) const
GetSeqRange NB: On a Spliced-seg, in case the product-type is protein, these only return the amin par...
TSeqPos GetSeqStop(TDim row) const
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
TSeqPos GetSeqStart(TDim row) const
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
static const char * KFILTER_SCORE
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
CConstRef< objects::CSeq_align_set > GetSeqAlign() const
Accessor for the Seq-align results.
CConstRef< objects::CSeq_id > GetSeqId() const
Accessor for the query's sequence identifier.
#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)
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
const string AsFastaString(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
void Reset(void)
Reset reference object.
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
bool IntersectingWith(const TThisType &r) const
TThisType IntersectionWith(const TThisType &r) const
TThisType & SetLength(position_type length)
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
void SetFrom(TFrom value)
Assign a value to From data member.
const TDenseg & GetDenseg(void) const
Get the variant data.
Tdata & Set(void)
Assign a value to data member.
bool CanGet(void) const
Check if it is safe to call Get method.
E_Choice Which(void) const
Which variant is currently selected.
const TStarts & GetStarts(void) const
Get the Starts member data.
const TLens & GetLens(void) const
Get the Lens member data.
bool IsDisc(void) const
Check if variant Disc is selected.
TNumseg GetNumseg(void) const
Get the Numseg member data.
list< CRef< CSeq_align > > Tdata
const TDisc & GetDisc(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
Magic spell ;-) needed for some weird compilers... very empiric.
Defines NCBI C++ exception handling.
void Out(T t, int w, CNcbiOstream &to=cout)