kmerSize = k;
outputDir = o;
- templateDB = new AlignmentDB(templateFileName, "kmer", kmerSize, 0.0,0.0,0.0,0.0);
+ templateDB = new AlignmentDB(templateFileName, "kmer", kmerSize, 0.0,0.0,0.0,0.0, rand());
m->mothurOutEndLine();
kmer = new Kmer(kmerSize);
}
}
//***************************************************************************************************************
-int ChimeraCheckRDP::print(ostream& out, ostream& outAcc) {
+Sequence ChimeraCheckRDP::print(ostream& out, ostream& outAcc) {
try {
m->mothurOut("Processing: " + querySeq->getName()); m->mothurOutEndLine();
}
}
- return 0;
+ return *querySeq;
}
catch(exception& e) {
m->errorOut(e, "ChimeraCheckRDP", "print");
}
#ifdef USE_MPI
//***************************************************************************************************************
-int ChimeraCheckRDP::print(MPI_File& out, MPI_File& outAcc) {
+Sequence ChimeraCheckRDP::print(MPI_File& out, MPI_File& outAcc) {
try {
cout << "Processing: " << querySeq->getName() << endl;
MPI_Status status;
int length = outString.length();
- char buf[length];
- strcpy(buf, outString.c_str());
+ char* buf = new char[length];
+ memcpy(buf, outString.c_str(), length);
MPI_File_write_shared(out, buf, length, MPI_CHAR, &status);
-
+ delete buf;
+
if (svg) {
if (name != "") { //if user has specific names
map<string, string>::iterator it = names.find(querySeq->getName());
}
}
- return 0;
+ return *querySeq;
}
catch(exception& e) {
m->errorOut(e, "ChimeraCheckRDP", "print");
MPI_File inMPI;
MPI_Offset size;
MPI_Status status;
+
+ //char* inFileName = new char[namefile.length()];
+ //memcpy(inFileName, namefile.c_str(), namefile.length());
- char inFileName[namefile.length()];
+ char inFileName[1024];
strcpy(inFileName, namefile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- char buffer[size];
+ //delete inFileName;
+
+ char* buffer = new char[size];
MPI_File_read(inMPI, buffer, size, MPI_CHAR, &status);
string tempBuf = buffer;
if (tempBuf.length() > size) { tempBuf = tempBuf.substr(0, size); }
istringstream iss (tempBuf,istringstream::in);
+ delete buffer;
while(!iss.eof()) {
- iss >> name; gobble(iss);
+ iss >> name; m->gobble(iss);
names[name] = name;
}
#else
ifstream in;
- openInputFile(namefile, in);
+ m->openInputFile(namefile, in);
while (!in.eof()) {
- in >> name; gobble(in);
+ in >> name; m->gobble(in);
names[name] = name;
}
in.close();
try{
int common = 0;
- map<int, int>::iterator small;
- map<int, int>::iterator large;
+ map<int, int>::iterator smallone;
+ map<int, int>::iterator largeone;
+
if (query.size() < subject.size()) {
- for (small = query.begin(); small != query.end(); small++) {
- large = subject.find(small->first);
+ for (smallone = query.begin(); smallone != query.end(); smallone++) {
+ largeone = subject.find(smallone->first);
//if you found it they have that kmer in common
- if (large != subject.end()) { common++; }
+ if (largeone != subject.end()) { common++; }
}
}else {
- for (small = subject.begin(); small != subject.end(); small++) {
- large = query.find(small->first);
+ for (smallone = subject.begin(); smallone != subject.end(); smallone++) {
+ largeone = query.find(smallone->first);
//if you found it they have that kmer in common
- if (large != query.end()) { common++; }
+ if (largeone != query.end()) { common++; }
}
}
MPI_File outSVG;
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
+
+ //char* FileName = new char[file.length()];
+ //memcpy(FileName, file.c_str(), file.length());
- char FileName[file.length()];
+ char FileName[1024];
strcpy(FileName, file.c_str());
-
+
MPI_File_open(MPI_COMM_SELF, FileName, outMode, MPI_INFO_NULL, &outSVG); //comm, filename, mode, info, filepointer
+ //delete FileName;
+
int width = (info.size()*5) + 150;
string outString = "";
MPI_Status status;
int length = outString.length();
- char buf2[length];
- strcpy(buf2, outString.c_str());
+ char* buf2 = new char[length];
+ memcpy(buf2, outString.c_str(), length);
MPI_File_write(outSVG, buf2, length, MPI_CHAR, &status);
+ delete buf2;
MPI_File_close(&outSVG);
string file = outputDir + querySeq->getName() + ".chimeracheck.svg";
ofstream outsvg;
- openOutputFile(file, outsvg);
+ m->openOutputFile(file, outsvg);
int width = (info.size()*5) + 150;