A7DA207D113FECD400BF472F /* heatmapsimcommand.h */,
A7DA207E113FECD400BF472F /* helpcommand.cpp */,
A7DA207F113FECD400BF472F /* helpcommand.h */,
- A7DA208D113FECD400BF472F /* libshuffcommand.cpp */,
A7DA208E113FECD400BF472F /* libshuffcommand.h */,
+ A7DA208D113FECD400BF472F /* libshuffcommand.cpp */,
A7DA2090113FECD400BF472F /* listseqscommand.h */,
A7DA208F113FECD400BF472F /* listseqscommand.cpp */,
A703FE931194645F002C397E /* makegroupcommand.h */,
if (m->control_pressed) { return 0; }
Sequence* candidateSeq = new Sequence(inFASTA); m->gobble(inFASTA);
-
+
int origNumBases = candidateSeq->getNumBases();
string originalUnaligned = candidateSeq->getUnaligned();
int numBasesNeeded = origNumBases * threshold;
}
delete candidateSeq;
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
}
delete candidateSeq;
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); }
}
delete candidateSeq;
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); }
}
delete candidateSeq;
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); }
}
delete candidateSeq;
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); }
string name, names;
- while(inNames){
+ while(!inNames.eof()){
inNames >> name; //read from first column A
inNames >> names; //read from second column A,B,C,D
m->gobble(inNames);
size = 0;
for (int i = 0; i < names.size(); i++) {
-
+
//if namesfile include the names
if (namefile != "") {
+
//is this sequence in the name file - namemap maps seqName -> repSeqName
it2 = nameMap.find(names[i]);
it = taxMap.find(it2->second);
if (it == taxMap.end()) { //this name is not in taxonomy file, skip it
- if (names[i] != it->second) { m->mothurOut(names[i] + " is represented by " + it2->second + " and is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
+
+ if (names[i] != it2->second) { m->mothurOut(names[i] + " is represented by " + it2->second + " and is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
else { m->mothurOut(names[i] + " is not in your taxonomy file. I will not include it in the consensus."); m->mothurOutEndLine(); }
}else{
//for each bin in the list vector
for (int i = 0; i < processList->getNumBins(); i++) {
+
conTax = findConsensusTaxonomy(i, processList, size);
-
+
if (m->control_pressed) { out.close(); return 0; }
//output to new names file
}
delete candidateSeq;
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); }
count++;
}
- unsigned long int pos = in.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = in.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (in.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
count++;
}
- unsigned long int pos = in.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = in.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (in.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
fileHandle.close();
return error;
}
+/************************************************************/
+int GroupMap::readDesignMap() {
+ string seqName, seqGroup;
+ int error = 0;
+
+ while(fileHandle){
+ fileHandle >> seqName; m->gobble(fileHandle); //read from first column
+ fileHandle >> seqGroup; //read from second column
+
+ if (m->control_pressed) { fileHandle.close(); return 1; }
+
+ setNamesOfGroups(seqGroup);
+
+ it = groupmap.find(seqName);
+
+ if (it != groupmap.end()) { error = 1; m->mothurOut("Your designfile contains more than 1 group named " + seqName + ", group names must be unique. Please correct."); m->mothurOutEndLine(); }
+ else {
+ groupmap[seqName] = seqGroup; //store data in map
+ seqsPerGroup[seqGroup]++; //increment number of seqs in that group
+ }
+ m->gobble(fileHandle);
+ }
+ fileHandle.close();
+ return error;
+}
+
/************************************************************/
int GroupMap::getNumGroups() { return namesOfGroups.size(); }
/************************************************************/
GroupMap(string);
~GroupMap();
int readMap();
+ int readDesignMap();
int getNumGroups();
bool isValidGroup(string); //return true if string is a valid group
string getGroup(string);
MOTHUR_FILES = "\"../Release\""
-RELEASE_DATE = "\"9/9/2010\""
+RELEASE_DATE = "\"9/17/2010\""
VERSION = "\"1.13.0\""
CXXFLAGS += -DRELEASE_DATE=${RELEASE_DATE} -DVERSION=${VERSION}
/***********************************************************************/
void MothurOut::gobble(istream& f){
try {
+
char d;
- while(isspace(d=f.get())) {;}
+ while(isspace(d=f.get())) { ;}
f.putback(d);
}
catch(exception& e) {
//estimate file breaks
unsigned long int chunkSize = 0;
chunkSize = size / proc;
-
+
//file to small to divide by processors
if (chunkSize == 0) { proc = 1; filePos.push_back(size); return filePos; }
char c = in.get();
if (c == '>') { in.putback(c); newSpot = in.tellg(); break; }
}
-
+
//there was not another sequence before the end of the file
unsigned long int sanityPos = in.tellg();
//sanity check filePos
for (int i = 0; i < (filePos.size()-1); i++) {
- if (filePos[(i+1)] <= filePos[i]) { filePos.erase(filePos.begin()+(i+1)); i--; }
+ if (filePos[(i+1)] <= filePos[i]) { cout << "erasing " << (i+1) << endl; filePos.erase(filePos.begin()+(i+1)); i--; }
}
proc = (filePos.size() - 1);
count++;
}
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
//report progress
if((count) % 100 == 0){ m->mothurOut("Processing sequence: " + toString(count)); m->mothurOutEndLine(); }
count++;
}
- unsigned long int pos = in.tellg();
- if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = in.tellg();
+ if ((pos == -1) || (pos >= filePos->end)) { break; }
+ #else
+ if (in.eof()) { break; }
+ #endif
//report progress
//if((count) % 100 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }
}
}
- while (!fastaString.eof()) { char c = fastaString.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ while (!fastaString.eof()) { char c = fastaString.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
sequence = getSequenceString(fastaString);
setAligned(sequence);
//setUnaligned removes any gap characters for us
setUnaligned(sequence);
}else{ m->mothurOut("Error in reading your fastafile, at position " + toString(fastaString.tellg()) + ". Blank name."); m->mothurOutEndLine(); }
-
+
}
catch(exception& e) {
m->errorOut(e, "Sequence", "Sequence");
}
}
- while (!fastaString.eof()) { char c = fastaString.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ while (!fastaString.eof()) { char c = fastaString.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
sequence = getSequenceString(fastaString);
//setUnaligned removes any gap characters for us
setUnaligned(sequence);
}else{ m->mothurOut("Error in reading your fastafile, at position " + toString(fastaString.tellg()) + ". Blank name."); m->mothurOutEndLine(); }
+
}
catch(exception& e) {
m->errorOut(e, "Sequence", "Sequence");
}
//read real sequence
- while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
sequence = getSequenceString(fastaFile);
-
+
setAligned(sequence);
//setUnaligned removes any gap characters for us
setUnaligned(sequence);
}else{ m->mothurOut("Error in reading your fastafile, at position " + toString(fastaFile.tellg()) + ". Blank name."); m->mothurOutEndLine(); }
-
+
}
catch(exception& e) {
m->errorOut(e, "Sequence", "Sequence");
}
//read real sequence
- while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
+ while (!fastaFile.eof()) { char c = fastaFile.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
sequence = getSequenceString(fastaFile);
//setUnaligned removes any gap characters for us
setUnaligned(sequence);
}else{ m->mothurOut("Error in reading your fastafile, at position " + toString(fastaFile.tellg()) + ". Blank name."); m->mothurOutEndLine(); }
-
+
}
catch(exception& e) {
m->errorOut(e, "Sequence", "Sequence");
count++;
}
- unsigned long int pos = inFASTA.tellg();
- if ((pos == -1) || (pos >= line->end)) { break; }
-
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ unsigned long int pos = inFASTA.tellg();
+ if ((pos == -1) || (pos >= line->end)) { break; }
+ #else
+ if (inFASTA.eof()) { break; }
+ #endif
+
//report progress
if((count) % 1000 == 0){ m->mothurOut(toString(count)); m->mothurOutEndLine(); }