diff --git a/src/commands/encoder_cmd.rs b/src/commands/encoder_cmd.rs index 17c8f17..0156246 100644 --- a/src/commands/encoder_cmd.rs +++ b/src/commands/encoder_cmd.rs @@ -241,7 +241,7 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) { TagLength::Genotypes => f.number = "G".to_string(), TagLength::Variable => f.number = ".".to_string(), }; - if f.description == fields::default_description_string() { + if f.field != "FILTER" && f.description == fields::default_description_string() { f.description = hdr_info_id2description(header.header_records(), &f.field, &f.description); }; } diff --git a/tests/big.sh b/tests/big.sh index 4139bae..3bc6da9 100644 --- a/tests/big.sh +++ b/tests/big.sh @@ -23,15 +23,17 @@ for mod in 2 3 4 5; do if [[ "mod" -ne "1" ]]; then - # now annotate with both and all values shouldl be annotated. - echo "two echtvars check" - $echtvar encode test.echtvar1 test1.hjson generated-subset1.vcf - $echtvar anno generated-all.vcf -e test.echtvar0 -e test.echtvar1 anno.vcf.gz - python3 check.py anno.vcf.gz 1 - # check default Description used - python3 check-string-for-issue33.py anno.vcf.gz aval1 1 "added by echtvar from test.echtvar1" - # check value . is left alone - python3 check-string-for-issue33.py anno.vcf.gz external_str . "added by echtvar from test.echtvar1" + # now annotate with both and all values should be annotated. + echo "two echtvars check" + $echtvar encode test.echtvar1 test1.hjson generated-subset1.vcf + $echtvar anno generated-all.vcf -e test.echtvar0 -e test.echtvar1 anno.vcf.gz + python3 check.py anno.vcf.gz 1 + # check that the default Description is used when no JSON value or encode Description + python3 check-string-for-issue33.py anno.vcf.gz no_description 1 "added by echtvar from test.echtvar1" + # check that the encode Description is used when no JSON value + python3 check-string-for-issue33.py anno.vcf.gz aval1 1 "added by echtvar random value" + # check value . is left alone + python3 check-string-for-issue33.py anno.vcf.gz external_str . "added by echtvar string value" fi diff --git a/tests/make-vcf.py b/tests/make-vcf.py index e98bd09..6a24483 100644 --- a/tests/make-vcf.py +++ b/tests/make-vcf.py @@ -15,6 +15,7 @@ ##INFO= ##INFO= ##INFO= +##INFO= ##INFO= ##INFO= ##INFO= diff --git a/tests/test1.hjson b/tests/test1.hjson index 6d3b74f..5816540 100644 --- a/tests/test1.hjson +++ b/tests/test1.hjson @@ -1,4 +1,5 @@ [ {"field": "val1", "alias": "aval1"}, - {"field": "str", "alias": "external_str"} + {"field": "str", "alias": "external_str"}, + {"field": "nodesc", "alias": "no_description"} ]