Table 1.
Utility classes in the org.phenopackets.phenopackettools.builder.builders package that provide predefined constants that simplify construction of selected elements of the Phenopacket Schema.
The second column shows an example, and a full list is available in the online documentation. The third column indicates the parts of the Phenopacket Schema in which the constants can be used.
Fig 1.
Methods for creating OntologyClass messages with phenopacket-tools.
A. Builder pattern provided by the protobuf Java framework. B. Predefined constant (static function) that returns an Ontology term singleton instance. Here, BiospecimenType.bloodDNA() generates the ontology term that represents the NCI Thesaurus (NCIt) concept C158416 for the biospecimen type “blood DNA” C. Convenience function provided by phenopacket-tools. D. The JSON representation of OntologyClass message that is generated by the code in panels A, B, and C.
Table 2.
Examples of convenience functions.
In addition to the ontologyClass function that was explained in detail in the text, phenopacket-tools provides convenience functions to reduce the amount of boilerplate in client code. Details are available in the online user guide and Javadoc documentation.
Table 3.
An overview of validation errors.
Phenopacket-tools includes multiple off-the-shelf validators for performing basic and domain-specific checks. The validators emit errors that refer to invalid phenopacket components. The table lists the errors and solutions for issues discovered in example phenopackets that are included in the phenopacket-tools distribution.
Fig 2.
Phenopacket-tools offers convenience functions that streamline the construction of GA4GH phenopackets. (A) The protobuf framework automatically generates Java bindings for messages that are defined in proto files. This panel shows an example of how the bindings can be used to create a PhenotypicFeature element that represents severe weakness of the left triceps muscle with age of onset at eleven years and four months (“P11Y4M”). (B) Phenopacket-tools provides builder classes that contain convenience functions that hide the relative verbosity of the protobuf bindings. (C) JSON representation of the PhenotypicFeature element generated by Panel A or B.
Fig 3.
Creating a customized validator and applying it to a phenopacket.
The ValidationResult object contains fields representing validation metadata, the level of the validation (error or warning), the category, and a message (See Table 3).