]> git.donarmstrong.com Git - mothur.git/blobdiff - trimseqscommand.cpp
added otu.association command. added calcSpearman, calcKendall and calcPearson functi...
[mothur.git] / trimseqscommand.cpp
index 89ea3f9c8b44c782e2a9ebd8588c548c61f9e81a..dd3427b9a9733285e5e793f78cabe5bdc3ed1cf3 100644 (file)
@@ -213,25 +213,25 @@ TrimSeqsCommand::TrimSeqsCommand(string option)  {
                        
                        
                        temp = validParameter.validFile(parameters, "maxambig", false);         if (temp == "not found") { temp = "-1"; }
-                       convert(temp, maxAmbig);  
+                       m->mothurConvert(temp, maxAmbig);  
 
                        temp = validParameter.validFile(parameters, "maxhomop", false);         if (temp == "not found") { temp = "0"; }
-                       convert(temp, maxHomoP);  
+                       m->mothurConvert(temp, maxHomoP);  
 
                        temp = validParameter.validFile(parameters, "minlength", false);        if (temp == "not found") { temp = "0"; }
-                       convert(temp, minLength); 
+                       m->mothurConvert(temp, minLength); 
                        
                        temp = validParameter.validFile(parameters, "maxlength", false);        if (temp == "not found") { temp = "0"; }
-                       convert(temp, maxLength);
+                       m->mothurConvert(temp, maxLength);
                        
                        temp = validParameter.validFile(parameters, "bdiffs", false);           if (temp == "not found") { temp = "0"; }
-                       convert(temp, bdiffs);
+                       m->mothurConvert(temp, bdiffs);
                        
                        temp = validParameter.validFile(parameters, "pdiffs", false);           if (temp == "not found") { temp = "0"; }
-                       convert(temp, pdiffs);
+                       m->mothurConvert(temp, pdiffs);
                        
                        temp = validParameter.validFile(parameters, "tdiffs", false);           if (temp == "not found") { int tempTotal = pdiffs + bdiffs;  temp = toString(tempTotal); }
-                       convert(temp, tdiffs);
+                       m->mothurConvert(temp, tdiffs);
                        
                        if(tdiffs == 0){        tdiffs = bdiffs + pdiffs;       }
                        
@@ -246,7 +246,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option)  {
                        else                                            {       nameFile = temp;        m->setNameFile(nameFile); }
                        
                        temp = validParameter.validFile(parameters, "qthreshold", false);       if (temp == "not found") { temp = "0"; }
-                       convert(temp, qThreshold);
+                       m->mothurConvert(temp, qThreshold);
                        
                        temp = validParameter.validFile(parameters, "qtrim", false);            if (temp == "not found") { temp = "t"; }
                        qtrim = m->isTrue(temp);
@@ -277,7 +277,7 @@ TrimSeqsCommand::TrimSeqsCommand(string option)  {
                        
                        temp = validParameter.validFile(parameters, "processors", false);       if (temp == "not found"){       temp = m->getProcessors();      }
                        m->setProcessors(temp);
-                       convert(temp, processors); 
+                       m->mothurConvert(temp, processors); 
                        
                        
                        if(allFiles && (oligoFile == "")){
@@ -292,6 +292,11 @@ TrimSeqsCommand::TrimSeqsCommand(string option)  {
                                m->mothurOut("You didn't set any options... quiting command."); m->mothurOutEndLine();
                                abort = true;
                        }
+                       
+                       if (nameFile == "") {
+                               vector<string> files; files.push_back(fastaFile);
+                               parser.getNameFile(files);
+                       }
                }
 
        }
@@ -1019,33 +1024,7 @@ int TrimSeqsCommand::setLines(string filename, string qfilename, vector<unsigned
                #else
                
                        fastaFilePos.push_back(0); qfileFilePos.push_back(0);
-                       //get last file position of fastafile
-                       FILE * pFile;
-                       unsigned long long size;
-                       
-                       //get num bytes in file
-                       pFile = fopen (filename.c_str(),"rb");
-                       if (pFile==NULL) perror ("Error opening file");
-                       else{
-                               fseek (pFile, 0, SEEK_END);
-                               size=ftell (pFile);
-                               fclose (pFile);
-                       }
-                       fastaFilePos.push_back(size);
-                       
-                       //get last file position of fastafile
-                       FILE * qFile;
-                       
-                       //get num bytes in file
-                       qFile = fopen (qfilename.c_str(),"rb");
-                       if (qFile==NULL) perror ("Error opening file");
-                       else{
-                               fseek (qFile, 0, SEEK_END);
-                               size=ftell (qFile);
-                               fclose (qFile);
-                       }
-                       qfileFilePos.push_back(size);
-               
+                       fastaFilePos.push_back(1000); qfileFilePos.push_back(1000);
                        return 1;
                
                #endif