string getCommandName() { return "make.contigs"; }
string getCommandCategory() { return "Sequence Processing"; }
//commmand category choices: Sequence Processing, OTU-Based Approaches, Hypothesis Testing, Phylotype Analysis, General, Clustering and Hidden
- string getHelpString();
+ string getOutputFileNameTag(string, string);
+ string getHelpString();
string getCitation() { return "http://www.mothur.org/wiki/Make.contigs"; }
string getDescription() { return "description"; }
bool abort;
string outputDir, ffastqfile, rfastqfile, align;
float match, misMatch, gapOpen, gapExtend;
- int processors, longestBase;
+ int processors, longestBase, threshold;
vector<string> outputNames;
fastqRead readFastq(ifstream&);
vector<string> files;
MothurOut* m;
float match, misMatch, gapOpen, gapExtend;
- int count, threadID;
+ int count, threshold, threadID;
contigsData(){}
- contigsData(vector<string> f, string of, string oq, string om, string al, MothurOut* mout, float ma, float misMa, float gapO, float gapE, int tid) {
+ contigsData(vector<string> f, string of, string oq, string om, string al, MothurOut* mout, float ma, float misMa, float gapO, float gapE, int thr, int tid) {
files = f;
outputFasta = of;
outputQual = oq;
misMatch = misMa;
gapOpen = gapO;
gapExtend = gapE;
+ threshold = thr;
align = al;
count = 0;
threadID = tid;
contig += seq1[i];
contigScores.push_back(scores1[ABaseMap[i]]);
if (scores1[ABaseMap[i]] < scores2[BBaseMap[i]]) { contigScores[i] = scores2[BBaseMap[i]]; }
- }else if (((seq1[i] == '.') || (seq1[i] == '-')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //seq1 is a gap and seq2 is a base, choose seq2
- contig += seq2[i];
- contigScores.push_back(scores2[BBaseMap[i]]);
- }else if (((seq2[i] == '.') || (seq2[i] == '-')) && ((seq1[i] != '-') && (seq1[i] != '.'))) { //seq2 is a gap and seq1 is a base, choose seq1
- contig += seq1[i];
- contigScores.push_back(scores1[ABaseMap[i]]);
+ }else if (((seq1[i] == '.') || (seq1[i] == '-')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //seq1 is a gap and seq2 is a base, choose seq2, unless quality score for base is below threshold. In that case eliminate base
+ if (scores2[BBaseMap[i]] >= pDataArray->threshold)) {
+ contig += seq2[i];
+ contigScores.push_back(scores2[BBaseMap[i]]);
+ }
+ }else if (((seq2[i] == '.') || (seq2[i] == '-')) && ((seq1[i] != '-') && (seq1[i] != '.'))) { //seq2 is a gap and seq1 is a base, choose seq1, unless quality score for base is below threshold. In that case eliminate base
+ if (scores1[ABaseMap[i]] >= pDataArray->threshold) {
+ contig += seq1[i];
+ contigScores.push_back(scores1[ABaseMap[i]]);
+ }
}else if (((seq1[i] != '-') && (seq1[i] != '.')) && ((seq2[i] != '-') && (seq2[i] != '.'))) { //both bases choose one with better quality
char c = seq1[i];
contigScores.push_back(scores1[ABaseMap[i]]);