|
811 | 811 | run_test(\&test_vcf_consensus,$opts,in=>'consensus.20',out=>'consensus20.2.out',fa=>'consensus.20.fa',args=>''); |
812 | 812 | run_test(\&test_vcf_consensus,$opts,in=>'consensus.20',out=>'consensus20.3.out',fa=>'consensus.20.fa',args=>'-M . -s b'); |
813 | 813 | run_test(\&test_vcf_consensus,$opts,in=>'consensus.20',out=>'consensus20.4.out',fa=>'consensus.20.fa',args=>'-M . -s a'); |
| 814 | +run_test(\&test_vcf_consensus,$opts,in=>'consensus.21',out=>'consensus21.1.out',fa=>'consensus.21.fa',args=>''); |
814 | 815 | run_test(\&test_mpileup,$opts,in=>[qw(mpileup.1 mpileup.2 mpileup.3)],out=>'mpileup/mpileup.1.out',args=>q[-r17:100-150],test_list=>1); |
815 | 816 | run_test(\&test_mpileup,$opts,in=>[qw(mpileup.1 mpileup.2 mpileup.3)],out=>'mpileup/mpileup.2.out',args=>q[-a DP,DV -r17:100-600]); # test files from samtools mpileup test suite |
816 | 817 | run_test(\&test_mpileup,$opts,in=>[qw(mpileup.1)],out=>'mpileup/mpileup.3.out',args=>q[-B --ff 0x14 -r17:1050-1060]); # test file converted to vcf from samtools mpileup test suite |
@@ -1174,6 +1175,18 @@ sub bgzip_tabix_vcf |
1174 | 1175 | my ($opts,$file) = @_; |
1175 | 1176 | bgzip_tabix($opts,file=>$file,suffix=>'vcf',args=>'-p vcf'); |
1176 | 1177 | } |
| 1178 | +sub bgzip_index_bcf |
| 1179 | +{ |
| 1180 | + my ($opts,$file) = @_; |
| 1181 | + if ( !-e "$$opts{tmp}/$file.bcf" or is_file_newer("$$opts{path}/$file.vcf","$$opts{tmp}/$file.bcf") ) |
| 1182 | + { |
| 1183 | + cmd("$$opts{bin}/bcftools view -Ob $$opts{path}/$file.vcf -o $$opts{tmp}/$file.bcf"); |
| 1184 | + } |
| 1185 | + if ( !-e "$$opts{tmp}/$file.bcf.csi" or is_file_newer("$$opts{tmp}/$file.bcf","$$opts{tmp}/$file.bcf.csi") ) |
| 1186 | + { |
| 1187 | + cmd("$$opts{bin}/bcftools index -f $$opts{tmp}/$file.bcf"); |
| 1188 | + } |
| 1189 | +} |
1177 | 1190 |
|
1178 | 1191 |
|
1179 | 1192 | # The tests -------------------------- |
@@ -1755,10 +1768,12 @@ sub test_vcf_consensus |
1755 | 1768 | { |
1756 | 1769 | my ($opts,%args) = @_; |
1757 | 1770 | bgzip_tabix_vcf($opts,$args{in}); |
| 1771 | + bgzip_index_bcf($opts,$args{in}); |
1758 | 1772 | $args{args} =~ s/{PATH}/$$opts{path}/g; |
1759 | 1773 | my $mask = $args{mask} ? "-m $$opts{path}/$args{mask}" : ''; |
1760 | 1774 | my $chain = $args{chain} ? "-c $$opts{tmp}/$args{chain}" : ''; |
1761 | 1775 | test_cmd($opts,%args,cmd=>"$$opts{bin}/bcftools consensus $$opts{tmp}/$args{in}.vcf.gz -f $$opts{path}/$args{fa} $args{args} $mask $chain"); |
| 1776 | + test_cmd($opts,%args,cmd=>"$$opts{bin}/bcftools consensus $$opts{tmp}/$args{in}.bcf -f $$opts{path}/$args{fa} $args{args} $mask $chain"); |
1762 | 1777 | } |
1763 | 1778 | sub test_vcf_consensus_chain |
1764 | 1779 | { |
|
0 commit comments