File: vsearchfileparser.h

package info (click to toggle)
mothur 1.48.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,692 kB
  • sloc: cpp: 161,866; makefile: 122; sh: 31
file content (53 lines) | stat: -rwxr-xr-x 1,755 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
//  vsearchfileparser.h
//  Mothur
//
//  Created by Sarah Westcott on 10/13/15.
//  Copyright (c) 2015 Schloss Lab. All rights reserved.
//

#ifndef __Mothur__vsearchfileparser__
#define __Mothur__vsearchfileparser__

#include "mothurout.h"
#include "uniqueseqscommand.h"
#include "sequence.hpp"
#include "rabundvector.hpp"
#include "sabundvector.hpp"

/**************************************************************************************************/

class VsearchFileParser {
    
#ifdef UNIT_TEST
    friend class TestVsearchFileParser;
#endif
    
    public:
        VsearchFileParser();
        VsearchFileParser(string f); //fastafile
        VsearchFileParser(string f, string n, string format); //fastafile, name or count file, format("name" or "count")
        ~VsearchFileParser(){}
    
        string getVsearchFile(); //creates vsearch formatted file. degapped, abundance appended, and sorted.
        string getCountFile(); //returns count filename. If no names or count file is given, then a count file is generated. 
        ListVector createListFile(string uc, int numbins, string label, map<string, int>& counts); //takes vsearch output and creates listvector
        int getNumBins(string logfile);
        void setFastaFile(string f) { fastafile = f; }
    
    private:
        MothurOut* m;
        map<string, string> nameMap;
        map<string, int> counts;
        string fastafile, namefile, countfile, format;
        string getNamesFile(string& inputFile);
        string createVsearchFasta(string);
        string removeAbundances(string seqName);
    
    
};

/**************************************************************************************************/


#endif /* defined(__Mothur__vsearchfileparser__) */