Skip to content

Commit

Permalink
Remove all-missing fields from example VCF
Browse files Browse the repository at this point in the history
Closes #1197
  • Loading branch information
jeromekelleher authored and mergify[bot] committed Mar 5, 2024
1 parent 636d744 commit ec365f0
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 54 deletions.
94 changes: 47 additions & 47 deletions sgkit/tests/io/vcf/data/all_fields.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT s1 s2
1 1 . G A,C . PASS IB0 . . .
1 2 . A G,G . PASS II1=126 . . .
1 3 . A G,G . PASS II1=. . . .
1 3 . A G,G . PASS . . . .
1 4 . T A,C . PASS II2=459,-140 . . .
1 5 . T A,C . PASS II2=.,-140 . . .
1 6 . T A,C . PASS II2=459,. . . .
1 7 . T A,C . PASS II2=.,. . . .
1 7 . T A,C . PASS . . . .
1 8 . A A,G . PASS IIA=294,130 . . .
1 9 . A A,G . PASS IIA=.,130 . . .
1 10 . A A,G . PASS IIA=294,. . . .
1 11 . A A,G . PASS IIA=.,. . . .
1 11 . A A,G . PASS . . . .
1 12 . A A,G . PASS IIR=95,724,44 . . .
1 13 . A A,G . PASS IIR=.,724,44 . . .
1 14 . A A,G . PASS IIR=95,.,44 . . .
1 15 . A A,G . PASS IIR=95,724,. . . .
1 16 . A A,G . PASS IIR=.,.,. . . .
1 16 . A A,G . PASS . . . .
1 17 . G A,G . PASS IID=-879,-534,238,-670,482,-913,396 . . .
1 18 . G A,G . PASS IID=.,-534,238,-670,482,-913,396 . . .
1 19 . G A,G . PASS IID=-879,.,238,-670,482,-913,396 . . .
Expand All @@ -71,28 +71,28 @@
1 22 . G A,G . PASS IID=-879,-534,238,-670,.,-913,396 . . .
1 23 . G A,G . PASS IID=-879,-534,238,-670,482,.,396 . . .
1 24 . G A,G . PASS IID=-879,-534,238,-670,482,-913,. . . .
1 25 . G A,G . PASS IID=.,.,.,.,.,.,. . . .
1 25 . G A,G . PASS . . . .
1 26 . G A,G . PASS IID=-129,687,-870,685 . . .
1 27 . G A,G . PASS IID=.,687,-870,685 . . .
1 28 . G A,G . PASS IID=-129,.,-870,685 . . .
1 29 . G A,G . PASS IID=-129,687,.,685 . . .
1 30 . G A,G . PASS IID=-129,687,-870,. . . .
1 31 . G A,G . PASS IID=.,.,.,. . . .
1 31 . G A,G . PASS . . . .
1 32 . T A,T . PASS IF1=-887.177 . . .
1 33 . T A,T . PASS IF1=. . . .
1 33 . T A,T . PASS . . . .
1 34 . G C,A . PASS IF2=443.998,877.105 . . .
1 35 . G C,A . PASS IF2=.,877.105 . . .
1 36 . G C,A . PASS IF2=443.998,. . . .
1 37 . G C,A . PASS IF2=.,. . . .
1 37 . G C,A . PASS . . . .
1 38 . T C,A . PASS IFA=-998.442,984.423 . . .
1 39 . T C,A . PASS IFA=.,984.423 . . .
1 40 . T C,A . PASS IFA=-998.442,. . . .
1 41 . T C,A . PASS IFA=.,. . . .
1 41 . T C,A . PASS . . . .
1 42 . A T,G . PASS IFR=234.963,223.306,-985.867 . . .
1 43 . A T,G . PASS IFR=.,223.306,-985.867 . . .
1 44 . A T,G . PASS IFR=234.963,.,-985.867 . . .
1 45 . A T,G . PASS IFR=234.963,223.306,. . . .
1 46 . A T,G . PASS IFR=.,.,. . . .
1 46 . A T,G . PASS . . . .
1 47 . T G,G . PASS IFD=-417.542,223.706,-721.012,-415.711,-267.276,-87.86,570.352,-600.652,28.4689 . . .
1 48 . T G,G . PASS IFD=.,223.706,-721.012,-415.711,-267.276,-87.86,570.352,-600.652,28.4689 . . .
1 49 . T G,G . PASS IFD=-417.542,.,-721.012,-415.711,-267.276,-87.86,570.352,-600.652,28.4689 . . .
Expand All @@ -103,7 +103,7 @@
1 54 . T G,G . PASS IFD=-417.542,223.706,-721.012,-415.711,-267.276,-87.86,.,-600.652,28.4689 . . .
1 55 . T G,G . PASS IFD=-417.542,223.706,-721.012,-415.711,-267.276,-87.86,570.352,.,28.4689 . . .
1 56 . T G,G . PASS IFD=-417.542,223.706,-721.012,-415.711,-267.276,-87.86,570.352,-600.652,. . . .
1 57 . T G,G . PASS IFD=.,.,.,.,.,.,.,.,. . . .
1 57 . T G,G . PASS . . . .
1 58 . T G,G . PASS IFD=-907.099,215.09,-658.952,-869.897,897.771,931.264,616.795,-390.772,-804.656 . . .
1 59 . T G,G . PASS IFD=.,215.09,-658.952,-869.897,897.771,931.264,616.795,-390.772,-804.656 . . .
1 60 . T G,G . PASS IFD=-907.099,.,-658.952,-869.897,897.771,931.264,616.795,-390.772,-804.656 . . .
Expand All @@ -114,28 +114,28 @@
1 65 . T G,G . PASS IFD=-907.099,215.09,-658.952,-869.897,897.771,931.264,.,-390.772,-804.656 . . .
1 66 . T G,G . PASS IFD=-907.099,215.09,-658.952,-869.897,897.771,931.264,616.795,.,-804.656 . . .
1 67 . T G,G . PASS IFD=-907.099,215.09,-658.952,-869.897,897.771,931.264,616.795,-390.772,. . . .
1 68 . T G,G . PASS IFD=.,.,.,.,.,.,.,.,. . . .
1 68 . T G,G . PASS . . . .
1 69 . T C,G . PASS IC1=f . . .
1 70 . T C,G . PASS IC1=. . . .
1 70 . T C,G . PASS . . . .
1 71 . G T,G . PASS IC2=e,a . . .
1 72 . G T,G . PASS IC2=.,a . . .
1 73 . G T,G . PASS IC2=e,. . . .
1 74 . G T,G . PASS IC2=.,. . . .
1 74 . G T,G . PASS . . . .
1 75 . A C,A . PASS ICA=b,a . . .
1 76 . A C,A . PASS ICA=.,a . . .
1 77 . A C,A . PASS ICA=b,. . . .
1 78 . A C,A . PASS ICA=.,. . . .
1 78 . A C,A . PASS . . . .
1 79 . C G,C . PASS ICR=c,b,b . . .
1 80 . C G,C . PASS ICR=.,b,b . . .
1 81 . C G,C . PASS ICR=c,.,b . . .
1 82 . C G,C . PASS ICR=c,b,. . . .
1 83 . C G,C . PASS ICR=.,.,. . . .
1 83 . C G,C . PASS . . . .
1 84 . T G,G . PASS ICD=b,f,b,c . . .
1 85 . T G,G . PASS ICD=.,f,b,c . . .
1 86 . T G,G . PASS ICD=b,.,b,c . . .
1 87 . T G,G . PASS ICD=b,f,.,c . . .
1 88 . T G,G . PASS ICD=b,f,b,. . . .
1 89 . T G,G . PASS ICD=.,.,.,. . . .
1 89 . T G,G . PASS . . . .
1 90 . T G,G . PASS ICD=g,e,d,e,f,f,b . . .
1 91 . T G,G . PASS ICD=.,e,d,e,f,f,b . . .
1 92 . T G,G . PASS ICD=g,.,d,e,f,f,b . . .
Expand All @@ -144,22 +144,22 @@
1 95 . T G,G . PASS ICD=g,e,d,e,.,f,b . . .
1 96 . T G,G . PASS ICD=g,e,d,e,f,.,b . . .
1 97 . T G,G . PASS ICD=g,e,d,e,f,f,. . . .
1 98 . T G,G . PASS ICD=.,.,.,.,.,.,. . . .
1 98 . T G,G . PASS . . . .
1 99 . A C,C . PASS IS1=bc . . .
1 100 . A C,C . PASS IS1=. . . .
1 100 . A C,C . PASS . . . .
1 101 . T T,C . PASS IS2=hij,d . . .
1 102 . T T,C . PASS IS2=.,d . . .
1 103 . T T,C . PASS IS2=hij,. . . .
1 104 . T T,C . PASS IS2=.,. . . .
1 104 . T T,C . PASS . . . .
1 105 . T C,C . PASS ISA=bc,efg . . .
1 106 . T C,C . PASS ISA=.,efg . . .
1 107 . T C,C . PASS ISA=bc,. . . .
1 108 . T C,C . PASS ISA=.,. . . .
1 108 . T C,C . PASS . . . .
1 109 . C G,T . PASS ISR=d,bc,op . . .
1 110 . C G,T . PASS ISR=.,bc,op . . .
1 111 . C G,T . PASS ISR=d,.,op . . .
1 112 . C G,T . PASS ISR=d,bc,. . . .
1 113 . C G,T . PASS ISR=.,.,. . . .
1 113 . C G,T . PASS . . . .
1 114 . G A,A . PASS ISD=ab,hij,klmn,d,ab,d,op,efg . . .
1 115 . G A,A . PASS ISD=.,hij,klmn,d,ab,d,op,efg . . .
1 116 . G A,A . PASS ISD=ab,.,klmn,d,ab,d,op,efg . . .
Expand All @@ -169,89 +169,89 @@
1 120 . G A,A . PASS ISD=ab,hij,klmn,d,ab,.,op,efg . . .
1 121 . G A,A . PASS ISD=ab,hij,klmn,d,ab,d,.,efg . . .
1 122 . G A,A . PASS ISD=ab,hij,klmn,d,ab,d,op,. . . .
1 123 . G A,A . PASS ISD=.,.,.,.,.,.,.,. . . .
1 123 . G A,A . PASS . . . .
1 124 . G A,A . PASS ISD=op,op,ab . . .
1 125 . G A,A . PASS ISD=.,op,ab . . .
1 126 . G A,A . PASS ISD=op,.,ab . . .
1 127 . G A,A . PASS ISD=op,op,. . . .
1 128 . G A,A . PASS ISD=.,.,. . . .
1 128 . G A,A . PASS . . . .
2 129 . G G,G . PASS . FI1 -795 .
2 130 . C G,A . PASS . FI2 104,955 .,955
2 131 . C G,A . PASS . FI2 104,. .,.
2 131 . C G,A . PASS . FI2 104,. .
2 132 . C C,T . PASS . FIA 585,895 .,895
2 133 . C C,T . PASS . FIA 585,. .,.
2 133 . C C,T . PASS . FIA 585,. .
2 134 . T C,G . PASS . FIR 411,25,21 .,25,21
2 135 . T C,G . PASS . FIR 411,.,21 411,25,.
2 136 . T C,G . PASS . FIR .,.,. .,.,.
2 136 . T C,G . PASS . FIR . .
2 137 . A T,T . PASS . FIG 413,-435,129,795,845,500 .,-435,129,795,845,500
2 138 . A T,T . PASS . FIG 413,.,129,795,845,500 413,-435,.,795,845,500
2 139 . A T,T . PASS . FIG 413,-435,129,.,845,500 413,-435,129,795,.,500
2 140 . A T,T . PASS . FIG 413,-435,129,795,845,. .,.,.,.,.,.
2 140 . A T,T . PASS . FIG 413,-435,129,795,845,. .
2 141 . C G,G . PASS . FID -271,579 .,579
2 142 . C G,G . PASS . FID -271,. .,.
2 142 . C G,G . PASS . FID -271,. .
2 143 . C G,G . PASS . FID -799,981 .,981
2 144 . C G,G . PASS . FID -799,. .,.
2 144 . C G,G . PASS . FID -799,. .
2 145 . A T,G . PASS . FF1 853.318 .
2 146 . T G,A . PASS . FF2 454.544,-346.918 .,-346.918
2 147 . T G,A . PASS . FF2 454.544,. .,.
2 147 . T G,A . PASS . FF2 454.544,. .
2 148 . C A,T . PASS . FFA 140.888,41.6685 .,41.6685
2 149 . C A,T . PASS . FFA 140.888,. .,.
2 149 . C A,T . PASS . FFA 140.888,. .
2 150 . T T,C . PASS . FFR 922.344,689.068,494.64 .,689.068,494.64
2 151 . T T,C . PASS . FFR 922.344,.,494.64 922.344,689.068,.
2 152 . T T,C . PASS . FFR .,.,. .,.,.
2 152 . T T,C . PASS . FFR . .
2 153 . A T,T . PASS . FFG 79.3843,173.502,930.511,214.068,-448.002,-407.453 .,173.502,930.511,214.068,-448.002,-407.453
2 154 . A T,T . PASS . FFG 79.3843,.,930.511,214.068,-448.002,-407.453 79.3843,173.502,.,214.068,-448.002,-407.453
2 155 . A T,T . PASS . FFG 79.3843,173.502,930.511,.,-448.002,-407.453 79.3843,173.502,930.511,214.068,.,-407.453
2 156 . A T,T . PASS . FFG 79.3843,173.502,930.511,214.068,-448.002,. .,.,.,.,.,.
2 156 . A T,T . PASS . FFG 79.3843,173.502,930.511,214.068,-448.002,. .
2 157 . A C,A . PASS . FFD -968.727 .
2 158 . A C,A . PASS . FFD 544.49,-602.569,-988.956,630.923,413.715,458.014,542.541,-851.911,-283.069 .,-602.569,-988.956,630.923,413.715,458.014,542.541,-851.911,-283.069
2 159 . A C,A . PASS . FFD 544.49,.,-988.956,630.923,413.715,458.014,542.541,-851.911,-283.069 544.49,-602.569,.,630.923,413.715,458.014,542.541,-851.911,-283.069
2 160 . A C,A . PASS . FFD 544.49,-602.569,-988.956,.,413.715,458.014,542.541,-851.911,-283.069 544.49,-602.569,-988.956,630.923,.,458.014,542.541,-851.911,-283.069
2 161 . A C,A . PASS . FFD 544.49,-602.569,-988.956,630.923,413.715,.,542.541,-851.911,-283.069 544.49,-602.569,-988.956,630.923,413.715,458.014,.,-851.911,-283.069
2 162 . A C,A . PASS . FFD 544.49,-602.569,-988.956,630.923,413.715,458.014,542.541,.,-283.069 544.49,-602.569,-988.956,630.923,413.715,458.014,542.541,-851.911,.
2 163 . A C,A . PASS . FFD .,.,.,.,.,.,.,.,. .,.,.,.,.,.,.,.,.
2 163 . A C,A . PASS . FFD . .
2 164 . T T,A . PASS . FC1 d .
2 165 . G C,T . PASS . FC2 c,b .,b
2 166 . G C,T . PASS . FC2 c,. .,.
2 166 . G C,T . PASS . FC2 c,. .
2 167 . G G,A . PASS . FCA c,g .,g
2 168 . G G,A . PASS . FCA c,. .,.
2 168 . G G,A . PASS . FCA c,. .
2 169 . G C,G . PASS . FCR a,b,c .,b,c
2 170 . G C,G . PASS . FCR a,.,c a,b,.
2 171 . G C,G . PASS . FCR .,.,. .,.,.
2 171 . G C,G . PASS . FCR . .
2 172 . G A,A . PASS . FCG a,e,b,g,g,a .,e,b,g,g,a
2 173 . G A,A . PASS . FCG a,.,b,g,g,a a,e,.,g,g,a
2 174 . G A,A . PASS . FCG a,e,b,.,g,a a,e,b,g,.,a
2 175 . G A,A . PASS . FCG a,e,b,g,g,. .,.,.,.,.,.
2 175 . G A,A . PASS . FCG a,e,b,g,g,. .
2 176 . A G,A . PASS . FCD a,g,d,d,f,f,b,a,d .,g,d,d,f,f,b,a,d
2 177 . A G,A . PASS . FCD a,.,d,d,f,f,b,a,d a,g,.,d,f,f,b,a,d
2 178 . A G,A . PASS . FCD a,g,d,.,f,f,b,a,d a,g,d,d,.,f,b,a,d
2 179 . A G,A . PASS . FCD a,g,d,d,f,.,b,a,d a,g,d,d,f,f,.,a,d
2 180 . A G,A . PASS . FCD a,g,d,d,f,f,b,.,d a,g,d,d,f,f,b,a,.
2 181 . A G,A . PASS . FCD .,.,.,.,.,.,.,.,. c,d,f,e,g,a,c
2 181 . A G,A . PASS . FCD . c,d,f,e,g,a,c
2 182 . A G,A . PASS . FCD .,d,f,e,g,a,c c,.,f,e,g,a,c
2 183 . A G,A . PASS . FCD c,d,.,e,g,a,c c,d,f,.,g,a,c
2 184 . A G,A . PASS . FCD c,d,f,e,.,a,c c,d,f,e,g,.,c
2 185 . A G,A . PASS . FCD c,d,f,e,g,a,. .,.,.,.,.,.,.
2 185 . A G,A . PASS . FCD c,d,f,e,g,a,. .
2 186 . C T,A . PASS . FS1 bc .
2 187 . C C,C . PASS . FS2 bc,op .,op
2 188 . C C,C . PASS . FS2 bc,. .,.
2 188 . C C,C . PASS . FS2 bc,. .
2 189 . C T,G . PASS . FSA ab,op .,op
2 190 . C T,G . PASS . FSA ab,. .,.
2 190 . C T,G . PASS . FSA ab,. .
2 191 . T T,T . PASS . FSR klmn,bc,efg .,bc,efg
2 192 . T T,T . PASS . FSR klmn,.,efg klmn,bc,.
2 193 . T T,T . PASS . FSR .,.,. .,.,.
2 193 . T T,T . PASS . FSR . .
2 194 . A C,A . PASS . FSG d,op,bc,klmn,efg,d .,op,bc,klmn,efg,d
2 195 . A C,A . PASS . FSG d,.,bc,klmn,efg,d d,op,.,klmn,efg,d
2 196 . A C,A . PASS . FSG d,op,bc,.,efg,d d,op,bc,klmn,.,d
2 197 . A C,A . PASS . FSG d,op,bc,klmn,efg,. .,.,.,.,.,.
2 197 . A C,A . PASS . FSG d,op,bc,klmn,efg,. .
2 198 . T T,G . PASS . FSD klmn,bc,d,op,hij,efg,klmn,ab,hij .,bc,d,op,hij,efg,klmn,ab,hij
2 199 . T T,G . PASS . FSD klmn,.,d,op,hij,efg,klmn,ab,hij klmn,bc,.,op,hij,efg,klmn,ab,hij
2 200 . T T,G . PASS . FSD klmn,bc,d,.,hij,efg,klmn,ab,hij klmn,bc,d,op,.,efg,klmn,ab,hij
2 201 . T T,G . PASS . FSD klmn,bc,d,op,hij,.,klmn,ab,hij klmn,bc,d,op,hij,efg,.,ab,hij
2 202 . T T,G . PASS . FSD klmn,bc,d,op,hij,efg,klmn,.,hij klmn,bc,d,op,hij,efg,klmn,ab,.
2 203 . T T,G . PASS . FSD .,.,.,.,.,.,.,.,. efg,klmn,bc,op,ab,bc,hij,hij
2 203 . T T,G . PASS . FSD . efg,klmn,bc,op,ab,bc,hij,hij
2 204 . T T,G . PASS . FSD .,klmn,bc,op,ab,bc,hij,hij efg,.,bc,op,ab,bc,hij,hij
2 205 . T T,G . PASS . FSD efg,klmn,.,op,ab,bc,hij,hij efg,klmn,bc,.,ab,bc,hij,hij
2 206 . T T,G . PASS . FSD efg,klmn,bc,op,.,bc,hij,hij efg,klmn,bc,op,ab,.,hij,hij
2 207 . T T,G . PASS . FSD efg,klmn,bc,op,ab,bc,.,hij efg,klmn,bc,op,ab,bc,hij,.
2 208 . T T,G . PASS . FSD .,.,.,.,.,.,.,. .,.,.,.,.,.,.,.
2 208 . T T,G . PASS . FSD . .
4 changes: 1 addition & 3 deletions sgkit/tests/io/vcf/test_vcf_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
},
True,
),
# Temporarily disabling this all_fields test while resolving missing data issue
# https://github.com/pystatgen/sgkit/issues/1197
# ("all_fields.vcf", None, True),
("all_fields.vcf", None, True),
("CEUTrio.20.21.gatk3.4.g.vcf.bgz", None, True),
# don't generate header to avoid https://github.com/pydata/xarray/issues/7328
("Homo_sapiens_assembly38.headerOnly.vcf.gz", None, False),
Expand Down
10 changes: 6 additions & 4 deletions sgkit/tests/io/vcf/vcf_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def generate_values(self, alt_alleles):
n = generate_number(self.vcf_number, alt_alleles)
data = generate_data(self.vcf_type, n)
val = ",".join([str(x) for x in data])
assert val != "."
yield f"{val}"
for i in range(n):
data_str = [str(x) for x in data]
data_str[i] = "." # missing
val = ",".join(data_str)
yield f"{val}"
yield f"{val}" if val != "." else None
if n > 1:
val = ",".join(["."] * n) # all missing
yield f"{val}"
yield None # all missing


def generate_header(info_fields, format_fields, vcf_samples):
Expand Down Expand Up @@ -154,7 +154,9 @@ def generate_vcf(output, seed=42):
pos = pos + 1
ref = alleles[0]
alt = alleles[1:]
info = {info_field.name: val}
info = {}
if val is not None:
info = {info_field.name: val}
samples: List[Dict[str, Any]] = [{}] * len(vcf_samples)

variant = VcfVariant(
Expand Down

0 comments on commit ec365f0

Please sign in to comment.