@@ -57,20 +57,20 @@ format_sam_flags(const uint16_t the_flags) {
5757 return oss.str ();
5858}
5959
60- static bool
61- valid_cigar (const string &cigar, const string &seq) {
62- return cigar_qseq_ops (cigar) == seq.size ();
63- }
60+ // static bool
61+ // valid_cigar(const string &cigar, const string &seq) {
62+ // return cigar_qseq_ops(cigar) == seq.size();
63+ // }
6464
65- static bool
66- valid_seq (const string &read) {
67- return regex_match (read, regex (" \\ *|[A-Za-z=.]+" ));
68- }
65+ // static bool
66+ // valid_seq(const string &read) {
67+ // return regex_match(read, regex("\\*|[A-Za-z=.]+"));
68+ // }
6969
70- static bool
71- valid_qual (const string &qual) {
72- return regex_match (qual, regex (" [!-~]+" ));
73- }
70+ // static bool
71+ // valid_qual(const string &qual) {
72+ // return regex_match(qual, regex("[!-~]+"));
73+ // }
7474
7575
7676ostream &
@@ -106,66 +106,11 @@ sam_rec::sam_rec(const string &line) {
106106 throw runtime_error (" invalid mapq in SAM record: " + line);
107107 mapq = static_cast <uint8_t >(will_become_mapq);
108108
109- // if (!valid_cigar(cigar, seq))
110- // throw runtime_error("invalid cigar in SAM record: " + line);
111-
112- // if (!valid_seq(seq))
113- // throw runtime_error("invalid read in SAM record: " + line);
114-
115- // if (!valid_qual(qual))
116- // throw runtime_error("invalid qual in SAM record: " + line);
117109 string tmp;
118110 while (iss >> tmp)
119111 tags.push_back (tmp);
120112}
121113
122- // // constructor for "general" sam
123- // sam_rec::sam_rec(const std::string &_qname,
124-
125- // // to make sam flags
126- // const sam_record_type type,
127- // const bool is_rc,
128-
129- // const std::string &_rname,
130- // // zero-based!
131- // const uint32_t start,
132- // const uint8_t _mapq,
133- // const std::string &_cigar,
134- // const std::string &_seq,
135- // const std::string &_qual,
136-
137- // // not used in SE
138- // const uint32_t _pnext,
139- // const uint32_t end,
140-
141- // // not used in non-WGBS
142- // const bool is_a_rich) {
143-
144- // // direct copies of entries
145- // qname = _qname;
146- // rname = _rname;
147- // pos = start + 1; // sam is one-based
148- // seq = is_rc ? revcomp(seq) : _seq;
149- // qual = _qual;
150- // mapq = _mapq;
151- // cigar = _cigar;
152- // pnext = _pnext + 1; // one-based!
153-
154- // // infer from non-sam arguments
155- // flags = (!is_a_rich) * bsflags::read_is_t_rich |
156- // (type != single) * (samflags::read_paired |
157- // samflags::read_pair_mapped) |
158- // (is_rc) * samflags::read_rc |
159- // (!is_rc) * samflags::mate_rc |
160- // (type == pe_first_mate) * samflags::template_first |
161- // (type == pe_second_mate) * samflags::template_last;
162-
163- // rnext = (type == single) ? "*" : "=";
164- // tlen = is_rc ? (_pnext - end) : (end - start);
165- // }
166-
167-
168-
169114void
170115inflate_with_cigar (const sam_rec &sr, string &to_inflate,
171116 const char inflation_symbol) {
0 commit comments