NCBI C++ ToolKit
result_set.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: result_set.cpp 72271 2016-04-27 16:55:47Z boukn $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Nathan Bouk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 #include <corelib/ncbiexpt.hpp>
34 #include <math.h>
35 
38 #include <objmgr/scope.hpp>
39 
42 
46 
48 
51 
52 
55 USING_SCOPE(blast);
56 
57 
59 {
60  m_QueryId.Reset(new CSeq_id);
61  m_QueryId->Assign(*Results.GetSeqId());
62  Insert(*Results.GetSeqAlign());
63 }
64 
65 
66 CQuerySet::CQuerySet(const objects::CSeq_align_set& Results)
67 {
68  if(Results.Get().empty()) {
69  cerr << __FILE__<<":"<<__LINE__<<" : "<<"Inserting Empty Seq-align-set?"<<endl;
70  }
71  m_QueryId.Reset(new CSeq_id);
72  m_QueryId->Assign(Results.Get().front()->GetSeq_id(0));
73  Insert(Results);
74 }
75 
76 
78 {
79  if(Alignment.IsNull()) {
80  cerr << __FILE__<<":"<<__LINE__<<" : "<<"Inserting Null Alignment?"<<endl;
81  }
82  m_QueryId.Reset(new CSeq_id);
83  m_QueryId->Assign(Alignment->GetSeq_id(0));
84  Insert(Alignment);
85 }
86 
87 
88 CQuerySet::CQuerySet(const CSearchResults& Results, CRef<CGC_Assembly> GenColl, bool AllowDupes)
89 {
90  m_AllowDupes = AllowDupes;
91  m_GenColl = GenColl;
92  m_QueryId.Reset(new CSeq_id);
93  m_QueryId->Assign(*Results.GetSeqId());
94  Insert(*Results.GetSeqAlign());
95 }
96 
97 
98 CQuerySet::CQuerySet(const objects::CSeq_align_set& Results, CRef<CGC_Assembly> GenColl, bool AllowDupes)
99 {
100  if(Results.Get().empty()) {
101  cerr << __FILE__<<":"<<__LINE__<<" : "<<"Inserting Empty Seq-align-set?"<<endl;
102  }
103  m_AllowDupes = AllowDupes;
104  m_GenColl = GenColl;
105  m_QueryId.Reset(new CSeq_id);
106  m_QueryId->Assign(Results.Get().front()->GetSeq_id(0));
107  Insert(Results);
108 }
109 
110 
111 CQuerySet::CQuerySet(const CRef<CSeq_align> Alignment, CRef<CGC_Assembly> GenColl, bool AllowDupes)
112 {
113  if(Alignment.IsNull()) {
114  cerr << __FILE__<<":"<<__LINE__<<" : "<<"Inserting Null Alignment?"<<endl;
115  }
116  m_AllowDupes = AllowDupes;
117  m_GenColl = GenColl;
118  m_QueryId.Reset(new CSeq_id);
119  m_QueryId->Assign(Alignment->GetSeq_id(0));
120  Insert(Alignment);
121 }
122 
123 
125 {
127 
129  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, AssemIter->second) {
130  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
131  Out->Set().push_back( *AlignIter );
132  }
133  }
134  }
135 
136  /*
137  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, m_SubjectMap) {
138  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
139  Out->Set().push_back( *AlignIter );
140  }
141  }
142  */
143 
144  if(!Out->IsSet() || Out->Get().empty())
145  return CRef<CSeq_align_set>();
146 
147  return Out;
148 }
149 
150 
152 {
154 
156  int BestRank = GetBestRank( AssemIter->first );
157  _TRACE("Best Rank: " << BestRank
158  << " in " << AssemIter->first
159  << " for " << m_QueryId->GetSeqIdString(true)
160  << " of " << AssemIter->second.size());
161  if(BestRank == -1) {
162  continue;
163  }
164  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, AssemIter->second) {
165  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
166  int CurrRank;
167  if((*AlignIter)->GetNamedScore(IAlignmentFilter::KFILTER_SCORE, CurrRank)) {
168  if(CurrRank == BestRank) {
169  Out->Set().push_back(*AlignIter);
170  }
171  }
172  }
173  }
174  }
175 
176  if(!Out->IsSet() || Out->Get().empty())
177  return CRef<CSeq_align_set>();
178 
179  /*
180  int BestRank = GetBestRank();
181  _TRACE("Best Rank: " << BestRank << " for " << m_QueryId->GetSeqIdString(true));
182  if(BestRank == -1) {
183  return CRef<CSeq_align_set>();
184  }
185  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, m_SubjectMap) {
186  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
187  int CurrRank;
188  if((*AlignIter)->GetNamedScore(IAlignmentFilter::KFILTER_SCORE, CurrRank)) {
189  if(CurrRank == BestRank) {
190  Out->Set().push_back(*AlignIter);
191  }
192  }
193  }
194  }
195  */
196 
198 
199  return Out;
200 }
201 
202 
204 {
205  ITERATE(TAssemblyToSubjectSet, AssemIter, QuerySet->Get()) {
206  ITERATE(TSubjectToAlignSet, SubjectIter, AssemIter->second) {
207  Insert(*SubjectIter->second);
208  }
209  }
210  /*ITERATE(TSubjectToAlignSet, SubjectIter, QuerySet->Get()) {
211  Insert(*SubjectIter->second);
212  }*/
213 }
214 
215 
216 void CQuerySet::Insert(const objects::CSeq_align_set& AlignSet)
217 {
218  ITERATE(CSeq_align_set::Tdata, Iter, AlignSet.Get()) {
219  Insert(*Iter);
220  }
221 }
222 
223 
224 void CQuerySet::Insert(const CRef<CSeq_align> Alignment)
225 {
226  if(!Alignment->GetSeq_id(0).Equals(*m_QueryId)) {
227  // Error, Throw?
228  ERR_POST(Error << "Id " << Alignment->GetSeq_id(0).AsFastaString()
229  << " tried to be inserted into set for "
230  << m_QueryId->AsFastaString());
231  return;
232  }
233 
234  // do not allow self-alignments into the result set
235  if(!m_AllowDupes) {
236  if(Alignment->GetSeq_id(0).Equals(Alignment->GetSeq_id(1)) &&
237  Alignment->GetSeqStart(0) == Alignment->GetSeqStart(1) &&
238  Alignment->GetSeqStop(0) == Alignment->GetSeqStop(1) &&
239  Alignment->GetSeqStrand(0) == Alignment->GetSeqStrand(1)) {
240  return;
241  }
242  }
243 
244 
245  CSeq_id_Handle IdHandle = CSeq_id_Handle::GetHandle(Alignment->GetSeq_id(1));
246  string AssemblyAcc;
247 //cerr << __FILE__<<":"<<__LINE__<<endl;
248  if(m_GenColl) {
251  m_GenColl->Find(IdHandle, SeqList);
252  if(!SeqList.empty())
253  Seq = SeqList.front();
254  //Seq = m_GenColl->Find(IdHandle);
255  if(Seq) {
257  Unit = Seq->GetAssemblyUnit();
258  if(Unit) {
259  AssemblyAcc = Unit->GetAccession();
260  }
261  }
262  }
263 //cerr << __FILE__<<":"<<__LINE__<<endl;
264 
265  string IdString = Alignment->GetSeq_id(1).AsFastaString();
266  TSubjectToAlignSet& CurrSubjectSet = m_AssemblyMap[AssemblyAcc];
267 
268  if(CurrSubjectSet.find(IdString) == CurrSubjectSet.end()) {
269  CRef<CSeq_align_set> AlignSet(new CSeq_align_set);
270  CurrSubjectSet[IdString] = AlignSet;
271  }
272  if(!x_AlreadyContains(*CurrSubjectSet[IdString], *Alignment)) {
273  CurrSubjectSet[IdString]->Set().push_back(Alignment);
274  } else {
275  //ERR_POST(Info << "Dupe Inserted");
276  }
277 
278  /*
279  if(m_SubjectMap.find(IdString) == m_SubjectMap.end()) {
280  CRef<CSeq_align_set> AlignSet(new CSeq_align_set);
281  m_SubjectMap[IdString] = AlignSet;
282  }
283  if(!x_AlreadyContains(*m_SubjectMap[IdString], *Alignment)) {
284  m_SubjectMap[IdString]->Set().push_back(Alignment);
285  } else {
286  //ERR_POST(Info << "Dupe Inserted");
287  }
288  */
289 }
290 
291 
292 int CQuerySet::GetBestRank(const string AssemblyAcc) const
293 {
294  int BestRank = numeric_limits<int>::max();
295  bool NeverRanked = true;
296 
298 
299  if(!AssemblyAcc.empty() && AssemIter->first != AssemblyAcc) {
300  continue;
301  }
302 
303  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, AssemIter->second) {
304  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
305  int CurrRank;
306  if((*AlignIter)->GetNamedScore(IAlignmentFilter::KFILTER_SCORE, CurrRank)) {
307  BestRank = min(BestRank, CurrRank);
308  NeverRanked = false;
309  }
310  }
311  }
312  }
313 
314  /*
315  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, m_SubjectMap) {
316  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
317  int CurrRank;
318  if((*AlignIter)->GetNamedScore(IAlignmentFilter::KFILTER_SCORE, CurrRank)) {
319  BestRank = min(BestRank, CurrRank);
320  NeverRanked = false;
321  }
322  }
323  }
324  */
325 
326  if(NeverRanked)
327  return -1;
328 
329  return BestRank;
330 }
331 
332 
333 bool CQuerySet::x_AlreadyContains(const CSeq_align_set& Set, const CSeq_align& New) const
334 {
335  if(m_AllowDupes)
336  return false;
337 
338  ITERATE(CSeq_align_set::Tdata, AlignIter, Set.Get()) {
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) ) {
345  return true;
346  } else if( (*AlignIter)->GetSegs().Equals(New.GetSegs()) ) {
347  return true;
348  }
349  }
350 
351  return false;
352 }
353 
354 
356 {
357  if(m_AllowDupes)
358  return;
359 
360 // Later alignments are likely to contain earlier alignments. But the iterators
361 // and erase() function only want to work one way. So we reverse the list
362  Source.Set().reverse();
363 
364  CSeq_align_set::Tdata::iterator Outer, Inner;
365  for(Outer = Source.Set().begin(); Outer != Source.Set().end(); ++Outer) {
366 
367  const CSeq_id& OuterSubjId = (*Outer)->GetSeq_id(1);
368 
369  for(Inner = Outer, ++Inner; Inner != Source.Set().end(); ) {
370 
371  const CSeq_id& InnerSubjId = (*Inner)->GetSeq_id(1);
372  if(!OuterSubjId.Equals(InnerSubjId)) {
373  ++Inner;
374  continue;
375  }
376 
377  bool IsInnerContained = x_ContainsAlignment(**Outer, **Inner);
378  if(IsInnerContained) {
379  //ERR_POST(Info << "Filtering Strict Sub Alignment");
380  //int OI, II;
381  //(*Outer)->GetNamedScore("num_ident", OI);
382  //(*Inner)->GetNamedScore("num_ident", II);
383  //ERR_POST(Info << (*Outer)->GetSegs().Which() << " : " << (*Inner)->GetSegs().Which() );
384  //ERR_POST(Info << OI << " : " << II );
385  Inner = Source.Set().erase(Inner);
386  }
387  else {
388  ++Inner;
389  }
390  } // end Inner
391  } // end Outer
392 }
393 
394 
396  const CSeq_align& Inner) const
397 {
398  if(m_AllowDupes)
399  return false;
400 
401  // Recurse over any Disc alignments
402  if(Outer.GetSegs().IsDisc()) {
403  bool AccumResults = false;
404  ITERATE(CSeq_align_set::Tdata, AlignIter, Outer.GetSegs().GetDisc().Get()) {
405  AccumResults |= x_ContainsAlignment(**AlignIter, Inner);
406  }
407  return AccumResults;
408  } else if(Inner.GetSegs().IsDisc()) {
409  bool AccumResults = false;
410  ITERATE(CSeq_align_set::Tdata, AlignIter, Inner.GetSegs().GetDisc().Get()) {
411  AccumResults |= x_ContainsAlignment(Outer, **AlignIter);
412  }
413  return AccumResults;
414  }
415 
416  CRange<TSeqPos> InQueryRange, InSubjRange;
417  CRange<TSeqPos> OutQueryRange, OutSubjRange;
418 
419  InQueryRange = Inner.GetSeqRange(0);
420  InSubjRange = Inner.GetSeqRange(1);
421  OutQueryRange = Outer.GetSeqRange(0);
422  OutSubjRange = Outer.GetSeqRange(1);
423 
424  // Overly simple check, of just the alignments edges, without care for the segments inside
425  /*if(OutQueryRange.IntersectionWith(InQueryRange).GetLength() == InQueryRange.GetLength() &&
426  OutSubjRange.IntersectionWith(InSubjRange).GetLength() == InSubjRange.GetLength()) {
427  return true;
428  } else {
429  return false;
430  }*/
431 
432  // if they dont intersect at all, we bail early.
433  if(!OutQueryRange.IntersectingWith(InQueryRange) ||
434  !OutSubjRange.IntersectingWith(InSubjRange)) {
435  return false;
436  }
437 
438  const CDense_seg& OuterSeg = Outer.GetSegs().GetDenseg();
439  const CDense_seg& InnerSeg = Inner.GetSegs().GetDenseg();
440 
441  int OuterSegIdx, InnerSegIdx;
442 
443  bool AllMatch = true;
444 
445  for(InnerSegIdx = 0; InnerSegIdx < InnerSeg.GetNumseg(); InnerSegIdx++) {
446 
447  bool InnerMatched = false;
448 
449  InQueryRange.SetFrom(InnerSeg.GetStarts()[InnerSegIdx*2]);
450  InQueryRange.SetLength(InnerSeg.GetLens()[InnerSegIdx]);
451  InSubjRange.SetFrom(InnerSeg.GetStarts()[(InnerSegIdx*2)+1]);
452  InSubjRange.SetLength(InnerSeg.GetLens()[InnerSegIdx]);
453 
454  for(OuterSegIdx = 0; OuterSegIdx < OuterSeg.GetNumseg(); OuterSegIdx++) {
455 
456  OutQueryRange.SetFrom(OuterSeg.GetStarts()[OuterSegIdx*2]);
457  OutQueryRange.SetLength(OuterSeg.GetLens()[OuterSegIdx]);
458  OutSubjRange.SetFrom(OuterSeg.GetStarts()[(OuterSegIdx*2)+1]);
459  OutSubjRange.SetLength(OuterSeg.GetLens()[OuterSegIdx]);
460 
461  // If the Outer segments are >= the Inner segments
462  if(OutQueryRange.IntersectionWith(InQueryRange) == InQueryRange &&
463  OutSubjRange.IntersectionWith(InSubjRange) == InSubjRange ) {
464  InnerMatched = true;
465  break;
466  }
467  }
468 
469  if(!InnerMatched) {
470  AllMatch = false;
471  break;
472  }
473  }
474 
475  return AllMatch;
476 }
477 
478 
479 ////////////////////////////////////////////////////////////////////////////////
480 
482 {
483 }
484 
485 
487 {
488  m_AllowDupes = AllowDupes;
489 }
490 
491 
493 {
494  m_GenColl = Gencoll;
495 
496  m_AllowDupes = AllowDupes;
497 }
498 
499 CAlignResultsSet::CAlignResultsSet(const blast::CSearchResultSet& BlastResults)
500 {
501  //m_AllowDupes = false;
502  Insert(BlastResults);
503 }
504 
505 
507 {
508  string IdString = Id.AsFastaString();
510  Found = m_QueryMap.find(IdString);
511  if(Found == m_QueryMap.end()) {
512  return false;
513  }
514  return true;
515 }
516 
517 
519 {
520  string IdString = Id.AsFastaString();
522  Found = m_QueryMap.find(IdString);
523  if(Found == m_QueryMap.end()) {
524  return CRef<CQuerySet>();
525  }
526  return Found->second;
527 }
528 
529 
530 
532 {
533  string IdString = Id.AsFastaString();
535  Found = m_QueryMap.find(IdString);
536  if(Found == m_QueryMap.end()) {
537  return CRef<CQuerySet>();
538  }
539  return Found->second;
540 }
541 
542 
544 {
546  ITERATE(TQueryToSubjectSet, QueryIter, m_QueryMap) {
547 
548  ITERATE(CQuerySet::TAssemblyToSubjectSet, AssemIter, QueryIter->second->Get()) {
549  ITERATE(CQuerySet::TSubjectToAlignSet, SubjectIter, AssemIter->second) {
550  ITERATE(CSeq_align_set::Tdata, AlignIter, SubjectIter->second->Get()) {
551  Out->Set().push_back( *AlignIter );
552  }
553  }
554  }
555  }
556  return Out;
557 }
558 
559 
561 {
563  ITERATE(TQueryToSubjectSet, QueryIter, m_QueryMap) {
564 
565  CRef<CSeq_align_set> CurrSet;
566  CurrSet = QueryIter->second->ToBestSeqAlignSet();
567 
568  if(CurrSet.IsNull())
569  continue;
570 
571  ITERATE(CSeq_align_set::Tdata, AlignIter, CurrSet->Get()) {
572  Out->Set().push_back(*AlignIter);
573  }
574  }
575  return Out;
576 }
577 
578 
580 {
581  string IdString = QuerySet->GetQueryId()->AsFastaString();
582  if(m_QueryMap.find(IdString) != m_QueryMap.end()) {
583  m_QueryMap[IdString]->Insert(QuerySet);
584  } else {
585  // this might only work by magic
586  //m_QueryMap[IdString] = QuerySet;
587  // Make a new Query Set, with the proper GenColl
588  CRef<CSeq_align_set> Alignments;
589  Alignments = QuerySet->ToSeqAlignSet();
590  if (Alignments &&
591  Alignments->CanGet() &&
592  !Alignments->Get().empty()) {
593  CRef<CQuerySet> Set(new CQuerySet(*Alignments, m_GenColl, m_AllowDupes));
594  m_QueryMap[IdString] = Set;
595  }
596  }
597 }
598 
599 
601 {
602  ITERATE(TQueryToSubjectSet, QueryIter, AlignSet->Get()) {
603  Insert(QueryIter->second);
604  }
605 }
606 
607 
608 void CAlignResultsSet::Insert(const blast::CSearchResultSet& BlastResults)
609 {
610  ITERATE(CSearchResultSet, Iter, BlastResults) {
611  CRef<CQuerySet> Set(new CQuerySet(**Iter, m_GenColl, m_AllowDupes));
612  string IdString = (*Iter)->GetSeqId()->AsFastaString();
613  if(m_QueryMap.find(IdString) != m_QueryMap.end()) {
614  m_QueryMap[IdString]->Insert(Set);
615  } else {
616  m_QueryMap[IdString] = Set;
617  }
618  }
619 }
620 
621 
623 {
624  string IdString = Alignment->GetSeq_id(0).AsFastaString();
625  if(m_QueryMap.find(IdString) != m_QueryMap.end()) {
626  m_QueryMap[IdString]->Insert(Alignment);
627  } else {
628  CRef<CQuerySet> Set(new CQuerySet(Alignment, m_GenColl, m_AllowDupes));
629  m_QueryMap[IdString] = Set;
630  }
631 }
632 
633 
634 void CAlignResultsSet::Insert(const CSeq_align_set& AlignSet)
635 {
636  if(!AlignSet.CanGet() || AlignSet.Get().empty())
637  return;
638 
639  ITERATE(CSeq_align_set::Tdata, AlignIter, AlignSet.Get()) {
640  Insert(*AlignIter);
641  }
642 }
643 
644 
646 {
647  string IdString = Id.AsFastaString();
648  TQueryToSubjectSet::iterator Found = m_QueryMap.find(IdString);
649  if(Found != m_QueryMap.end()) {
650  m_QueryMap.erase(Found);
651  }
652 }
653 
654 
655 
656 
658 
Definition of classes which constitute the results of running a BLAST search.
void Insert(CRef< CQuerySet > QuerySet)
Definition: result_set.cpp:579
void DropQuery(const objects::CSeq_id &Id)
Definition: result_set.cpp:645
TQueryToSubjectSet m_QueryMap
Definition: result_set.hpp:158
CRef< CQuerySet > GetQuerySet(const objects::CSeq_id &Id)
bool QueryExists(const objects::CSeq_id &Id) const
Definition: result_set.cpp:506
CRef< objects::CSeq_align_set > ToBestSeqAlignSet() const
Definition: result_set.cpp:560
CRef< objects::CGC_Assembly > m_GenColl
Definition: result_set.hpp:160
CRef< objects::CSeq_align_set > ToSeqAlignSet() const
Definition: result_set.cpp:543
CConstRef –.
Definition: ncbiobj.hpp:1266
list< CConstRef< CGC_Sequence > > TSequenceList
Definition: GC_Assembly.hpp:67
bool x_ContainsAlignment(const objects::CSeq_align &Outer, const objects::CSeq_align &Inner) const
Definition: result_set.cpp:395
bool m_AllowDupes
Definition: result_set.hpp:106
int GetBestRank(const string AssemblyAcc="") const
Definition: result_set.cpp:292
TAssemblyToSubjectSet m_AssemblyMap
Definition: result_set.hpp:108
CRef< objects::CSeq_align_set > ToSeqAlignSet() const
Definition: result_set.cpp:124
CRef< objects::CSeq_align_set > ToBestSeqAlignSet() const
Definition: result_set.cpp:151
bool x_AlreadyContains(const objects::CSeq_align_set &Set, const objects::CSeq_align &New) const
Definition: result_set.cpp:333
TAssemblyToSubjectSet & Get()
Definition: result_set.hpp:82
void Insert(CRef< CQuerySet > QuerySet)
Definition: result_set.cpp:203
CRef< objects::CGC_Assembly > m_GenColl
Definition: result_set.hpp:105
map< string, CRef< objects::CSeq_align_set > > TSubjectToAlignSet
Definition: result_set.hpp:69
void x_FilterStrictSubAligns(objects::CSeq_align_set &Source) const
Definition: result_set.cpp:355
CRef< objects::CSeq_id > m_QueryId
Definition: result_set.hpp:103
CQuerySet(const blast::CSearchResults &Results)
CConstRef< objects::CSeq_id > GetQueryId() const
Definition: result_set.hpp:91
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...
Definition: Seq_align.cpp:153
TSeqPos GetSeqStop(TDim row) const
Definition: Seq_align.cpp:273
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
Definition: Seq_align.cpp:317
TSeqPos GetSeqStart(TDim row) const
Definition: Seq_align.cpp:252
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
Definition: Seq_align.cpp:294
static const char * KFILTER_SCORE
void erase(iterator pos)
Definition: map.hpp:167
const_iterator end() const
Definition: map.hpp:152
const_iterator find(const key_type &key) const
Definition: map.hpp:153
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.
Definition: ncbimisc.hpp:815
#define _TRACE(message)
Definition: ncbidbg.hpp:122
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
const string AsFastaString(void) const
Definition: Seq_id.cpp:2266
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.
Definition: ncbiobj.hpp:773
bool IsNull(void) const THROWS_NONE
Check if pointer is null – same effect as Empty().
Definition: ncbiobj.hpp:735
bool IntersectingWith(const TThisType &r) const
Definition: range.hpp:331
TThisType IntersectionWith(const TThisType &r) const
Definition: range.hpp:312
TThisType & SetLength(position_type length)
Definition: range.hpp:194
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
void SetFrom(TFrom value)
Assign a value to From data member.
Definition: Range_.hpp:231
const TDenseg & GetDenseg(void) const
Get the variant data.
Definition: Seq_align_.cpp:153
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.
Definition: Seq_align_.hpp:691
const TStarts & GetStarts(void) const
Get the Starts member data.
Definition: Dense_seg_.hpp:530
const TLens & GetLens(void) const
Get the Lens member data.
Definition: Dense_seg_.hpp:555
bool IsDisc(void) const
Check if variant Disc is selected.
Definition: Seq_align_.hpp:772
TNumseg GetNumseg(void) const
Get the Numseg member data.
Definition: Dense_seg_.hpp:465
list< CRef< CSeq_align > > Tdata
const TDisc & GetDisc(void) const
Get the variant data.
Definition: Seq_align_.cpp:197
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
Definition: Seq_align_.hpp:921
Magic spell ;-) needed for some weird compilers... very empiric.
Defines NCBI C++ exception handling.
T max(T x_, T y_)
T min(T x_, T y_)
void Out(T t, int w, CNcbiOstream &to=cout)
Definition: parse.cpp:467
USING_SCOPE(objects)
#define const
Definition: zconf.h:232
Modified on Sat May 18 11:36:26 2024 by modify_doxy.py rev. 669887