phenopacket_mapper.validate.validate module

class phenopacket_mapper.validate.validate.Validator(*args, **kwargs)[source]

Bases: object

Internal class, implemented using the singleton pattern, that uses phenopacket-tools to validate phenopackets. This is complicated a bit by the fact that phenopacket-tools is implemented in java. The singleton pattern ensures that only one instance of the class is created for efficiency purposes.

validate(phenopackets: List[Phenopacket]) bool[source]

Validate phenopackets using phenopacket-tools.

Parameters:

phenopackets – List of phenopackets to validate

Returns:

True if the phenopackets are valid, False otherwise

phenopacket_mapper.validate.validate.validate(phenopackets: List[Phenopacket]) bool[source]

Validate phenopackets using phenopacket-tools.

Parameters:

phenopackets – List of phenopackets to validate

Returns:

True if the phenopackets are valid, False otherwise

phenopacket_mapper.validate.validate.read_validate(path: Path) bool[source]

Read phenopackets from a file and validate them.

Parameters:

path – Path to the file containing phenopackets

Returns:

True if the phenopackets are valid, False otherwise