[RESOLVED] Issue with BOLD run_qc

We tried to run QC for BOLD data for all scan numbers of a session. So we deleted the --bolddata flag to use the default mode that includes all scans within a session.

qunex_container run_qc \
--sessionsfolder="/gpfs/project/fas/n3/Studies/ABCD/site21/sessions" \
--sessions="$sessions_qc" \
--outpath="/gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD" \
--scenetemplatefolder="/gpfs/project/fas/n3/software/qunex/qx_library/data/scenes/qc" \
--modality='BOLD' \
--boldsuffix='Atlas' \
--overwrite='no' \
--parjobs="200" \
--container="/gpfs/project/fas/n3/software/Singularity/qunex_suite-0.91.10.sif" \
--scheduler="SLURM,time=08:00:00,mem-per-cpu=100000,partition=pi_anticevic_gpu"

While the commands were run, we don’t see any output in the session folder until we test it by specifying some scan numbers in the --bolddata flag (please see example below).

--bolddata='1,2' \

We are not sure if there is an alternative way to include all scan numbers in the session. Thanks in advance for any support you could provide!

Hi!

No unfortunately run_qc does not support this at the moment. We have a plan to upgrade run_qc in the future, but there are some more pressing developments in the pipeline right now, so I cannot really give an eta.

There might be a workaround through run_turnkey:

qunex_container run_turnkey \
  --workingdir="/gpfs/project/fas/n3/Studies/ABCD/site21/" \
  --projectname="site21" \
  --path="/gpfs/project/fas/n3/Studies/ABCD/site21" \
  --sessionsfoldername="sessions" \
  --batchfile="/gpfs/project/fas/n3/Studies/ABCD/site21/processing/batch_hcp.txt" \
  --sessions="$sessions_qc" \
  --sessionids="$sessions_qc" \
  --overwrite="no" \
  --turnkeytype="local" \
  --turnkeysteps="run_qc_bold" \
  --container="/gpfs/project/fas/n3/software/Singularity/qunex_suite-latest.sif" \
  --scheduler="SLURM,time=08:00:00,mem=32000,partition=pi_anticevic"

Replace the batchfile with another one if what is specified above is not correct.

Also note that I changed the container version to latest which always make sense, since the latest container should be the best one there is. I also tweaked the scheduler parameters for your call, you do not really need the GPU node and that much memory for run_QC. By optimizing the scheduler parameter your jobs will be start running earlier.

Hope the above solution works for you!

Hi!

Another solution here, and a better one than the proposed one is to pass sessions to run_qc through the --sessionsbatchfile parameter. This way run_qc should be able to run over all BOLDs. The thing is that QuNex cannot know which BOLDs a session has only from a list of sessions it needs additional info provided through the batch file.

Thank you very much!! This is helpful! We will try after Grace is back again.

Hi Jure, I suspect there is still a bug in the code that needs to be patched. We tried the following command (with batchfile parameter specified):
We are using v0.91.10 below for consistency with earlier commands in this same study.

--sessionsfolder="/gpfs/project/fas/n3/Studies/ABCD/site21/sessions" \
--sessions="$sessions_qc" \
--outpath="/gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD" \
--scenetemplatefolder="/gpfs/project/fas/n3/software/qunex/qx_library/data/scenes/qc" \
--batchfile="/gpfs/project/fas/n3/Studies/ABCD/site21/processing/batch_hcp.txt" \
--modality='BOLD' \
--boldsuffix='Atlas' \
--overwrite='yes' \
--parjobs="200" \
--container="/gpfs/project/fas/n3/software/Singularity/qunex_suite-0.91.10.sif" \
--scheduler="SLURM,time=08:00:00,mem-per-cpu=32000,partition=pi_anticevic"

The error is shown below (copied from
/gpfs/project/fas/n3/Studies/ABCD/site21/processing/logs/comlogs/error_run_qc_NDARINVZ0TL0G08_baselineYear1Arm1_2022-02-08_11.48.0670377114.log).

# Generated by QuNex 0.91.10 on 2022-02-08_11.48.0670377114
#

