uclahs-cds / package-PipeVal

An easy to use CLI tool that can be used to validate different parameters in your NF script/pipeline.
GNU General Public License v2.0
5 stars 1 forks source link

Add bam index check #60

Closed aybeshlikyan closed 1 year ago

aybeshlikyan commented 1 year ago

Checklist

Formatting

File Updates

Docker Hub Auto Build Rules

Docker Image Testing

Test the Docker image with at least one sample. Verify the new Docker image works using:

docker run -u $(id -u):$(id -g) –w <working-directory> -v <directory-you-want-to-mount>:<how-you-want-to-mount-it-within-the-docker> --rm <docker-image-name> <command-to-the-docker-with-all-parameters>

My command:

I created a test directory (/hot/user/abeshlikyan/pipeval_testing_set) that contains:

  1. a directory with soft symlinks to both a BAM file and its index (bam_pass/),
  2. a directory with a soft symlink to only a BAM file (bam_warn_index_missing/),
  3. a directory with soft symlinks to an empty BAM file and its index (bam_fail_empty/), and
  4. a directory with an invalid BAM file and index (bam_fail_invalid).

Pull the test image:

docker pull ghcr.io/uclahs-cds/pipeval:abesh-check-bam-index

Runs successfully without outputting a warning:

docker run -it --rm \
-v /hot/user/abeshlikyan/pipeval_testing_set:/tool/test \
-v /hot/resource/pipeline_testing_set/WTS/GRCh37/A/mini/:/hot/resource/pipeline_testing_set/WTS/GRCh37/A/mini \
ghcr.io/uclahs-cds/pipeval:abesh-check-bam-index \
validate test/bam_pass/CPCG0196-F1-A-mini-0-RNA.bam

Runs successfully but outputs a warning about missing BAM index:

docker run -it --rm \
-v /hot/user/abeshlikyan/pipeval_testing_set:/tool/test \
-v /hot/resource/pipeline_testing_set/WTS/GRCh37/A/mini/:/hot/resource/pipeline_testing_set/WTS/GRCh37/A/mini \
ghcr.io/uclahs-cds/pipeval:abesh-check-bam-index \
validate test/bam_warn_index_missing/CPCG0196-F1-A-mini-0-RNA.bam

Fails with error about empty bam file:

docker run -it --rm \
-v /hot/user/abeshlikyan/pipeval_testing_set:/tool/test \
-v /hot/resource/SMC-HET/normal/bams/A-null/:/hot/resource/SMC-HET/normal/bams/A-null/ \
ghcr.io/uclahs-cds/pipeval:abesh-check-bam-index \
validate test/bam_fail_empty/HG002_N_A-null.bam

Fails with error about invalid bam file:

docker run -it --rm \
-v /hot/user/abeshlikyan/pipeval_testing_set:/tool/test \
ghcr.io/uclahs-cds/pipeval:abesh-check-bam-index \
validate test/bam_fail_invalid/invalid.bam

Description

Closes #50. Adds check for BAM index existence.

aybeshlikyan commented 1 year ago

Some notes: