From 03acfa01ede71b107817966fcf27cd728038b3c9 Mon Sep 17 00:00:00 2001 From: pschloss Date: Wed, 9 Feb 2011 20:22:07 +0000 Subject: [PATCH] mods to trim.seqs --- Mothur.xcodeproj/project.pbxproj | 4 ++-- trimseqscommand.cpp | 20 +++----------------- trimseqscommand.h | 10 ++++++---- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/Mothur.xcodeproj/project.pbxproj b/Mothur.xcodeproj/project.pbxproj index 49131e5..6d6393f 100644 --- a/Mothur.xcodeproj/project.pbxproj +++ b/Mothur.xcodeproj/project.pbxproj @@ -1615,7 +1615,7 @@ attributes = { ORGANIZATIONNAME = "Schloss Lab"; }; - buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "mothur" */; + buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Mothur" */; compatibilityVersion = "Xcode 3.1"; developmentRegion = English; hasScannedForEncodings = 1; @@ -2036,7 +2036,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "mothur" */ = { + 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "Mothur" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB928A08733DD80010E9CD /* Debug */, diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index 2ad4f06..7f82366 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -14,7 +14,7 @@ vector TrimSeqsCommand::getValidParameters(){ try { - string Array[] = {"fasta", "flip", "oligos", "maxambig", "maxhomop", "group","minlength", "maxlength", "qfile", + string Array[] = {"fasta", "flip", "oligos", "maxambig", "maxhomop","minlength", "maxlength", "qfile", "qthreshold", "qwindowaverage", "qstepsize", "qwindowsize", "qaverage", "rollaverage", "keepfirst", "removelast", "allfiles", "qtrim","tdiffs", "pdiffs", "bdiffs", "processors", "outputdir","inputdir"}; @@ -35,7 +35,6 @@ TrimSeqsCommand::TrimSeqsCommand(){ vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["qual"] = tempOutNames; - outputTypes["group"] = tempOutNames; } catch(exception& e) { m->errorOut(e, "TrimSeqsCommand", "TrimSeqsCommand"); @@ -83,7 +82,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { else { //valid paramters for this command - string AlignArray[] = { "fasta", "flip", "oligos", "maxambig", "maxhomop", "group","minlength", "maxlength", "qfile", + string AlignArray[] = { "fasta", "flip", "oligos", "maxambig", "maxhomop", "minlength", "maxlength", "qfile", "qthreshold", "qwindowaverage", "qstepsize", "qwindowsize", "qaverage", "rollaverage", "keepfirst", "removelast", "allfiles", "qtrim","tdiffs", "pdiffs", "bdiffs", "processors", "outputdir","inputdir"}; @@ -105,7 +104,6 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { vector tempOutNames; outputTypes["fasta"] = tempOutNames; outputTypes["qual"] = tempOutNames; - outputTypes["group"] = tempOutNames; //if the user changes the input directory command factory will send this info to us in the output parameter string inputDir = validParameter.validFile(parameters, "inputdir", false); @@ -136,13 +134,6 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { if (path == "") { parameters["qfile"] = inputDir + it->second; } } - it = parameters.find("group"); - //user has given a template file - if(it != parameters.end()){ - path = m->hasPath(it->second); - //if the user has not given a path then, add inputdir. else leave path alone. - if (path == "") { parameters["group"] = inputDir + it->second; } - } } @@ -170,10 +161,6 @@ TrimSeqsCommand::TrimSeqsCommand(string option) { else if(temp == "not open"){ abort = true; } else { oligoFile = temp; } - temp = validParameter.validFile(parameters, "group", true); - if (temp == "not found"){ groupfile = ""; } - else if(temp == "not open"){ abort = true; } - else { groupfile = temp; } temp = validParameter.validFile(parameters, "maxambig", false); if (temp == "not found") { temp = "-1"; } convert(temp, maxAmbig); @@ -268,9 +255,8 @@ void TrimSeqsCommand::help(){ try { m->mothurOut("The trim.seqs command reads a fastaFile and creates 2 new fasta files, .trim.fasta and scrap.fasta, as well as group files if you provide and oligos file.\n"); m->mothurOut("The .trim.fasta contains sequences that meet your requirements, and the .scrap.fasta contains those which don't.\n"); - m->mothurOut("The trim.seqs command parameters are fasta, flip, oligos, group, maxambig, maxhomop, minlength, maxlength, qfile, qthreshold, qaverage, diffs, qtrim, keepfirst, removelast and allfiles.\n"); + m->mothurOut("The trim.seqs command parameters are fasta, flip, oligos, maxambig, maxhomop, minlength, maxlength, qfile, qthreshold, qaverage, diffs, qtrim, keepfirst, removelast and allfiles.\n"); m->mothurOut("The fasta parameter is required.\n"); - m->mothurOut("The group parameter allows you to enter a group file for your fasta file.\n"); m->mothurOut("The flip parameter will output the reverse compliment of your trimmed sequence. The default is false.\n"); m->mothurOut("The oligos parameter allows you to provide an oligos file.\n"); m->mothurOut("The maxambig parameter allows you to set the maximum number of ambigious bases allowed. The default is -1.\n"); diff --git a/trimseqscommand.h b/trimseqscommand.h index e4c2e0b..d43eaa4 100644 --- a/trimseqscommand.h +++ b/trimseqscommand.h @@ -38,7 +38,7 @@ private: linePair(unsigned long int i, unsigned long int j) : start(i), end(j) {} }; - void getOligos(vector&, vector&); + void getOligos(vector >&, vector >&); int stripBarcode(Sequence&, QualityScores&, int&); int stripForward(Sequence&, QualityScores&, int&); bool stripReverse(Sequence&, QualityScores&); @@ -67,13 +67,15 @@ private: map primers; map combos; map groupToIndex; - + vector primerNameVector; //needed here? + vector barcodeNameVector; //needed here? + vector processIDS; //processid vector lines; vector qLines; - int driverCreateTrim(string, string, string, string, string, string, string, vector, vector, linePair*, linePair*); - int createProcessesCreateTrim(string, string, string, string, string, string, string, vector, vector); + int driverCreateTrim(string, string, string, string, string, string, string, vector >, vector >, linePair*, linePair*); + int createProcessesCreateTrim(string, string, string, string, string, string, string, vector >, vector >); int setLines(string, string, vector&, vector&); }; -- 2.39.2