void SearchAmplitude::ProjectionSearchAmplitude ( BeadTracker &my_beads, bool , bool sampledOnly, int flow_block_size, int flow_block_start ) const { // should be using a specific region pointer, not the universal one, to match the bead list // as we may generate more region pointers from more beads my_scratch->FillShiftedBkg ( *empty_trace, pointer_regions->rp.tshift, *time_c, true, flow_block_size ); my_scratch->ResetXtalkToZero(); // "emphasis" originally set to zero here, boosted up to the calling function to be explicit int TmpEmphasis[flow_block_size]; for( int fnum = 0 ; fnum < flow_block_size ; ++fnum ) TmpEmphasis[fnum] = 0; // all zero my_scratch->FillEmphasis ( TmpEmphasis,emphasis_data->EmphasisVectorByHomopolymer,emphasis_data->EmphasisScale, flow_block_size ); pointer_regions->cache_step.ForceLockCalculateNucRiseCoarseStep ( &pointer_regions->rp, *time_c, *my_flow ); // technically the same over the whole region for ( int ibd=0;ibd < my_beads.numLBeads;ibd++ ) { // want this for all beads, even if they are polyclonal. if (!sampledOnly || (sampledOnly && my_beads.Sampled(ibd))) { my_scratch->FillObserved ( *my_trace,ibd, flow_block_size ); // set scratch space for this bead ProjectionSearchOneBead ( &my_beads.params_nn[ibd], flow_block_size, flow_block_start ); my_beads.params_nn[ibd].ApplyAmplitudeZeros ( my_flow->dbl_tap_map, flow_block_size ); // force double-taps to zero } } // undo any problems we may have caused for the rest of the code pointer_regions->cache_step.Unlock(); }
void LevMarBeadAssistant::FinalComputeAndSetAverageResidual(BeadTracker& my_beads) { avg_resid = 0.0; float beads_counted = 0.0001; for (int ibd=0; ibd < numLBeads; ibd++){ // if this iteration is a region-wide parameter fit, then only process beads // in the sampled sub-group if ( my_beads.isSampled ) { // regional sampling enabled if (my_beads.Sampled(ibd) ) {// && my_beads.BeadIncluded(ibd,skip_beads) ) { avg_resid += residual[ibd]; beads_counted += 1.0f; } } else { // rolling regional groups enabled if (ValidBeadGroup (ibd)) { if (my_beads.BeadIncluded(ibd,skip_beads)) { avg_resid += residual[ibd]; beads_counted += 1.0f; } } } } avg_resid /= beads_counted; avg_resid_state = res_state; }