+ if(hard.compare("") != 0) { F.doHard(hard); }
+ else { F.setFilter(string(alignmentLength, '1')); }
+
+ numSeqs = 0;
+
+ if(trump != '*' || isTrue(vertical) || soft != 0){
+ for (int s = 0; s < fastafileNames.size(); s++) {
+
+ for (int i = 0; i < lines.size(); i++) { delete lines[i]; } lines.clear();
+
+ #if defined (__APPLE__) || (__MACH__) || (linux) || (__linux)
+ if(processors == 1){
+ ifstream inFASTA;
+ openInputFile(fastafileNames[s], inFASTA);
+ int numFastaSeqs=count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
+ inFASTA.close();
+
+ numSeqs += numFastaSeqs;
+
+ lines.push_back(new linePair(0, numFastaSeqs));
+
+ driverCreateFilter(F, fastafileNames[s], lines[0]);
+ }else{
+ vector<int> positions;
+
+ ifstream inFASTA;
+ openInputFile(fastafileNames[s], inFASTA);
+
+ string input;
+ while(!inFASTA.eof()){
+ input = getline(inFASTA);
+ if (input.length() != 0) {
+ if(input[0] == '>'){ long int pos = inFASTA.tellg(); positions.push_back(pos - input.length() - 1); }
+ }
+ }
+ inFASTA.close();
+
+ int numFastaSeqs = positions.size();
+
+ numSeqs += numFastaSeqs;
+
+ int numSeqsPerProcessor = numFastaSeqs / processors;
+
+ for (int i = 0; i < processors; i++) {
+ long int startPos = positions[ i * numSeqsPerProcessor ];
+ if(i == processors - 1){
+ numSeqsPerProcessor = numFastaSeqs - i * numSeqsPerProcessor;
+ }
+ lines.push_back(new linePair(startPos, numSeqsPerProcessor));
+ }
+
+ createProcessesCreateFilter(F, fastafileNames[s]);
+ }
+ #else
+ ifstream inFASTA;
+ openInputFile(fastafileNames[s], inFASTA);
+ int numFastaSeqs=count(istreambuf_iterator<char>(inFASTA),istreambuf_iterator<char>(), '>');
+ inFASTA.close();
+
+ numSeqs += numFastaSeqs;
+
+ lines.push_back(new linePair(0, numFastaSeqs));
+
+ driverCreateFilter(F, lines[0], fastafileNames[s]);
+ #endif