]> git.donarmstrong.com Git - mothur.git/blobdiff - sharedrabundvector.cpp
changed get.sharedotu to get.sharedseqs
[mothur.git] / sharedrabundvector.cpp
index 0a69e4c37849171e01544da40f2c09bbd86d40b0..142f787e24ac3663c19783874721299a071336cf 100644 (file)
@@ -101,6 +101,8 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                        
                }
                
+               gobble(f);
+               
                if (f.eof() != true) { f >> nextLabel; }
                
                //read the rest of the groups info in
@@ -126,6 +128,7 @@ SharedRAbundVector::SharedRAbundVector(ifstream& f) : DataVector(), maxRank(0),
                                lookup[count]->push_back(inputData, i, groupN); //abundance, bin, group
                        }
                        
+                       gobble(f);
                                
                        if (f.eof() != true) { f >> nextLabel; }
                }
@@ -379,12 +382,15 @@ vector<SharedRAbundVector*> SharedRAbundVector::getSharedRAbundVectors(){
 
 RAbundVector SharedRAbundVector::getRAbundVector() {
        try {
-               RAbundVector rav(data.size());
+               RAbundVector rav;
                
                for (int i = 0; i < data.size(); i++) {
-                       rav.set(i, data[i].abundance);
+                       if(data[i].abundance != 0) {
+                               rav.push_back(data[i].abundance);
+                       }
                }
-       
+               
+               rav.setLabel(label);
                return rav;
        }
        catch(exception& e) {