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 */
26 
27 #ifndef _inl_ngs_reference_
28 #define _inl_ngs_reference_
29 
30 #ifndef _hpp_ngs_reference_
31 #include <ngs/Reference.hpp>
32 #endif
33 
34 #ifndef _hpp_ngs_itf_referenceitf_
35 #include <ngs/itf/ReferenceItf.hpp>
36 #endif
37 
38 namespace ngs
39 {
40 
41     /*----------------------------------------------------------------------
42      * Reference
43      */
44 
45     inline
getCommonName() const46     String Reference :: getCommonName () const
47         NGS_THROWS ( ErrorMsg )
48     { return StringRef ( self -> getCommonName () ) . toString (); }
49 
50     inline
getCanonicalName() const51     String Reference :: getCanonicalName () const
52         NGS_THROWS ( ErrorMsg )
53     { return StringRef ( self -> getCanonicalName () ) . toString (); }
54 
55     inline
getIsCircular() const56     bool Reference :: getIsCircular () const
57         NGS_THROWS ( ErrorMsg )
58     { return self -> getIsCircular (); }
59 
60     inline
getIsLocal() const61     bool Reference :: getIsLocal () const
62         NGS_THROWS ( ErrorMsg )
63     { return self -> getIsLocal (); }
64 
65     inline
getLength() const66     uint64_t Reference :: getLength () const
67         NGS_THROWS ( ErrorMsg )
68     { return self -> getLength (); }
69 
70     inline
getReferenceBases(uint64_t offset) const71     String Reference :: getReferenceBases ( uint64_t offset ) const
72         NGS_THROWS ( ErrorMsg )
73     { return StringRef ( self -> getReferenceBases ( offset ) ) . toString (); }
74 
75     inline
getReferenceBases(uint64_t offset,uint64_t length) const76     String Reference :: getReferenceBases ( uint64_t offset, uint64_t length ) const
77         NGS_THROWS ( ErrorMsg )
78     { return StringRef ( self -> getReferenceBases ( offset, length ) ) . toString (); }
79 
80     inline
getReferenceChunk(uint64_t offset) const81     StringRef Reference :: getReferenceChunk ( uint64_t offset ) const
82         NGS_THROWS ( ErrorMsg )
83     { return StringRef ( self -> getReferenceChunk ( offset ) ); }
84 
85     inline
getReferenceChunk(uint64_t offset,uint64_t length) const86     StringRef Reference :: getReferenceChunk ( uint64_t offset, uint64_t length ) const
87         NGS_THROWS ( ErrorMsg )
88     { return StringRef ( self -> getReferenceChunk ( offset, length ) ); }
89 
90     inline
getAlignmentCount() const91     uint64_t Reference :: getAlignmentCount () const
92         NGS_THROWS ( ErrorMsg )
93     { return self -> getAlignmentCount (); }
94 
95     inline
getAlignmentCount(Alignment::AlignmentCategory categories) const96     uint64_t Reference :: getAlignmentCount ( Alignment :: AlignmentCategory categories ) const
97         NGS_THROWS ( ErrorMsg )
98     { return self -> getAlignmentCount ( ( uint32_t ) categories ); }
99 
100     inline
getAlignment(const String & alignmentId) const101     Alignment Reference :: getAlignment ( const String & alignmentId ) const
102         NGS_THROWS ( ErrorMsg )
103     { return Alignment ( ( AlignmentRef ) self -> getAlignment ( alignmentId . c_str () ) ); }
104 
105     inline
getAlignments(Alignment::AlignmentCategory categories) const106     AlignmentIterator Reference :: getAlignments ( Alignment :: AlignmentCategory categories ) const
107         NGS_THROWS ( ErrorMsg )
108     { return AlignmentIterator ( ( AlignmentRef ) self -> getAlignments ( ( uint32_t ) categories ) ); }
109 
110     inline
getAlignmentSlice(int64_t start,uint64_t length) const111     AlignmentIterator Reference :: getAlignmentSlice ( int64_t start, uint64_t length ) const
112         NGS_THROWS ( ErrorMsg )
113     { return AlignmentIterator ( ( AlignmentRef ) self -> getAlignmentSlice ( start, length ) ); }
114 
115     inline
getAlignmentSlice(int64_t start,uint64_t length,Alignment::AlignmentCategory categories) const116     AlignmentIterator Reference :: getAlignmentSlice ( int64_t start, uint64_t length, Alignment :: AlignmentCategory categories ) const
117         NGS_THROWS ( ErrorMsg )
118     { return AlignmentIterator ( ( AlignmentRef ) self -> getAlignmentSlice ( start, length, ( uint32_t ) categories ) ); }
119 
120     inline
getFilteredAlignmentSlice(int64_t start,uint64_t length,Alignment::AlignmentCategory categories,Alignment::AlignmentFilter filters,int32_t mappingQuality) const121     AlignmentIterator Reference :: getFilteredAlignmentSlice ( int64_t start, uint64_t length, Alignment :: AlignmentCategory categories, Alignment :: AlignmentFilter filters, int32_t mappingQuality ) const
122         NGS_THROWS ( ErrorMsg )
123     { return AlignmentIterator ( ( AlignmentRef ) self -> getFilteredAlignmentSlice ( start, length, ( uint32_t ) categories, ( uint32_t ) filters, mappingQuality ) ); }
124 
125     inline
getPileups(Alignment::AlignmentCategory categories) const126     PileupIterator Reference :: getPileups ( Alignment :: AlignmentCategory categories ) const
127         NGS_THROWS ( ErrorMsg )
128     { return PileupIterator ( ( PileupRef ) self -> getPileups ( ( uint32_t ) categories ) ); }
129 
130     inline
getFilteredPileups(Alignment::AlignmentCategory categories,Alignment::AlignmentFilter filters,int32_t mappingQuality) const131     PileupIterator Reference :: getFilteredPileups ( Alignment :: AlignmentCategory categories, Alignment :: AlignmentFilter filters, int32_t mappingQuality ) const
132         NGS_THROWS ( ErrorMsg )
133     { return PileupIterator ( ( PileupRef ) self -> getFilteredPileups ( ( uint32_t ) categories, ( uint32_t ) filters, mappingQuality ) ); }
134 
135     inline
getPileupSlice(int64_t start,uint64_t length) const136     PileupIterator Reference :: getPileupSlice ( int64_t start, uint64_t length ) const
137         NGS_THROWS ( ErrorMsg )
138     { return PileupIterator ( ( PileupRef ) self -> getPileupSlice ( start, length ) ); }
139 
140     inline
getPileupSlice(int64_t start,uint64_t length,Alignment::AlignmentCategory categories) const141     PileupIterator Reference :: getPileupSlice ( int64_t start, uint64_t length, Alignment :: AlignmentCategory categories ) const
142         NGS_THROWS ( ErrorMsg )
143     { return PileupIterator ( ( PileupRef ) self -> getPileupSlice ( start, length, ( uint32_t ) categories ) ); }
144 
145     inline
getFilteredPileupSlice(int64_t start,uint64_t length,Alignment::AlignmentCategory categories,Alignment::AlignmentFilter filters,int32_t mappingQuality) const146     PileupIterator Reference :: getFilteredPileupSlice ( int64_t start, uint64_t length, Alignment :: AlignmentCategory categories, Alignment :: AlignmentFilter filters, int32_t mappingQuality ) const
147         NGS_THROWS ( ErrorMsg )
148     { return PileupIterator ( ( PileupRef ) self -> getFilteredPileupSlice ( start, length, ( uint32_t ) categories, ( uint32_t ) filters, mappingQuality ) ); }
149 
150 } // namespace ngs
151 
152 #endif // _inl_ngs_reference_
153