1 #ifndef SFFINFOCOMMAND_H
2 #define SFFINFOCOMMAND_H
8 * Created by westcott on 7/7/10.
9 * Copyright 2010 Schloss Lab. All rights reserved.
13 #include "command.hpp"
15 #define SFF_MAGIC 0x2e736666 /* ".sff" */
16 #define SFF_VERSION "\0\0\0\1"
18 /**********************************************************/
25 uint16_t headerLength;
27 uint16_t numFlowsPerRead;
28 uint8_t flogramFormatCode;
29 char* flowChars; //length depends on number flow reads
30 char* keySequence; //length depends on key length
32 CommonHeader() { magicNumber=0; indexOffset=0; indexLength=0; numReads=0; headerLength=0; keyLength=0; numFlowsPerRead=0; flogramFormatCode='s'; }
34 /**********************************************************/
36 unsigned short headerLength;
37 unsigned short nameLength;
38 unsigned int numBases;
39 unsigned short clipQualLeft;
40 unsigned short clipQualRight;
41 unsigned short clipAdapterLeft;
42 unsigned short clipAdapterRight;
43 char* name; //length depends on nameLength
45 Header() { headerLength=0; nameLength=0; numBases=0; clipQualLeft=0; clipQualRight=0; clipAdapterLeft=0; clipAdapterRight=0; }
47 /**********************************************************/
49 vector<unsigned short> flowgram;
50 vector<unsigned int> flowIndex;
52 vector<unsigned int> qualScores;
54 /**********************************************************/
56 class SffInfoCommand : public Command {
59 SffInfoCommand(string);
65 string sffFilename, outputDir;
66 vector<string> filenames, outputNames;
69 int extractSffInfo(string, string);
70 CommonHeader* readCommonHeader(ifstream&);
71 Header* readHeader(ifstream&);
72 seqRead* readSeqData(ifstream&, int, int);
74 int printCommonHeader(ofstream&, CommonHeader*, bool); //bool is debug mode
75 int printHeader(ofstream&, Header*, bool);
76 int printSeqData(ofstream&, seqRead*, bool);
80 /**********************************************************/