Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
vasudeva8 committed Jul 10, 2024
1 parent d535ac0 commit d4e88ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
12 changes: 6 additions & 6 deletions inc/vcf/validator_detail_v44.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


#line 263 "src/vcf/vcf_v44.ragel"
#line 268 "src/vcf/vcf_v44.ragel"


namespace
Expand Down Expand Up @@ -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"

}

Expand All @@ -204,7 +204,7 @@ namespace ebi
cs = vcf_v44_start;
}

#line 283 "src/vcf/vcf_v44.ragel"
#line 288 "src/vcf/vcf_v44.ragel"

}

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -8632,7 +8632,7 @@ goto _again;}
_out: {}
}

#line 291 "src/vcf/vcf_v44.ragel"
#line 296 "src/vcf/vcf_v44.ragel"

}

Expand Down
4 changes: 2 additions & 2 deletions src/vcf/record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,8 @@ namespace ebi
+ " is not one of [A, R, G, ., <non-negative number>]"));
}
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) {
Expand Down
7 changes: 6 additions & 1 deletion src/vcf/vcf_v44.ragel
Original file line number Diff line number Diff line change
Expand Up @@ -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)? |
Expand Down

0 comments on commit d4e88ce

Please sign in to comment.