def truncated_gaussian_factor(exp, a, b, sig): print scipy.special.erf((b - exp) / sig), scipy.special.erf( (a - exp) / sig), b - exp, a - exp return 1 / (0.5 * (scipy.special.erf( (b - exp) / sig * numpy.sqrt(3.1415)) - scipy.special.erf( (a - exp) / sig * numpy.sqrt(3.1415)))) ############################### ### System Setup: ############################### # Initialize model (name, FASTA sequence, offset) model = system_setup.HDXModel("simple", inseq, offset=offset) # Create a fragment frag = system_setup.Fragment(inseq, 1, 15, 0) # Add data to the fragment for t in data: tp = frag.add_timepoint(t) for d in data[t]: tp.add_replicate(d) # enumerate and score all solutions best_grid = sampling.enumerate_fragment(frag, exp_grid, sigma0) ###############################
else: nsteps = args.NSTEPS num_best_models = 1000 # Number of best models to consider for analysis # Non user controlled vbl - for now. annealing_steps = 200 # steps per temperature in annealing - 100-200 sufficient sigma0 = 5 # Estimate for experimental error in %D Units saturation = 1.0 # Deuterium saturation in experiment percentD = True # Is the data in percent D (True) or Deuterium units? - Always percentD for Workbench. ############################### ### System Setup: ############################### # Initialize model (name, FASTA sequence, offset) model = system_setup.HDXModel("name", inseq, offset=offset) # Add data to model (model, filename) input_data.HDXWorkbench(model, workbench_file) #Initialize a sampling model for each state (Multiexponential in this case) for state in model.states: hdxm = hdx_models.MultiExponentialModel(model=model, state=state, sigma=sigma0, init=init) ############################### ### Sampling: ### # If benchmark is set to true, run a short simulation to estimate runtime
init = "random" # How to initialize - either "random" or "enumerate". Enumerate is slower but sampling will converge faster annealing_steps = 100 # steps per temperature in annealing - 100-200 sufficient nsteps = 2000 # equilibrium steps. 5000 to 10000 num_best_models = 100 # Number of best models to consider for analysis #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ### Here the real work begins.... ### You should not have to change anything beneath this line. #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ############################################ ### System Setup: # Initialize model model = system_setup.HDXModel( "Simulated", # Name for this system inseq, # Fasta sequence string offset=offset) # Offset from FASTA sequence to HDX data # Add data to model. input_data.HDXColumns( model, input_file_apo, "Apo", default_sigma=sigma0, offset=offset, temp= 298.15, # temperature of experiment - currently not used, so no need to change. saturation=saturation, percentD=percentD) input_data.HDXColumns(model,