}
//read list file
- read = new ReadPhilFile(globaldata->getListFile());
+ read = new ReadOTUFile(globaldata->getListFile());
read->read(&*globaldata);
input = globaldata->ginput;
if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(list->getLabel()) == 1){
- //create output file
+ //make new folder for bin info
+ //string foldername = "/" + getRootName(globaldata->getListFile()) + list->getLabel() + ".bins/";
+ // mkdir(foldername.c_str());
+
string outputFileName = getRootName(globaldata->getListFile()) + list->getLabel() + ".fasta";
openOutputFile(outputFileName, out);
//for each bin in the list vector
for (int i = 0; i < list->size(); i++) {
+
+ //create output file
+ //string outputFileName = foldername + getRootName(globaldata->getListFile()) + "bin" + toString(i+1) + ".fasta";
+ //openOutputFile(outputFileName, out);
+
binnames = list->get(i);
while (binnames.find_first_of(',') != -1) {
name = binnames.substr(0,binnames.find_first_of(','));
//do work for that name
sequence = fasta->getSequence(name);
if (sequence != "not found") {
- name = name + "bin" + toString(i+1);
+ name = name + "|" + toString(i+1);
out << ">" << name << endl;
out << sequence << endl;
}else {
//get last name
sequence = fasta->getSequence(binnames);
if (sequence != "not found") {
- name = binnames + "bin" + toString(i+1);
+ name = binnames + '|' + toString(i+1);
out << ">" << name << endl;
out << sequence << endl;
}else {
remove(outputFileName.c_str());
return 0;
}
+ //out.close();
}
+ out.close();
}
list = input->getListVector();