Commit 24966965 authored by Fidel Alfaro Almagro's avatar Fidel Alfaro Almagro
Browse files

Update bb_pipeline_diff_queue_joint.py to return to old execution blocks.

parent 4b842774
......@@ -27,9 +27,14 @@ def bb_pipeline_diff_joint(subject, jobHold, fileConfiguration, queue, coeff,
# Run bedpostX with CPU or GPU
if ((exec_block == 20) or (exec_block == 123)):
run_cpu = True
eddy_cpu = True
else:
run_cpu = False
eddy_cpu = False
if (exec_block == 40):
bedpostx_cpu = True
else:
bedpostx_cpu = False
# Run block 2 --> eddy
if ((exec_block == 0) or (exec_block == 123) or (exec_block == 2) or (exec_block == 20)):
......@@ -43,40 +48,50 @@ def bb_pipeline_diff_joint(subject, jobHold, fileConfiguration, queue, coeff,
else:
run_block_3 = False
# Run block 4 --> bedpostx + probtrack
if ((exec_block == 0) or (exec_block == 4) or (exec_block == 40)):
run_block_4 = True
else:
run_block_4 = False
# This should never happen
if (exec_block == 1):
if ((exec_block == 1) or (exec_block == 5)):
return 1
jobAUTOPTX = "1"
jobDTIFIT = "1"
jobTBSS = "1"
finalJob = "1"
jobEDDY="1"
jobPOSTEDDY="1"
jobDTIFIT="1"
jobTBSS="1"
jobPREBEDPOSTX="1"
jobNODDI="1"
finalJob="1"
if run_block_2:
jobPREPARE = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_pre_eddy_' + subject + '" -j ' + str(jobHold) + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_pre_eddy ' + subject )
if run_cpu:
jobPREPARE = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_pre_eddy_' + subject + '" -j ' + str(jobHold) + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_pre_eddy ' + subject )
if eddy_cpu:
jobEDDY = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_eddy_cpu_' + subject + '" -j ' + jobPREPARE + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_eddy_wrap_cpu ' + baseDir)
jobPOSTEDDY = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_post_eddy_' + subject + '" -j ' + jobEDDY + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_post_eddy ' + baseDir + ' ' + coeff + ' ' + str(b_value_shell))
jobPREBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_pre_bedpostx_' + subject + '" -j ' + jobPOSTEDDY + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_pre_bedpostx ' + baseDir + '/dMRI/dMRI')
jobBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_bedpostx_cpu_' + subject + '" -j ' + jobPREBEDPOSTX + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_bedpostx_cpu ' + baseDir + '/dMRI/dMRI')
jobAUTOPTX = LT.runCommand(logger, '${BB_BIN_DIR}/bb_diffusion_pipeline/bb_autoPtx/bb_autoPtx_queue_cpu_joint ' + subject + ' ' + jobBEDPOSTX + ',' + jobTBSS + ' ' + long_queues)
else:
jobEDDY = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_eddy_gpu_' + subject + '" -j ' + jobPREPARE + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_eddy_wrap_gpu ' + baseDir)
jobPOSTEDDY = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_post_eddy_' + subject + '" -j ' + jobEDDY + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_post_eddy ' + baseDir + ' ' + coeff + ' ' + str(b_value_shell))
jobPREBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_pre_bedpostx_' + subject + '" -j ' + jobPOSTEDDY + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_pre_bedpostx ' + baseDir + '/dMRI/dMRI')
jobBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_bedpostx_gpu_' + subject + '" -j ' + jobPREBEDPOSTX + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_bedpostx_gpu ' + baseDir + '/dMRI/dMRI')
jobAUTOPTX = LT.runCommand(logger, '${BB_BIN_DIR}/bb_diffusion_pipeline/bb_autoPtx/bb_autoPtx_queue_gpu_joint ' + subject + ' ' + jobBEDPOSTX + ',' + jobTBSS + ' ' + long_queues)
finalJob = finalJob + "," + str(jobAUTOPTX)
finalJob = finalJob + "," + str(jobEDDY)
if run_block_3:
jobDTIFIT = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_dtifit_' + subject + '" -j ' + jobAUTOPTX + ' -l ' + logDir + ' ${FSLDIR}/bin/dtifit -k ' + baseDir + '/dMRI/dMRI/data_ud_1_shell -m ' + baseDir + '/dMRI/dMRI/nodif_brain_mask_ud -r ' + baseDir + '/dMRI/dMRI/data_ud_1_shell.bvec -b ' + baseDir + '/dMRI/dMRI/data_ud_1_shell.bval -o ' + baseDir + '/dMRI/dMRI/dti')
jobTBSS = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_tbss_' + subject + '" -j ' + jobDTIFIT + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_tbss/bb_tbss_general ' + subject )
jobPOSTEDDY = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_post_eddy_' + subject + '" -j ' + jobEDDY + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_eddy/bb_post_eddy ' + baseDir + ' ' + coeff + ' ' + str(b_value_shell))
jobDTIFIT = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_dtifit_' + subject + '" -j ' + jobPOSTEDDY + ' -l ' + logDir + ' ${FSLDIR}/bin/dtifit -k ' + baseDir + '/dMRI/dMRI/data_ud_1_shell -m ' + baseDir + '/dMRI/dMRI/nodif_brain_mask_ud -r ' + baseDir + '/dMRI/dMRI/data_ud_1_shell.bvec -b ' + baseDir + '/dMRI/dMRI/data_ud_1_shell.bval -o ' + baseDir + '/dMRI/dMRI/dti')
jobTBSS = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_tbss_' + subject + '" -j ' + jobDTIFIT + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_tbss/bb_tbss_general ' + subject )
if num_shells > 1:
jobNODDI = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_NODDI_' + subject + '" -j ' + jobTBSS + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_NODDI ' + subject )
finalJob = finalJob + "," + str(jobNODDI)
jobNODDI = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_NODDI_' + subject + '" -j ' + jobTBSS + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_NODDI ' + subject )
jobPREBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + short_queues + ' -N "bb_pre_bedpostx_' + subject + '" -j ' + jobDTIFIT + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_pre_bedpostx ' + baseDir + '/dMRI/dMRI')
finalJob = finalJob + "," + str(jobPREBEDPOSTX)
if run_block_4:
if bedpostx_cpu:
jobBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_bedpostx_cpu_' + subject + '" -j ' + jobPREBEDPOSTX + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_bedpostx_cpu ' + baseDir + '/dMRI/dMRI')
jobAUTOPTX = LT.runCommand(logger, '${BB_BIN_DIR}/bb_diffusion_pipeline/bb_autoPtx/bb_autoPtx_queue_cpu_joint ' + subject + ' ' + jobBEDPOSTX + ',' + jobTBSS + ' ' + long_queues)
else:
finalJob = finalJob + "," + str(jobTBSS)
jobBEDPOSTX = LT.runCommand(logger, '${FSLDIR}/bin/fsl_sub -q ' + long_queues + ' -N "bb_bedpostx_gpu_' + subject + '" -j ' + jobPREBEDPOSTX + ' -l ' + logDir + ' $BB_BIN_DIR/bb_diffusion_pipeline/bb_bedpostx/bb_bedpostx_gpu ' + baseDir + '/dMRI/dMRI')
jobAUTOPTX = LT.runCommand(logger, '${BB_BIN_DIR}/bb_diffusion_pipeline/bb_autoPtx/bb_autoPtx_queue_gpu_joint ' + subject + ' ' + jobBEDPOSTX + ',' + jobTBSS + ' ' + long_queues)
finalJob = finalJob + "," + str(jobAUTOPTX)
return finalJob
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment