00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_SEQ_ALIGNMENT_HANDLE_HH
00020 #define OST_SEQ_ALIGNMENT_HANDLE_HH
00021
00022
00023
00024
00025 #include <ost/seq/module_config.hh>
00026
00027 #include <ost/seq/impl/sequence_list_impl_fw.hh>
00028 #include <ost/seq/sequence_handle.hh>
00029 #include <ost/seq/sequence_list.hh>
00030
00031 namespace ost { namespace seq {
00032
00033 class SequenceList;
00034 class AlignedRegion;
00035 class AlignedColumn;
00036 class AlignedColumnIterator;
00037
00053 class DLLEXPORT_OST_SEQ AlignmentHandle {
00054 public:
00055
00056 typedef AlignedColumnIterator iterator;
00057 AlignmentHandle();
00058
00063 int GetPos(int seq_index, int residue_index) const;
00064
00068 int GetResidueIndex(int seq_index, int pos) const;
00069
00070 mol::ResidueView GetResidue(int seq_index, int pos) const;
00071
00072 char GetOneLetterCode(int seq_index, int pos) const;
00073
00078 void AddSequence(const ConstSequenceHandle& sequence);
00079
00082 ConstSequenceHandle GetSequence(int seq_id) const;
00083
00085 String ToString(int width=80) const;
00086
00088 int GetLength() const;
00089
00091 AlignmentHandle Copy() const;
00092
00097 ConstSequenceHandle FindSequence(const String& name) const;
00098
00101 void AttachView(int seq_index, const mol::EntityView& view);
00102
00105 void AttachView(int seq_index, const mol::EntityView& view,
00106 const String& chain_name);
00107
00109 void SetSequenceName(int seq_index, const String& name);
00110
00111 void SetSequenceOffset(int seq_index, int offset);
00112 int GetSequenceOffset(int seq_index);
00114 ConstSequenceList GetSequences() const;
00115
00125 AlignedRegion MakeRegion(int start, int n, int master=-1) const;
00126
00128 int GetCount() const;
00129
00130 bool operator==(const AlignmentHandle& rhs) const;
00131 bool operator!=(const AlignmentHandle& rhs) const;
00132
00138 AlignedColumn operator[](int index) const;
00139
00140 AlignmentHandle(const impl::SequenceListImplPtr& impl);
00141
00143 void Cut(int start, int end);
00144
00146 void Replace(const AlignedRegion& rhs, int start, int end);
00151 void ShiftRegion(int start, int end, int amount, int master=-1);
00152
00154 iterator begin() const;
00156 iterator end() const;
00157
00158 private:
00159 void CheckValidity() const;
00160 impl::SequenceListImplPtr impl_;
00161 };
00162
00163 AlignmentHandle DLLEXPORT_OST_SEQ CreateAlignment();
00164
00171 AlignmentHandle DLLEXPORT_OST_SEQ
00172 AlignmentFromSequenceList(const SequenceList& seq_list);
00173
00174 typedef std::vector<AlignmentHandle> AlignmentList;
00175
00176 }}
00177
00178 #endif