diff --git a/inc/vcf/validator_detail_v44.hpp b/inc/vcf/validator_detail_v44.hpp index 95a8f697..fe75dd91 100644 --- a/inc/vcf/validator_detail_v44.hpp +++ b/inc/vcf/validator_detail_v44.hpp @@ -17,7 +17,7 @@ */ -#line 263 "src/vcf/vcf_v44.ragel" +#line 268 "src/vcf/vcf_v44.ragel" namespace @@ -185,7 +185,7 @@ static const int vcf_v44_en_meta_section_skip = 667; static const int vcf_v44_en_body_section_skip = 668; -#line 269 "src/vcf/vcf_v44.ragel" +#line 274 "src/vcf/vcf_v44.ragel" } @@ -204,7 +204,7 @@ namespace ebi cs = vcf_v44_start; } -#line 283 "src/vcf/vcf_v44.ragel" +#line 288 "src/vcf/vcf_v44.ragel" } @@ -8133,11 +8133,11 @@ case 681: } break; case 75: -#line 261 "src/vcf/vcf_v44.ragel" +#line 266 "src/vcf/vcf_v44.ragel" { {cs = 28;goto _again;} } break; case 76: -#line 262 "src/vcf/vcf_v44.ragel" +#line 267 "src/vcf/vcf_v44.ragel" { {cs = 673;goto _again;} } break; #line 8144 "inc/vcf/validator_detail_v44.hpp" @@ -8632,7 +8632,7 @@ goto _again;} _out: {} } -#line 291 "src/vcf/vcf_v44.ragel" +#line 296 "src/vcf/vcf_v44.ragel" } diff --git a/src/vcf/record.cpp b/src/vcf/record.cpp index 1284afde..7be42dce 100644 --- a/src/vcf/record.cpp +++ b/src/vcf/record.cpp @@ -1003,8 +1003,8 @@ namespace ebi + " is not one of [A, R, G, ., ]")); } if(!values.empty()) { - if (values.front() == MISSING_VALUE) { return; } // No need to check missing data - } //TODO, if the 1st one is . then check stops; svclaim=.,DJ worked! + if (values.front() == MISSING_VALUE && values.size() == 1) { return; } // No need to check missing data + } bool number_matches = true; if (expected_cardinality > 0) { diff --git a/src/vcf/vcf_v44.ragel b/src/vcf/vcf_v44.ragel index 9fe21cb7..6c6f1280 100644 --- a/src/vcf/vcf_v44.ragel +++ b/src/vcf/vcf_v44.ragel @@ -222,7 +222,12 @@ ## Accepting non-alphanumeric characters is an addition in v4.3, but widely used in already existing files format_value = ( (alpha | '_') (alnum | '_' | '.' | '%')* ) >token_begin $token_middle %token_end ; record_format = format_value (':' format_value)* ; - + + ## NOTE: The genotype definition shows the format in which it is expected but won't get enforced from ragel + ## as sample_values is a super set of genotype and other chars. Invalid genotypes successfully passes through + ## ragel checks. The validation of genotype takes place in c++ code and not in ragel space. + ## Same is applicable for older version as well. + ## In a sample, if a genotype is present it must be the first field record_sample = ( genotype $eof(no_newline_at_eof_error) $err(genotype_error) (':' sample_values)? |