Interface V1ToV2Converter
public interface V1ToV2Converter
Convert top-level elements of the phenopacket schema from v1 to v2 format.
WARNING: the conversion can be lossy. The default V1ToV2Converter
implementation attempts to convert
Phenopacket
variants into Interpretation
,
assuming all Variant
s are
GenomicInterpretation.InterpretationStatus.CAUSATIVE
. For this to work,
there must be exactly one Disease
in the phenopacket, otherwise
a PhenopacketToolsRuntimeException
is thrown.
Note, it is technically possible to convert an empty v1 phenopacket, family, or cohort message. In that case,
the returned instance
will equal to protobuf default instance (e.g. Phenopacket.getDefaultInstance()
).
-
Method Summary
Modifier and TypeMethodDescriptionorg.phenopackets.schema.v2.Cohort
convertCohort
(org.phenopackets.schema.v1.Cohort cohort) Convert v1Cohort
to v2Cohort
.org.phenopackets.schema.v2.Family
convertFamily
(org.phenopackets.schema.v1.Family family) Convert v1Family
to v2Family
.org.phenopackets.schema.v2.Phenopacket
convertPhenopacket
(org.phenopackets.schema.v1.Phenopacket phenopacket) Convert v1Phenopacket
to v2Phenopacket
.static V1ToV2Converter
of
(boolean convertVariants)
-
Method Details
-
of
-
convertPhenopacket
org.phenopackets.schema.v2.Phenopacket convertPhenopacket(org.phenopackets.schema.v1.Phenopacket phenopacket) Convert v1Phenopacket
to v2Phenopacket
. -
convertFamily
org.phenopackets.schema.v2.Family convertFamily(org.phenopackets.schema.v1.Family family) Convert v1Family
to v2Family
. -
convertCohort
org.phenopackets.schema.v2.Cohort convertCohort(org.phenopackets.schema.v1.Cohort cohort) Convert v1Cohort
to v2Cohort
.
-