libStatGen Software
1
|
00001 /* 00002 * Copyright (C) 2010 Regents of the University of Michigan 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 void modifyFirstBase(); 00019 void modifyFirstBaseLong(); 00020 void testModifyVar(); 00021 00022 class modifyVar 00023 { 00024 public: 00025 void testModifyVar(const char* filename, bool valBufFirst); 00026 00027 private: 00028 void testModifyReadNameOnlySameLength(); 00029 void testModifyCigarOnlySameLength(); 00030 void testModifySequenceOnlySameLength(); 00031 void testModifyQualityOnlySameLength(); 00032 void testRemoveQuality(); 00033 void testShortenQuality(); 00034 void testLengthenQuality(); 00035 00036 void testShortenReadName(); 00037 void testShortenCigar(); 00038 void testShortenSequence(); 00039 00040 void testLengthenReadName(); 00041 void testLengthenCigar(); 00042 void testLengthenSequence(); 00043 00044 void testRemoveCigar(); 00045 void testRemoveSequence(); 00046 00047 void testLengthenSequenceAndQuality(); 00048 00049 void validate(); 00050 00051 void validateReadName(const bamRecordStruct* recordBuffer); 00052 void validateCigar(const bamRecordStruct* recordBuffer); 00053 void validateSequence(const bamRecordStruct* recordBuffer); 00054 void validateQuality(const bamRecordStruct* recordBuffer); 00055 void validateTags(const bamRecordStruct* recordBuffer); 00056 00057 void validateReadNameString(); 00058 void validateCigarString(); 00059 void validateSequenceString(); 00060 void validateQualityString(); 00061 void validateTagsString(); 00062 00063 // Open and read the first record. 00064 void openAndRead1Rec(); 00065 void resetExpected(); 00066 00067 // Variables. 00068 const char* myFilename; 00069 bool myValBufFirst; 00070 00071 // Rather than passing around all these variables, just store them in the class. 00072 SamFile samIn; 00073 SamFileHeader samHeader; 00074 SamRecord samRecord; 00075 const bamRecordStruct* recordBuffer; 00076 00077 // Expected values. 00078 int expectedCigarBufLen; 00079 unsigned int expectedCigarBuffer[100]; 00080 unsigned char expectedSequenceBuffer[100]; 00081 int expectedTagsLen; 00082 unsigned char expectedTagsBuffer[100]; 00083 00084 // Expected values for the strings. 00085 std::string expectedReadNameString; 00086 std::string expectedCigarString; 00087 std::string expectedSequenceString; 00088 std::string expectedQualityString; 00089 }; 00090