NCBI C++ ToolKit
blastxml2_format.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: blastxml2_format.hpp 68773 2015-09-01 13:59:06Z fongah2 $
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 offical 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: Ilya Dondoshansky
27 *
28 * ===========================================================================
29 */
30 
31 /// @file: blastxml_format.hpp
32 /// Formatting of pairwise sequence alignments in XML form.
33 
34 #ifndef ALGO_BLAST_FORMAT___BLASTXML2_FORMAT__HPP
35 #define ALGO_BLAST_FORMAT___BLASTXML2_FORMAT__HPP
36 
38 #include <objmgr/scope.hpp>
40 
43 
45 
47 
48 /** @addtogroup BlastFormatting
49  *
50  * @{
51  */
52 
53 /// Interface for filling the top layer of the XML report
55 {
56 public:
57  /// Our virtual destructor
58  virtual ~IBlastXML2ReportData() {}
59  /// Returns BLAST program name as string.
60  virtual string GetBlastProgramName(void) const = 0;
61  /// Returns BLAST task as an enumerated value.
62  virtual blast::EProgram GetBlastTask(void) const = 0;
63  /// Returns database name.
64  virtual string GetDatabaseName(void) const = 0;
65  /// Returns e-value theshold used in search.
66  virtual double GetEvalueThreshold(void) const = 0;
67  /// Returns gap opening cost used in search.
68  virtual int GetGapOpeningCost(void) const = 0;
69  /// Returns gap extension cost used in search.
70  virtual int GetGapExtensionCost(void) const = 0;
71  /// Returns match reward, for blastn search only.
72  virtual int GetMatchReward(void) const = 0;
73  /// Returns mismatch penalty, for blastn search only.
74  virtual int GetMismatchPenalty(void) const = 0;
75  /// Returns pattern string, for PHI BLAST search only.
76  virtual string GetPHIPattern(void) const = 0;
77  /// Returns filtering option string.
78  virtual string GetFilterString(void) const = 0;
79  /// Returns matrix name.
80  virtual string GetMatrixName(void) const = 0;
81  /// Returns a 256x256 ASCII-alphabet matrix, needed for formatting.
82  virtual CBlastFormattingMatrix* GetMatrix(void) const = 0;
84  /// Returns list of mask locations for a given query.
85  virtual const TMaskedQueryRegions & GetMaskLocations() const = 0;
86  /// Returns number of database sequences.
87  virtual Int8 GetDbNumSeqs(void) const = 0;
88  /// Returns database length
89  virtual Int8 GetDbLength(void) const = 0;
90  /// Returns length adjustment for a given query.
91  virtual int GetLengthAdjustment(int num) const = 0;
92  /// Returns effective search space for a given query.
93  virtual Int8 GetEffectiveSearchSpace(int num) const = 0;
94  /// Returns Karlin-Altschul Lambda parameter for a given query.
95  virtual double GetLambda(int num) const = 0;
96  /// Returns Karlin-Altschul K parameter for a given query.
97  virtual double GetKappa(int num) const = 0;
98  /// Returns Karlin-Altschul H parameter for a given query.
99  virtual double GetEntropy(int num) const = 0;
100  /// Returns scope .
101  virtual CRef<objects::CScope> GetScope(void) const = 0;
102  /// Returns a vector continaing set of alignments found for a
103  /// given query
105  ///master genetic code
106  virtual int GetQueryGeneticCode(void) const = 0;
107  ///slave genetic code
108  virtual int GetDbGeneticCode(void) const = 0;
109  /// Get error messages
110  virtual string GetMessages(int num) const = 0;
111 
112  virtual list<string> GetSubjectIds(void) const = 0;
113  virtual bool IsBl2seq(void) const = 0;
114  virtual int GetNumOfSearchResults(void) const = 0;
115  virtual bool CanGetTaxInfo(void) const = 0;
116  virtual bool IsGappedSearch(void) const = 0;
117  virtual int GetCompositionBasedStats(void) const = 0;
118  virtual string GetBl2seqMode(void) const = 0;
119  virtual bool IsIterativeSearch(void) const = 0;
120  virtual string GetEntrezQuery(void) const = 0;
121 
122 };
123 
124 
125 /// Fills all fields in the XML BLAST v2 output object.
126 /// @param bxmlout XML BLAST v2 output object [in] [out]
127 /// @param data Data structure containing all information necessary to
128 /// produce a BLAST XML report.[in]
129 /// @param out_stream output stream [out]
132  CNcbiOstream *out_stream);
133 
136 
138 void BlastXML2_PrintHeader(CNcbiOstream *out_stream);
139 
141 void BlastXML2_FormatError( int exit_code,
142  string err_msg,
143  CNcbiOstream *out_stream);
144 
146 void
148 
150 void
152 
154 void
156 /* @} */
157 
159 
160 #endif /* ALGO_BLAST_FORMAT___BLASTXML2_FORMAT__HPP */
BLAST formatter utilities.
Sequence alignment display tool.
EProgram
This enumeration is to evolve into a task/program specific list that specifies sets of default parame...
Definition: blast_types.hpp:56
256x256 matrix used for calculating positives etc.
Interface for filling the top layer of the XML report.
Collection of masked regions for a single query sequence.
Definition: seqlocinfo.hpp:113
const char * file_name[]
char data[12]
Definition: iconv.c:80
virtual string GetFilterString(void) const =0
Returns filtering option string.
virtual double GetKappa(int num) const =0
Returns Karlin-Altschul K parameter for a given query.
virtual bool IsGappedSearch(void) const =0
virtual string GetMessages(int num) const =0
Get error messages.
virtual int GetNumOfSearchResults(void) const =0
virtual bool CanGetTaxInfo(void) const =0
virtual CConstRef< objects::CSeq_align_set > GetAlignmentSet(int num) const =0
Returns a vector continaing set of alignments found for a given query.
virtual double GetLambda(int num) const =0
Returns Karlin-Altschul Lambda parameter for a given query.
virtual int GetLengthAdjustment(int num) const =0
Returns length adjustment for a given query.
virtual Int8 GetEffectiveSearchSpace(int num) const =0
Returns effective search space for a given query.
void BlastXML2_FormatError(int exit_code, string err_msg, CNcbiOstream *out_stream)
virtual CConstRef< objects::CSeq_loc > GetQuerySeqLoc(void) const =0
virtual int GetDbGeneticCode(void) const =0
slave genetic code
virtual int GetQueryGeneticCode(void) const =0
master genetic code
virtual bool IsBl2seq(void) const =0
virtual CBlastFormattingMatrix * GetMatrix(void) const =0
Returns a 256x256 ASCII-alphabet matrix, needed for formatting.
virtual string GetEntrezQuery(void) const =0
virtual blast::EProgram GetBlastTask(void) const =0
Returns BLAST task as an enumerated value.
virtual int GetCompositionBasedStats(void) const =0
void BlastXML2_FormatReport(const IBlastXML2ReportData *data, CNcbiOstream *out_stream)
Fills all fields in the XML BLAST v2 output object.
virtual Int8 GetDbNumSeqs(void) const =0
Returns number of database sequences.
virtual bool IsIterativeSearch(void) const =0
virtual string GetDatabaseName(void) const =0
Returns database name.
virtual string GetPHIPattern(void) const =0
Returns pattern string, for PHI BLAST search only.
virtual string GetBl2seqMode(void) const =0
virtual list< string > GetSubjectIds(void) const =0
virtual string GetMatrixName(void) const =0
Returns matrix name.
virtual int GetMismatchPenalty(void) const =0
Returns mismatch penalty, for blastn search only.
virtual double GetEvalueThreshold(void) const =0
Returns e-value theshold used in search.
void BlastJSON_FormatReport(const IBlastXML2ReportData *data, string file_name)
virtual int GetGapOpeningCost(void) const =0
Returns gap opening cost used in search.
void BlastXML2_PrintHeader(CNcbiOstream *out_stream)
virtual double GetEntropy(int num) const =0
Returns Karlin-Altschul H parameter for a given query.
virtual int GetMatchReward(void) const =0
Returns match reward, for blastn search only.
virtual const TMaskedQueryRegions & GetMaskLocations() const =0
Returns list of mask locations for a given query.
virtual int GetGapExtensionCost(void) const =0
Returns gap extension cost used in search.
virtual string GetBlastProgramName(void) const =0
Returns BLAST program name as string.
virtual Int8 GetDbLength(void) const =0
Returns database length.
void BlastJSON_PrintHeader(CNcbiOstream *out_stream)
virtual CRef< objects::CScope > GetScope(void) const =0
Returns scope .
virtual ~IBlastXML2ReportData()
Our virtual destructor.
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define NCBI_XBLASTFORMAT_EXPORT
Definition: ncbi_export.h:1073
Modified on Wed May 01 14:24:49 2024 by modify_doxy.py rev. 669887