bl1231 / bilbomd-worker

Processes BilboMD jobs and run CHARMM, FoXS, and MultiFoXS
1 stars 0 forks source link

refactor `bilbomd.ts` #95

Closed dsclassen closed 6 months ago

dsclassen commented 1 year ago

In particular I use params in a bunch of the functions. For example:

const runMinimize = async (MQjob: BullMQJob, DBjob: IBilboMDJob) => {
  console.log(MQjob.data)
  console.log(DBjob)
  const outputDir = path.join(dataVol, MQjob.data.uuid)
  const params = {
    template: 'minimize',
    topology_dir: topoFiles,
    out_dir: outputDir,
    charmm_inp_file: 'minimize.inp',
    charmm_out_file: 'minimize.out',
    in_psf: DBjob.psf_file,
    in_crd: DBjob.crd_file,
    out_min_crd: 'minimization_output.crd',
    out_min_pdb: 'minimization_output.pdb',
    rg_min: DBjob.rg_min,
    rg_max: DBjob.rg_max,
    conf_sample: DBjob.conformational_sampling
  }
  await generateInputFile(params).catch((err) => {
    console.log('Got generateInputFile error:', err.message, err.stack)
  })
  await spawnCharmm(params)
}

I'd like to discuss this pattern with someone who actually knows about Javascript.

dsclassen commented 6 months ago

a bit vague... closing for now