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

Go to the SVN repository for this file.

1 /* $Id: cuBlast2Seq.cpp 51593 2011-10-17 14:21:18Z lanczyck $
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: Charlie Liu
27  *
28  * File Description:
29  *
30  * Functions to call C++ BLAST
31  *
32  * ===========================================================================
33  */
34 
35 #include <ncbi_pch.hpp>
36 #include <vector>
37 #include <string>
38 #include <list>
39 
40 #include <objects/seq/Bioseq.hpp>
46 //#include <algo/blast/api/bl2seq.hpp>
60 //#include <objtools/simple/simple_om.hpp>
61 
65 #include <objects/seq/NCBIeaa.hpp>
68 
70 BEGIN_SCOPE(cd_utils)
71 
72 const int CdBlaster::CDD_DATABASE_SIZE = 1000000;
74 const double CdBlaster::E_VAL_WHEN_NO_SEQ_ALIGN = 1000000; // eval when Blast doesn't return a seq-align
75 const double CdBlaster::SCORE_WHEN_NO_SEQ_ALIGN = -1;
77 const long CdBlaster::DEFAULT_NR_SIZE = 1196146007;
78 const int CdBlaster::DEFAULT_NR_SEQNUM = 3479934;
79 
81 : m_ac(&source), m_queryRows(0), m_subjectRows(0), m_seqs(0), m_scoringMatrix(matrixName), m_useWhole(false),
82 m_scoreType(CSeq_align::eScore_Score), m_psiTargetCd(0)
83 {
84  //m_offsets.assign(m_ac->GetNumRows(), 0);
85  m_batchSizes.assign(m_ac->GetNumRows(), 0);
86  m_nExt = m_cExt = 0;
89 }
90 
91 CdBlaster::CdBlaster(vector< CRef<CBioseq> >& seqs, string matrixName)
92 : m_ac(0), m_seqs(&seqs), m_scoringMatrix(matrixName), m_useWhole(false), m_psiTargetCd(0)
93 {
94  //m_offsets.assign(seqs.size(), 0);
95  m_batchSizes.assign(seqs.size(), 0);
96  m_nExt = m_cExt = 0;
99 }
100 
102 {
103  m_useWhole = whole;
104 }
105 
106 void CdBlaster::setFootprintExtension(int nExt, int cExt)
107 {
108  m_nExt = nExt;
109  m_cExt = cExt;
110  m_useWhole = false;
111 }
112 
113 //to do psi-blast
115 {
116  m_psiTargetPssm = pssm;
117 }
118 
120 {
121  m_psiTargetCd = targetCD;
122  cd_utils::PssmMaker pm(targetCD,true,true); // 2rd param is useConsensus. generally "true".
123  cd_utils::PssmMakerOptions config;
124  config.requestFrequencyRatios = true;
125  config.matrixName = m_scoringMatrix;
126  pm.setOptions(config);
127  m_psiTargetPssm = pm.make();
128  return(m_psiTargetPssm);
129 }
130 
132 {
133  int nrows = 0;
134  int numBlastsDone = 0;
135  int totalBlasts = 0;
136  CRef< CBioseq > bioseqRef;
137  if (m_queryRows && m_subjectRows)
138  {
139  nrows = m_queryRows->size() + m_subjectRows->size();
140  totalBlasts = m_queryRows->size() * m_subjectRows->size();
141  for (unsigned int q = 0; q < m_queryRows->size(); q++)
142  {
143  if (m_useWhole)
144  {
145  m_ac->GetBioseqForRow((*m_queryRows)[q], bioseqRef);
146  m_truncatedBioseqs.push_back(bioseqRef);
147  }
148  else
150  }
151  for (unsigned int s = 0; s < m_subjectRows->size(); s++)
152  {
153  if (m_useWhole)
154  {
155  m_ac->GetBioseqForRow((*m_subjectRows)[s], bioseqRef);
156  m_truncatedBioseqs.push_back(bioseqRef);
157  }
158  else
160  }
161  }
162  else
163  {
164  nrows = m_ac->GetNumRows();
165  for (int i = 0; i < nrows; i++)
166  {
167  if (m_useWhole)
168  {
169  m_ac->GetBioseqForRow(i, bioseqRef);
170  m_truncatedBioseqs.push_back(bioseqRef);
171  }
172  m_truncatedBioseqs.push_back(truncateBioseq(i));
173  }
174  totalBlasts = (int)((double)nrows * (((double)nrows-1)/2));
175  }
176 
178  options->SetEvalueThreshold(10.0);
179  //options->SetPercentIdentity(10.0);
180  options->SetMatrixName(m_scoringMatrix.c_str());
181  options->SetSegFiltering(false);
182  options->SetDbLength(CDD_DATABASE_SIZE);
183  options->SetHitlistSize(nrows);
184  options->SetDbSeqNum(1);
187 
188  CRef< CSeq_align > nullRef;
189  m_scores.reserve(totalBlasts);
190 
191  // use objmgr interface
194  CScope scope(*objmgr);
195 
196  int numQueries = 0;
197  if (m_queryRows)
198  numQueries = m_queryRows->size();
199  else
200  numQueries = nrows-1;
201 
202  bool result = true;
203  CSeq_loc querySeqLoc, subjectSeqLoc;
204  for (int qr = 0; qr < numQueries; qr++)
205  {
206  CBlastQueryVector queryVector, subjectVector;
207  scope.ResetDataAndHistory();
208 
209  // Set up the QueryFactory for the query sequence
210  scope.AddBioseq(*m_truncatedBioseqs[qr]);
211  if (FillOutSeqLoc(m_truncatedBioseqs[qr], querySeqLoc)) {
212  CRef<CBlastSearchQuery> bsqQuery(new CBlastSearchQuery(querySeqLoc, scope));
213  queryVector.AddQuery(bsqQuery);
214  } else {
215  result = false;
216  m_batchSizes[qr] = 0;
217  continue;
218  }
220 
221 /*
222  CRef< CBioseq > queryBioseq = m_truncatedBioseqs[qr];
223  CRef<IQueryFactory> query(new CObjMgrFree_QueryFactory(queryBioseq));
224 
225  CRef< CBioseq_set > bioseqset(new CBioseq_set);
226  list< CRef< CSeq_entry > >& seqEntryList = bioseqset->SetSeq_set();
227 */
228  int subStart = qr +1;
229  int batchSize = (nrows -1) - (qr + 1) + 1;
230  if (m_queryRows)
231  {
232  subStart = m_queryRows->size();
233  batchSize = m_subjectRows->size();
234  }
235  //loop for subject rows
236  for (int sr = subStart; sr < nrows; sr++)
237  {
238 /*
239  CRef< CSeq_entry > seqEntry(new CSeq_entry);
240  seqEntry->SetSeq(*m_truncatedBioseqs[sr]);
241  seqEntryList.push_back(seqEntry);
242  comIndex++;
243 */
244 
245  scope.AddBioseq(*m_truncatedBioseqs[sr]);
246  // Set up the QueryFactory for the subject sequences
247  if (FillOutSeqLoc(m_truncatedBioseqs[sr], subjectSeqLoc)) {
248  CRef<CBlastSearchQuery> bsqSubject(new CBlastSearchQuery(subjectSeqLoc, scope));
249  subjectVector.AddQuery(bsqSubject);
250  }
251  }
252 
253  assert((unsigned)batchSize == subjectVector.Size());
254  m_batchSizes[qr] = subjectVector.Size(); // in case there was a problem w/ FillOutSeqLoc above, use the actual size submitted instead of batchSize
255 
256 // CRef<IQueryFactory> subject(new CObjMgrFree_QueryFactory(bioseqset));
258  CPsiBl2Seq blaster(query,subject,blastOptions);
259  CSearchResultSet& hits = *blaster.Run();
260  numBlastsDone += batchSize; // don't use subjectVector.Size() so notifier(...) works normally even if FillOutSeqLoc failed above
261  if (notifier)
262  notifier(numBlastsDone, totalBlasts);
263  processBlastHits(qr, hits);
264  }
265  return result;
266 }
267 
269 {
270  //debug
272  int nrows = 0;
273  if (m_ac)
274  nrows = m_ac->GetNumRows();
275  else
276  nrows= m_seqs->size();
277 
279  options->SetMatrixName(m_scoringMatrix.c_str());
280  options->SetDbLength(m_dbSize);
281  options->SetDbSeqNum(m_dbSeqNum);
282  options->SetHitlistSize(nrows);
284  options->SetSegFiltering(false);
286  //options->SetEffectiveSearchSpace(27608309120);
287  // debugging
288 // options->SetCompositionBasedStatsMode(true);
289 
290  // use objmgr interface
293  CScope scope(*objmgr);
294  CBlastQueryVector subjectVector;
295 
296 /*
297  CRef< CBioseq_set > bioseqset(new CBioseq_set);
298  list< CRef< CSeq_entry > >& seqEntryList = bioseqset->SetSeq_set();
299 */
300  CSeq_loc subjectSeqLoc;
301  for (int sr = 0; sr < nrows; sr++)
302  {
304  scope.AddBioseq(*bs);
305  // Set up the QueryFactory for the subject sequences
306  if (FillOutSeqLoc(bs, subjectSeqLoc)) {
307  CRef<CBlastSearchQuery> bsqSubject(new CBlastSearchQuery(subjectSeqLoc, scope));
308  subjectVector.AddQuery(bsqSubject);
309  }
310 /*
311  // use footprint
312 
313  CRef< CSeq_entry > seqEntry(new CSeq_entry);
314  seqEntry->SetSeq(*truncateBioseq(sr));
315  seqEntryList.push_back(seqEntry);
316 */
317  // use whole sequence
318  /*
319  CRef< CSeq_entry > seqEntry;
320  if (m_ac->GetSeqEntryForRow(sr, seqEntry))
321  seqEntryList.push_back(seqEntry);
322  else
323  bool wrong = true;
324  */
325  }
327 // CRef<IQueryFactory> subject(new CObjMgrFree_QueryFactory(bioseqset));
328 
329  CPsiBl2Seq blaster(m_psiTargetPssm, subject, options);
330  CRef<CSearchResultSet> hits = blaster.Run();
331  unsigned int index, total = hits->GetNumResults();
332  for (index = 0; index < total; ++index)
333  {
334  const list< CRef< CSeq_align > >& seqAlignList = (*hits)[index].GetSeqAlign()->Get();
335  if (seqAlignList.empty())
336  m_alignments.push_back(CRef< CSeq_align>());
337  else
338  m_alignments.push_back(*(seqAlignList.begin()));
339  }
340  assert (m_alignments.size() == (unsigned) nrows);
341  return m_alignments.size();
342 }
343 
345 {
346  return m_alignments[getCompositeIndex(row1, row2)];
347 }
348 
349 double CdBlaster::getPairwiseScore(int row1, int row2)
350 {
351  return(m_scores[getCompositeIndex(row1, row2)]);
352 }
353 
354 double CdBlaster::getPairwiseEValue(int row1, int row2)
355 {
356  return(m_evals[getCompositeIndex(row1, row2)]);
357 }
358 
360 {
361  double score = SCORE_WHEN_NO_SEQ_ALIGN;
363  if (!sa.Empty())
364  {
365  sa->GetNamedScore("score", score);
366  }
367  return score;
368 }
369 
371 {
372  double evalue = E_VAL_WHEN_NO_SEQ_ALIGN;
374  if (!sa.Empty())
375  {
376  sa->GetNamedScore("e_value", evalue);
377  }
378  return evalue;
379 }
380 
382 {
383  return m_alignments[row];
384 }
385 
387 {
388  CRef<CBioseq> bioseq;
389  int len = 0;
390  int from = 0;
391  int to = 0;
392 
393  if (m_ac)
394  {
395  if (!m_ac->GetBioseqForRow(row, bioseq))
396  return bioseq;
397  from = m_ac->GetLowerBound(row);
398  to = m_ac->GetUpperBound(row);
399  }
400  else if (m_seqs)
401  {
402  bioseq = (*m_seqs)[row];
403  if (bioseq.Empty())
404  return bioseq;
405  from = 0;
406  to = bioseq->GetInst().GetLength() - 1;
407  if (bioseq->IsSetAnnot())
408  {
409  const list< CRef< CSeq_annot > >& annots = bioseq->GetAnnot();
410  for (list< CRef< CSeq_annot > >::const_iterator cit = annots.begin(); cit != annots.end(); cit++)
411  {
412  if ((*cit)->IsSetData())
413  {
414  if ((*cit)->GetData().IsLocs())
415  {
416  const list< CRef< CSeq_loc > >& locs = (*cit)->GetData().GetLocs();
417  if (locs.size() > 0)
418  {
419  CRef< CSeq_loc > seqLoc = *locs.begin();
420  if (seqLoc->IsInt())
421  {
422  from = seqLoc->GetInt().GetFrom();
423  to = seqLoc->GetInt().GetTo();
424  }
425  }
426  }
427  }
428  }
429  }
430 
431  }
432  len = bioseq->GetInst().GetLength();
433  if(m_useWhole)
434  return bioseq;
435  CRef<CBioseq> tbioseq(new CBioseq);
436  tbioseq->Assign(*bioseq);
437 
438  string seqData;
439  GetNcbieaaString(*bioseq, seqData);
440  ApplyEndShiftToRange(from, m_nExt, to, m_cExt, len);
441  //m_offsets[row] = from; //keep this for using to remap seq-align later.
442  tbioseq->SetInst().SetLength(to - from + 1);
443  CNCBIeaa tr(seqData.substr(from, to - from + 1));
444  tbioseq->SetInst().SetSeq_data().SetNcbieaa(tr);
445  return tbioseq;
446 }
447 
449 {
450  double score, idScore;
451  int seqLen = m_truncatedBioseqs[queryRow]->GetInst().GetLength();
452  int nhits = hits.GetNumResults();
453  assert (nhits == m_batchSizes[queryRow]);
454  for (int i = 0; i < nhits; i++)
455  {
456  score = 0.0;
457  const list< CRef< CSeq_align > >& seqAlignList = hits[i].GetSeqAlign()->Get();
458  if (seqAlignList.size() > 0)
459  {
460  CRef< CSeq_align > sa = ExtractFirstSeqAlign(*(seqAlignList.begin()));
461  if (!sa.Empty()) {
463  {
464  idScore = 0.0;
466  if (seqLen != 0) {
467  score = 100*idScore/seqLen;
468  }
469  }
470  else
471  sa->GetNamedScore(m_scoreType, score);
472  }
473  }
474  m_scores.push_back(score);
475  }
476 }
477 
479 {
480  //make sure query < subject, otherwise swap
481  int comp = -1;
482  if (m_queryRows == 0)
483  {
484  int realQuery = query;
485  int realSubject = subject;
486  if (query > subject)
487  {
488  realQuery = subject;
489  realSubject = query;
490  }
491  int nrows = m_ac->GetNumRows();
492  int totalBeforeQuery = (nrows - 1 + nrows - realQuery)*realQuery/2;
493  comp = totalBeforeQuery + (realSubject - realQuery - 1);
494  }
495  else
496  {
497  comp = query * m_subjectRows->size() + subject;
498  }
499  return comp;
500 }
501 
502 // A couple functions to manage extensions at end of aligned range
503 bool CdBlaster::IsFootprintValid(int from, int to, int len) {
504 
505  // The positions on a sequence are offsets from start of sequence and hence
506  // run from [0, length-1]. See Bioseq section of C Toolkit docs.
507  bool result = false;
508  if (from < 0 || to < 0 || len <=0) return result;
509  if (from <= to && to < len && (to - from + 1 >= 0)) {
510  result = true;
511  }
512  return result;
513 }
514 
515 void CdBlaster::ApplyEndShiftToRange(int& from, int nTermShift, int& to, int cTermShift, int len)
516 {
517 
518  // Shift ends of range by indicated amounts: positive values extend, and negative
519  // values shorten.
520  // A full sequence is indicated if from = to = 0, or from = 0 and to = len - 1,
521  // and in this case it should be negative. For a footprint, the positive shift extends
522  // the footprint defined by [from, to] by the shift or to the end, whichever is closer.
523  // If on shortening, the shifts cause a crossing of from/to values, revert to using
524  // the zero shifts.
525 
526  if (nTermShift == 0 && cTermShift == 0) {
527  return;
528  }
529 // nTermShift = (nTermShift < 0) ? -nTermShift : nTermShift;
530 // cTermShift = (cTermShift < 0) ? -cTermShift : cTermShift;
531 
532  // truncate full sequence; if shifts aren't negative, set them to zero.
533  if (from == 0 && (to == 0 || to == len - 1)) {
534  nTermShift = (nTermShift < 0) ? nTermShift : 0;
535  cTermShift = (cTermShift < 0) ? cTermShift : 0;
536  if (-nTermShift < len - 1 + cTermShift ) {
537  from = -nTermShift;
538  to += cTermShift;
539  } else {
540  from = 0;
541  to = len - 1;
542  }
543 
544  } else { // extend or shrink footprint
545  if (nTermShift >= 0) {
546  from = (nTermShift <= from) ? from - nTermShift : 0;
547  } else {
548  from = (-nTermShift < to - 1 + cTermShift) ? from - nTermShift : from;
549  }
550  if (cTermShift >= 0) {
551  to = (cTermShift <= len - 1 - to) ? to + cTermShift : len - 1;
552  } else {
553  to = (-cTermShift <= to - from - 1 + nTermShift) ? to + cTermShift : to;
554  }
555  }
556 
557 }
558 
560 {
561  bool result = true;
562  CSeq_interval& seqInt = seqLoc.SetInt();
563  CSeq_id& seqId = seqInt.SetId();
564  seqInt.SetFrom(0);
565 
566  // Assign the first identifier from the bioseq
567  if (bs.NotEmpty() && bs->GetFirstId() != 0) {
568  seqInt.SetTo(bs->GetLength() - 1);
569  seqId.Assign(*(bs->GetFirstId()));
570  } else {
571  result = false;
572  }
573 
574  return result;
575 }
576 
578  int i = 1;
581  om->GetRegisteredNames(loader_names);
582  ITERATE(CObjectManager::TRegisteredNames, itr, loader_names) {
583  om->RevokeDataLoader(*itr);
584  ++i;
585  }
586 }
587 
588 
589 END_SCOPE(cd_utils)
591 
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.
Declares the CBlastAdvancedProteinOptionsHandle class.
Declares the CBlastProteinOptionsHandle class.
User-defined methods of the data storage class.
bool GetBioseqForRow(int rowId, CRef< CBioseq > &bioseq)
int GetLowerBound(int row) const
int GetUpperBound(int row) const
const CSeq_id * GetFirstId() const
Definition: Bioseq.cpp:271
TSeqPos GetLength(void) const
Definition: Bioseq.cpp:360
Handle to the Advanced BLASTP options.
Handle to the protein-protein options to the BLAST algorithm.
Query Vector.
Definition: sseqloc.hpp:276
void AddQuery(CRef< CBlastSearchQuery > q)
Add a query to the set.
Definition: sseqloc.hpp:293
size_type Size() const
Returns the number of queries found in this query vector.
Definition: sseqloc.hpp:305
Search Query.
Definition: sseqloc.hpp:147
CNCBIeaa –.
Definition: NCBIeaa.hpp:66
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Handle to the protein-protein options to the BLAST algorithm.
Runs a single iteration of the PSI-BLAST algorithm between 2 sequences.
Definition: psibl2seq.hpp:58
CScope –.
Definition: scope.hpp:92
Search Results for All Queries.
@ eScore_IdentityCount
Definition: Seq_align.hpp:145
@ eScore_PercentIdentity
Definition: Seq_align.hpp:189
bool GetNamedScore(const string &id, int &score) const
Get score.
Definition: Seq_align.cpp:563
bool IsFootprintValid(int from, int to, int len)
void useWholeSequence(bool whole)
int getCompositeIndex(int query, int subject)
CRef< CSeq_align > getPsiBlastAlignement(int row)
bool FillOutSeqLoc(const CRef< CBioseq > &bs, CSeq_loc &seqLoc)
CRef< CPssmWithParameters > m_psiTargetPssm
int psiBlast()
double getPairwiseScore(int row1, int row2)
void RemoveAllDataLoaders()
const vector< int > * m_subjectRows
vector< double > m_scores
void processBlastHits(int queryRow, CSearchResultSet &hits)
vector< CRef< CSeq_align > > m_alignments
CRef< CBioseq > truncateBioseq(int row)
static const double E_VAL_WHEN_NO_SEQ_ALIGN
Definition: cuBlast2Seq.hpp:56
static const int DEFAULT_NR_SEQNUM
Definition: cuBlast2Seq.hpp:60
vector< CRef< CBioseq > > * m_seqs
static const double BLAST_SCALING_FACTOR_DEFAULT
Definition: cuBlast2Seq.hpp:55
long m_dbSize
Definition: cuBlast2Seq.hpp:98
CdBlaster(AlignmentCollection &source, string matrixName=SCORING_MATRIX_DEFAULT)
Definition: cuBlast2Seq.cpp:80
bool m_useWhole
CRef< CSeq_align > getPairwiseBlastAlignement(int row1, int row2)
static const string SCORING_MATRIX_DEFAULT
Definition: cuBlast2Seq.hpp:58
void ApplyEndShiftToRange(int &from, int nTermShift, int &to, int cTermShift, int len)
vector< double > m_evals
CCdCore * m_psiTargetCd
const vector< int > * m_queryRows
double getPairwiseEValue(int row1, int row2)
vector< int > m_batchSizes
static const long DEFAULT_NR_SIZE
Definition: cuBlast2Seq.hpp:59
vector< CRef< CBioseq > > m_truncatedBioseqs
static const double SCORE_WHEN_NO_SEQ_ALIGN
Definition: cuBlast2Seq.hpp:57
string m_scoringMatrix
bool blast(NotifierFunction notifier=0)
double getPsiBlastScore(int row)
static const int CDD_DATABASE_SIZE
Definition: cuBlast2Seq.hpp:54
int m_dbSeqNum
Definition: cuBlast2Seq.hpp:99
void setFootprintExtension(int nExt, int CExt)
CSeq_align::EScoreType m_scoreType
void setPsiBlastTarget(CRef< CPssmWithParameters > pssm)
AlignmentCollection * m_ac
double getPsiBlastEValue(int row)
@ eCompositionBasedStats
Composition-based statistics as in NAR 29:2994-3005, 2001.
@ eNoCompositionBasedStats
Don't use composition based statistics.
struct config config
CRef< CSeq_align > ExtractFirstSeqAlign(CRef< CSeq_align > seqAlign)
Definition: cuAlign.cpp:683
void(* NotifierFunction)(int Num, int Total)
Definition: cuBlast2Seq.hpp:49
#define BLOSUM62NAME
bool GetNcbieaaString(const CBioseq &bioseq, string &str)
Definition: cuSequence.cpp:298
#define false
Definition: bool.h:36
void SetEvalueThreshold(double eval)
Sets EvalueThreshold.
void SetDbLength(Int8 len)
Sets DbLength.
void SetDbSeqNum(unsigned int num)
Sets DbSeqNum.
void SetCompositionBasedStats(ECompoAdjustModes mode)
Sets this mode, which mostly specifies whether composition of db sequence is taken into account when ...
void SetHitlistSize(int s)
Sets HitlistSize.
CRef< CSearchResultSet > Run()
Run the PSI-BLAST 2 Sequences engine.
Definition: psibl2seq.cpp:92
void SetMatrixName(const char *matrix)
Sets MatrixName.
void SetPseudoCount(int p)
Sets PseudoCount.
void SetSegFiltering(bool val)
Enable SEG filtering.
size_type GetNumResults() const
Return the number of results contained by this object.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
void SetInt(TInt &v)
Definition: Seq_loc.hpp:983
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
Definition: scope.cpp:530
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
vector< string > TRegisteredNames
void ResetDataAndHistory(void)
Clear all information in the scope except added data loaders.
Definition: scope.cpp:331
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
Definition: ncbiobj.hpp:719
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
TPseudocount GetPseudocount(void) const
Get the Pseudocount member data.
const TParams & GetParams(void) const
Get the Params member data.
void SetTo(TTo value)
Assign a value to To data member.
void SetId(TId &value)
Assign a value to Id data member.
TFrom GetFrom(void) const
Get the From member data.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
bool IsInt(void) const
Check if variant Int is selected.
Definition: Seq_loc_.hpp:528
const TInt & GetInt(void) const
Get the variant data.
Definition: Seq_loc_.cpp:194
const TInst & GetInst(void) const
Get the Inst member data.
Definition: Bioseq_.hpp:336
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
Definition: Bioseq_.hpp:354
const TAnnot & GetAnnot(void) const
Get the Annot member data.
Definition: Bioseq_.hpp:366
TLength GetLength(void) const
Get the Length member data.
Definition: Seq_inst_.hpp:659
void SetInst(TInst &value)
Assign a value to Inst data member.
Definition: Bioseq_.cpp:86
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is whole
int i
int len
const CharType(& source)[N]
Definition: pointer.h:1149
The Object manager core.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Declares the CPSIBlastOptionsHandle class.
CRef< objects::CObjectManager > om
#define assert(x)
Definition: srv_diag.hpp:58
#define row(bind, expected)
Definition: string_bind.c:73
static string subject
static string query
else result
Definition: token2.c:20
Modified on Sun Apr 14 05:24:37 2024 by modify_doxy.py rev. 669887