diff --git a/README.md b/README.md index d0c51c4..0aced07 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ To initialize the `.env` file, copy `wsi-worker/scripts/.env.example` and modify 1. KPMP ID 2. SVS filename without the `.svs` extension 3. Package File ID from the Data Lake -4. [Optional] stain type. Values are 'he', 'pas', 'silver', 'tri', 'frz', 'tol' and 'cr'. Defaults to 'pas' +4. Slide type. Values are 'LM', 'EM', 'IF'. +5. [Optional] stain type. Values are 'he', 'pas', 'silver', 'tri', 'frz', 'tol' and 'cr'. Defaults to 'pas' #### .env File 1. `ENV_IMAGE`: defaults to `kingstonduo/wsi-worker` diff --git a/docker/wsi-worker/svs2dz b/docker/wsi-worker/svs2dz index 6d47187..cd348b9 100755 --- a/docker/wsi-worker/svs2dz +++ b/docker/wsi-worker/svs2dz @@ -3,7 +3,7 @@ source /usr/sbin/svs2dz-functions.sh assert_no_errors "!!! source load failure" -validate_args $1 $2 $3 $4 +validate_args $1 $2 $3 $4 $5 # no assertion needed; validate_args works differently call_vips $1 $2 $3 $4 diff --git a/docker/wsi-worker/svs2dz-functions.sh b/docker/wsi-worker/svs2dz-functions.sh index e0cf5ec..9edf543 100755 --- a/docker/wsi-worker/svs2dz-functions.sh +++ b/docker/wsi-worker/svs2dz-functions.sh @@ -8,10 +8,10 @@ JOB_OUT_DIR=/data/job/out print_help() { cat << EOL --- Command help -Usage: svs2dz "KPMP_ID" "FILENAME_NO_EXTENSION" "PKG_FILE_ID" ["STAIN_TYPE"] +Usage: svs2dz "KPMP_ID" "FILENAME_NO_EXTENSION" "PKG_FILE_ID" "SLIDE_TYPE" ["STAIN_TYPE"] All arguments should be enclosed in double-quotes to escape spaces. -Example: svs2dz "KPMP-Ex1" "KPMP-Ex1_TRI_1of1" "b9f7c729-8370-4f8d-9753-4a36e8ae57a4" "TRI" -... The above example creates symlinks at /files_KPMP-Ex1/KPMP-Ex1_TRI_1of1, stain type Trichrome +Example: svs2dz "KPMP-Ex1" "KPMP-Ex1_TRI_1of1" "b9f7c729-8370-4f8d-9753-4a36e8ae57a4" "IF" "TRI" +... The above example creates symlinks at /files_KPMP-Ex1/KPMP-Ex1_TRI_1of1, slide type Immunofluorescence, stain type Trichrome EOL } @@ -53,8 +53,12 @@ validate_args() { fi if [[ -z $4 ]]; then + print_error "!!! arg 4 must be slide type" + fi + + if [[ -z $5 ]]; then echo "... optional stain not passed; defaulting to type 'pas'" - 4=pas + 5=pas fi if (( DID_ERROR > 0 )); then @@ -111,5 +115,5 @@ extract_metadata() { } generate_mongo_records() { - node /usr/sbin/generate_mongo_records.js $1 $2 $3 $4 $JOB_OUT_DIR/metadata.json + node /usr/sbin/generate_mongo_records.js $1 $2 $3 $4 $5 $JOB_OUT_DIR/metadata.json } diff --git a/scripts/run-wsi-worker.sh b/scripts/run-wsi-worker.sh index a2b9045..b8a4fb3 100755 --- a/scripts/run-wsi-worker.sh +++ b/scripts/run-wsi-worker.sh @@ -9,7 +9,8 @@ mkdir -p ${ENV_LINK_DST_DIR_HOST} # arg $1 must be KPMP ID # arg $2 must be input file name (no extension) directly inside $JOB_IN_DIR # arg $3 must be file ID -# arg $4 is currently optional stain type (defaults to "pas") +# arg $4 must be stain type (LM, EM, IF) +# arg $5 is currently optional stain type (defaults to "pas") docker run \ --env-file .env \ @@ -18,4 +19,4 @@ docker run \ -v ${ENV_LINK_DST_DIR_HOST}:${ENV_LINK_DST_DIR} \ -v ${ENV_JOB_IN_DIR}:/data/job/in \ -v ${ENV_JOB_OUT_DIR}:/data/job/out \ - ${ENV_IMAGE} $1 $2 $3 $4 + ${ENV_IMAGE} $1 $2 $3 $4 $5