A75790591301749D00A30DAB /* homovacommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A75790581301749D00A30DAB /* homovacommand.cpp */; };
A799F5B91309A3E000AEEFA0 /* makefastqcommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A799F5B81309A3E000AEEFA0 /* makefastqcommand.cpp */; };
A7A61F2D130062E000E05B6B /* amovacommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A61F2C130062E000E05B6B /* amovacommand.cpp */; };
+ A7AACFBC132FE008003D6C4D /* currentfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7AACFBB132FE008003D6C4D /* currentfile.cpp */; };
A7E9B88112D37EC400DA6239 /* ace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B64F12D37EC300DA6239 /* ace.cpp */; };
A7E9B88212D37EC400DA6239 /* aligncommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B65112D37EC300DA6239 /* aligncommand.cpp */; };
A7E9B88312D37EC400DA6239 /* alignment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7E9B65312D37EC300DA6239 /* alignment.cpp */; };
A7A61F1A130035C800E05B6B /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
A7A61F2B130062E000E05B6B /* amovacommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = amovacommand.h; sourceTree = "<group>"; };
A7A61F2C130062E000E05B6B /* amovacommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = amovacommand.cpp; sourceTree = "<group>"; };
+ A7AACFBA132FE008003D6C4D /* currentfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = currentfile.h; sourceTree = "<group>"; };
+ A7AACFBB132FE008003D6C4D /* currentfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = currentfile.cpp; sourceTree = "<group>"; };
A7E9B64F12D37EC300DA6239 /* ace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ace.cpp; sourceTree = "<group>"; };
A7E9B65012D37EC300DA6239 /* ace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ace.h; sourceTree = "<group>"; };
A7E9B65112D37EC300DA6239 /* aligncommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = aligncommand.cpp; sourceTree = "<group>"; };
A7E9B6B212D37EC400DA6239 /* commandoptionparser.hpp */,
A7E9B6B412D37EC400DA6239 /* completelinkage.cpp */,
A7E9BA4212D3960D00DA6239 /* containers */,
+ A7AACFBA132FE008003D6C4D /* currentfile.h */,
+ A7AACFBB132FE008003D6C4D /* currentfile.cpp */,
A7E9B6C912D37EC400DA6239 /* display.h */,
A7E9B6D112D37EC400DA6239 /* dlibshuff.cpp */,
A7E9B6D212D37EC400DA6239 /* dlibshuff.h */,
A7FA10021302E097003860FE /* mantelcommand.cpp in Sources */,
A799F5B91309A3E000AEEFA0 /* makefastqcommand.cpp in Sources */,
A71CB160130B04A2001E7287 /* anosimcommand.cpp in Sources */,
+ A7AACFBC132FE008003D6C4D /* currentfile.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
}else if (templateFileName == "not open") { abort = true; }
candidateFileName = validParameter.validFile(parameters, "candidate", false);
- if (candidateFileName == "not found") { m->mothurOut("candidate is a required parameter for the align.seqs command."); m->mothurOutEndLine(); abort = true; }
- else {
+ if (candidateFileName == "not found") {
+ //check currentFiles for a fasta file
+ if (currentFiles->getFastaFile() != "") { candidateFileName = currentFiles->getFastaFile(); m->mothurOut("Using " + candidateFileName + " as candidate file."); m->mothurOutEndLine();
+ }else { m->mothurOut("candidate is a required parameter for the align.seqs command."); m->mothurOutEndLine(); abort = true; }
+ }else {
m->splitAtDash(candidateFileName, candidateFileNames);
//go through files and make sure they are good, if not, then disregard them
}
}
- //if you can't open it, try default location
+ //if you can't open it, try output location
if (ableToOpen == 1) {
if (m->getOutputDir() != "") { //default path is set
string tryPath = m->getOutputDir() + m->getSimpleName(candidateFileNames[i]);
m->mothurOutEndLine();
}
-
+ //set align file as new current fastafile
+ string currentFasta = "";
+ itTypes = outputTypes.find("fasta");
+ if (itTypes != outputTypes.end()) {
+ if ((itTypes->second).size() != 0) { currentFasta = (itTypes->second)[0]; }
+ }
+ currentFiles->setFastaFile(currentFasta);
+ cout << "current fasta = " << currentFiles->getFastaFile() << endl;
m->mothurOutEndLine();
m->mothurOut("Output File Names: "); m->mothurOutEndLine();
for (int i = 0; i < outputNames.size(); i++) { m->mothurOut(outputNames[i]); m->mothurOutEndLine(); }
phylipFileName = validParameter.validFile(parameters, "phylip", true);
if (phylipFileName == "not open") { phylipFileName = ""; abort = true; }
- else if (phylipFileName == "not found") { phylipFileName = ""; }
- else if (designFileName == "not found") {
- designFileName = "";
- m->mothurOut("You must provide an phylip file.");
- m->mothurOutEndLine();
- abort = true;
+ else if (phylipFileName == "not found") {
+ phylipFileName = "";
+
+ //check currentFiles for a phylip file
+ if (currentFiles->getPhylipFile() != "") { phylipFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + phylipFileName + " as phylip file."); m->mothurOutEndLine();
+ }else { m->mothurOut("You must provide an phylip file."); m->mothurOutEndLine(); abort = true; }
}
//check for required parameters
if (designFileName == "not open") { abort = true; }
else if (designFileName == "not found") {
designFileName = "";
- m->mothurOut("You must provide an design file.");
- m->mothurOutEndLine();
- abort = true;
+
+ //check currentFiles for a design file
+ if (currentFiles->getDesignFile() != "") { designFileName = currentFiles->getPhylipFile(); m->mothurOut("Using " + designFileName + " as phylip file."); m->mothurOutEndLine();
+ }else { m->mothurOut("You must provide an design file."); m->mothurOutEndLine(); abort = true; }
}
string temp = validParameter.validFile(parameters, "iters", false);
while(!m8FileHandle.eof()){
m8FileHandle >> dummy >> templateAccession >> searchScore;
+ //cout << templateAccession << '\t' << searchScore << endl;
//get rest of junk in line
while (!m8FileHandle.eof()) { char c = m8FileHandle.get(); if (c == 10 || c == 13){ break; } }
}else if (searchMethod == "blast") {
//generate blastdb
- databaseLeft = new BlastDB(-2.0, -1.0, match, misMatch);
+ databaseLeft = new BlastDB(-1.0, -1.0, 1, -3);
for (int i = 0; i < templateSeqs.size(); i++) { databaseLeft->addSequence(*templateSeqs[i]); }
databaseLeft->generateDB();
databaseLeft->setNumSeqs(templateSeqs.size());
}else if (searchMethod == "blast") {
//generate blastdb
- databaseLeft = new BlastDB(-2.0, -1.0, match, misMatch);
+ databaseLeft = new BlastDB(-1.0, -1.0, 1, -3);
for (int i = 0; i < thisTemplate.size(); i++) { if (m->control_pressed) { return thisTemplate; } databaseLeft->addSequence(*thisTemplate[i]); }
databaseLeft->generateDB();
databaseLeft->setNumSeqs(thisTemplate.size());
#include "optionparser.h"
#include "validparameter.h"
#include "mothurout.h"
+#include "currentfile.h"
class Command {
public:
- Command() { m = MothurOut::getInstance(); }
+ Command() { m = MothurOut::getInstance(); currentFiles = CurrentFile::getInstance(); }
virtual vector<string> getValidParameters() = 0;
virtual vector<string> getRequiredParameters() = 0; //adding "or" as the last element indicates one of the previous is needed
virtual vector<string> getRequiredFiles() = 0; //adding "or" as the last element indicates one of the previous is needed
virtual ~Command() { }
protected:
MothurOut* m;
+ CurrentFile* currentFiles;
bool calledHelp;
+
+ map<string, vector<string> >::iterator itTypes;
};
#endif
--- /dev/null
+/*
+ * currentfile.cpp
+ * Mothur
+ *
+ * Created by westcott on 3/15/11.
+ * Copyright 2011 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "currentfile.h"
+
+/******************************************************/
+CurrentFile* CurrentFile::getInstance() {
+ if(_uniqueInstance == 0) {
+ _uniqueInstance = new CurrentFile();
+ }
+ return _uniqueInstance;
+}
+/*********************************************************************************************/
+CurrentFile::CurrentFile() {
+ phylipfile = "";
+ columnfile = "";
+ listfile = "";
+ rabundfile = "";
+ sabundfile = "";
+ namefile = "";
+ groupfile = "";
+ designfile = "";
+ orderfile = "";
+ treefile = "";
+ sharedfile = "";
+ ordergroupfile = "";
+ relabundfile = "";
+ fastafile = "";
+ qualfile = "";
+ sfffile = "";
+ oligosfile = "";
+}
+/*********************************************************************************************/
+CurrentFile::~CurrentFile() {
+ _uniqueInstance = 0;
+}
+/*********************************************************************************************/
+
+
--- /dev/null
+#ifndef CURRENTFILE_H
+#define CURRENTFILE_H
+
+/*
+ * currentfile.h
+ * Mothur
+ *
+ * Created by westcott on 3/15/11.
+ * Copyright 2011 Schloss Lab. All rights reserved.
+ *
+ */
+
+#include "mothur.h"
+
+/***********************************************/
+
+class CurrentFile {
+
+public:
+
+ static CurrentFile* getInstance();
+
+ string getPhylipFile() { return phylipfile; }
+ string getColumnFile() { return columnfile; }
+ string getListFile() { return listfile; }
+ string getRabundFile() { return rabundfile; }
+ string getSabundFile() { return sabundfile; }
+ string getNameFile() { return namefile; }
+ string getGroupFile() { return groupfile; }
+ string getOrderFile() { return orderfile; }
+ string getOrderGroupFile() { return ordergroupfile; }
+ string getTreeFile() { return treefile; }
+ string getSharedFile() { return sharedfile; }
+ string getRelAbundFile() { return relabundfile; }
+ string getDesignFile() { return designfile; }
+ string getFastaFile() { return fastafile; }
+ string getSFFFile() { return sfffile; }
+ string getQualFile() { return qualfile; }
+ string getOligosFile() { return oligosfile; }
+
+
+ void setListFile(string f) { listfile = f; }
+ void setTreeFile(string f) { treefile = f; }
+ void setGroupFile(string f) { groupfile = f; }
+ void setPhylipFile(string f) { phylipfile = f; }
+ void setColumnFile(string f) { columnfile = f; }
+ void setNameFile(string f) { namefile = f; }
+ void setRabundFile(string f) { rabundfile = f; }
+ void setSabundFile(string f) { sabundfile = f; }
+ void setSharedFile(string f) { sharedfile = f; }
+ void setRelAbundFile(string f) { relabundfile = f; }
+ void setOrderFile(string f) { orderfile = f; }
+ void setOrderGroupFile(string f) { ordergroupfile = f; }
+ void setDesignFile(string f) { designfile = f; }
+ void setFastaFile(string f) { fastafile = f; }
+ void setSFFFile(string f) { sfffile = f; }
+ void setQualFile(string f) { qualfile = f; }
+ void setOligosFile(string f) { oligosfile = f; }
+
+private:
+ static CurrentFile* _uniqueInstance;
+ CurrentFile( const CurrentFile& ); // Disable copy constructor
+ void operator=( const CurrentFile& ); // Disable assignment operator
+ CurrentFile();
+ ~CurrentFile();
+
+ string phylipfile, columnfile, listfile, rabundfile, sabundfile, namefile, groupfile, designfile;
+ string orderfile, treefile, sharedfile, ordergroupfile, relabundfile, fastafile, qualfile, sfffile, oligosfile;
+
+
+};
+/***********************************************/
+
+#endif
+
}
if (mergedResults.size() < numWanted) { numWanted = mergedResults.size(); }
-//cout << q->getName() << endl;
+//cout << q->getName() << " merged results size = " << mergedResults.size() << '\t' << "numwanted = " << numWanted << endl;
for (int i = 0; i < numWanted; i++) {
-//cout << db[mergedResults[i]]->getName() << endl;
+//cout << db[mergedResults[i]]->getName() << '\t' << mergedResults[i] << endl;
if (db[mergedResults[i]]->getName() != q->getName()) {
Sequence* temp = new Sequence(db[mergedResults[i]]->getName(), db[mergedResults[i]]->getAligned());
refResults.push_back(temp);
}
//cout << mergedResults[i] << endl;
}
-//cout << endl;
+//cout << "done " << q->getName() << endl;
delete queryRight;
delete queryLeft;