diff --git a/src/rseqc/rseqc_bamstat/config.vsh.yaml b/src/rseqc/rseqc_bamstat/config.vsh.yaml index fa186723..6d607e2f 100644 --- a/src/rseqc/rseqc_bamstat/config.vsh.yaml +++ b/src/rseqc/rseqc_bamstat/config.vsh.yaml @@ -17,11 +17,13 @@ authors: argument_groups: - name: "Input" arguments: - - name: "--input" + - name: "--input_file" + alternatives: -i type: file required: true description: Input alignment file in BAM or SAM format. - - name: "--map_qual" + - name: "--mapq" + alternatives: -q type: integer example: 30 description: | @@ -45,10 +47,8 @@ test_resources: engines: - type: docker - image: ubuntu:22.04 - setup: - - type: apt - packages: [ python3-pip ] + image: python:3.10 + setup: - type: python packages: [ RSeQC ] - type: docker diff --git a/src/rseqc/rseqc_bamstat/script.sh b/src/rseqc/rseqc_bamstat/script.sh index 86de32e5..32927bb6 100644 --- a/src/rseqc/rseqc_bamstat/script.sh +++ b/src/rseqc/rseqc_bamstat/script.sh @@ -4,6 +4,6 @@ set -eo pipefail bam_stat.py \ - --input "${par_input}" \ - ${par_map_qual:+--mapq "${par_map_qual}"} \ + --input-file "${par_input_file}" \ + ${par_mapq:+--mapq "${par_mapq}"} \ > $par_output diff --git a/src/rseqc/rseqc_bamstat/test.sh b/src/rseqc/rseqc_bamstat/test.sh index f47c8717..f9180da8 100644 --- a/src/rseqc/rseqc_bamstat/test.sh +++ b/src/rseqc/rseqc_bamstat/test.sh @@ -2,14 +2,14 @@ # define input and output for script -input_bam="test.paired_end.sorted.bam" +input_bam="sample.bam" output_summary="mapping_quality.txt" # run executable and tests echo "> Running $meta_functionality_name." "$meta_executable" \ - --input "$meta_resources_dir/test_data/$input_bam" \ + --input_file "$meta_resources_dir/test_data/$input_bam" \ --output "$output_summary" exit_code=$? @@ -26,15 +26,15 @@ diff "$meta_resources_dir/test_data/ref_output.txt" "$meta_resources_dir/$output echo ">>> Test 2: Test with non-default mapping quality threshold" -output_summary="mapping_quality_mapq_30.txt" +output_summary="mapping_quality_mapq_50.txt" # run executable and tests echo "> Running $meta_functionality_name." "$meta_executable" \ - --input "$meta_resources_dir/test_data/$input_bam" \ + --input_file "$meta_resources_dir/test_data/$input_bam" \ --output "$output_summary" \ - --map_qual 50 + --mapq 50 exit_code=$? [[ $exit_code != 0 ]] && echo "Non zero exit code: $exit_code" && exit 1 diff --git a/src/rseqc/rseqc_bamstat/test_data/ref_output.txt b/src/rseqc/rseqc_bamstat/test_data/ref_output.txt index ced4cc13..6b939096 100644 --- a/src/rseqc/rseqc_bamstat/test_data/ref_output.txt +++ b/src/rseqc/rseqc_bamstat/test_data/ref_output.txt @@ -3,20 +3,20 @@ #All numbers are READ count #================================================== -Total records: 200 +Total records: 90 QC failed: 0 Optical/PCR duplicate: 0 Non primary hits 0 -Unmapped reads: 3 -mapq < mapq_cut (non-unique): 1 +Unmapped reads: 1 +mapq < mapq_cut (non-unique): 0 -mapq >= mapq_cut (unique): 196 -Read-1: 99 -Read-2: 97 -Reads map to '+': 98 -Reads map to '-': 98 -Non-splice reads: 196 +mapq >= mapq_cut (unique): 89 +Read-1: 45 +Read-2: 44 +Reads map to '+': 44 +Reads map to '-': 45 +Non-splice reads: 89 Splice reads: 0 -Reads mapped in proper pairs: 192 +Reads mapped in proper pairs: 88 Proper-paired reads map to different chrom:0 diff --git a/src/rseqc/rseqc_bamstat/test_data/ref_output_mapq.txt b/src/rseqc/rseqc_bamstat/test_data/ref_output_mapq.txt index 457c8863..be8af62f 100644 --- a/src/rseqc/rseqc_bamstat/test_data/ref_output_mapq.txt +++ b/src/rseqc/rseqc_bamstat/test_data/ref_output_mapq.txt @@ -3,20 +3,20 @@ #All numbers are READ count #================================================== -Total records: 200 +Total records: 90 QC failed: 0 Optical/PCR duplicate: 0 Non primary hits 0 -Unmapped reads: 3 -mapq < mapq_cut (non-unique): 20 +Unmapped reads: 1 +mapq < mapq_cut (non-unique): 6 -mapq >= mapq_cut (unique): 177 -Read-1: 88 -Read-2: 89 -Reads map to '+': 96 -Reads map to '-': 81 -Non-splice reads: 177 +mapq >= mapq_cut (unique): 83 +Read-1: 42 +Read-2: 41 +Reads map to '+': 44 +Reads map to '-': 39 +Non-splice reads: 83 Splice reads: 0 -Reads mapped in proper pairs: 175 +Reads mapped in proper pairs: 83 Proper-paired reads map to different chrom:0 diff --git a/src/rseqc/rseqc_bamstat/test_data/sample.bam b/src/rseqc/rseqc_bamstat/test_data/sample.bam new file mode 100644 index 00000000..ed1e2433 Binary files /dev/null and b/src/rseqc/rseqc_bamstat/test_data/sample.bam differ diff --git a/src/rseqc/rseqc_bamstat/test_data/test.paired_end.sorted.bam b/src/rseqc/rseqc_bamstat/test_data/test.paired_end.sorted.bam deleted file mode 100644 index 85cccf14..00000000 Binary files a/src/rseqc/rseqc_bamstat/test_data/test.paired_end.sorted.bam and /dev/null differ