for(int i=0;i<fastaFileNames.size();i++){
if (isBlank(fastaFileNames[i])) { remove(fastaFileNames[i].c_str()); }
+ else if (filesToRemove.count(fastaFileNames[i]) > 0) { remove(fastaFileNames[i].c_str()); }
else {
ifstream inFASTA;
string seqName;
int success = 1;
Sequence currSeq(inFASTA);
- cout << i << '\t' << currSeq.getName() << endl;
+
string origSeq = currSeq.getUnaligned();
if (origSeq != "") {
int groupBar, groupPrime;
}
}
outGroups << currSeq.getName() << '\t' << thisGroup << endl;
-
if(allFiles){
currSeq.printSequence(*fastaFileNames[indexToFastaFile]);
}
lines.clear();
- vector<long int> positions;
+ vector<unsigned long int> positions;
ifstream inFASTA;
openInputFile(filename, inFASTA);
input = getline(inFASTA);
if (input.length() != 0) {
- if(input[0] == '>'){ long int pos = inFASTA.tellg(); positions.push_back(pos - input.length() - 1); }
+ if(input[0] == '>'){ unsigned long int pos = inFASTA.tellg(); positions.push_back(pos - input.length() - 1); }
}
}
inFASTA.close();
int numFastaSeqs = positions.size();
FILE * pFile;
- long size;
+ unsigned long int size;
//get num bytes in file
pFile = fopen (filename.c_str(),"rb");
for (int i = 0; i < processors; i++) {
- long int startPos = positions[ i * numSeqsPerProcessor ];
+ unsigned long int startPos = positions[ i * numSeqsPerProcessor ];
if(i == processors - 1){
numSeqsPerProcessor = numFastaSeqs - i * numSeqsPerProcessor;
}else{
- long int myEnd = positions[ (i+1) * numSeqsPerProcessor ];
+ unsigned long int myEnd = positions[ (i+1) * numSeqsPerProcessor ];
}
lines.push_back(new linePair(startPos, numSeqsPerProcessor));
}
groupVector.push_back(group);
if(allFiles){
- if (group != "") { //there is a group for this primer
+ outFASTAVec.push_back((outputDir + getRootName(getSimpleName(fastaFile)) + toString(index) + "." + group + ".fasta"));
+ if (group == "") { //if there is not a group for this primer, then this file will not get written to, but we add it to keep the indexes correct
+ filesToRemove.insert((outputDir + getRootName(getSimpleName(fastaFile)) + toString(index) + "." + group + ".fasta"));
+ }else {
outputNames.push_back((outputDir + getRootName(getSimpleName(fastaFile)) + toString(index) + "." + group + ".fasta"));
- outFASTAVec.push_back((outputDir + getRootName(getSimpleName(fastaFile)) + toString(index) + "." + group + ".fasta"));
}
}