alignment.align(referenceName, readsFile, bidirectional=False, mark_duplicates=False, realign=False, skip_sorting=True, aligner_opts_extra="", logfile=os.path.join( RECALIBRATION_RESULTS, "alignmentQC_out.txt"), output_dir=RECALIBRATION_RESULTS, output_basename="samplelib") # Generate both hpTable and hpModel. flow_space_recal.calibrate(RECALIBRATION_RESULTS, sample_map_path, env['recalibArgs'], chipflow) # merge step, calibrate collects the training data saved for each barcode, # calculate and generate hpTable and hpModel files for the whole dataset flow_space_recal.HPaggregation( os.path.join(env['BASECALLER_RESULTS'], "recalibration"), env['recalibArgs']) hptable = os.path.join(env['BASECALLER_RESULTS'], "recalibration", "hpTable.txt") printtime("hptable: %s" % hptable) additional_basecallerArgs = " --calibration-file " + hptable additional_basecallerArgs += " --phase-estimation-file " + os.path.join( env['BASECALLER_RESULTS'], "recalibration",
alignment.align( referenceName, readsFile, bidirectional=False, mark_duplicates=False, realign=False, skip_sorting=True, aligner_opts_extra="", logfile=os.path.join(RECALIBRATION_RESULTS,"alignmentQC_out.txt"), output_dir=RECALIBRATION_RESULTS, output_basename="samplelib") # Generate both hpTable and hpModel. flow_space_recal.calibrate( RECALIBRATION_RESULTS, sample_map_path, env['recalibArgs'], chipflow) # merge step, calibrate collects the training data saved for each barcode, # calculate and generate hpTable and hpModel files for the whole dataset flow_space_recal.HPaggregation( os.path.join(env['BASECALLER_RESULTS'],"recalibration"), env['recalibArgs']) hptable = os.path.join(env['BASECALLER_RESULTS'], "recalibration", "hpTable.txt") printtime("hptable: %s" % hptable) additional_basecallerArgs = " --calibration-file " + hptable additional_basecallerArgs += " --phase-estimation-file " + os.path.join(env['BASECALLER_RESULTS'], "recalibration", "BaseCaller.json") additional_basecallerArgs += " --model-file " + os.path.join(env['BASECALLER_RESULTS'], "recalibration", "hpModel.txt")
os.path.join(env['BASECALLER_RESULTS'], "recalibration", 'BaseCaller.json'), 'r') chipflow = json.load(c) c.close() except: traceback.print_exc() raise # Call Calibration module to process training BAM files if we have some if len(calibration_input_bams) > 0: calibration_args = env['recalibArgs'] if calibration_mode == "blind_recal": calibration_args += " --blind-fit on --load-unmapped on" flow_space_recal.calibrate(env['BASECALLER_RESULTS'], calibration_input_bams, calibration_args, chipflow) additional_basecallerArgs += " --calibration-json " + \ os.path.join(env['BASECALLER_RESULTS'], "Calibration.json") printtime("Finished Recalibration") add_status("Recalibration", 0) except: traceback.print_exc() add_status("Recalibration", 1) printtime("ERROR: Recalibration failed") sys.exit(1) # --------------------------------------------------------------------------- # Finished with Calibration workflow - on to base calling
do_sorting=False, do_mark_duplicates=False, do_indexing=False, output_dir=RECALIBRATION_RESULTS, output_basename=dataset['file_prefix']) # Do not call Calibration if we did not generate any aligned input BAMs but gracefully continue additional_basecallerArgs += " --phase-estimation-file " + os.path.join(env['BASECALLER_RESULTS'], "recalibration", "BaseCaller.json") if env['doBaseRecal'] == "panel_recal": additional_basecallerArgs += " --calibration-panel /opt/ion/config/datasets_calibration.json" if len(calibration_input_bams)>0: # Call Calibration module to process aligned training BAM files flow_space_recal.calibrate( env['BASECALLER_RESULTS'], calibration_input_bams, env['recalibArgs'], chipflow) additional_basecallerArgs += " --calibration-json " + os.path.join(env['BASECALLER_RESULTS'],"Calibration.json") printtime("Finished Recalibration") add_status("Recalibration", 0) except: traceback.print_exc() add_status("Recalibration", 1) printtime ("ERROR: Recalibration failed") sys.exit(1) else: printtime("DEBUG: Flow Space Recalibration is disabled")