Changeset 3409 for trunk/test/bam_header.cc
- Timestamp:
- Apr 17, 2015, 3:07:04 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/bam_header.cc
r3408 r3409 1 1 // $Id$ 2 2 // 3 // Copyright (C) 2013, 2014 Peter Johansson3 // Copyright (C) 2013, 2014, 2015 Peter Johansson 4 4 // 5 5 // This program is free software; you can redistribute it and/or modify … … 100 100 } 101 101 102 int32_t n_chr = hdr.n_targets(); 103 104 // check that we can add another chromosomevia a @SG field 105 std::stringstream ss(hdr.text()); 106 std::string str3; 107 std::string line; 108 int32_t n_targ = 0; 109 while (getline(ss, line)) { 110 str3 += line + "\n"; 111 if (line.substr(0,3) == "@SQ") { 112 ++n_targ; 113 if (n_targ == n_chr) 114 str3 += "@SQ\tSN:Zbababababa\tLN:123\n"; 115 } 116 } 117 hdr.text(str3); 118 119 int32_t n = hdr.n_targets(); 120 if (n != n_chr+1) { 121 suite.add(false); 122 suite.err() << "error: incorrect number of targets: " << n 123 << " expected " << (n_chr+1) << "\n"; 124 suite.err() << "header text:\n" << hdr.text() << "===\n"; 125 } 126 102 127 #endif 103 128 }
Note: See TracChangeset
for help on using the changeset viewer.