OpenStructure
aligned_region.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_SEQ_ALIGNED_REGION_HH
20 #define OST_SEQ_ALIGNED_REGION_HH
21 
22 /*
23  Author: Marco Biasini
24  */
25 #include <ost/seq/module_config.hh>
28 
29 namespace ost { namespace seq {
30 
31 
39 public:
42  int start, int end, int master=-1);
43 
45  int GetEnd() const;
47  int GetStart() const;
48  int GetMaster() const;
49  void SetMaster(int master);
51  void Delete();
54  void Replace(const AlignedRegion& aln_r);
55 
58  void ShiftLeft(int n);
59 
63  void ShiftRight(int n);
64 
68  int GetLength() const;
69 
72 
76  AlignedColumn operator[](int index) const;
77 
82 
83  bool operator==(const AlignedRegion& rhs) const;
84  bool operator!=(const AlignedRegion& rhs) const;
85 private:
86  AlignmentHandle aln_;
87  int start_;
88  int end_ ;
89  int master_;
90 };
91 
92 typedef std::vector<AlignedRegion> AlignedRegionList;
93 
94 }}
95 
96 #endif
Provides access to a column in a aligned region or a sequence alignment.
represents a region in a sequence alignment
AlignedRegion(const AlignmentHandle &aln, int start, int end, int master=-1)
void ShiftRight(int n)
shift the aligned region of the master sequence to the right by n characters.
AlignedColumnIterator iterator
bool operator==(const AlignedRegion &rhs) const
AlignedColumnIterator end()
iterator pointing at end of aligned region.
int GetEnd() const
get end of aligned region
int GetStart() const
get start of aligned region
AlignmentHandle GetAlignmentHandle() const
retrieve alignment handle for aligned region
int GetLength() const
length of the aligned region
AlignedColumnIterator begin()
iterator pointing at start of aligned region
bool operator!=(const AlignedRegion &rhs) const
void ShiftLeft(int n)
shift the aligned region of the master sequence to the left by n characters.
AlignedColumn operator[](int index) const
get aligned column at given index
void Delete()
delete interval and update length of AlignedRegion
void SetMaster(int master)
void Replace(const AlignedRegion &aln_r)
replace region with content of AlignedRegion and set length to length of aln_r
representation of a multiple sequence alignemnt consisting of two or more sequences
pointer_it< T > end(const std::vector< T > &values)
std::vector< AlignedRegion > AlignedRegionList
Definition: base.dox:1
#define DLLEXPORT_OST_SEQ