From 905cc2b0bd18c5ce611b048d785e93859865a5ea Mon Sep 17 00:00:00 2001 From: westcott Date: Tue, 4 May 2010 13:45:52 +0000 Subject: [PATCH] fixed bug that caused bayesian cutoff not to work if iters > 100. fixed bug in trim.seqs caused by sequence length for qfile coming from fasta file. --- bayesian.cpp | 2 +- trimseqscommand.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bayesian.cpp b/bayesian.cpp index e5543cd..00467ff 100644 --- a/bayesian.cpp +++ b/bayesian.cpp @@ -274,7 +274,7 @@ string Bayesian::bootstrapResults(vector kmers, int tax, int numToSelect) { confidence = confidenceScores[seqTax.level][seqTax.name]; } - if (confidence >= confidenceThreshold) { + if (((confidence/(float)iters) * 100) >= confidenceThreshold) { confidenceTax = seqTax.name + "(" + toString(((confidence/(float)iters) * 100)) + ");" + confidenceTax; simpleTax = seqTax.name + ";" + simpleTax; } diff --git a/trimseqscommand.cpp b/trimseqscommand.cpp index ef7dfdd..bb45063 100644 --- a/trimseqscommand.cpp +++ b/trimseqscommand.cpp @@ -778,10 +778,14 @@ bool TrimSeqsCommand::compareDNASeq(string oligo, string seq){ bool TrimSeqsCommand::stripQualThreshold(Sequence& seq, ifstream& qFile){ try { string rawSequence = seq.getUnaligned(); - int seqLength = rawSequence.length(); - string name; + int seqLength; // = rawSequence.length(); + string name, temp, temp2; - qFile >> name; + qFile >> name >> temp; + + splitAtEquals(temp2, temp); //separates length=242, temp=length, temp2=242 + convert(temp, seqLength); //converts string to int + if (name.length() != 0) { if(name.substr(1) != seq.getName()) { m->mothurOut("sequence name mismatch btwn fasta and qual file"); m->mothurOutEndLine(); } } while (!qFile.eof()) { char c = qFile.get(); if (c == 10 || c == 13){ break; } } -- 2.39.2