Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate Variation object embedded in the the Phenopacket Schema #133

Merged
merged 5 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
498 changes: 498 additions & 0 deletions phenopacket-tools-cli/src/examples/phenopackets/retinoblastoma.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.phenopackets.phenopackettools.cli.examples;

import org.ga4gh.vrs.v1.*;
import org.ga4gh.vrs.v1.Number;
import org.phenopackets.phenopackettools.builder.PhenopacketBuilder;
import org.phenopackets.phenopackettools.builder.builders.*;
import org.phenopackets.phenopackettools.builder.constants.Laterality;
Expand Down Expand Up @@ -71,10 +73,10 @@ Interpretation interpretation() {
* @return Genomic interpretation related to a somatic missense mutation in the RB1 gene.
*/
GenomicInterpretation somaticRb1Missense() {
AlleleBuilder abuilder = AlleleBuilder.builder();
abuilder.sequenceId("refseq:NC_000013.11");
abuilder.interbaseStartEnd( 48367511, 48367512);
abuilder.altAllele("T");
AlleleBuilder abuilder = AlleleBuilder.builder()
.sequenceId("refseq:NC_000013.11")
.interbaseStartEnd( 48367511, 48367512)
.altAllele("T");
VariationDescriptorBuilder vbuilder = VariationDescriptorBuilder.builder("rs121913300")
.variation(abuilder.buildVariation())
.genomic()
Expand All @@ -100,15 +102,31 @@ GenomicInterpretation somaticRb1Missense() {


GenomicInterpretation germlineRb1Deletion() {
CopyNumberBuilder abuilder = CopyNumberBuilder.builder();
CopyNumber cnv = CopyNumber.newBuilder()
.setDerivedSequenceExpression(DerivedSequenceExpression.newBuilder()
.setLocation(SequenceLocation.newBuilder()
.setSequenceId("refseq:NC_000013.14")
.setSequenceInterval(SequenceInterval.newBuilder()
.setStartNumber(Number.newBuilder().
setValue(25981249)
.build())
.setEndNumber(Number.newBuilder()
.setValue(61706822)
.build())
.build())
.build())
.build())
.setNumber(Number.newBuilder().setValue(1).build())
.build();
//abuilder.copyNumberId("ga4gh:VCN.AFfJws1M4Lg8w1O3XknmHYc9TU2hHYpp");
// original coordinates in paper were given as 13q12.13q21.2(26,555,387–62,280,955 for hg19
//chr13 25981249 61706822 -- lifted over to hg38
Variation variation = Variation.newBuilder()
.setCopyNumber(cnv)
.build();

abuilder.alleleLocation("refseq:NC_000013.14",25981249, 61706822);//VRS uses inter-residue coordinates
ielis marked this conversation as resolved.
Show resolved Hide resolved
abuilder.oneCopy();
VariationDescriptorBuilder vbuilder = VariationDescriptorBuilder.builder();
vbuilder.variation(abuilder.buildVariation());
vbuilder.variation(variation);
vbuilder.mosaicism(40.0);
VariantInterpretationBuilder vibuilder = VariantInterpretationBuilder.builder(vbuilder);
vibuilder.pathogenic();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# README

This folder contains JSON schemas for validating top-level Phenopacket Schema elements and the `Variation` element
embedded in the Phenopacket Schema.

## VRSATILE notes

The datatype of the `VcfRecord.pos` field in `vrsatile.proto` is:
```
uint64 pos = 3;
```

Since Protobuf's `JSONFormat` serializes `uint64` fields into a JSON `string` instead of a JSON `number`,
the JSON schema element for validation of the `VcfRecord.pos` field is:

```
"type": "string",
"pattern": "^[1-9][0-9]*$"
```

instead of a more straightforward:

```
"type": "integer"
```
Loading