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

Go to the SVN repository for this file.

1 /* ===========================================================================
2  *
3  * PUBLIC DOMAIN NOTICE
4  * National Center for Biotechnology Information
5  *
6  * This software/database is a "United States Government Work" under the
7  * terms of the United States Copyright Act. It was written as part of
8  * the author's official duties as a United States Government employee and
9  * thus cannot be copyrighted. This software/database is freely available
10  * to the public for use. The National Library of Medicine and the U.S.
11  * Government have not placed any restriction on its use or reproduction.
12  *
13  * Although all reasonable efforts have been taken to ensure the accuracy
14  * and reliability of the software and data, the NLM and the U.S.
15  * Government do not and cannot warrant the performance or results that
16  * may be obtained by using this software or data. The NLM and the U.S.
17  * Government disclaim all warranties, express or implied, including
18  * warranties of performance, merchantability or fitness for any particular
19  * purpose.
20  *
21  * Please cite the author in any work or product based on this material.
22  *
23  * ===========================================================================
24  *
25  * Author: Christiam Camacho
26  *
27  */
28 
29 /** @file psibl2seq.cpp
30  * Implementation of CPsiBl2Seq.
31  */
32 
33 #include <ncbi_pch.hpp>
35 #include "psiblast_impl.hpp"
39 
40 /** @addtogroup AlgoBlast
41  *
42  * @{
43  */
44 
47 BEGIN_SCOPE(blast)
48 
52 {
53  x_InitSubject(subject, options.GetPointer());
54  m_Impl = new CPsiBlastImpl(pssm, m_Subject, options);
55 }
56 
60 {
62  m_Impl = new CPsiBlastImpl(pssm, m_Subject, options);
63 }
64 
68 {
69  x_InitSubject(subject, options.GetPointer());
70  m_Impl = new CPsiBlastImpl(query, m_Subject, options);
71 }
72 
73 void
75  const CBlastOptionsHandle* options)
76 {
77  if ( !options ) {
78  NCBI_THROW(CBlastException, eInvalidArgument, "Missing options");
79  }
80  CConstRef<CBlastOptionsHandle> opts_handle(options);
81  m_Subject.Reset(new CLocalDbAdapter(subject, opts_handle));
82 }
83 
85 {
86  if (m_Impl) {
87  delete m_Impl;
88  }
89 }
90 
93 {
95  return m_Impl->Run();
96 }
97 
98 END_SCOPE(blast)
100 
101 /* @} */
User-defined methods of the data storage class.
@ eSequenceComparison
Seq-aligns in the BLAST 2 Sequence style (one alignment per query-subject pair)
Defines BLAST error codes (user errors included)
Handle to the options to the BLAST algorithm.
CConstRef –.
Definition: ncbiobj.hpp:1266
Interface to create a BlastSeqSrc suitable for use in CORE BLAST from a a variety of BLAST database/s...
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
Implementation class for PSI-BLAST (database search and 2 sequences).
CRef –.
Definition: ncbiobj.hpp:618
Source of query sequence data for BLAST Provides an interface for search classes to retrieve sequence...
Definition: query_data.hpp:147
CRef< CLocalDbAdapter > m_Subject
Reference to a BLAST subject/database object.
Definition: psibl2seq.hpp:116
class CPsiBlastImpl * m_Impl
Implementation class.
Definition: psibl2seq.hpp:119
void SetResultType(EResultType type)
Set the desired result type.
CPsiBl2Seq(CRef< objects::CPssmWithParameters > pssm, CRef< IQueryFactory > subject, CConstRef< CPSIBlastOptionsHandle > options)
Constructor to compare a PSSM against protein sequences.
Definition: psibl2seq.cpp:49
~CPsiBl2Seq()
Destructor.
Definition: psibl2seq.cpp:84
CRef< CSearchResultSet > Run()
Run the PSI-BLAST 2 Sequences engine.
Definition: psibl2seq.cpp:92
void x_InitSubject(CRef< IQueryFactory > subject, const CBlastOptionsHandle *options)
Auxiliary method to initialize the subject.
Definition: psibl2seq.cpp:74
CRef< CSearchResultSet > Run()
Run the PSI-BLAST engine for one iteration.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
TObjectType * GetPointer(void) const THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:1684
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define USING_SCOPE(ns)
Use the specified namespace.
Definition: ncbistl.hpp:78
#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
Declares CPsiBl2Seq, the C++ API for the PSI-BLAST 2 Sequences engine.
Defines implementation class for PSI-BLAST and PSI-BLAST 2 Sequences.
Declares the CPSIBlastOptionsHandle class.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
static string subject
static string query
Modified on Wed Apr 17 13:10:08 2024 by modify_doxy.py rev. 669887