本文整理汇总了C++中SamFileHeader::addHD方法的典型用法代码示例。如果您正苦于以下问题:C++ SamFileHeader::addHD方法的具体用法?C++ SamFileHeader::addHD怎么用?C++ SamFileHeader::addHD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SamFileHeader
的用法示例。
在下文中一共展示了SamFileHeader::addHD方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testModHeader
void testModHeader(SamFileHeader& samHeader)
{
// Check the header line.
std::string headerString = "";
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:11\tLN:134452384\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\tLB:library2\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Remove a tag - by setting it to "".
assert(samHeader.setRGTag("LB", "", "myID2") == true);
// Check the header line.
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:11\tLN:134452384\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Add an HD tag.
SamHeaderHD* hd = new SamHeaderHD();
assert(hd->setTag("VN", "1.3") == true);
assert(samHeader.addHD(hd) == true);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.3") == 0);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:11\tLN:134452384\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tVN:1.3\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Try adding another HD tag.
SamHeaderHD* hd2 = new SamHeaderHD();
assert(hd2->setTag("VN", "1.4") == true);
assert(samHeader.addHD(hd2) == false);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.4") != 0);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.3") == 0);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:11\tLN:134452384\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tVN:1.3\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Remove the entire HD Tag.
assert(samHeader.removeHD() == true);
assert(strcmp(samHeader.getHDTagValue("VN"), "") == 0);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:11\tLN:134452384\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Remove an entire SQ Tag.
assert(strcmp(samHeader.getSQTagValue("LN", "11"), "134452384") == 0);
assert(samHeader.removeSQ("11") == true);
assert(strcmp(samHeader.getSQTagValue("LN", "11"), "") == 0);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Try adding a null HD tag.
hd = NULL;
assert(samHeader.addHD(hd) == false);
assert(strcmp(samHeader.getHDTagValue("VN"), "") == 0);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.4") != 0);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.3") != 0);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Try adding a null SQ tag.
SamHeaderSQ* sq = NULL;
assert(samHeader.addSQ(sq) == false);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tComment 1\[email protected]\tComment 2\n");
// Try adding an HD tag again.
assert(samHeader.addHD(hd2) == true);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.4") == 0);
assert(strcmp(samHeader.getHDTagValue("VN"), "1.3") != 0);
assert(samHeader.getHeaderString(headerString) == true);
assert(headerString == "@SQ\tSN:1\tLN:247249719\[email protected]\tSN:2\tLN:242951149\[email protected]\tSN:3\tLN:199501827\[email protected]\tSN:4\tLN:191273063\[email protected]\tSN:5\tLN:180857866\[email protected]\tSN:6\tLN:170899992\[email protected]\tSN:7\tLN:158821424\[email protected]\tSN:8\tLN:146274826\[email protected]\tSN:9\tLN:140273252\[email protected]\tSN:10\tLN:135374737\[email protected]\tSN:12\tLN:132349534\[email protected]\tSN:13\tLN:114142980\[email protected]\tSN:14\tLN:106368585\[email protected]\tSN:15\tLN:100338915\[email protected]\tSN:16\tLN:88827254\[email protected]\tSN:17\tLN:78774742\[email protected]\tSN:18\tLN:76117153\[email protected]\tSN:19\tLN:63811651\[email protected]\tSN:20\tLN:62435964\[email protected]\tSN:21\tLN:46944323\[email protected]\tSN:22\tLN:49691432\[email protected]\tSN:X\tLN:154913754\[email protected]\tID:myID\tLB:library\tSM:sample\[email protected]\tID:myID2\tSM:sample2\[email protected]\tVN:1.4\[email protected]\tComment 1\[email protected]\tComment 2\n");
// TODO Get the comments.
}