Esempio n. 1
0
/*************************************************************************************************
 *************************************************************************************************
 *
 *  Start of Main Function
 *
 *************************************************************************************************
 ************************************************************************************************/
int main (int argc, char *argv[])
{

  init_salute();
#ifdef _DEBUG
  atexit (memstatus);
  dbgmemInit();
#endif /* _DEBUG */
  ofstream null_ostream("/dev/null"); // must stay live for entire scope, or crash when writing
  TheSilenceOfTheArmadillos(null_ostream);
  
  TrackProgress my_progress;  
  DumpStartingStateOfProgram (argc,argv,my_progress);

  CommandLineOpts inception_state (argc, argv);
  SeqListClass my_keys;
  ImageSpecClass my_image_spec;
  SlicedPrequel my_prequel_setup;  

  SetUpOrLoadInitialState(inception_state, my_keys, my_progress, my_image_spec, my_prequel_setup);

  // Start logging process parameters & timing now that we have somewhere to log
  my_progress.InitFPLog(inception_state);

  // Write processParameters.parse file now that processing is about to begin
  my_progress.WriteProcessParameters(inception_state);
  
  // Do separator
  Region wholeChip(0, 0, my_image_spec.cols, my_image_spec.rows);
  IsolatedBeadFind( my_prequel_setup, my_image_spec, wholeChip, inception_state,
        inception_state.sys_context.GetResultsFolder(), inception_state.sys_context.analysisLocation,  my_keys, my_progress);

  exit (EXIT_SUCCESS);
}
Esempio n. 2
0
/*************************************************************************************************
 *************************************************************************************************
 *
 *  Start of Main Function
 *
 *************************************************************************************************
 ************************************************************************************************/
int main (int argc, char *argv[])
{
  init_salute();
#ifdef _DEBUG
  atexit (memstatus);
  dbgmemInit();
#endif /* _DEBUG */
  ofstream null_ostream("/dev/null"); // must stay live for entire scope, or crash when writing
  TheSilenceOfTheArmadillos(null_ostream);
  
  TrackProgress my_progress;  
  DumpStartingStateOfProgram (argc,argv,my_progress);

  CommandLineOpts inception_state (argc, argv);
  SeqListClass my_keys;
  ImageSpecClass my_image_spec;
  SlicedPrequel my_prequel_setup;

  InitStackUnwind(inception_state.sys_context.stackDumpFile);

  SetUpOrLoadInitialState(inception_state, my_keys, my_progress, my_image_spec, my_prequel_setup);
  
  // Start logging process parameters & timing now that we have somewhere to log
  my_progress.InitFPLog(inception_state);

  // Write processParameters.parse file now that processing is about to begin
  my_progress.WriteProcessParameters(inception_state);

  // Do background model
  RealImagesToWells ( inception_state, my_keys, my_progress, my_image_spec,
		      my_prequel_setup);

  my_progress.ReportState ("Analysis (wells file only) Complete");

  exit (EXIT_SUCCESS);
}
Esempio n. 3
0
/*************************************************************************************************
 *************************************************************************************************
 *
 *  Start of Main Function
 *
 *************************************************************************************************
 ************************************************************************************************/
int main (int argc, char *argv[])
{
  init_salute();

  ofstream null_ostream("/dev/null"); // must stay live for entire scope, or crash when writing
  TheSilenceOfTheArmadillos(null_ostream);

  TrackProgress my_progress;  
  DumpStartingStateOfProgram (argc,argv,my_progress);
   
  if(argc < 2)
  {
      PrintHelp();
  }

  for(int i = 1; i < argc; ++i)
  {
	  string s = argv[i];
	  if(s == "-" || s == "--")
	  {
	      cerr << "ERROR: command line input \"-\" must be followed by a short option name (a letter) and \"--\" must be followed by a long option name." << endl; 
		  exit ( EXIT_FAILURE );
	  }
	  else if(s == "-?" || s == "-h" || s == "--help")
	  {
	      PrintHelp();
	  }
  }

  ValidateOpts validater;
  validater.Validate(argc, argv);

  char** argv2 = new char*[argc];
  int datind = TrapAndDeprecateOldArgs(argc, argv, argv2);

  OptArgs opts;
  opts.ParseCmdLine(argc, (const char**)argv2);

  for(int k = 0; k < argc ; ++k)
  {
	  delete [] argv2[k];
  }
  delete [] argv2;
   
  Json::Value json_params;
  CommandLineOpts inception_state;
  inception_state.SetOpts(opts, json_params);

  if(datind < 0) // there is no "--dat-source-directory"
  {
	  inception_state.sys_context.dat_source_directory = argv[argc - 1];
	  cout << "dat_source_directory = " << inception_state.sys_context.dat_source_directory << endl;
  }

  inception_state.PostProcessArgs(opts);

  SeqListClass my_keys;
  ImageSpecClass my_image_spec;
  SlicedPrequel my_prequel_setup;  

  SetUpOrLoadInitialState(inception_state, my_keys, my_progress, my_image_spec, my_prequel_setup);

  // Start logging process parameters & timing now that we have somewhere to log
  my_progress.InitFPLog(inception_state);

  // Write processParameters.parse file now that processing is about to begin
  my_progress.WriteProcessParameters(inception_state);
  
  // Do separator
  Region wholeChip(0, 0, my_image_spec.cols, my_image_spec.rows);
  IsolatedBeadFind( my_prequel_setup, my_image_spec, wholeChip, inception_state,
        inception_state.sys_context.GetResultsFolder(), inception_state.sys_context.analysisLocation,  my_keys, my_progress);

  exit (EXIT_SUCCESS);
}
Esempio n. 4
0
/*************************************************************************************************
 *************************************************************************************************
 *
 *  Start of Main Function
 *
 *************************************************************************************************
 ************************************************************************************************/
