- if (m->debug) { m->mothurOut("[DEBUG]: reading type - " + type + ".\n"); }
-
- if(type[0] == '#'){
- while (!in.eof()) { char c = in.get(); if (c == 10 || c == 13){ break; } } // get rest of line if there's any crap there
- m->gobble(in);
- }
- else{
- m->gobble(in);
- //make type case insensitive
- for(int i=0;i<type.length();i++){ type[i] = toupper(type[i]); }
-
- in >> foligo;
-
- if (m->debug) { m->mothurOut("[DEBUG]: reading - " + foligo + ".\n"); }
-
- for(int i=0;i<foligo.length();i++){
- foligo[i] = toupper(foligo[i]);
- if(foligo[i] == 'U') { foligo[i] = 'T'; }
- }
-
- if(type == "PRIMER"){
- m->gobble(in);
-
- in >> roligo;
-
- for(int i=0;i<roligo.length();i++){
- roligo[i] = toupper(roligo[i]);
- if(roligo[i] == 'U') { roligo[i] = 'T'; }
- }
- //roligo = reverseOligo(roligo);
-
- group = "";
-
- // get rest of line in case there is a primer name
- while (!in.eof()) {
- char c = in.get();
- if (c == 10 || c == 13){ break; }
- else if (c == 32 || c == 9){;} //space or tab
- else { group += c; }
- }
-
- oligosPair newPrimer(foligo, roligo);
-
- //check for repeat barcodes
- string tempPair = foligo+roligo;
- if (uniquePrimers.count(tempPair) != 0) { m->mothurOut("primer pair " + newPrimer.forward + " " + newPrimer.reverse + " is in your oligos file already."); m->mothurOutEndLine(); }
- else { uniquePrimers.insert(tempPair); }
-
- if (m->debug) { if (group != "") { m->mothurOut("[DEBUG]: reading group " + group + ".\n"); }else{ m->mothurOut("[DEBUG]: no group for primer pair " + newPrimer.forward + " " + newPrimer.reverse + ".\n"); } }
-
- primers[indexPrimer]=newPrimer; indexPrimer++;
- primerNameVector.push_back(group);
- }else if(type == "BARCODE"){
- m->gobble(in);
-
- in >> roligo;
-
- for(int i=0;i<roligo.length();i++){
- roligo[i] = toupper(roligo[i]);
- if(roligo[i] == 'U') { roligo[i] = 'T'; }
- }
- //roligo = reverseOligo(roligo);
-
- oligosPair newPair(foligo, roligo);
-
- group = "";
- while (!in.eof()) {
- char c = in.get();
- if (c == 10 || c == 13){ break; }
- else if (c == 32 || c == 9){;} //space or tab
- else { group += c; }
- }
-
- if (m->debug) { m->mothurOut("[DEBUG]: barcode pair " + newPair.forward + " " + newPair.reverse + ", and group = " + group + ".\n"); }
-
- //check for repeat barcodes
- string tempPair = foligo+roligo;
- if (uniqueBarcodes.count(tempPair) != 0) { m->mothurOut("barcode pair " + newPair.forward + " " + newPair.reverse + " is in your oligos file already, disregarding."); m->mothurOutEndLine(); }
- else { uniqueBarcodes.insert(tempPair); }
-
- barcodes[indexBarcode]=newPair; indexBarcode++;
- barcodeNameVector.push_back(group);
- }else if(type == "LINKER"){
- linker.push_back(foligo);
- m->mothurOut("[WARNING]: make.contigs is not setup to remove linkers, ignoring.\n");
- }else if(type == "SPACER"){
- spacer.push_back(foligo);
- m->mothurOut("[WARNING]: make.contigs is not setup to remove spacers, ignoring.\n");
- }
- else{ m->mothurOut("[WARNING]: " + type + " is not recognized as a valid type. Choices are primer, barcode, linker and spacer. Ignoring " + foligo + "."); m->mothurOutEndLine(); }
- }
- m->gobble(in);
- }
- in.close();
-
- if(barcodeNameVector.size() == 0 && primerNameVector[0] == ""){ allFiles = 0; }
-
- //add in potential combos
- if(barcodeNameVector.size() == 0){
- oligosPair temp("", "");
- barcodes[0] = temp;
- barcodeNameVector.push_back("");
- }
-
- if(primerNameVector.size() == 0){
- oligosPair temp("", "");
- primers[0] = temp;
- primerNameVector.push_back("");
- }
-
- fastaFileNames.resize(barcodeNameVector.size());
+ if (m->control_pressed) { return false; }
+
+ numLinkers = oligos->getLinkers().size();
+ numSpacers = oligos->getSpacers().size();
+ numRPrimers = oligos->getReversePrimers().size();
+ if (numLinkers != 0) { m->mothurOut("[WARNING]: make.contigs is not setup to remove linkers, ignoring.\n"); }
+ if (numSpacers != 0) { m->mothurOut("[WARNING]: make.contigs is not setup to remove spacers, ignoring.\n"); }
+
+ vector<string> groupNames = oligos->getGroupNames();
+ if (groupNames.size() == 0) { allFiles = 0; allBlank = true; }
+
+
+ fastaFileNames.resize(oligos->getBarcodeNames().size());