Пример #1
0
void IsolatedSignalProcessing (
  SlicedPrequel    &my_prequel_setup,
  ImageSpecClass   &my_image_spec,
  Region           &wholeChip,
  OptArgs		   &opts,
  CommandLineOpts  &inception_state,
  string           &analysisLocation,
  SeqListClass     &my_keys,
  TrackProgress    &my_progress,
  ComplexMask      *complex_mask,
  BkgFitterTracker *bkg_fitter_tracker)
{
//@TODO: split function here as we immediately pick up the files

  ComplexMask from_beadfind_mask; //Todo: check if we can move this one level up so it is at the same level as the read in from the archive.
  if(!(inception_state.bkg_control.signal_chunks.restart_from.empty()))
  {
    from_beadfind_mask = *complex_mask;
  }
  else
    {
    // starting execution fresh
    from_beadfind_mask.InitMask();

    my_prequel_setup.LoadBeadFindForSignalProcessing ( true );

	Json::Value json1;
    vector<int> region_list;
	RetrieveParameterVectorInt(opts, json1, '-', "region-list", "", region_list);
	if(!region_list.empty())
	{
		my_prequel_setup.RestrictRegions(region_list);
	}

    if ( inception_state.bfd_control.beadMaskFile != NULL )
    {
      fprintf ( stdout, "overriding beadfind mask with %s\n", inception_state.bfd_control.beadMaskFile );
      from_beadfind_mask.my_mask->LoadMaskAndAbortOnFailure ( inception_state.bfd_control.beadMaskFile );
    }
    else
    {
      from_beadfind_mask.my_mask->LoadMaskAndAbortOnFailure ( my_prequel_setup.bfMaskFile.c_str() );
    }

    from_beadfind_mask.InitPinnedInFlow ( inception_state.flow_context.GetNumFlows() );
  }
  /********************************************************************
   *
   *  Background Modelling Process
   *
   *******************************************************************/
  // set up the directory for a new temporary wells file
  // clear out previous ones (can be bad with re-entrant processing!)
  ClearStaleWellsFile();
  inception_state.sys_context.MakeNewTmpWellsFile ( inception_state.sys_context.GetResultsFolder() );

  // feenableexcept(FE_DIVBYZERO | FE_INVALID); // | FE_OVERFLOW);

  // we might use some other model here
  if ( true )
  {
    DoThreadedSignalProcessing ( opts, inception_state, from_beadfind_mask, ChipIdDecoder::GetChipType(), my_image_spec,
                                 my_prequel_setup,my_keys, inception_state.mod_control.passTau, bkg_fitter_tracker);

  } // end BKG_MODL

  // whatever model we run, copy the signals to permanent location
  inception_state.sys_context.CopyTmpWellFileToPermanent (  inception_state.sys_context.GetResultsFolder() );

  inception_state.sys_context.CleanupTmpWellsFile (); // remove local file(!) how will this work with re-entrant processing????

  // mask file may be updated by model processing
  // analysis.bfmask.bin is what BaseCaller expects
  string analysisMaskFile  = analysisLocation + "analysis.bfmask.bin";
  string analysisStatFile  = analysisLocation + "analysis.bfmask.stats";
  from_beadfind_mask.my_mask->UpdateBeadFindOutcomes ( wholeChip, analysisMaskFile.c_str(), !inception_state.bfd_control.SINGLEBF, 0, analysisStatFile.c_str() );

  my_progress.ReportState ( "Raw flowgrams complete" );
}