00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __ALIGNMENT_HPP__
00025 #define __ALIGNMENT_HPP__
00026 #include <iosfwd>
00027 #include <fstream>
00028 #include <vector>
00029 #include <string>
00030 #include <Sequence/SeqExceptions.hpp>
00031
00055 namespace Sequence
00056 {
00057 namespace Alignment
00058 {
00059
00060 template < typename T >
00061 void GetData (std::vector < T >&seqarray,
00062 const char *infilename);
00063
00064 template < typename T >
00065 std::istream & GetData (std::vector < T >&seqarray,
00066 std::istream & input_stream);
00067
00068 template < typename T >
00069 std::istream & ReadNObjects ( std::vector < T > &seqarray, unsigned n,
00070 std::istream & input_stream);
00071
00072 template < typename T >
00073 void EmptyVector (std::vector< T * > &seqarray);
00074
00075 template < typename T >
00076 bool Gapped (const std::vector < T >&data);
00077
00078 template < typename T >
00079 bool IsAlignment (const std::vector < T >&data);
00080
00081
00082 template<typename Iterator>
00083 bool validForPolyAnalysis( Iterator beg,
00084 Iterator end );
00085
00086 template < typename T >
00087 unsigned UnGappedLength (const std::vector <T>&data);
00088
00089 template <typename T>
00090 void RemoveGaps (std::vector <T> &data);
00091
00092 template < typename T >
00093 void RemoveTerminalGaps (std::vector < T >&data);
00094 template < typename T >
00095 void RemoveFixedOutgroupInsertions( std::vector<T> & data,
00096 unsigned site,
00097 const unsigned & ref );
00098
00099 template < typename T >
00100 std::vector < T >Trim (const std::vector < T >&data,
00101 const std::vector <int> &sites)
00102 throw (Sequence::SeqException);
00103
00104 template < typename T >
00105 std::vector < T >TrimComplement (const std::vector < T >&data,
00106 const std::vector <int> &sites)
00107 throw (Sequence::SeqException);
00108
00109
00110 template<> bool Gapped(const std::vector<std::string> &data);
00111 template <> bool IsAlignment(const std::vector<std::string> &data);
00112 template<>
00113 bool validForPolyAnalysis( std::vector<std::string>::const_iterator beg,
00114 std::vector<std::string>::const_iterator end );
00115 template<>
00116 bool validForPolyAnalysis( std::vector<std::string>::iterator beg,
00117 std::vector<std::string>::iterator end );
00118 template <>
00119 unsigned UnGappedLength (const std::vector <std::string>&data) throw (Sequence::SeqException);
00120 template <>
00121 void RemoveGaps (std::vector <std::string> &data);
00122 template <>
00123 void RemoveTerminalGaps (std::vector <std::string> &data);
00124 template <>
00125 void RemoveFixedOutgroupInsertions(std::vector<std::string> &data,
00126 unsigned site,
00127 const unsigned & ref);
00128 template <>
00129 std::vector <std::string >Trim (const std::vector <std::string>&data,
00130 const std::vector <int> &sites) throw (Sequence::SeqException);
00131
00132 template <>
00133 std::vector <std::string> TrimComplement (const std::vector <std::string>&data,
00134 const std::vector <int> &sites) throw (Sequence::SeqException);
00135
00136 }
00137 }
00138 #include <Sequence/bits/Alignment.tcc>
00139 #endif