]> git.donarmstrong.com Git - mothur.git/blobdiff - getlineagecommand.cpp
mods in testing 1.16.0
[mothur.git] / getlineagecommand.cpp
index 4231435e556f205b753985bacca8d418b0d07c2c..8a6f47c0998202943e398fce09a9ae52edfa5eda 100644 (file)
@@ -677,8 +677,14 @@ vector< map<string, int> > GetLineageCommand::getTaxons(string tax) {
                                int openParen = taxon.find_first_of('(');
                                int closeParen = taxon.find_last_of(')');
                                
-                               string newtaxon = taxon.substr(0, openParen); //rip off confidence
-                               string confidence = taxon.substr((openParen+1), (closeParen-openParen-1));  
+                               string newtaxon, confidence;
+                               if ((openParen != string::npos) && (closeParen != string::npos)) {
+                                       newtaxon = taxon.substr(0, openParen); //rip off confidence
+                                       confidence = taxon.substr((openParen+1), (closeParen-openParen-1));  
+                               }else{
+                                       newtaxon = taxon;
+                                       confidence = "0";
+                               } 
                                int con = 0;
                                convert(confidence, con);