File: filefile.hpp

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (100 lines) | stat: -rw-r--r-- 2,649 bytes parent folder | download | duplicates (3)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
//  filefile.hpp
//  Mothur
//
//  Created by Sarah Westcott on 12/5/18.
//  Copyright © 2018 Schloss Lab. All rights reserved.
//

#ifndef filefile_hpp
#define filefile_hpp

#include "mothurout.h"
#include "utils.hpp"
#include "currentfile.h"

/*
 file option 1
 
 sfffile1   oligosfile1
 sfffile2   oligosfile2
 ...
 
 file option 2
 
 fastqfile1 oligosfile1
 fastqfile2 oligosfile2
 ...
 
 file option 3
 
 ffastqfile1 rfastqfile1
 ffastqfile2 rfastqfile2
 ...
 
 file option 4 - only vaild if mode is set to parsefastqpacbio
 
 group1 pacBiofastqfile1
 group2 pacBiofastqfile2
 ...
 
 file option 5
 
 group fastqfile  fastqfile
 group fastqfile  fastqfile
 group fastqfile  fastqfile
 ...
 
 file option 6
 
 My.forward.fastq My.reverse.fastq none My.rindex.fastq //none is an option is no forward or reverse index file
 ...
 
 file option 7 - for make.count command
 
 group fastafile
 
 file option 8 - for make.count command
 
 group forwardFasta reverseFasta
 
 ********* fileOption; //1 -> 2 column(4 forms of 2 column), 2 -> 3 column, 3 -> 4 column ******************
 */
/**************************************************************************************************/

class FileFile {
    
public:
    FileFile(string, string); //provide file file and read file, mode (ie. contigs) mode options include: mimarks,contigs,parseFastq,renameSeqs,sra,parsefastqpacbio
    ~FileFile() = default;
    
    vector< vector<string> > getFiles() { return files; }
    
    bool isColumnWithGroupNames() { return columnWithGroups; }
    int getFileFormat() { return fileOption; }
    
    bool isGZ() { return gz; } //are files listed in file compressed
    bool containsIndexFiles() { return hasIndex; } //indicates oligos file is required
    vector<string> getGroupNames() { return groupNames; } //fileIndex2GroupName, files[0]'s group is -> groupNames[0]
    
protected:
    
    MothurOut* m;
    CurrentFile* current;
    Utils util;
    string filename, mode, mpath;
    bool gz, hasIndex, columnWithGroups;
    int fileOption; //1 -> 2 column(3 forms of 2 column), 2 -> 3 column, 3 -> 4 column
    vector< vector<string> > files;
    vector<string> groupNames;
    
    void read(string, string); //read file, used with () constructor
    bool validateFiles(vector<string> pieces, string& forward, string& reverse, string& findex, string& rindex, string& group); //checks locations, abletoOPen, fileOPtion
    void setGZ(string forward, string reverse, string findex, string rindex, bool&, bool&);
};

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



#endif /* filefile_hpp */