26 #ifndef SHORE_ALIGNMENT_STRING_OPS_HPP__
27 #define SHORE_ALIGNMENT_STRING_OPS_HPP__
65 class alignment_tokenizer;
66 class alignment_helper;
74 typedef std::string::const_iterator iterator;
75 typedef std::reverse_iterator<iterator> reverse_iterator;
83 static const std::string CIGAR_TRF;
87 bool m_sequence_omitted;
153 void print(std::ostream &os)
const;
159 void to_string(std::string &res,
const size_t pos=0,
160 const size_t size=std::numeric_limits<size_t>::max(),
161 const bool omit_refbases=
false)
const;
162 void to_cigar(std::string &res,
const size_t pos=0,
163 const size_t size=std::numeric_limits<size_t>::max())
const;
185 const std::string *m_aln;
227 std::vector<shore::nuc::base> m_ref;
229 std::vector<shore::nuc::base> m_qry;
231 std::vector<AlignmentOperation> m_ops;
234 std::string m_ws_ref;
236 std::string m_ws_qry;
245 void build_at(std::string & buf,
size_t i);
250 void to_string(std::string & buf,
const bool reverse);
271 void resize(
const size_t size);
283 std::string m_workspace;
295 size_t extract_qry(
const std::string &alignment,std::string &qry,
296 const bool include_softclipped=
false);
300 std::string &ref,std::string &qry,
301 const bool include_softclipped=
false);
305 const bool include_softclipped=
false);
314 std::pair<int,int>
calc_indels(
const std::string &alignment);
339 void rebuild(std::string &alignment);
342 void invert(std::string &alignment);
345 void revcomp(std::string &alignment);
356 void paste(std::string &alignment,
const std::string &other,
357 int distance=0,
bool inv=
false,
bool forcefrag=
true,
364 void cigar(
const std::string &alignment,
365 std::string &
cigar,
const char sep=0);
390 #endif // SHORE_ALIGNMENT_STRING_OPS_HPP__