]> git.donarmstrong.com Git - mothur.git/blobdiff - binsequencecommand.cpp
removed "shared" from some of the calculator names and classes
[mothur.git] / binsequencecommand.cpp
index 5db29329cb28a569542581bc4a47b1cb38b6a7bf..c3c68abacffd43efaf5768796655e8816da87bd6 100644 (file)
@@ -67,7 +67,10 @@ int BinSeqCommand::execute(){
                        
                        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);
 
@@ -75,6 +78,11 @@ int BinSeqCommand::execute(){
                                
                                //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(','));
@@ -83,7 +91,7 @@ int BinSeqCommand::execute(){
                                                //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 { 
@@ -105,7 +113,9 @@ int BinSeqCommand::execute(){
                                                remove(outputFileName.c_str());
                                                return 0;
                                        }
+                                       //out.close();
                                }
+                               out.close();
                        }
                        
                        list = input->getListVector();