//**********************************************************************************************************************
-FlowData::FlowData(int numFlows, float signal, float noise, int maxHomoP) :
- numFlows(numFlows), signalIntensity(signal), noiseIntensity(noise), maxHomoP(maxHomoP){
+FlowData::FlowData(int numFlows, float signal, float noise, int maxHomoP, string baseFlow) :
+ numFlows(numFlows), signalIntensity(signal), noiseIntensity(noise), maxHomoP(maxHomoP), baseFlow(baseFlow){
try {
m = MothurOut::getInstance();
flowData.assign(numFlows, 0);
- baseFlow = "TACG";
+// baseFlow = "TACG";
seqName = "";
locationString = "";
}
bool FlowData::getNext(ifstream& flowFile){
try {
-
- string lengthString;
- string flowString;
-
- flowFile >> seqName >> endFlow;
- for(int i=0;i<numFlows;i++) { flowFile >> flowData[i]; }
-
- updateEndFlow();
- translateFlow();
-
- m->gobble(flowFile);
+ flowFile >> seqName >> endFlow;
+ if (seqName.length() != 0) {
+ //cout << "in Flowdata " + seqName << endl;
+ for(int i=0;i<numFlows;i++) { flowFile >> flowData[i]; }
+ //cout << "in Flowdata read " << seqName + " done" << endl;
+ updateEndFlow();
+ translateFlow();
+ m->gobble(flowFile);
+ }else{ m->mothurOut("Error in reading your flowfile, at position " + toString(flowFile.tellg()) + ". Blank name."); m->mothurOutEndLine(); }
+
if(flowFile){ return 1; }
else { return 0; }
}
try{
maxFlows = mF;
- if(endFlow > maxFlows){ endFlow = maxFlows; }
+ if(endFlow > maxFlows){ endFlow = maxFlows; }
+ translateFlow();
}
catch(exception& e) {
}
//**********************************************************************************************************************
+
+string FlowData::getName(){
+
+ try{
+ return seqName;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "FlowData", "getName");
+ exit(1);
+ }
+}
+
+//**********************************************************************************************************************