def run(args):
    params = get_input(args, master_params, "zrefine", banner, help)
    if params is None:
        return
    np = 30
    nmax = params.zrefine.nmax
    start_file = params.zrefine.start
    target_file = params.zrefine.target
    rmax = params.zrefine.rmax
    qmax = params.zrefine.qmax
    prefix = params.zrefine.prefix
    splat_range = params.zrefine.splat_range
    pdb = params.zrefine.pdb
    n_trial = params.zrefine.n_trial
    if pdb is not None:
        pdb_obj = model_interface.container(pdbfile=pdb, rmax=rmax, nmax=nmax)
        pdb_nlm = pdb_obj.nlm_array
    else:
        pdb_nlm = None

    data = saxs_read_write.read_standard_ascii_qis(target_file)
    refine_obj = zm_xplor_refine(data,
                                 start_file,
                                 rmax,
                                 qmax=qmax,
                                 nmax=nmax,
                                 np_on_grid=np,
                                 prefix=prefix,
                                 splat_range=splat_range,
                                 pdb_nlm=pdb_nlm,
                                 n_trial=n_trial)

    if pdb is not None:
        out_pdb_filename = pdb.split('.')[0] + '_shift.pdb'
        pdb_obj.write_pdb(rmax=refine_obj.rmax, filename=out_pdb_filename)
def process(pdb_files, nmax, rmax=50.0, fraction=0.9):
    pdb_models = []
    rmax_over_fraction = rmax / fraction
    shift = (rmax_over_fraction, rmax_over_fraction, rmax_over_fraction)
    for file in pdb_files:
        model = model_interface.container(pdbfile=file, rmax=rmax, nmax=nmax)
        if (model is not None):
            if (len(pdb_models) == 0):
                ref_nlm_array = model.nlm_array
                pdb_models.append(
                    pdb_model(ref_nlm_array.coefs(), file, model.rmax, model))
                ea = (0, 0, 0)
                outname = model.id + '_sa.pdb'
                model.write_pdb(rmax=rmax_over_fraction,
                                rotation=ea,
                                filename=outname)
            else:
                mov_nlm_array = model.nlm_array
                align_obj = fft_align.align(ref_nlm_array,
                                            mov_nlm_array,
                                            nmax=nmax,
                                            refine=True)
                pdb_models.append(
                    pdb_model(align_obj.moving_nlm.coefs(), file, model.rmax,
                              model))
                ea = align_obj.best_ea
                outname = model.id + '_sa.pdb'
                model.write_pdb(rmax=rmax_over_fraction,
                                rotation=ea,
                                filename=outname)
    return pdb_models
def run(args):
    params = get_input(args, master_params, "zrefine", banner, help)
    if params is None:
        return
    nmax = params.zrefine.nmax
    start_file = params.zrefine.start
    target_file = params.zrefine.target
    rmax = params.zrefine.rmax
    qmax = params.zrefine.qmax
    np_on_grid = params.zrefine.np_on_grid  # number of grids covering [0,1]
    nbr_dist = params.zrefine.nbr_dist
    prefix = params.zrefine.prefix
    splat_range = params.zrefine.splat_range
    pdb = params.zrefine.pdb
    n_trial = params.zrefine.n_trial
    if pdb is not None:
        pdb_nlm = model_interface.container(pdbfile=pdb, rmax=rmax,
                                            nmax=nmax).nlm_array
    else:
        pdb_nlm = None

    data = saxs_read_write.read_standard_ascii_qis(target_file)
    zm_xplor_refine(data,
                    start_file,
                    rmax,
                    qmax=qmax,
                    nmax=nmax,
                    np_on_grid=np_on_grid,
                    prefix=prefix,
                    splat_range=splat_range,
                    pdb_nlm=pdb_nlm,
                    n_trial=n_trial,
                    nbr_dist=nbr_dist)
Exemple #4
0
def run(args):
  params = get_input(args, master_params, "zrefine", banner, help)
  if params is None:
    return
  nmax=params.zrefine.nmax
  lmax=params.zrefine.lmax
  if( lmax is None ): lmax=nmax
  start_file=params.zrefine.start
  target_file=params.zrefine.target
  rmax = params.zrefine.rmax
  qmax = params.zrefine.qmax
  prefix = params.zrefine.prefix
  splat_range = params.zrefine.splat_range
  pdb = params.zrefine.pdb
  np_on_grid = params.zrefine.np_on_grid
  n_trial = params.zrefine.n_trial
  nbr_dist = params.zrefine.nbr_dist
  if pdb is not None:
    pdb_nlm = model_interface.container( pdbfile=pdb, rmax=rmax, nmax=nmax ).nlm_array
  else:
    pdb_nlm = None

  data = fxs_tools.read_blq( target_file,lmax=lmax )
  data.print_out(data=data.blq/data.blq[0], out=open(target_file+'_n', 'w') )
  zm_xplor_refine( data, start_file, rmax, qmax=qmax, nmax=nmax, lmax=lmax, np_on_grid=np_on_grid, prefix=prefix, splat_range=splat_range, pdb_nlm=pdb_nlm, n_trial=n_trial, nbr_dist=nbr_dist )