#include "ignoregaps.h"
#include "eachgapdist.h"
-
//***************************************************************************************************************
Ccode::Ccode(string filename, string temp, bool f, string mask, int win, int numW, string o) : Chimera() {
+ try {
+
fastafile = filename;
outputDir = o;
- templateFileName = temp; templateSeqs = readSeqs(temp);
+ templateFileName = temp; templateSeqs = readSeqs(temp);
setMask(mask);
filter = f;
window = win;
distCalc = new eachGapDist();
decalc = new DeCalculator();
- mapInfo = outputDir + getRootName(getSimpleName(fastafile)) + "mapinfo";
+ mapInfo = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "mapinfo";
#ifdef USE_MPI
#else
ofstream out2;
- openOutputFile(mapInfo, out2);
+ m->openOutputFile(mapInfo, out2);
out2 << "Place in masked, filtered and trimmed sequence\tPlace in original alignment" << endl;
out2.close();
#endif
+ }
+ catch(exception& e) {
+ m->errorOut(e, "Ccode", "Ccode");
+ exit(1);
+ }
}
//***************************************************************************************************************
Ccode::~Ccode() {
#endif
}
//***************************************************************************************************************
-int Ccode::print(ostream& out, ostream& outAcc) {
+Sequence Ccode::print(ostream& out, ostream& outAcc) {
try {
ofstream out2;
- openOutputFileAppend(mapInfo, out2);
+ m->openOutputFileAppend(mapInfo, out2);
out2 << querySeq->getName() << endl;
for (it = spotMap.begin(); it!= spotMap.end(); it++) {
//free memory
for (int i = 0; i < closest.size(); i++) { delete closest[i].seq; }
- return results;
+ return *querySeq;
}
catch(exception& e) {
m->errorOut(e, "Ccode", "print");
}
#ifdef USE_MPI
//***************************************************************************************************************
-int Ccode::print(MPI_File& out, MPI_File& outAcc) {
+Sequence Ccode::print(MPI_File& out, MPI_File& outAcc) {
try {
string outMapString = "";
//free memory
for (int i = 0; i < closest.size(); i++) { delete closest[i].seq; }
- return results;
+ return *querySeq;
}
catch(exception& e) {
m->errorOut(e, "Ccode", "print");
MPI_File_write_shared(outMap, buf, length, MPI_CHAR, &status);
delete buf;
+
+ return 0;
}
catch(exception& e) {