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 Type
    Method
    Description
    org.phenopackets.schema.v2.Cohort
    convertCohort(org.phenopackets.schema.v1.Cohort cohort)
    Convert v1 Cohort to v2 Cohort.
    org.phenopackets.schema.v2.Family
    convertFamily(org.phenopackets.schema.v1.Family family)
    Convert v1 Family to v2 Family.
    org.phenopackets.schema.v2.Phenopacket
    convertPhenopacket(org.phenopackets.schema.v1.Phenopacket phenopacket)
    Convert v1 Phenopacket to v2 Phenopacket.
    of(boolean convertVariants)
     
  • Method Details

    • of

      static V1ToV2Converter of(boolean convertVariants)
    • convertPhenopacket

      org.phenopackets.schema.v2.Phenopacket convertPhenopacket(org.phenopackets.schema.v1.Phenopacket phenopacket)
      Convert v1 Phenopacket to v2 Phenopacket.
    • convertFamily

      org.phenopackets.schema.v2.Family convertFamily(org.phenopackets.schema.v1.Family family)
      Convert v1 Family to v2 Family.
    • convertCohort

      org.phenopackets.schema.v2.Cohort convertCohort(org.phenopackets.schema.v1.Cohort cohort)
      Convert v1 Cohort to v2 Cohort.