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 void RemoveSequence(int seq_index);
00087 String ToString(int width=80) const;
00088
00090 int GetLength() const;
00091
00093 AlignmentHandle Copy() const;
00094
00099 ConstSequenceHandle FindSequence(const String& name) const;
00100
00101 int FindSequenceIndex(const String& name) const;
00102
00105 void AttachView(int seq_index, const mol::EntityView& view);
00106
00109 void AttachView(int seq_index, const mol::EntityView& view,
00110 const String& chain_name);
00111
00112
00113 mol::EntityViewPair GetMatchingBackboneViews(int idx0=0, int idx1=1) const;
00115 void SetSequenceName(int seq_index, const String& name);
00116
00117 void SetSequenceOffset(int seq_index, int offset);
00118 int GetSequenceOffset(int seq_index);
00120 ConstSequenceList GetSequences() const;
00121
00131 AlignedRegion MakeRegion(int start, int n, int master=-1) const;
00132
00134 int GetCount() const;
00135
00136 bool operator==(const AlignmentHandle& rhs) const;
00137 bool operator!=(const AlignmentHandle& rhs) const;
00138
00144 AlignedColumn operator[](int index) const;
00145
00146 AlignmentHandle(const impl::SequenceListImplPtr& impl);
00147
00149 void Cut(int start, int end);
00150
00152 void Replace(const AlignedRegion& rhs, int start, int end);
00157 void ShiftRegion(int start, int end, int amount, int master=-1);
00158
00160 iterator begin() const;
00162 iterator end() const;
00163
00164 bool IsValid() const { return impl_.get()!=0; }
00165
00171 Real GetCoverage(int seq_index) const;
00172
00173
00174 const String& GetSequenceRole(int seq_index);
00175
00176 void SetSequenceRole(int seq_index, const String& role);
00177 private:
00178 void CheckValidity() const;
00179 impl::SequenceListImplPtr impl_;
00180 };
00181
00182 AlignmentHandle DLLEXPORT_OST_SEQ CreateAlignment();
00183
00190 AlignmentHandle DLLEXPORT_OST_SEQ
00191 AlignmentFromSequenceList(const SequenceList& seq_list);
00192
00193 typedef std::vector<AlignmentHandle> AlignmentList;
00194
00195 }}
00196
00197 #endif