def make_job(subject_id_list, freesurfer_dir,
base_feature, weight_method, num_bins, edge_range, summary_stat,
atlas, fwhm, out_proc_dir, job_dir, job_name, num_procs):
"Creates graynet job for running on HPC"
str_list_weight_method = ' '.join(weight_method)
job_file = pjoin(job_dir, '{}.{}.job'.format(job_name, job_type))
job_log = pjoin(job_dir, '{}.{}.log'.format(job_name, job_type))
if pexists(job_file):
os.remove(job_file)
with open(job_file, 'w') as jf:
jf.write('#!/bin/bash\n')
jf.write(specify_hpc_resources(mem, queue, num_procs, job_dir, job_log))
jf.write(make_cli_call(cli_name, realpath(subject_id_list), base_feature, realpath(freesurfer_dir),
str_list_weight_method, num_bins, edge_range, summary_stat, atlas, fwhm, realpath(out_proc_dir),
num_procs))
st = os.stat(job_file)
os.chmod(job_file, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
return job_file
评论列表
文章目录