---> Scene files found in: 

/opt/qunex/qx_library/data/scenes/qc/template_bold_qc.wb.scene
/opt/qunex/qx_library/data/scenes/qc/template_gbc_bold_qc.wb.scene
/opt/qunex/qx_library/data/scenes/qc/template_pconn_bold_qc.wb.scene
/opt/qunex/qx_library/data/scenes/qc/template_scalar_bold_qc.wb.scene 

---> Suffix not manually set. Setting default: 2022-02-08_11.47.0127710713

---> hcp_suffix flag not explicitly provided. Using defaults: 


Note: BOLD input list not specified. Relying  individual information files.

BOLD prefix not specified. Assuming no prefix




-- qunex.sh: Specified Command-Line Options - Start --
  Study Folder: /gpfs/project/fas/n3/Studies/ABCD/site21
  Session Folder: /gpfs/project/fas/n3/Studies/ABCD/site21/sessions
  Sessions: NDARINVZ0TL0G08_baselineYear1Arm1
  QC Modality: BOLD
  QC Output Path: /gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD
  Custom QC requested: no
  HCP suffix: 
   Session batch file requested: /gpfs/project/fas/n3/Studies/ABCD/site21/processing/batch_hcp.txt
   BOLD runs requested: all
  Omit default QC: no 
  QC Scene Template Folder: /opt/qunex/qx_library/data/scenes/qc
  QC User-defined Scene: 
  Overwrite prior run: yes
  Time stamp for logging: 2022-02-08_11.47.0127710713
  Zip Scene File: yes
  BOLD data input: 
  BOLD prefix: 
  BOLD suffix: _Atlas
  Skip Initial Frames: 0
  Compute SNR Only: no
-- qunex.sh: Specified Command-Line Options - End --

 ------------------------- Start of work -------------------------------- 


 --- Note: Overwrite requested. 


  --- Generating BOLD QC scene here: /gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD 


  --- Checking and generating output folders... 

     RunQCLogFolder: /gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD/qclog 
     Output path: /gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD 

   --> For NDARINVZ0TL0G08_baselineYear1Arm1 searching for BOLD tags in batch file /gpfs/project/fas/n3/Studies/ABCD/site21/processing/batch_hcp.txt ...  

  ERROR: BOLDS variable not set. Something went wrong for NDARINVZ0TL0G08_baselineYear1Arm1. Check your batch file inputs! 

The command seems to be parsing batch_hcp.txt properly, but is failing at Relying individual information files. This really should read Relying session_hcp.txt individual information files. The code of run_qc.sh suggests that if the bolddata parameter is empty, it looks for ${SessAcqInfoFile} in individual session folders (line 561). However, SessAcqInfoFile is not defined until later during the main function in the script, hence the inability of run_qc to find the relevant information.
I think this needs to be a patch where the section on BOLDS="${SessAcqInfoFile}" is moved to after SessAcqInfoFile is defined in the script. If this looks right to you, I can outline the steps on the dev Trello.

Hi!

Lisa, the issue you outlined at the end of your post was just one part of the problem :). Anyhow thanks for identifying this. The issues has been now fixed. I successfully ran:

qx run_qc \
--sessionsfolder="/gpfs/project/fas/n3/Studies/ABCD/site21/sessions" \
--sessions="NDARINVZ0TL0G08_baselineYear1Arm1" \
--outpath="/gpfs/project/fas/n3/Studies/ABCD/site21/sessions/QC/BOLD" \
--scenetemplatefolder="/gpfs/project/fas/n3/software/qunex/qx_library/data/scenes/qc" \
--batchfile="/gpfs/project/fas/n3/Studies/ABCD/site21/processing/batch_hcp.txt" \
--modality='BOLD' \
--boldsuffix='Atlas' \
--overwrite='yes' \
--scheduler="SLURM,time=08:00:00,mem-per-cpu=32000,partition=pi_anticevic"

The patch is already available on the current develop version of QuNex and will be publicly released within a week or two.

Thank you very much Jure!