Skip to content

Commit

Permalink
Clean up test script, update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarousseau committed Apr 5, 2024
1 parent 2e1ae9b commit 576d926
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
- `salmon/salmon_quant`: Transcript quantification from RNA-seq data (PR #24).

* `samtools`:
- `samtools/flagstat`: Counts the number of alignments in SAM/BAM/CRAM files for each FLAG type (PR #31).
- `samtools/idxstats`: Reports alignment summary statistics for a SAM/BAM/CRAM file (PR #32).
- `samtools/samtools_flagstat`: Counts the number of alignments in SAM/BAM/CRAM files for each FLAG type (PR #31).
- `samtools/samtools_idxstats`: Reports alignment summary statistics for a SAM/BAM/CRAM file (PR #32).
- `samtools/samtools_sort`: Sort SAM/BAM/CRAM files (PR #36).

## MAJOR CHANGES
Expand Down
1 change: 1 addition & 0 deletions src/samtools/samtools_sort/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ argument_groups:
description: |
Write final output to file.
required: true
must_exist: false
example: out.bam
- name: --output_fmt
alternatives: -O
Expand Down
18 changes: 9 additions & 9 deletions src/samtools/samtools_sort/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ echo ">>> Test 1: Sorting a BAM file"

echo ">>> Check if output file exists"
[ ! -f "$test_dir/a.sorted.bam" ] \
&& echo "Output file test_data/a.sorted.bam does not exist" && exit 1
&& echo "Output file a.sorted.bam does not exist" && exit 1

echo ">>> Check if output is empty"
[ ! -s "$test_dir/a.sorted.bam" ] \
&& echo "Output file test_data/a.sorted.bam is empty" && exit 1
&& echo "Output file a.sorted.bam is empty" && exit 1

echo ">>> Check if output matches expected output"
diff -a "$test_dir/a.sorted.bam.txt" "$out_dir/a_ref.sorted.txt" \
|| (echo "Output file test_data/a.sorted.bam does not match expected output" && exit 1)
|| (echo "Output file a.sorted.bam does not match expected output" && exit 1)

rm "$test_dir/a.sorted.bam" "$test_dir/a.sorted.bam.txt"

Expand All @@ -37,15 +37,15 @@ echo ">>> Test 2: Sorting a BAM file according to ascii order"

echo ">>> Check if output file exists"
[ ! -f "$test_dir/ascii.sorted.bam" ] \
&& echo "Output file test_data/ascii.sorted.bam does not exist" && exit 1
&& echo "Output file ascii.sorted.bam does not exist" && exit 1

echo ">>> Check if output is empty"
[ ! -s "$test_dir/ascii.sorted.bam" ] \
&& echo "Output file test_data/ascii.sorted.bam is empty" && exit 1
&& echo "Output file ascii.sorted.bam is empty" && exit 1

echo ">>> Check if output matches expected output"
diff -a "$test_dir/ascii.sorted.bam.txt" "$out_dir/ascii_ref.sorted.txt" \
|| (echo "Output file test_data/ascii.sorted.bam does not match expected output" && exit 1)
|| (echo "Output file ascii.sorted.bam does not match expected output" && exit 1)

rm "$test_dir/ascii.sorted.bam" "$test_dir/ascii.sorted.bam.txt"

Expand All @@ -60,15 +60,15 @@ echo ">>> Test 3: Sorting a BAM file with compression"

echo ">>> Check if output file exists"
[ ! -f "$test_dir/compressed.sorted.bam" ] \
&& echo "Output file test_data/compressed.sorted.bam does not exist" && exit 1
&& echo "Output file compressed.sorted.bam does not exist" && exit 1

echo ">>> Check if output is empty"
[ ! -s "$test_dir/compressed.sorted.bam" ] \
&& echo "Output file test_data/compressed.sorted.bam is empty" && exit 1
&& echo "Output file compressed.sorted.bam is empty" && exit 1

echo ">>> Check if output matches expected output" #
diff "$test_dir/compressed.sorted.bam.txt" "$out_dir/compressed_ref.sorted.txt" \
|| (echo "Output file test_data/compressed.sorted.bam does not match expected output" && exit 1)
|| (echo "Output file compressed.sorted.bam does not match expected output" && exit 1)

rm "$test_dir/compressed.sorted.bam" "$test_dir/compressed.sorted.bam.txt"

Expand Down

0 comments on commit 576d926

Please sign in to comment.