X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=sffinfocommand.h;h=4e72a960a7bb07d4e94df795bea462519f6d777a;hb=f06b339c5fc4b6d1b9d2a08fe16bf7670bf7aeb4;hp=939a1c70bf87ee50c97aa95bc387599cf0b866f5;hpb=e0fbf58358a72f20352cf2a43922ab6b5bdf0cf8;p=mothur.git diff --git a/sffinfocommand.h b/sffinfocommand.h index 939a1c7..4e72a96 100644 --- a/sffinfocommand.h +++ b/sffinfocommand.h @@ -17,7 +17,7 @@ struct CommonHeader { unsigned int magicNumber; string version; - unsigned long int indexOffset; + unsigned long long indexOffset; unsigned int indexLength; unsigned int numReads; unsigned short headerLength; @@ -40,6 +40,9 @@ struct Header { unsigned short clipAdapterLeft; unsigned short clipAdapterRight; string name; //length depends on nameLength + string timestamp; + string region; + string xy; Header() { headerLength=0; nameLength=0; numBases=0; clipQualLeft=0; clipQualRight=0; clipAdapterLeft=0; clipAdapterRight=0; } ~Header() { } @@ -60,20 +63,33 @@ class SffInfoCommand : public Command { public: SffInfoCommand(string); - ~SffInfoCommand(); - int execute(); - void help(); + SffInfoCommand(); + ~SffInfoCommand(){} + + vector setParameters(); + string getCommandName() { return "sffinfo"; } + string getCommandCategory() { return "Sequence Processing"; } + string getOutputFileNameTag(string, string); + string getHelpString(); + string getCitation() { return "http://www.mothur.org/wiki/Sffinfo"; } + string getDescription() { return "extract sequences reads from a .sff file"; } + + int execute(); + void help() { m->mothurOut(getHelpString()); } private: - string sffFilename, outputDir, accnosName; + string sffFilename, sfftxtFilename, outputDir, accnosName; vector filenames, outputNames, accnosFileNames; bool abort, fasta, qual, trim, flow, sfftxt, hasAccnos; + int mycount; set seqNames; - + + //extract sff file functions int extractSffInfo(string, string); int readCommonHeader(ifstream&, CommonHeader&); int readHeader(ifstream&, Header&); int readSeqData(ifstream&, seqRead&, int, int); + int decodeName(string&, string&, string&, string); int printCommonHeader(ofstream&, CommonHeader&); int printHeader(ofstream&, Header&); @@ -82,7 +98,14 @@ private: int printFastaSeqData(ofstream&, seqRead&, Header&); int printQualSeqData(ofstream&, seqRead&, Header&); int readAccnosFile(string); - + int parseSffTxt(); + bool sanityCheck(Header&, seqRead&); + + //parsesfftxt file functions + int parseHeaderLineToInt(ifstream&); + vector parseHeaderLineToFloatVector(ifstream&, int); + vector parseHeaderLineToIntVector(ifstream&, int); + string parseHeaderLineToString(ifstream&); }; /**********************************************************/