libStatGen Software  1
WriteFiles.h
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 #ifndef __WRITE_FILES_H__
00018 #define __WRITE_FILES_H__
00019 
00020 #include <stdio.h>
00021 #include "GlfFile.h"
00022 
00023 
00024 void testWrite();
00025 void testHeaderWrite();
00026 void testWriteCopiedHeader();
00027 
00028 class TestWrite
00029 {
00030 public:
00031     void testWrite();
00032 private:
00033     void writeHeader(GlfFile& glfOut, int headerNum);
00034     void writeRefSection1(GlfFile& glfOut);
00035     void writeSec1Record1(GlfFile& glfOut);
00036     void writeSec1Record2(GlfFile& glfOut);
00037     void writeEndMarker(GlfFile& glfOut);
00038     void writeRefSection2(GlfFile& glfOut);
00039     void writeSec2Record1(GlfFile& glfOut);
00040     
00041     void readHeader(GlfFile& glfIn, int headerNum);
00042     void readRefSection1(GlfFile& glfIn);
00043     void readSec1Record1(GlfFile& glfIn);
00044     void readSec1Record2(GlfFile& glfIn);
00045     void readEndMarker(GlfFile& glfIn);
00046     void readRefSection2(GlfFile& glfIn);
00047     void readSec2Record1(GlfFile& glfIn);
00048     
00049     void checkEOF(GlfFile& glfIn);
00050     
00051     // 1st file header values:
00052     static const std::string HEADER_TEXT1;
00053     
00054     // SEC1 values:
00055     static const std::string SEC1_REFNAME;
00056     static const uint32_t SEC1_REFLEN = 200;
00057     
00058     // SEC1REC1 values:
00059     static const uint8_t SEC1REC1_RECTYPE = 1;
00060     static const uint8_t SEC1REC1_REFBASE = 4;
00061     static const uint32_t SEC1REC1_OFFSET = 99;
00062     static const uint32_t SEC1REC1_MINLK = 55;
00063     static const uint32_t SEC1REC1_READDEPTH = 31;
00064     static const uint8_t SEC1REC1_RMSMAPQ = 25;
00065     
00066     // SEC1REC2 values:
00067     static const uint8_t SEC1REC2_RECTYPE = 2;
00068     static const uint8_t SEC1REC2_REFBASE = 1;
00069     static const uint32_t SEC1REC2_OFFSET = 6;
00070     static const uint32_t SEC1REC2_MINLK = 44;
00071     static const uint32_t SEC1REC2_READDEPTH = 66;
00072     static const uint8_t SEC1REC2_RMSMAPQ = 32;
00073     static const uint8_t SEC1REC2_LKHOM1 = 98;
00074     static const uint8_t SEC1REC2_LKHOM2 = 86;
00075     static const uint8_t SEC1REC2_LKHET = 73;
00076     static const int16_t SEC1REC2_INDELLEN1 = 2;
00077     static const int16_t SEC1REC2_INDELLEN2 = -3;
00078     static const std::string SEC1REC2_INDELSEQ1;
00079     static const std::string SEC1REC2_INDELSEQ2;
00080     
00081     // SEC2 values
00082     static const std::string SEC2_REFNAME;
00083     static const uint32_t SEC2_REFLEN = 102;
00084     
00085     // SEC2REC1 values:
00086     static const uint8_t SEC2REC1_RECTYPE = 1;
00087     static const uint8_t SEC2REC1_REFBASE = 2;
00088     static const uint32_t SEC2REC1_OFFSET = 50;
00089     static const uint32_t SEC2REC1_MINLK = 55;
00090     static const uint32_t SEC2REC1_READDEPTH = 31;
00091     static const uint8_t SEC2REC1_RMSMAPQ = 25;
00092 
00093     // 2nd file header.
00094     static const std::string HEADER_TEXT2;
00095     // 3rd file header.
00096     static const std::string HEADER_TEXT3;
00097 };
00098 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends