1 /*  $Id: bed_feature_record.hpp 632624 2021-06-03 17:38:23Z ivanov $
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 bed file
29  *
30  */
31 
32 #ifndef OBJTOOLS_WRITERS___BED_FEATURE_RECORD__HPP
33 #define OBJTOOLS_WRITERS___BED_FEATURE_RECORD__HPP
34 
35 BEGIN_NCBI_SCOPE
36 BEGIN_objects_SCOPE
37 
38 //  ============================================================================
39 /// Encapsulation of the BED feature record. That's columnar data with at least
40 /// three and at most twelve columns. Each column has a fixed, well defined
41 /// meaning, and all records of the same track must have the same number of
42 /// columns.
43 ///
44 class CBedFeatureRecord
45 //  ============================================================================
46 {
47 public:
48     CBedFeatureRecord();
49 
50     ~CBedFeatureRecord();
51 
52     bool AssignLocation(CScope&, const CSeq_interval&);
53     bool AssignDisplayData(const CMappedFeat&, bool);
54     bool AssignName(const CMappedFeat&);
55 
56     bool Write(CNcbiOstream&, unsigned int);
57 
58     bool SetLocation(const CSeq_loc&);
59     bool SetName(const CSeqFeatData&);
60     bool SetScore(int);
61     bool SetThick(const CSeq_loc&);
62     bool SetNoThick(const CSeq_loc&);
63     bool SetRgb(const string&);
64     bool SetBlocks(const CSeq_loc&, const CSeq_loc&);
65 
Chrom() const66     const string& Chrom() const { return m_strChrom; };
ChromStart() const67     const string& ChromStart() const { return m_strChromStart; };
ChromEnd() const68     const string& ChromEnd() const { return m_strChromEnd; };
Name() const69     const string& Name() const { return m_strName; };
Score() const70     const string& Score() const { return m_strScore; };
Strand() const71     const string& Strand() const { return m_strStrand; };
ThickStart() const72     const string& ThickStart() const { return m_strThickStart; };
ThickEnd() const73     const string& ThickEnd() const { return m_strThickEnd; };
ItemRgb() const74     const string& ItemRgb() const { return m_strItemRgb; };
BlockCount() const75     const string& BlockCount() const { return m_strBlockCount; };
BlockSizes() const76     const string& BlockSizes() const { return m_strBlockSizes; };
BlockStarts() const77     const string& BlockStarts() const { return m_strBlockStarts; };
78 
ColumnCount() const79     size_t ColumnCount() const { return m_uColumnCount; };
80 
81 protected:
82     size_t m_uColumnCount;
83     string m_strChrom;
84     string m_strChromStart;
85     string m_strChromEnd;
86     string m_strName;
87     string m_strScore;
88     string m_strStrand;
89     string m_strThickStart;
90     string m_strThickEnd;
91     string m_strItemRgb;
92     string m_strBlockCount;
93     string m_strBlockSizes;
94     string m_strBlockStarts;
95 };
96 
97 END_objects_SCOPE
98 END_NCBI_SCOPE
99 
100 #endif  // OBJTOOLS_WRITERS___BED_FEATURE_RECORD__HPP
101