Skip to content

Commit 7ddc969

Browse files
committed
models: Add missing fields to variant_annotation.proto #TASK-7555
1 parent f225f58 commit 7ddc969

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

biodata-models/src/main/proto/protobuf/opencb/variant_annotation.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ message ConsequenceType {
9393
repeated SpliceScores spliceScores = 16;
9494
repeated string transcriptFlags = 17;
9595
string source = 18;
96+
repeated string acmg = 19;
9697
}
9798

9899
message Repeat {
@@ -248,6 +249,12 @@ message CancerHotspotVariantAnnotation {
248249
string source = 10;
249250
}
250251

252+
message GenomicSequenceContext {
253+
int32 start = 1;
254+
int32 end = 2;
255+
string sequence = 3;
256+
}
257+
251258
message VariantAnnotation {
252259
string chromosome = 1;
253260
int32 start = 2;
@@ -285,6 +292,8 @@ message VariantAnnotation {
285292
repeated GwasAssociation gwas = 30;
286293
repeated CancerHotspotVariantAnnotation cancer_hotspots = 31;
287294

295+
GenomicSequenceContext genomic_sequence_context = 32;
296+
288297
message AdditionalAttribute {
289298
map<string, string> attribute = 1;
290299
}

biodata-tools/src/main/java/org/opencb/biodata/tools/variant/converters/proto/AvroToProtoConverter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.function.Consumer;
1313
import java.util.function.Function;
1414
import java.util.function.Supplier;
15+
import java.util.stream.Collectors;
1516

1617
public class AvroToProtoConverter {
1718
private final Map<String, Message.Builder> builders = new HashMap<>();
@@ -46,6 +47,10 @@ protected <Builder extends Message.Builder> Builder toProto(GenericRecord record
4647
logger.warn("Number of fields mismatch at " + context + ": Avro fields="
4748
+ record.getSchema().getFields().size() + ", Proto fields=" + descriptor.getFields().size()
4849
+ ", missing avro fields: " + missingInAvro + ", missing proto fields: " + missingInProto);
50+
logger.warn("Proto fields: "
51+
+ descriptor.getFields().stream().map(Descriptors.FieldDescriptor::getJsonName).sorted().collect(Collectors.toList()));
52+
logger.warn("Avro fields: "
53+
+ record.getSchema().getFields().stream().map(Schema.Field::name).sorted().collect(Collectors.toList()));
4954
throw new IllegalArgumentException("Number of fields mismatch at " + context + ": Avro fields="
5055
+ record.getSchema().getFields().size() + ", Proto fields=" + descriptor.getFields().size());
5156
}

0 commit comments

Comments
 (0)