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 Variants 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.CohortconvertCohort(org.phenopackets.schema.v1.Cohort cohort) Convert v1Cohortto v2Cohort.org.phenopackets.schema.v2.FamilyconvertFamily(org.phenopackets.schema.v1.Family family) Convert v1Familyto v2Family.org.phenopackets.schema.v2.PhenopacketconvertPhenopacket(org.phenopackets.schema.v1.Phenopacket phenopacket) Convert v1Phenopacketto v2Phenopacket.static V1ToV2Converterof(boolean convertVariants)
-
Method Details
-
of
-
convertPhenopacket
org.phenopackets.schema.v2.Phenopacket convertPhenopacket(org.phenopackets.schema.v1.Phenopacket phenopacket) Convert v1Phenopacketto v2Phenopacket. -
convertFamily
org.phenopackets.schema.v2.Family convertFamily(org.phenopackets.schema.v1.Family family) Convert v1Familyto v2Family. -
convertCohort
org.phenopackets.schema.v2.Cohort convertCohort(org.phenopackets.schema.v1.Cohort cohort) Convert v1Cohortto v2Cohort.
-