int main (int argc, char *argv[])
{

  init_salute();
#ifdef _DEBUG
  atexit (memstatus);
  dbgmemInit();
#endif /* _DEBUG */
  // Disable armadillo warning messages.
  ofstream null_ostream("/dev/null");
  arma::set_stream_err1(null_ostream);
  arma::set_stream_err2(null_ostream);
  TrackProgress my_progress;
  DumpStartingStateOfProgram (argc,argv,my_progress);

  CommandLineOpts clo (argc, argv);

  InitPinnedWellReporterSystem (clo.img_control);

  // Directory to which results files will be written
  char *experimentName = NULL;
  experimentName = strdup (clo.GetExperimentName());

  CreateResultsFolder (experimentName);
  CreateResultsFolder (clo.sys_context.basecaller_output_directory);

  string analysisLocation;
  clo.sys_context.SetUpAnalysisLocation (experimentName,analysisLocation);

  // Start logging process parameters & timing now that we have somewhere to log to
  my_progress.fpLog = clo.InitFPLog();

  // create a raw wells file object
  // for new analysis, this is a file to be created; for reprocessing, this is the wells file to be read.
  // create the new wells file on a local partition.
  ClearStaleWellsFile();
  clo.sys_context.MakeNewTmpWellsFile (experimentName);

  RawWells rawWells (clo.sys_context.wellsFilePath, clo.sys_context.wellsFileName);

  int well_rows, well_cols; // dimension of wells file - found out from images if we use them - why is this separate from the rawWells object?

  // structure our flows & special key sequences we look for
  int numFlows = clo.GetNumFlows();

  SeqListClass my_keys;
  my_keys.StdInitialize (clo.flow_context.flowOrder,clo.key_context.libKey, clo.key_context.tfKey,my_progress.fpLog); // 8th duplicated flow processing code
  //@TODO: these parameters are just for reporting purposes???
  // they appear to be ignored everywhere
  my_keys.UpdateMinFlows (clo.key_context.minNumKeyFlows);
  my_keys.UpdateMaxFlows (clo.key_context.maxNumKeyFlows);

  // GENERATE FUNCTIONAL WELLS FILE & BEADFIND FROM IMAGES OR PREVIOUS PROCESS

  Region wholeChip;

  //Create empty Mask object
  ExportSubRegionSpecsToMask (clo.loc_context);

  Mask bfmask (1, 1);
  Mask *maskPtr = &bfmask;

  GetFromImagesToWells (rawWells, maskPtr, clo, experimentName, analysisLocation, numFlows, my_keys,my_progress, wholeChip, well_rows,well_cols);

  if (!clo.mod_control.USE_RAWWELLS & clo.mod_control.WELLS_FILE_ONLY)
  {
    // stop after generating the functional wells file
    UpdateBeadFindOutcomes (maskPtr, wholeChip, experimentName, !clo.bfd_control.SINGLEBF, clo.mod_control.USE_RAWWELLS);
    my_progress.ReportState ("Analysis (wells file only) Complete");

  }
  else
  {

    fprintf (stderr, "\n");
    fprintf (stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
    fprintf (stderr, "ERROR: Analysis has reached removed BaseCalling code section\n");
    fprintf (stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
    fprintf (stderr, "\n");
    exit (EXIT_FAILURE);

/*
    // Update progress bar status file: img proc complete/sig proc started
    updateProgress (IMAGE_TO_SIGNAL);

    // ==============================================
    //                BASE CALLING
    // ==============================================
    // no images below this point

    // operating from a wells file generated above
    GenerateBasesFromWells (clo, rawWells, maskPtr, my_keys.seqList, well_rows, well_cols, experimentName, my_progress);

    UpdateBeadFindOutcomes (maskPtr, wholeChip, experimentName, !clo.bfd_control.SINGLEBF, clo.mod_control.USE_RAWWELLS);
    my_progress.ReportState ("Analysis Complete");
*/
  }

  clo.sys_context.CleanupTmpWellsFile (clo.mod_control.USE_RAWWELLS);

  free (experimentName);
  exit (EXIT_SUCCESS);
}