| 410 | } |
| 411 | |
| 412 | static void |
| 413 | readAlignment(const string& line, ReadAlignMap& out) |
| 414 | { |
| 415 | istringstream s(line); |
| 416 | pair<string, AlignmentVector> v; |
| 417 | switch (opt::inputFormat) { |
| 418 | case opt::SAM: { |
| 419 | SAMRecord sam; |
| 420 | s >> sam; |
| 421 | assert(s); |
| 422 | v.first = sam.qname; |
| 423 | if (sam.isRead1()) |
| 424 | v.first += "/1"; |
| 425 | else if (sam.isRead2()) |
| 426 | v.first += "/2"; |
| 427 | if (!sam.isUnmapped()) |
| 428 | v.second.push_back(sam); |
| 429 | break; |
| 430 | } |
| 431 | case opt::KALIGNER: { |
| 432 | s >> v.first; |
| 433 | assert(s); |
| 434 | v.second.reserve(count(line.begin(), line.end(), '\t')); |
| 435 | v.second.assign(istream_iterator<Alignment>(s), istream_iterator<Alignment>()); |
| 436 | assert(s.eof()); |
| 437 | break; |
| 438 | } |
| 439 | } |
| 440 | handleAlignment(v, out); |
| 441 | } |
| 442 | |
| 443 | static void |
| 444 | readAlignments(istream& in, ReadAlignMap* pout) |
no test coverage detected