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

Go to the SVN repository for this file.

1 /* $Id: vcf_writer.hpp 93574 2021-04-30 16:19:19Z stakhovv $
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  * Authors: Frank Ludwig
27  *
28  * File Description: Write vcf file
29  *
30  */
31 
32 #ifndef OBJTOOLS_WRITERS___VCF_WRITER__HPP
33 #define OBJTOOLS_WRITERS___VCF_WRITER__HPP
34 
37 
39 BEGIN_objects_SCOPE
40 
41 
42 // ============================================================================
44  public CWriterBase, public CFeatWriter
45 // ============================================================================
46 {
47 public:
48  typedef enum {
49  fNormal = 0,
50  } TFlags;
51 
52 public:
53  CVcfWriter(
54  CScope&,
55  CNcbiOstream&,
56  TFlags = fNormal );
57 
58  virtual ~CVcfWriter();
59 
60  bool WriteAnnot(
61  const CSeq_annot&,
62  const string& = "",
63  const string& = "" ) override;
64 
65  virtual SAnnotSelector& SetAnnotSelector(void) override;
66 
67 protected:
68  void x_GetTypeRefAlt(const CVariation_inst &inst, int &rtype, string &ref, list<int>& alt_types, vector<string> &alt);
69 
70  bool x_WriteInit(
71  const CSeq_annot& );
72  bool x_WriteMeta(
73  const CSeq_annot& );
74  bool x_WriteHeader(
75  const CSeq_annot& );
76  bool x_WriteData(
77  const CSeq_annot& );
78 
79  bool x_WriteMetaCreateNew(
80  const CSeq_annot& );
81 
82  bool xWriteFeature(
83  CFeat_CI feat_it) override;
84 
85  bool x_WriteFeature(
86  const CMappedFeat& );
87 
88  bool x_WriteFeatureChrom(
89  const CMappedFeat& );
90 
91  bool x_WriteFeaturePos(
92  const CMappedFeat&,
93  unsigned int start,
94  const int type
95  );
96 
97  bool x_WriteFeatureId(
98  const CMappedFeat& );
99 
100  bool x_WriteFeatureRef(
101  const unsigned int start,
102  const int type,
103  const string &anchor,
104  const string &ref
105  );
106 
107  bool x_WriteFeatureAlt(
108  const unsigned int start,
109  const int type,
110  const string &anchor,
111  const list<int>& alt_types,
112  const vector<string> &alt
113  );
114 
115  bool x_WriteFeatureQual(
116  const CMappedFeat&);
117 
118  bool x_WriteFeatureFilter(
119  const CMappedFeat& );
120 
121  bool x_WriteFeatureInfo(
122  const CMappedFeat& );
123 
124  bool x_WriteFeatureGenotypeData(
125  const CMappedFeat& );
126 
128  vector<string> m_GenotypeHeaders;
129 };
130 
131 END_objects_SCOPE
133 
134 #endif // OBJTOOLS_WRITERS___VCF_WRITER__HPP
User-defined methods of the data storage class.
virtual bool xWriteFeature(CFeat_CI)
Definition: writer.hpp:278
CFeat_CI –.
Definition: feat_ci.hpp:64
CMappedFeat –.
Definition: mapped_feat.hpp:59
CScope –.
Definition: scope.hpp:92
CVariation_inst –.
vector< string > m_GenotypeHeaders
Definition: vcf_writer.hpp:128
CScope & m_Scope
Definition: vcf_writer.hpp:127
Defines and provides stubs for a general interface to a variety of file formatters.
Definition: writer.hpp:81
virtual bool WriteAnnot(const CSeq_annot &, const string &="", const string &="")
Write a raw Seq-annot to the internal output stream.
Definition: writer.hpp:116
TFlags
Customization flags that are relevant to all CWriterBase derived writers.
Definition: writer.hpp:85
virtual SAnnotSelector & SetAnnotSelector(void)
Definition: writer.hpp:246
#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_XOBJWRITE_EXPORT
Definition: ncbi_export.h:1347
SAnnotSelector –.
Definition: type.c:6
Modified on Fri Sep 20 14:57:31 2024 by modify_doxy.py rev. 669887