Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Added a simple test case for empty VCF traversal using MultipleVarian…
Browse files Browse the repository at this point in the history
…tIterator
  • Loading branch information
kgururaj committed Nov 21, 2014
1 parent f462f14 commit 6ce9443
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/reference_block_splitting_variant_reader_test.cpp
Expand Up @@ -368,3 +368,12 @@ BOOST_AUTO_TEST_CASE( reference_block_problem_region_3 ) {

BOOST_CHECK(truth_index == p3_block_starts.size());
}

BOOST_AUTO_TEST_CASE( test_mvi_for_empty_vcf )
{
auto mvr = GVCFReader { vector<string>{"testdata/var_hdr_merge/empty_vcf.vcf"}, false };
auto num_variants = 0u;
for(const auto& variant : mvr)
++num_variants;
BOOST_CHECK_EQUAL(num_variants, 0u);
}
22 changes: 22 additions & 0 deletions testdata/var_hdr_merge/empty_vcf.vcf
@@ -0,0 +1,22 @@
##fileformat=VCFv4.1
##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency, for each ALT allele, in the same order as listed">
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
##INFO=<ID=VALIDATED,Number=0,Type=Flag,Description="Validated By Follow-up Experiment">
##INFO=<ID=DESC,Number=.,Type=String,Description="Custom Description">
##FILTER=<ID=PASS,Description=All filters passed>
##FILTER=<ID=LOW_QUAL,Description=Low quality call>
##FILTER=<ID=MISSED,Description=Missed by the variant caller>
##FILTER=<ID=NOT_DEFINED,Description=Undefined filter>
##contig=<ID=1,Length=300000000,Description=the first chromosome>
##contig=<ID=20,Length=64000000>
##contig=<ID=22,Length=120000000>
##FORMAT=<ID=GT,Number=1,Type=String,Description=Genotype>
##FORMAT=<ID=GQ,Number=1,Type=Integer,Description=Genotype quality>
##FORMAT=<ID=PL,Number=G,Type=Integer,Description=Phred scaled relative Likelihoods of the genotypes>
##FORMAT=<ID=AF,Number=2,Type=Float,Description=Arbitrary float field with 2 values (test purposes only)>
##FORMAT=<ID=AS,Number=1,Type=String,Description=Arbitrary string field with 1 value (test purposes only)>
##INFO=<ID=VLFLOAT,Number=.,Type=Float,Description=Arbitrary float vector with variable number of elements (test purposes only)>
##INFO=<ID=VLINT,Number=.,Type=Integer,Description=Arbitrary integer vector with variable number of elements (test purposes only)>
##FORMAT=<ID=VLFLOAT,Number=.,Type=Float,Description=Arbitrary float vector with variable number of elements (test purposes only)>
##FORMAT=<ID=VLINT,Number=.,Type=Integer,Description=Arbitrary integer vector with variable number of elements (test purposes only)>
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12878 NA12891 NA12892

0 comments on commit 6ce9443

Please sign in to comment.