File: clusterfragmentscommand.h

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (70 lines) | stat: -rwxr-xr-x 1,902 bytes parent folder | download | duplicates (4)
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
#ifndef CLUSTERFRAGMENTSCOMMAND_H
#define CLUSTERFRAGMENTSCOMMAND_H

/*
 *  clusterfragmentscommand.h
 *  Mothur
 *
 *  Created by westcott on 9/23/10.
 *  Copyright 2010 Schloss Lab. All rights reserved.
 *
 */


#include "command.hpp"
#include "sequence.hpp"
#include "counttable.h"

/************************************************************/
struct seqRNode {
	int numIdentical;
	int length;
	Sequence seq;
	string names;
	bool active;
    seqRNode() = default;
	seqRNode(int n, Sequence s, string nm, int l) : numIdentical(n), seq(s), names(nm), active(1), length(l) {}
	~seqRNode() = default;
};
/************************************************************/

class ClusterFragmentsCommand : public Command {
	
public:
	ClusterFragmentsCommand(string);
	~ClusterFragmentsCommand() = default;
	
	vector<string> setParameters();
	string getCommandName()			{ return "cluster.fragments";		}
	string getCommandCategory()		{ return "Sequence Processing";		}
	
	string getHelpString();	
    string getOutputPattern(string);	
	string getCitation() { return "http://www.mothur.org/wiki/Cluster.fragments"; }
	string getDescription()		{ return "creates a namesfile with sequences that are a fragment of a larger sequence"; }
	
	int execute(); 
	void help() { m->mothurOut(getHelpString()); }	
	
private:
    CountTable ct;
	bool abort;
	string fastafile, namefile, countfile;
	int diffs, percent;
	vector<seqRNode> alignSeqs; 
	map<string, string> names; //represents the names file first column maps to second column
	map<string, int> sizes;  //this map a seq name to the number of identical seqs in the names file
	map<string, int>::iterator itSize; 
	vector<string> outputNames;
	
	int readFASTA();
	void readNameFile();
	void printData(string, string); //fasta filename, names file name
	bool isFragment(string, string);
	
};

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

#endif