X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=alignmentdb.cpp;h=f59c5db7d6e6ef2d039ccdda8b48a6ea3fb6428a;hb=e0ce7cbc93d7d2fbb753ca694182db092a0ea0e7;hp=6ccfd39edf3562d6795db6c9de131287b86241e0;hpb=d3aed959ca3b68890eeb7b815e24210bcfeb256c;p=mothur.git diff --git a/alignmentdb.cpp b/alignmentdb.cpp index 6ccfd39..f59c5db 100644 --- a/alignmentdb.cpp +++ b/alignmentdb.cpp @@ -14,34 +14,7 @@ #include "referencedb.h" /**************************************************************************************************/ -//deep copy -AlignmentDB::AlignmentDB(const AlignmentDB& adb) : numSeqs(adb.numSeqs), longest(adb.longest), method(adb.method), emptySequence(adb.emptySequence) { - try { - - m = MothurOut::getInstance(); - if (adb.method == "blast") { - search = new BlastDB(*((BlastDB*)adb.search)); - }else if(adb.method == "kmer") { - search = new KmerDB(*((KmerDB*)adb.search)); - }else if(adb.method == "suffix") { - search = new SuffixDB(*((SuffixDB*)adb.search)); - }else { - m->mothurOut("[ERROR]: cannot create copy of alignment database, unrecognized method - " + adb.method); m->mothurOutEndLine(); - } - - for (int i = 0; i < adb.templateSequences.size(); i++) { - Sequence temp(adb.templateSequences[i]); - templateSequences.push_back(temp); - } - } - catch(exception& e) { - m->errorOut(e, "AlignmentDB", "AlignmentDB"); - exit(1); - } - -} -/**************************************************************************************************/ -AlignmentDB::AlignmentDB(string fastaFileName, string s, int kmerSize, float gapOpen, float gapExtend, float match, float misMatch){ // This assumes that the template database is in fasta format, may +AlignmentDB::AlignmentDB(string fastaFileName, string s, int kmerSize, float gapOpen, float gapExtend, float match, float misMatch, int tid){ // This assumes that the template database is in fasta format, may try { // need to alter this in the future? m = MothurOut::getInstance(); longest = 0; @@ -49,6 +22,7 @@ AlignmentDB::AlignmentDB(string fastaFileName, string s, int kmerSize, float gap bool needToGenerate = true; ReferenceDB* rdb = ReferenceDB::getInstance(); bool silent = false; + threadID = tid; if (fastaFileName == "saved-silent") { fastaFileName = "saved"; silent = true; @@ -76,7 +50,7 @@ AlignmentDB::AlignmentDB(string fastaFileName, string s, int kmerSize, float gap #ifdef USE_MPI int pid, processors; - vector positions; + vector positions; MPI_Status status; MPI_File inMPI; @@ -189,7 +163,7 @@ AlignmentDB::AlignmentDB(string fastaFileName, string s, int kmerSize, float gap #endif } else if(method == "suffix") { search = new SuffixDB(numSeqs); } - else if(method == "blast") { search = new BlastDB(fastaFileName.substr(0,fastaFileName.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, ""); } + else if(method == "blast") { search = new BlastDB(fastaFileName.substr(0,fastaFileName.find_last_of(".")+1), gapOpen, gapExtend, match, misMatch, "", threadID); } else { method = "kmer"; m->mothurOut(method + " is not a valid search option. I will run the command using kmer, ksize=8."); @@ -231,7 +205,7 @@ AlignmentDB::AlignmentDB(string s){ method = s; if(method == "suffix") { search = new SuffixDB(); } - else if(method == "blast") { search = new BlastDB(""); } + else if(method == "blast") { search = new BlastDB("", 0); } else { search = new KmerDB(); }