Пример #1
0
void PhaseEstimator::NormalizeBasecallerRead(DPTreephaser& treephaser, BasecallerRead& read, int start_flow, int end_flow)
{
    switch (norm_method_) {
        case 0:
            treephaser.Normalize(read, start_flow, end_flow);
            break;
        case 1:
            treephaser.WindowedNormalize(read, (end_flow / windowSize_), windowSize_);
            break;
        case 2:
            treephaser.PIDNormalize(read, start_flow, end_flow);
            break;
        case 3: // Variable per-read normalization based on the number of negative valued zero-mers
            if (read.penalty_residual.at(0) >  maxfrac_negative_flows_)
              treephaser.WindowedNormalize(read, (end_flow / windowSize_), windowSize_);
            else
              treephaser.Normalize(read, start_flow, end_flow);
            break;
        case 4: // "off" do not do anything
            break;
        default:
            cerr << "PhaseEstimator: Unknown normalization method " << norm_method_ << endl;
            exit(EXIT_FAILURE);
    }
};
Пример #2
0
int HypothesisEvaluator::EvaluateOneHypothesis(DPTreephaser &working_treephaser, BasecallerRead &current_hypothesis, int applyNormalization) {

  int last_incorporating_flow = LastIncorporatingFlow(current_hypothesis);

  // Simulate sequence
  working_treephaser.Simulate(current_hypothesis, nFlows);

  // Adaptively normalize each hypothesis
  if (applyNormalization>0) {
    int window_size= 50;
    int steps = last_incorporating_flow / window_size;
    working_treephaser.WindowedNormalize(current_hypothesis, steps, window_size);
  }

  // Solver simulates beginning of the read and then fills in the remaining clipped bases
  working_treephaser.Solve(current_hypothesis, nFlows, last_incorporating_flow);
  /*cout << "Solved sequence of length: " << hypothesesReadsVector[r].sequence.size() << " ;nFlows = " << nFlows << endl;
  cout << "Total read: ";
  for (int i=0; i<hypothesesReadsVector[r].sequence.size(); i++)
   cout << hypothesesReadsVector[r].sequence[i];
  cout << endl;*/
  return(last_incorporating_flow);
}