Skip to content

Commit

Permalink
Update test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaspe committed Aug 29, 2024
1 parent 1946874 commit 6331b4f
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/bcftools/bcftools_concat/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,37 @@ EOF
bgzip -c $TMPDIR/example.vcf > $TMPDIR/example.vcf.gz
tabix -p vcf $TMPDIR/example.vcf.gz

# Test 1: Remove ID annotations
cat <<EOF > "$TMPDIR/example_2.vcf"
##fileformat=VCFv4.1
##contig=<ID=1,length=249250621,assembly=b37>
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT SAMPLE1
1 752569 cat G C,A . . . . 1/2
1 752739 . G A,AAA . . . . ./.
EOF

# Test 1: Default test
mkdir "$TMPDIR/test1" && pushd "$TMPDIR/test1" > /dev/null

echo "> Run bcftools_norm"
echo "> Run bcftools_concat default test"
"$meta_executable" \
--input "../example.vcf" \
--output "normalized.vcf" \
--atomize \
--atom_overlaps "." \
&> /dev/null
--input "../example_2.vcf" \
--output "concatenated.vcf" \

# &> /dev/null

# checks
assert_file_exists "normalized.vcf"
assert_file_not_empty "normalized.vcf"
assert_file_contains "normalized.vcf" "bcftools_normCommand=norm --atomize --atom-overlaps . -o normalized.vcf ../example.vcf"
assert_file_exists "concatenated.vcf"
assert_file_not_empty "concatenated.vcf"
assert_file_contains "concatenated.vcf" "concat -o concatenated.vcf ../example.vcf ../example_2.vcf"
echo "- test1 succeeded -"

popd > /dev/null

echo "---- All tests succeeded! ----"
exit 0

echo
cat concatenated.vcf
echo

0 comments on commit 6331b4f

Please sign in to comment.