]> git.donarmstrong.com Git - mothur.git/blobdiff - groupmap.cpp
Added get.line command.
[mothur.git] / groupmap.cpp
index 9cf5d7a53acf2f421bea5aeb7601a3efe674aee3..1f22013699014c6afa0b6de5b7ce1722c43acbc0 100644 (file)
@@ -3,7 +3,7 @@
  *  Dotur
  *
  *  Created by Sarah Westcott on 12/1/08.
- *  Copyright 2008 __MyCompanyName__. All rights reserved.
+ *  Copyright 2008 Schloss Lab UMASS Amherst. All rights reserved.
  *
  */
 
@@ -14,6 +14,7 @@
  GroupMap::GroupMap(string filename) {
        groupFileName = filename;
        openInputFile(filename, fileHandle);
+       index = 0;
 }
 
 /************************************************************/
@@ -36,12 +37,7 @@ void GroupMap::readMap() {
                fileHandle.close();
 }
 /************************************************************/
-
-int GroupMap::getNumGroups() {
-                       
-       return namesOfGroups.size();    
-               
-}
+int GroupMap::getNumGroups() { return namesOfGroups.size();    }
 /************************************************************/
 
 string GroupMap::getGroup(string sequenceName) {
@@ -52,11 +48,13 @@ string GroupMap::getGroup(string sequenceName) {
        }else {
                return "not found";
        }
-               
 }
 
 /************************************************************/
-
+void GroupMap::setGroup(string sequenceName, string groupN) {
+       groupmap[sequenceName] = groupN;
+}
+/************************************************************/
 void GroupMap::setNamesOfGroups(string seqGroup) {
                        int i, count;
                        count = 0;
@@ -69,6 +67,7 @@ void GroupMap::setNamesOfGroups(string seqGroup) {
                        }
                        if (count == namesOfGroups.size()) {
                                namesOfGroups.push_back(seqGroup); //new group
+                               groupIndex[seqGroup] = index;
+                               index++;
                        }
 }
-/************************************************************/
\ No newline at end of file