Skip to content

Commit

Permalink
final touches, fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarousseau committed Apr 7, 2024
1 parent f1cc6c0 commit 1826d1a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/samtools/samtools_stats/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ argument_groups:
Exclude from statistics reads marked as duplicates.
- name: --customized_index_file
alternatives: -X
type: file
type: boolean_true
description: |
Use a customized index file.
- name: --required_flag
Expand Down
1 change: 0 additions & 1 deletion src/samtools/samtools_stats/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set -e
$(which samtools) stats \
${par_coverage:+-c "$par_coverage"} \
${par_remove_dups:+-d} \
${par_customized_index_file:+-X "$par_bai"} \
${par_required_flag:+-f "$par_required_flag"} \
${par_filtering_flag:+-F "$par_filtering_flag"} \
${par_GC_depth:+--GC-depth "$par_GC_depth"} \
Expand Down
20 changes: 10 additions & 10 deletions src/samtools/samtools_stats/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ echo ">>> Checking whether output is non-empty"
[ ! -s "$test_dir/test.paired_end.sorted.txt" ] && echo "File 'test.paired_end.sorted.txt' is empty!" && exit 1

echo ">>> Checking whether output is correct"
# compare using diff, but ingnoring the header line (starting with "#")
diff <(grep -v "^#" "$test_dir/test.paired_end.sorted.txt") \
<(grep -v "^#" "$test_dir/ref.paired_end.sorted.txt") || \
# compare using diff, ignoring the line stating the command that was passed.
diff <(grep -v "^# The command" "$test_dir/test.paired_end.sorted.txt") \
<(grep -v "^# The command" "$test_dir/ref.paired_end.sorted.txt") || \
(echo "Output file ref.paired_end.sorted.txt does not match expected output" && exit 1)

rm "$test_dir/test.paired_end.sorted.txt"

############################################################################################
Expand All @@ -40,9 +40,9 @@ echo ">>> Checking whether output is non-empty"
[ ! -s "$test_dir/ref.d.paired_end.sorted.txt" ] && echo "File 'ref.d.paired_end.sorted.txt' is empty!" && exit 1

echo ">>> Checking whether output is correct"
# compare using diff, but ingnoring the header line (starting with "#")
diff <(grep -v "^#" "$test_dir/test.d.paired_end.sorted.txt") \
<(grep -v "^#" "$test_dir/ref.d.paired_end.sorted.txt") || \
# compare using diff, ignoring the line stating the command that was passed.
diff <(grep -v "^# The command" "$test_dir/test.d.paired_end.sorted.txt") \
<(grep -v "^# The command" "$test_dir/ref.d.paired_end.sorted.txt") || \
(echo "Output file ref.d.paired_end.sorted.txt does not match expected output" && exit 1)

rm "$test_dir/test.d.paired_end.sorted.txt"
Expand All @@ -64,9 +64,9 @@ echo ">>> Checking whether output is non-empty"


echo ">>> Checking whether output is correct"
# compare using diff, but ingnoring the header line (starting with "#")
diff <(grep -v "^#" "$test_dir/test.p.paired_end.sorted.txt") \
<(grep -v "^#" "$test_dir/ref.p.paired_end.sorted.txt") || \
# compare using diff, ignoring the line stating the command that was passed.
diff <(grep -v "^# The command" "$test_dir/test.p.paired_end.sorted.txt") \
<(grep -v "^# The command" "$test_dir/ref.p.paired_end.sorted.txt") || \
(echo "Output file ref.p.paired_end.sorted.txt does not match expected output" && exit 1)

rm "$test_dir/test.p.paired_end.sorted.txt"
Expand Down

0 comments on commit 1826d1a

Please sign in to comment.