Skip to content

Commit 95bd420

Browse files
dmiller15brentp
authored andcommitted
🔧 description testing updates
1 parent 6b659aa commit 95bd420

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

src/commands/encoder_cmd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) {
241241
TagLength::Genotypes => f.number = "G".to_string(),
242242
TagLength::Variable => f.number = ".".to_string(),
243243
};
244-
if f.description == fields::default_description_string() {
244+
if f.field != "FILTER" && f.description == fields::default_description_string() {
245245
f.description = hdr_info_id2description(header.header_records(), &f.field, &f.description);
246246
};
247247
}

tests/big.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ for mod in 2 3 4 5; do
2323

2424

2525
if [[ "mod" -ne "1" ]]; then
26-
# now annotate with both and all values shouldl be annotated.
27-
echo "two echtvars check"
28-
$echtvar encode test.echtvar1 test1.hjson generated-subset1.vcf
29-
$echtvar anno generated-all.vcf -e test.echtvar0 -e test.echtvar1 anno.vcf.gz
30-
python3 check.py anno.vcf.gz 1
31-
# check default Description used
32-
python3 check-string-for-issue33.py anno.vcf.gz aval1 1 "added by echtvar from test.echtvar1"
33-
# check value . is left alone
34-
python3 check-string-for-issue33.py anno.vcf.gz external_str . "added by echtvar from test.echtvar1"
26+
# now annotate with both and all values should be annotated.
27+
echo "two echtvars check"
28+
$echtvar encode test.echtvar1 test1.hjson generated-subset1.vcf
29+
$echtvar anno generated-all.vcf -e test.echtvar0 -e test.echtvar1 anno.vcf.gz
30+
python3 check.py anno.vcf.gz 1
31+
# check that the default Description is used when no JSON value or encode Description
32+
python3 check-string-for-issue33.py anno.vcf.gz no_description 1 "added by echtvar from test.echtvar1"
33+
# check that the encode Description is used when no JSON value
34+
python3 check-string-for-issue33.py anno.vcf.gz aval1 1 "added by echtvar random value"
35+
# check value . is left alone
36+
python3 check-string-for-issue33.py anno.vcf.gz external_str . "added by echtvar string value"
3537
fi
3638

3739

tests/make-vcf.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
##INFO=<ID=AC,Number=A,Type=Integer,Description="Alternate allele count">
1616
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles">
1717
##INFO=<ID=val%s,Number=1,Type=Integer,Description="random value">
18+
##INFO=<ID=nodesc,Number=1,Type=Integer>
1819
##INFO=<ID=nvar,Number=1,Type=Integer,Description="variant index">
1920
##INFO=<ID=str,Number=.,Type=String,Description="string value">
2021
##INFO=<ID=AF,Number=A,Type=Float,Description="Alternate allele frequency">

tests/test1.hjson

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
22
{"field": "val1", "alias": "aval1"},
3-
{"field": "str", "alias": "external_str"}
3+
{"field": "str", "alias": "external_str"},
4+
{"field": "nodesc", "alias": "no_description"}
45
]

0 commit comments

Comments
 (0)