for (int j = 0; j < wordGenusProb.size(); j++) { wordGenusProb[j].resize(genusNodes.size()); }
+ ofstream out;
+ ofstream out2;
#ifdef USE_MPI
int pid;
if (pid == 0) {
#endif
- ofstream out;
+
openOutputFile(probFileName, out);
out << numKmers << endl;
- ofstream out2;
openOutputFile(probFileName2, out2);
#ifdef USE_MPI
//for each word
for (int i = 0; i < numKmers; i++) {
- if (m->control_pressed) { break; }
+ if (m->control_pressed) { break; }
#ifdef USE_MPI
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
wordGenusProb[i][k] = log((count[genusNodes[k]] + probabilityInTemplate) / (float) (genusTotals[k] + 1));
if (count[genusNodes[k]] != 0) {
#ifdef USE_MPI
+ int pid;
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+
if (pid == 0) {
#endif
#ifdef USE_MPI
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+
if (pid == 0) {
#endif
#ifdef USE_MPI
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
+
if (pid == 0) {
#endif
temp = validParameter.validFile(parameters, "minbs", false); if (temp == "not found") { temp = "90"; }
convert(temp, minBS);
- temp = validParameter.validFile(parameters, "minsnp", false); if (temp == "not found") { temp = "10"; }
+ temp = validParameter.validFile(parameters, "minsnp", false); if (temp == "not found") { temp = "100"; }
convert(temp, minSNP);
temp = validParameter.validFile(parameters, "parents", false); if (temp == "not found") { temp = "3"; }
m->mothurOut("The minsim parameter allows you to specify a minimum similarity with the parent fragments, default=90. \n");
m->mothurOut("The mincov parameter allows you to specify minimum coverage by closest matches found in template. Default is 70, meaning 70%. \n");
m->mothurOut("The minbs parameter allows you to specify minimum bootstrap support for calling a sequence chimeric. Default is 90, meaning 90%. \n");
- m->mothurOut("The minsnp parameter allows you to specify percent of SNPs to sample on each side of breakpoint for computing bootstrap support (default: 10) \n");
+ m->mothurOut("The minsnp parameter allows you to specify percent of SNPs to sample on each side of breakpoint for computing bootstrap support (default: 100) \n");
m->mothurOut("The search parameter allows you to specify search method for finding the closest parent. Choices are distance, blast, and kmer, default distance. \n");
m->mothurOut("The realign parameter allows you to realign the query to the potential parents. Choices are true or false, default false. \n");
m->mothurOut("The chimera.slayer command should be in the following format: \n");
m->mothurOut("Classifying sequences from " + fastaFileNames[s] + " ..." ); m->mothurOutEndLine();
+ string RippedTaxName = getRootName(getSimpleName(taxonomyFileName));
+ RippedTaxName = getExtension(RippedTaxName.substr(0, RippedTaxName.length()-1));
+ if (RippedTaxName[0] == '.') { RippedTaxName = RippedTaxName.substr(1, RippedTaxName.length()); }
+ RippedTaxName += ".";
+
if (outputDir == "") { outputDir += hasPath(fastaFileNames[s]); }
- string newTaxonomyFile = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + getRootName(getSimpleName(taxonomyFileName)) + "taxonomy";
+ string newTaxonomyFile = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + RippedTaxName + "taxonomy";
string tempTaxonomyFile = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + "taxonomy.temp";
- string taxSummary = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + getRootName(getSimpleName(taxonomyFileName)) + "tax.summary";
+ string taxSummary = outputDir + getRootName(getSimpleName(fastaFileNames[s])) + RippedTaxName + "tax.summary";
outputNames.push_back(newTaxonomyFile);
outputNames.push_back(taxSummary);
while(quitCommandCalled != 1){
-
+ #ifdef USE_MPI
+ int pid, processors;
+ MPI_Status status;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+ MPI_Comm_size(MPI_COMM_WORLD, &processors);
+
+ if (pid == 0) {
+
+ #endif
+
mout->mothurOutEndLine();
input = getCommand();
mout->mothurOutEndLine();
-
+
if (mout->control_pressed) { input = "quit()"; }
//allow user to omit the () on the quit command
if (input == "quit") { input = "quit()"; }
+
+
+ #ifdef USE_MPI
+ //send commandName
+ for(int i = 1; i < processors; i++) {
+ int length = input.length();
+ MPI_Send(&length, 1, MPI_INT, i, 2001, MPI_COMM_WORLD);
+ MPI_Send(&input[0], length, MPI_CHAR, i, 2001, MPI_COMM_WORLD);
+
+ }
+ }else {
+ int length;
+ MPI_Recv(&length, 1, MPI_INT, 0, 2001, MPI_COMM_WORLD, &status);
+ //recieve container
+ char* tempBuf = new char[length];
+ MPI_Recv(&tempBuf[0], length, MPI_CHAR, 0, 2001, MPI_COMM_WORLD, &status);
+
+ input = tempBuf;
+ if (input.length() > length) { input = input.substr(0, length); }
+ delete tempBuf;
+ }
+
+ #endif
+
CommandOptionParser parser(input);
commandName = parser.getCommandString();
#ifdef USE_MPI
int pid;
MPI_Comm_rank(MPI_COMM_WORLD, &pid);
-
-//cout << pid << " is here " << commandName << endl;
+
if ((cFactory->MPIEnabled(commandName)) || (pid == 0)) {
+ //cout << pid << " is in execute " << commandName << endl;
#endif
//executes valid command
Command* command = cFactory->getCommand(commandName, options);
/***********************************************************************/
string Engine::getCommand() {
try {
- #ifdef USE_MPI
- MPI_Barrier(MPI_COMM_WORLD);
- #endif
#if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
#ifdef USE_READLINE
int quitCommandCalled = 0;
int count = 0;
while(quitCommandCalled == 0){
-
+
+ #ifdef USE_MPI
+ int pid, processors;
+ MPI_Status status;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+ MPI_Comm_size(MPI_COMM_WORLD, &processors);
+
+ if (pid == 0) {
+
+ #endif
+
input = getNextCommand(inputBatchFile);
count++;
+ #ifdef USE_MPI
+ //send commandName
+ for(int i = 1; i < processors; i++) {
+ int length = input.length();
+ MPI_Send(&length, 1, MPI_INT, i, 2001, MPI_COMM_WORLD);
+ MPI_Send(&input[0], length, MPI_CHAR, i, 2001, MPI_COMM_WORLD);
+
+ }
+ }else {
+ int length;
+ MPI_Recv(&length, 1, MPI_INT, 0, 2001, MPI_COMM_WORLD, &status);
+ //recieve container
+ char* tempBuf = new char[length];
+ MPI_Recv(&tempBuf[0], length, MPI_CHAR, 0, 2001, MPI_COMM_WORLD, &status);
+
+ input = tempBuf;
+ if (input.length() > length) { input = input.substr(0, length); }
+ delete tempBuf;
+ }
+
+
+ #endif
+
+
+
if (input[0] != '#') {
mout->mothurOutEndLine();
string BatchEngine::getNextCommand(ifstream& inputBatchFile) {
try {
- #ifdef USE_MPI
- int err = MPI_Barrier(MPI_COMM_WORLD);
-//cout << "barrier = " << err << '\t' << MPI_SUCCESS << endl;
- #endif
-
string nextcommand = "";
if (inputBatchFile.eof()) { nextcommand = "quit()"; }
int quitCommandCalled = 0;
while(quitCommandCalled == 0){
-
+
+ #ifdef USE_MPI
+ int pid, processors;
+ MPI_Status status;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+ MPI_Comm_size(MPI_COMM_WORLD, &processors);
+
+ if (pid == 0) {
+
+ #endif
+
input = getNextCommand(listOfCommands);
if (input == "") { input = "quit()"; }
mout->mothurOut("mothur > " + input);
mout->mothurOutEndLine();
+ #ifdef USE_MPI
+ //send commandName
+ for(int i = 1; i < processors; i++) {
+ int length = input.length();
+ MPI_Send(&length, 1, MPI_INT, i, 2001, MPI_COMM_WORLD);
+ MPI_Send(&input[0], length, MPI_CHAR, i, 2001, MPI_COMM_WORLD);
+
+ }
+ }else {
+ int length;
+ MPI_Recv(&length, 1, MPI_INT, 0, 2001, MPI_COMM_WORLD, &status);
+ //recieve container
+ char* tempBuf = new char[length];
+ MPI_Recv(&tempBuf[0], length, MPI_CHAR, 0, 2001, MPI_COMM_WORLD, &status);
+
+ input = tempBuf;
+ if (input.length() > length) { input = input.substr(0, length); }
+ delete tempBuf;
+ }
+
+
+ #endif
+
+
if (mout->control_pressed) { input = "quit()"; }
//allow user to omit the () on the quit command
string ScriptEngine::getNextCommand(string& commandString) {
try {
- #ifdef USE_MPI
- MPI_Barrier(MPI_COMM_WORLD);
- #endif
-
string nextcommand = "";
int count = 0;
MPI_Status status;
MPI_Comm_size(MPI_COMM_WORLD, &processors); //set processors to the number of mpi processes running
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
-
+ cout << pid << "is in create filter " << endl;
MPI_File outMPI;
MPI_File tempMPI;
MPI_File inMPI;
//calc the total in this otu
int totalOtu = 0;
for (int l = 0; l < thisLookUp.size(); l++) { totalOtu += thisLookUp[l]->getAbundance(j); }
-
relabund = abund / (float) totalOtu;
}else if (scale == "averagegroup") {
relabund = abund / (float) (thisLookUp[i]->getNumSeqs() / (float) thisLookUp[i]->getNumBins());
# if you do not want to use the readline library, set this to no.
# make sure you have the library installed
-USEREADLINE ?= no
+USEREADLINE ?= yes
ifeq ($(strip $(USEREADLINE)),yes)
CXXFLAGS += -DUSE_READLINE
#endif
//header
- m->mothurOut("mothur v.1.12.0");
+ m->mothurOut("mothur v.1.12.1");
m->mothurOutEndLine();
- m->mothurOut("Last updated: 7/23/2010");
+ m->mothurOut("Last updated: 7/29/2010");
m->mothurOutEndLine();
m->mothurOutEndLine();
m->mothurOut("by");
vector<string> outputNames;
for(int i=0;i<vCalcs.size();i++){
- string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + ".venn." + sabund->getLabel() + vCalcs[i]->getName() + ".svg";
+ string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + "." + sabund->getLabel() + "." + vCalcs[i]->getName() + ".svg";
outputNames.push_back(filenamesvg);
openOutputFile(filenamesvg, outsvg);
//make a file for each calculator
for(int i=0;i<vCalcs.size();i++){
- string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+ string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + ".svg";
outputNames.push_back(filenamesvg);
openOutputFile(filenamesvg, outsvg);
//make a file for each calculator
for(int i=0;i<vCalcs.size();i++){
- string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+ string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + "-" + lookup[1]->getGroup() + ".svg";
+
outputNames.push_back(filenamesvg);
openOutputFile(filenamesvg, outsvg);
//make a file for each calculator
for(int i=0;i<vCalcs.size();i++){
- string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+ string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + "-" + lookup[1]->getGroup() + "-" + lookup[2]->getGroup() + ".svg";
+
outputNames.push_back(filenamesvg);
openOutputFile(filenamesvg, outsvg);
if ((vCalcs[i]->getName() != "sharedsobs") && (vCalcs[i]->getName() != "sharedchao")) { m->mothurOut(vCalcs[i]->getName() + " is not a valid calculator with four groups. It will be disregarded. "); m->mothurOutEndLine(); }
else{
- string filenamesvg = outputDir + getSimpleName(globaldata->inputFileName) + lookup[0]->getLabel() + ".venn." + vCalcs[i]->getName() + ".svg";
+ string filenamesvg = outputDir + getRootName(getSimpleName(globaldata->inputFileName)) + lookup[0]->getLabel() + "." + vCalcs[i]->getName() + "." + lookup[0]->getGroup() + "-" + lookup[1]->getGroup() + "-" + lookup[2]->getGroup() + "-" + lookup[3]->getGroup() + ".svg";
outputNames.push_back(filenamesvg);
openOutputFile(filenamesvg, outsvg);