Пример #1
0
//***************************************************************************************************************
Ccode::Ccode(string filename, string temp, bool f, string mask, int win, int numW, string o) : MothurChimera() {  
 try {	
	
	fastafile = filename;  
	outputDir = o; 
	templateFileName = temp;  templateSeqs = readSeqs(temp); 
	setMask(mask);
	filter = f;
	window = win;
	numWanted = numW;
	
	distCalc = new eachGapDist();
	decalc = new DeCalculator();
	
	mapInfo = outputDir + m->getRootName(m->getSimpleName(fastafile)) + "mapinfo";
    
     ofstream out2;
     m->openOutputFile(mapInfo, out2);
     
     out2 << "Place in masked, filtered and trimmed sequence\tPlace in original alignment" << endl;
     out2.close();
	
	}
	catch(exception& e) {
		m->errorOut(e, "Ccode", "Ccode");
		exit(1);
	}
}
Пример #2
0
Bellerophon::Bellerophon(string name, bool filterSeqs,  bool c, int win, int inc, int p, string o) : Chimera() {
	try {
		fastafile = name;
		correction = c;
		outputDir = o;
		window = win;
		increment = inc;
		processors = p;
		
		//read in sequences
		seqs = readSeqs(fastafile);
		numSeqs = seqs.size();
		if (numSeqs == 0) { m->mothurOut("Error in reading you sequences."); m->mothurOutEndLine(); exit(1); }
	
		//do soft filter
		if (filterSeqs)  {
			createFilter(seqs, 0.5);
			for (int i = 0; i < seqs.size(); i++) {  runFilter(seqs[i]);  }
		}
		
		distCalculator = new eachGapDist();
		
		//set default window to 25% of sequence length
		string seq0 = seqs[0]->getAligned();
		if (window == 0) { window = seq0.length() / 4;  }
		else if (window > (seq0.length() / 2)) {  
			m->mothurOut("Your sequence length is = " + toString(seq0.length()) + ". You have selected a window size greater than the length of half your aligned sequence. I will run it with a window size of " + toString((seq0.length() / 2))); m->mothurOutEndLine();
			window = (seq0.length() / 2);
		}
		
		if (increment > (seqs[0]->getAlignLength() - (2*window))) { 
			if (increment != 10) {
			
				m->mothurOut("You have selected a increment that is too large. I will use the default."); m->mothurOutEndLine();
				increment = 10;
				if (increment > (seqs[0]->getAlignLength() - (2*window))) {  increment = 0;  }
				
			}else{ increment = 0; }
		}
		
		if (increment == 0) { iters = 1; }
		else { iters = ((seqs[0]->getAlignLength() - (2*window)) / increment); }
		
		//initialize pref
		pref.resize(iters);
		for (int i = 0; i < iters; i++) { 
			Preference temp;
			for (int j = 0; j < numSeqs; j++) {  
				pref[i].push_back(temp); 
			}
		} 

	}
	catch(exception& e) {
		m->errorOut(e, "Bellerophon", "Bellerophon");
		exit(1);
	}
}
Пример #3
0
AHalfLifeDecoder::AHalfLifeDecoder(const char *fname) : AMeshDecoder(fname)
{
  init();
  openFile(fname);
  readHeader();
  if(numbones) readBones();
  if(numbonecontrollers) readBoneControllers();
  if(numhitboxes) readHitBoxes();
  if(numseq) readSeqs();
  if(numseqgroups) readSeqGroups();
  if(numtextures) readTextures();
  if(numskinref*numskinfamilies) readSkins();
  if(numbodyparts) readBodyParts();
  if(numattachments) readAttachments();
  if(soundtable) readSounds();
  if(soundgroups) readSoundGroups();
  if(numtransitions) readTransitions();
}