]> git.donarmstrong.com Git - mothur.git/blob - sffinfocommand.h
added oligos class. added check orient parameter to trim.flows, sffinfo, fastq.info...
[mothur.git] / sffinfocommand.h
1 #ifndef SFFINFOCOMMAND_H
2 #define SFFINFOCOMMAND_H
3
4 /*
5  *  sffinfocommand.h
6  *  Mothur
7  *
8  *  Created by westcott on 7/7/10.
9  *  Copyright 2010 Schloss Lab. All rights reserved.
10  *
11  */
12
13 #include "command.hpp"
14 #include "groupmap.h"
15 #include "oligos.h"
16 #include "trimoligos.h"
17
18 /**********************************************************/
19
20 class SffInfoCommand : public Command {
21         
22 public:
23         SffInfoCommand(string);
24         SffInfoCommand();
25         ~SffInfoCommand(){}
26         
27         vector<string> setParameters();
28         string getCommandName()                 { return "sffinfo";                                     }
29         string getCommandCategory()             { return "Sequence Processing";         }
30         
31         string getHelpString(); 
32     string getOutputPattern(string);    
33         string getCitation() { return "http://www.mothur.org/wiki/Sffinfo"; }
34         string getDescription()         { return "extract sequences reads from a .sff file"; }
35
36         int execute(); 
37         void help() { m->mothurOut(getHelpString()); }  
38         
39 private:
40         string sffFilename, sfftxtFilename, outputDir, accnosName, currentFileName, oligosfile, noMatchFile, groupfile;
41         vector<string> filenames, outputNames, accnosFileNames, oligosFileNames, groupFileNames;
42         bool abort, fasta, qual, trim, flow, sfftxt, hasAccnos, hasOligos, hasGroup, reorient, pairedOligos;
43         int mycount, split, numBarcodes, numFPrimers, numLinkers, numSpacers, numRPrimers, pdiffs, bdiffs, ldiffs, sdiffs, tdiffs, numNoMatch;
44         set<string> seqNames;
45     GroupMap* groupMap;
46     vector<vector<int> > numSplitReads;
47     vector<vector<string> > filehandles;
48     vector<vector<string> > filehandlesHeaders;
49     Oligos* oligosObject;
50     
51         //extract sff file functions
52         int extractSffInfo(string, string, string);
53         int readCommonHeader(ifstream&, CommonHeader&);
54         int readHeader(ifstream&, Header&);
55         bool readSeqData(ifstream&, seqRead&, int, Header&, TrimOligos*&, TrimOligos*&);
56         int decodeName(string&, string&, string&, string);
57     bool readOligos(string oligosFile);
58     bool readGroup(string oligosFile);
59         
60         int printCommonHeader(ofstream&, CommonHeader&); 
61         int printHeader(ofstream&, Header&);
62         int printSffTxtSeqData(ofstream&, seqRead&, Header&);
63         int printFlowSeqData(ofstream&, seqRead&, Header&);
64         int printFastaSeqData(ofstream&, seqRead&, Header&);
65         int printQualSeqData(ofstream&, seqRead&, Header&);
66         int readAccnosFile(string);
67         int parseSffTxt();
68         bool sanityCheck(Header&, seqRead&);
69     int adjustCommonHeader(CommonHeader);
70     int findGroup(Header header, seqRead read, int& barcode, int& primer, TrimOligos*&, TrimOligos*&);
71     int findGroup(Header header, seqRead read, int& barcode, int& primer, string);
72     string reverseOligo(string oligo);
73     
74         //parsesfftxt file functions
75         int parseHeaderLineToInt(ifstream&);
76         vector<unsigned short> parseHeaderLineToFloatVector(ifstream&, int);
77         vector<unsigned int> parseHeaderLineToIntVector(ifstream&, int);
78         string parseHeaderLineToString(ifstream&);
79 };
80
81 /**********************************************************/
82  
83 #endif
84
85