Skip to content

Commit

Permalink
update beagle tests so zcat doesn't break on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
gymreklab committed Nov 22, 2023
1 parent 90ff40a commit 263717c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/trtools_prep_beagle_vcf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ while read -r line ; do
# this assumes the output meta line ordering of Beagle 5.4 VCFs
if (( line_num == 3 )) ; then
for meta_line in '##source' '##command' ; do
zcat "$ref_panel" | awk '/^'"$meta_line"'/ {print $0} /^#CHROM/ {exit}' | sed -e 's/##/##preimuptation_/' >> "$temp_file"
zcat < "$ref_panel" | awk '/^'"$meta_line"'/ {print $0} /^#CHROM/ {exit}' | sed -e 's/##/##preimuptation_/' >> "$temp_file"
done
for meta_line in '##contig' '##ALT' '##INFO=<ID=END' ; do
zcat "$ref_panel" | awk '/^'"$meta_line"'/ {print $0} /^#CHROM/ {exit}' >> "$temp_file"
zcat < "$ref_panel" | awk '/^'"$meta_line"'/ {print $0} /^#CHROM/ {exit}' >> "$temp_file"
done
fi
line_num=$(( line_num+1 ))
done < <(zcat "$imputed")
done < <(zcat < "$imputed")


echo "bgzipping and tabix indexing"
Expand Down
8 changes: 4 additions & 4 deletions test/cmdline_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ if ! [[ -f "$prep_beagle_out".tbi ]] ; then
exit 1
fi

if (( 1172 != $(zcat "$prep_beagle_out" | grep -vc '#') )) ; then
if (( 1172 != $(zcat < "$prep_beagle_out" | grep -vc '#') )) ; then
echo "prep_beagle_vcf outputted a file that didn't have the expected number of lines (1172)"
exit 1
fi

if (( 1172 != $(zcat "$prep_beagle_out" | grep -v '#' | grep -c 'START') )) ||
(( 1172 != $(zcat "$prep_beagle_out" | grep -v '#' | grep -c 'END') )) ||
(( 1172 != $(zcat "$prep_beagle_out" | grep -v '#' | grep -c 'PERIOD') ))
if (( 1172 != $(zcat < "$prep_beagle_out" | grep -v '#' | grep -c 'START') )) ||
(( 1172 != $(zcat < "$prep_beagle_out" | grep -v '#' | grep -c 'END') )) ||
(( 1172 != $(zcat < "$prep_beagle_out" | grep -v '#' | grep -c 'PERIOD') ))
then
echo "prep_beagle_vcf outputted a file that didn't have the expected number of INFO annotations"
exit 1
Expand Down

0 comments on commit 263717c

Please sign in to comment.