Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Commit daa2738

Browse files
ejacoxdavid4096
authored andcommitted
added fields for structural variants (#827)
* added fields for structural variants * added sint32 type to protobuf to json-docs converter * added other protobuf types to sphinx converter
1 parent 67a3756 commit daa2738

File tree

4 files changed

+78
-10
lines changed

4 files changed

+78
-10
lines changed
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# File generated by scripts/process_schemas.py; do not edit
2-
version = '0.6.0a9'
2+
version = '0.6.0a10'

python/ga4gh/schemas/ga4gh/variants_pb2.py

+33-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/proto/ga4gh/variants.proto

+29-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ message Variant {
184184
// The bases that appear instead of the reference bases. Multiple alternate
185185
// alleles are possible.
186186
repeated string alternate_bases = 10;
187-
187+
188188
// A map of additional information about the Variant.
189189
Attributes attributes = 13;
190190

@@ -193,15 +193,40 @@ message Variant {
193193
// array are implicitly associated with this `Variant`.
194194
repeated Call calls = 12;
195195

196-
// True if filters were applied for this variant. VCF column 7 "FILTER"
196+
// The "variant_type" is used to denote e.g. structural variants.
197+
// Examples:
198+
// DUP : duplication of sequence following "start"; not necessarily in situ
199+
// DEL : deletion of sequence following "start"
200+
string variant_type = 17;
201+
202+
// Length of the - if labeled as such in variant_type - structural variation.
203+
// Based on the use in VCFv4.2
204+
int64 svlen = 18;
205+
206+
// In the case of structural variants, start and end of the variant may not
207+
// be known with an exact base position. "cipos" provides an interval with
208+
// high confidence for the start position. The interval is provided by 0 or
209+
// 2 signed integers which are added to the start position.
210+
// Based on the use in VCFv4.2
211+
// Example:
212+
// [ -12000, 1000 ]
213+
repeated sint32 cipos = 19;
214+
215+
// Similar to "cipos", but for the variant's end position (which is derived
216+
// from start + svlen).
217+
// Example:
218+
// [ -1000, 0 ]
219+
repeated sint32 ciend = 20;
220+
221+
// True if filters were applied for this variant. VCF column 7 "FILTER"
197222
// any value other than the missing value.
198223
bool filters_applied = 14;
199224

200-
// True if all filters for this variant passed. VCF column 7 "FILTER"
225+
// True if all filters for this variant passed. VCF column 7 "FILTER"
201226
// value PASS.
202227
bool filters_passed = 15;
203228

204-
// Zero or more filters that failed for this variant. VCF column 7 "FILTER"
229+
// Zero or more filters that failed for this variant. VCF column 7 "FILTER"
205230
// shared across all alleles in the same VCF record.
206231
repeated string filters_failed = 16;
207232
}

tools/sphinx/protobuf-json-docs.py

+15
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,15 @@ def type_to_string(f, map_types):
148148
return "uint64"
149149
elif f.type in [5]:
150150
return "integer"
151+
elif f.type in [6]:
152+
return "fixed64"
153+
elif f.type in [7]:
154+
return "fixed32"
151155
elif f.type in [8]:
152156
return "boolean"
153157
elif f.type in [9]:
154158
return "string"
159+
# missing type 10 - Group
155160
elif f.type in [11, 14]:
156161
ref_name = f.ref_type
157162
if ref_name in map_types:
@@ -169,6 +174,16 @@ def type_to_string(f, map_types):
169174
return kind
170175
elif f.type in [12]:
171176
return "bytes"
177+
elif f.type in [13]:
178+
return "uint32"
179+
elif f.type in [15]:
180+
return "sfixed32"
181+
elif f.type in [16]:
182+
return "sfixed64"
183+
elif f.type in [17]:
184+
return "sint32"
185+
elif f.type in [18]:
186+
return "sint64"
172187
else:
173188
raise Exception, f.type
174189

0 commit comments

Comments
 (0)