ppsc.v202 package

A package with types corresponding to the v2.0.2 release of the Phenopacket Schema.

class ppsc.v202.Phenopacket(id: str, meta_data: MetaData, subject: Individual | None = None, phenotypic_features: Iterable[PhenotypicFeature] | None = None, measurements: Iterable[Measurement] | None = None, biosamples: Iterable[Biosample] | None = None, interpretations: Iterable[Interpretation] | None = None, diseases: Iterable[Disease] | None = None, medical_actions: Iterable[MedicalAction] | None = None, files: Iterable[File] | None = None)[source]

Bases: MessageMixin

property id: str
property subject: Individual | None
property phenotypic_features: MutableSequence[PhenotypicFeature]
property measurements: MutableSequence[Measurement]
property biosamples: MutableSequence[Biosample]
property interpretations: MutableSequence[Interpretation]
property diseases: MutableSequence[Disease]
property medical_actions: MutableSequence[MedicalAction]
property files: MutableSequence[File]
property meta_data: MetaData
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Individual(id: str, alternate_ids: Iterable[str] | None = None, date_of_birth: Timestamp | None = None, time_at_last_encounter: TimeElement | None = None, vital_status: VitalStatus | None = None, sex: Sex | None = None, karyotypic_sex: KaryotypicSex | None = None, gender: OntologyClass | None = None, taxonomy: OntologyClass | None = None)[source]

Bases: MessageMixin

property id: str | None
property alternate_ids: MutableSequence[str]
property date_of_birth: Timestamp | None
property time_at_last_encounter: TimeElement | None
property vital_status: VitalStatus | None
property sex: Sex | None
property karyotypic_sex: KaryotypicSex | None
property gender: OntologyClass | None
property taxonomy: OntologyClass | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.VitalStatus(status: Status, time_of_death: TimeElement | None = None, cause_of_death: OntologyClass | None = None, survival_time_in_days: int | None = None)[source]

Bases: MessageMixin

TODO: add docs.

class Status(value)[source]

Bases: Enum

TODO: add docs.

UNKNOWN_STATUS = 0
ALIVE = 1
DECEASED = 2
property status: Status
property time_of_death: TimeElement | None
property cause_of_death: OntologyClass | None
property survival_time_in_days: int | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Sex(value)[source]

Bases: Enum

An enumeration used to represent the sex of an individual. This element does not represent gender identity or KaryotypicSex, but instead represents typical “phenotypic sex”, as would be determined by a midwife or physician at birth.

UNKNOWN_SEX = 0

Not assessed or not available. Maps to NCIT:C17998

FEMALE = 1

Female sex. Maps to NCIT:C46113.

MALE = 2

Male sex. Maps to NCIT:C46112

OTHER_SEX = 3

It is not possible to accurately assess the applicability of MALE/FEMALE. Maps to NCIT:C45908

class ppsc.v202.KaryotypicSex(value)[source]

Bases: Enum

An enumeration.

UNKNOWN_KARYOTYPE = 0
XX = 1
XY = 2
XO = 3
XXY = 4
XXX = 5
XXYY = 6
XXXY = 7
XXXX = 8
XYY = 9
OTHER_KARYOTYPE = 10
class ppsc.v202.GeneDescriptor(value_id: str, symbol: str, description: str | None = None, alternate_ids: Iterable[str] | None = None, xrefs: Iterable[str] | None = None, alternate_symbols: Iterable[str] | None = None)[source]

Bases: MessageMixin

property value_id: str
property symbol: str
property description: str
property alternate_ids: MutableSequence[str]
property xrefs: MutableSequence[str]
property alternate_symbols: MutableSequence[str]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.AcmgPathogenicityClassification(value)[source]

Bases: Enum

An enumeration.

NOT_PROVIDED = 0
BENIGN = 1
LIKELY_BENIGN = 2
UNCERTAIN_SIGNIFICANCE = 3
LIKELY_PATHOGENIC = 4
PATHOGENIC = 5
class ppsc.v202.TherapeuticActionability(value)[source]

Bases: Enum

An enumeration.

UNKNOWN_ACTIONABILITY = 0
NOT_ACTIONABLE = 1
ACTIONABLE = 2
class ppsc.v202.VariantInterpretation(acmg_pathogenicity_classification: AcmgPathogenicityClassification, therapeutic_actionability: TherapeuticActionability, variation_descriptor: VariationDescriptor)[source]

Bases: MessageMixin

property acmg_pathogenicity_classification: AcmgPathogenicityClassification
property therapeutic_actionability: TherapeuticActionability
property variation_descriptor: VariationDescriptor
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.GenomicInterpretation(subject_or_biosample_id: str, interpretation_status: InterpretationStatus, call: GeneDescriptor | VariantInterpretation)[source]

Bases: MessageMixin

class InterpretationStatus(value)[source]

Bases: Enum

An enumeration.

UNKNOWN_STATUS = 0
REJECTED = 1
CANDIDATE = 2
CONTRIBUTORY = 3
CAUSATIVE = 4
property subject_or_biosample_id: str
property interpretation_status: InterpretationStatus
property call: GeneDescriptor | VariantInterpretation
property gene_descriptor: GeneDescriptor | None
property variant_interpretation: VariantInterpretation | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Diagnosis(disease: OntologyClass, genomic_interpretations: Iterable[GenomicInterpretation] | None = None)[source]

Bases: MessageMixin

property disease: OntologyClass
property genomic_interpretations: MutableSequence[GenomicInterpretation]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Interpretation(id: str, progress_status: ProgressStatus, diagnosis: Diagnosis | None = None, summary: str | None = None)[source]

Bases: MessageMixin

class ProgressStatus(value)[source]

Bases: Enum

An enumeration.

UNKNOWN_PROGRESS = 0
IN_PROGRESS = 1
COMPLETED = 2
SOLVED = 3
UNSOLVED = 4
property id: str
property progress_status: ProgressStatus
property diagnosis: Diagnosis | None
property summary: str | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.ReferenceRange(unit: OntologyClass, low: float, high: float)[source]

Bases: MessageMixin

property unit: OntologyClass
property low: float
property high: float
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Quantity(unit: OntologyClass, value: float, reference_range: ReferenceRange | None = None)[source]

Bases: MessageMixin

property unit: OntologyClass
property value: float
property reference_range: ReferenceRange | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

to_message() Message[source]

Get a protobuf representation of the class.

class ppsc.v202.TypedQuantity(type: OntologyClass, quantity: Quantity)[source]

Bases: MessageMixin

property type: OntologyClass
property quantity: Quantity
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.ComplexValue(typed_quantities: Iterable[TypedQuantity])[source]

Bases: MessageMixin

property typed_quantities: MutableSequence[TypedQuantity]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

to_message() Message[source]

Get a protobuf representation of the class.

class ppsc.v202.Value(value: Quantity | OntologyClass)[source]

Bases: MessageMixin

property value: Quantity | OntologyClass
property quantity: Quantity | None
property ontology_class: OntologyClass | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Measurement(assay: OntologyClass, measurement_value: Value | ComplexValue, description: str | None = None, time_observed: TimeElement | None = None, procedure: Procedure | None = None)[source]

Bases: MessageMixin

property assay: OntologyClass
property measurement_value: Value | ComplexValue
property value: Value | None
property complex_value: ComplexValue | None
property description: str | None
property time_observed: TimeElement | None
property procedure: Procedure | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.TherapeuticRegimen(identifier: ExternalReference | OntologyClass, regimen_status: RegimenStatus, start_time: TimeElement | None = None, end_time: TimeElement | None = None)[source]

Bases: MessageMixin

class RegimenStatus(value)[source]

Bases: Enum

An enumeration.

UNKNOWN_STATUS = 0
STARTED = 1
COMPLETED = 2
DISCONTINUED = 3
property identifier: ExternalReference | OntologyClass
property external_reference: ExternalReference | None
property ontology_class: OntologyClass | None
property regimen_status: RegimenStatus
property start_time: TimeElement | None
property end_time: TimeElement | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.RadiationTherapy(modality: OntologyClass, body_site: OntologyClass, dosage: int, fractions: int)[source]

Bases: MessageMixin

property modality: OntologyClass
property body_site: OntologyClass
property dosage: int
property fractions: int
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.DrugType(value)[source]

Bases: Enum

An enumeration.

UNKNOWN_DRUG_TYPE = 0
PRESCRIPTION = 1
EHR_MEDICATION_LIST = 2
class ppsc.v202.DoseInterval(quantity: Quantity, schedule_frequency: OntologyClass, interval: TimeInterval)[source]

Bases: MessageMixin

property quantity: Quantity
property schedule_frequency: OntologyClass
property interval: TimeInterval
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Treatment(agent: OntologyClass, route_of_administration: OntologyClass | None = None, dose_intervals: Iterable[DoseInterval] | None = None, drug_type: DrugType | None = None, cumulative_dose: Quantity | None = None)[source]

Bases: MessageMixin

property agent: OntologyClass
property route_of_administration: OntologyClass | None
property dose_intervals: MutableSequence[DoseInterval]
property drug_type: DrugType | None
property cumulative_dose: Quantity | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

to_message() Message[source]

Get a protobuf representation of the class.

class ppsc.v202.MedicalAction(action: Procedure | Treatment | RadiationTherapy | TherapeuticRegimen, treatment_target: OntologyClass | None = None, treatment_intent: OntologyClass | None = None, response_to_treatment: OntologyClass | None = None, adverse_events: Iterable[OntologyClass] | None = None, treatment_termination_reason: OntologyClass | None = None)[source]

Bases: MessageMixin

property action: Procedure | Treatment | RadiationTherapy | TherapeuticRegimen
property procedure: Procedure
property treatment: Treatment
property radiation_therapy: RadiationTherapy
property therapeutic_regimen: TherapeuticRegimen
property treatment_target: OntologyClass | None
property treatment_intent: OntologyClass | None
property response_to_treatment: OntologyClass | None
property adverse_events: MutableSequence[OntologyClass]
property treatment_termination_reason: OntologyClass | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Expression(syntax: str, value: str, version: str | None = None)[source]

Bases: MessageMixin

property syntax: str
property value: str
property version: str | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Extension(name: str, value: str)[source]

Bases: MessageMixin

property name: str
property value: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.VcfRecord(genome_assembly: str, chrom: str, pos: int, ref: str, alt: str, id: str | None = None, qual: str | None = None, filter: str | None = None, info: str | None = None)[source]

Bases: MessageMixin

property genome_assembly: str
property chrom: str
property pos: int
property ref: str
property alt: str
property id: str | None
property qual: str | None
property filter: str | None
property info: str | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.MoleculeContext(value)[source]

Bases: Enum

An enumeration.

unspecified_molecule_context = 0
genomic = 1
transcript = 2
protein = 3
class ppsc.v202.VariationDescriptor(id: str, molecule_context: MoleculeContext, label: str | None = None, description: str | None = None, gene_context: GeneDescriptor | None = None, expressions: Iterable[Expression] | None = None, vcf_record: VcfRecord | None = None, xrefs: Iterable[str] | None = None, alternate_labels: Iterable[str] | None = None, extensions: Iterable[Extension] | None = None, structural_type: OntologyClass | None = None, vrs_ref_allele_seq: str | None = None, allelic_state: OntologyClass | None = None)[source]

Bases: MessageMixin

property id: str
property molecule_context: MoleculeContext
property label: str | None
property description: str | None
property gene_context: GeneDescriptor | None
property expressions: MutableSequence[Expression]
property vcf_record: VcfRecord | None
property xrefs: MutableSequence[str]
property alternate_labels: MutableSequence[str]
property extensions: MutableSequence[Extension]
property structural_type: OntologyClass | None
property vrs_ref_allele_seq: str | None
property allelic_state: OntologyClass | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.PhenotypicFeature(type: OntologyClass, excluded: bool = False, description: str | None = None, severity: OntologyClass | None = None, modifiers: Iterable[OntologyClass] | None = None, onset: TimeElement | None = None, resolution: TimeElement | None = None, evidence: Iterable[Evidence] | None = None)[source]

Bases: MessageMixin

property type: OntologyClass
property excluded: bool
property description: str | None
property severity: OntologyClass | None
property modifiers: MutableSequence[OntologyClass]
property onset: TimeElement | None
property resolution: TimeElement | None
property evidence: MutableSequence[Evidence]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Disease(term: OntologyClass, excluded: bool = False, onset: TimeElement | None = None, resolution: TimeElement | None = None, disease_stage: Iterable[OntologyClass] | None = None, clinical_tnm_finding: Iterable[OntologyClass] | None = None, primary_site: OntologyClass | None = None, laterality: OntologyClass | None = None)[source]

Bases: MessageMixin

property term: OntologyClass
property excluded: bool
property onset: TimeElement | None
property resolution: TimeElement | None
property disease_stage: MutableSequence[OntologyClass]
property clinical_tnm_finding: MutableSequence[OntologyClass]
property primary_site: OntologyClass | None
property laterality: OntologyClass | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Biosample(id: str, individual_id: str | None = None, derived_from_id: str | None = None, description: str | None = None, sampled_tissue: OntologyClass | None = None, sample_type: OntologyClass | None = None, phenotypic_features: Iterable[PhenotypicFeature] | None = None, measurements: Iterable[Measurement] | None = None, taxonomy: OntologyClass | None = None, time_of_collection: TimeElement | None = None, histological_diagnosis: OntologyClass | None = None, tumor_progression: OntologyClass | None = None, tumor_grade: OntologyClass | None = None, pathological_stage: OntologyClass | None = None, pathological_tnm_finding: Iterable[OntologyClass] | None = None, diagnostic_markers: Iterable[OntologyClass] | None = None, procedure: Procedure | None = None, files: Iterable[File] | None = None, material_sample: OntologyClass | None = None, sample_processing: OntologyClass | None = None, sample_storage: OntologyClass | None = None)[source]

Bases: MessageMixin

property id: str
property individual_id: str | None
property derived_from_id: str | None
property description: str | None
property sampled_tissue: OntologyClass | None
property sample_type: OntologyClass | None
property phenotypic_features: MutableSequence[PhenotypicFeature]
property measurements: MutableSequence[Measurement]
property taxonomy: OntologyClass | None
property time_of_collection: TimeElement | None
property histological_diagnosis: OntologyClass | None
property tumor_progression: OntologyClass | None
property tumor_grade: OntologyClass | None
property pathological_stage: OntologyClass | None
property pathological_tnm_finding: MutableSequence[OntologyClass]
property diagnostic_markers: MutableSequence[OntologyClass]
property procedure: Procedure | None
property files: MutableSequence[File]
property material_sample: OntologyClass | None
property sample_processing: OntologyClass | None
property sample_storage: OntologyClass | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.MetaData(created: Timestamp, created_by: str, submitted_by: str | None = None, resources: Iterable[Resource] | None = None, updates: Iterable[Update] | None = None, phenopacket_schema_version: str = '2.0.2', external_references: Iterable[ExternalReference] | None = None)[source]

Bases: MessageMixin

property created: Timestamp
property created_by: str
property submitted_by: str | None
property resources: MutableSequence[Resource]
property updates: MutableSequence[Update]
property phenopacket_schema_version: str
property external_references: MutableSequence[ExternalReference]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Resource(id: str, name: str, url: str, version: str, namespace_prefix: str, iri_prefix: str)[source]

Bases: MessageMixin

property id: str
property name: str
property url: str
property version: str
property namespace_prefix: str
property iri_prefix: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

to_message() Message[source]

Get a protobuf representation of the class.

class ppsc.v202.Update(timestamp: Timestamp, updated_by: str | None = None, comment: str | None = None)[source]

Bases: MessageMixin

property timestamp: Timestamp
property updated_by: str
property comment: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

to_message() Message[source]

Get a protobuf representation of the class.

class ppsc.v202.OntologyClass(id: str, label: str)[source]

Bases: MessageMixin

OntologyClass represents classes (terms) from ontologies, and is used in many places throughout the Phenopacket standard. It is a simple, two element message that represents the identifier and the label of an ontology class.

>>> from ppsc.v202 import OntologyClass
>>> oc = OntologyClass(id='HP:0001250', label='Seizure')
>>> oc.id
'HP:0001250'
>>> oc.label
'Seizure'
Parameters:
  • id – a str with a CURIE-style identifier (e.g. HP:0001250).

  • label – a str with a human-readable class name (e.g. Seizure).

property id: str

Get a str with the ontology class identifier.

property label: str

Get a str with the human-readable class name.

static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.ExternalReference(id: str | None = None, reference: str | None = None, description: str | None = None)[source]

Bases: MessageMixin

property id: str
property reference: str
property description: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Evidence(evidence_code: OntologyClass, reference: ExternalReference | None = None)[source]

Bases: MessageMixin

property evidence_code: OntologyClass
property reference: ExternalReference | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Procedure(code: OntologyClass, body_site: OntologyClass | None = None, performed: TimeElement | None = None)[source]

Bases: MessageMixin

property code: OntologyClass
property body_site: OntologyClass | None
property performed: TimeElement | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.GestationalAge(weeks: int, days: int | None = None)[source]

Bases: MessageMixin

property weeks: int
property days: int | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Age(iso8601duration: str)[source]

Bases: MessageMixin

property iso8601duration: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.AgeRange(start: Age, end: Age)[source]

Bases: MessageMixin

property start
property end: Age
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.TimeInterval(start: Timestamp, end: Timestamp)[source]

Bases: MessageMixin

property start: Timestamp
property end: Timestamp
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.TimeElement(element: GestationalAge | Age | AgeRange | OntologyClass | Timestamp | TimeInterval)[source]

Bases: MessageMixin

TODO: better description

property element: GestationalAge | Age | AgeRange | OntologyClass | Timestamp | TimeInterval
property age: Age | None
property age_range: AgeRange | None
property ontology_class: OntologyClass
property timestamp: Timestamp
property interval: TimeInterval
property gestational_age: GestationalAge | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Timestamp(seconds: int, nanos: int)[source]

Bases: ToProtobuf, FromProtobuf

This Timestamp implementation is functionally equivalent to protobuf’s timestamp.

Per protobuf API documentation, A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one.

Consult the Phenopacket Schema documentation for more information.

Examples

Here we show how to create a Timestamp from various inputs.

>>> from ppsc import Timestamp

Let’s create a timestamp from a date time string:

>>> ts = Timestamp.from_str('1970-01-01T00:00:30Z')
>>> ts.seconds, ts.nanos
(30, 0)

Note, we indicate that the timestamp is in UTC by adding Z suffix.

We can also create a timestamp from a local time. Let’s create the same Timestamp but now in Eastern Daylight Time (EDT) which is 4 hours behind UTC:

>>> ts_local = Timestamp.from_str('1969-12-31T20:00:30-04:00')
>>> ts_local == ts
True

We can also create timestamp from a datetime object:

>>> from datetime import datetime, date, time, timezone
>>> d = date(1970, 1, 1)
>>> t = time(0, 0, 30)
>>> dt = datetime.combine(d, t, tzinfo=timezone.utc)
>>> ts_dt = Timestamp.from_datetime(dt)
>>> ts_dt == ts
True

Last, we can create timestamp directly from seconds and nanoseconds:

>>> ts_raw = Timestamp(30, 0)
>>> ts_raw == ts
True

and we can convert the timestamp to a UTC date time string:

>>> ts_raw.as_str()
'1970-01-01T00:00:30Z'
property seconds: int
property nanos: int
as_datetime() datetime[source]

Convert timestamp into Python’s datetime object.

The datetime is always in UTC.

Example

>>> from ppsc import Timestamp
>>> ts = Timestamp(10, 500)
>>> dt = ts.as_datetime()

Now we can access the datetime components:

>>> dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second
(1970, 1, 1, 0, 0, 10)

including the time zone:

>>> dt.tzname()
'UTC'
as_str(fmt: str = '%Y-%m-%dT%H:%M:%SZ') str[source]

Convert timestamp into a date time string.

Example

>>> from ppsc import Timestamp
>>> ts = Timestamp(0, 500_000)
>>> ts.as_str()
'1970-01-01T00:00:00Z'

We can use different formatting:

>>> ts.as_str('%Y-%m-%dT%H:%M:%S.%f%Z')
'1970-01-01T00:00:00.000500UTC'
static from_str(val: str, fmt: str = '%Y-%m-%dT%H:%M:%S%z')[source]

Create Timestamp from a date time string.

Parameters:
  • val – the date time str.

  • fmt – the date time format string.

static from_datetime(dt: datetime)[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.File(uri: str, individual_to_file_identifiers: Mapping[str, str] | None = None, file_attributes: Mapping[str, str] | None = None)[source]

Bases: MessageMixin

property uri: str
property individual_to_file_identifiers: MutableMapping[str, str]
property file_attributes: MutableMapping[str, str]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Gene(gene_id: str)[source]

Bases: MessageMixin

property gene_id: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Text(definition: str)[source]

Bases: MessageMixin

property definition: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Number(value: int | str)[source]

Bases: MessageMixin

property value: int
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.IndefiniteRange(value: int, comparator: str)[source]

Bases: MessageMixin

property value: int
property comparator: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

to_message() Message[source]

Get a protobuf representation of the class.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.DefiniteRange(min: int, max: int)[source]

Bases: MessageMixin

property min: int
property max: int
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

to_message() Message[source]

Get a protobuf representation of the class.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.SimpleInterval(start: int, end: int)[source]

Bases: MessageMixin

property start: int
property end: int
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

to_message() Message[source]

Get a protobuf representation of the class.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.SequenceInterval(start: Number | IndefiniteRange | DefiniteRange, end: Number | IndefiniteRange | DefiniteRange)[source]

Bases: MessageMixin

SequenceInterval is a complicated case which is

property start: Number | IndefiniteRange | DefiniteRange
property start_number: Number | None
property start_indefinite_range: IndefiniteRange | None
property start_definite_range: DefiniteRange | None
property end: Number | IndefiniteRange | DefiniteRange
property end_number: Number | None
property end_indefinite_range: IndefiniteRange | None
property end_definite_range: DefiniteRange | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
to_dict(out: MutableMapping[str, Any])[source]

Write itself into a dictionary composed of primitive or Python compound types.

classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.SequenceLocation(sequence_id: str, interval: SequenceInterval | SimpleInterval)[source]

Bases: MessageMixin

property sequence_id: str
property interval: SequenceInterval | SimpleInterval
property sequence_interval
property simple_interval
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.SequenceState(sequence: str)[source]

Bases: MessageMixin

property sequence: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.LiteralSequenceExpression(sequence: str)[source]

Bases: MessageMixin

property sequence: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.DerivedSequenceExpression(location: SequenceLocation, reverse_complement: bool = False)[source]

Bases: MessageMixin

property location: SequenceLocation
property reverse_complement: bool
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.RepeatedSequenceExpression(seq_expr: LiteralSequenceExpression | DerivedSequenceExpression, count: Number | IndefiniteRange | DefiniteRange)[source]

Bases: MessageMixin

property seq_expr: LiteralSequenceExpression | DerivedSequenceExpression
property literal_sequence_expression: LiteralSequenceExpression | None
property derived_sequence_expression: DerivedSequenceExpression | None
property count: Number | IndefiniteRange | DefiniteRange
property number: Number | None
property indefinite_range: IndefiniteRange | None
property definite_range
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.CytobandInterval(start: str, end: str)[source]

Bases: MessageMixin

property start: str
property end: str
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

to_message() Message[source]

Get a protobuf representation of the class.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.ChromosomeLocation(species_id: str, chr: str, interval: CytobandInterval)[source]

Bases: MessageMixin

property species_id: str
property chr: str
property interval: CytobandInterval
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

to_message() Message[source]

Get a protobuf representation of the class.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Allele(location: str | ChromosomeLocation | SequenceLocation, state: SequenceState | LiteralSequenceExpression | DerivedSequenceExpression | RepeatedSequenceExpression)[source]

Bases: MessageMixin

property location: str | ChromosomeLocation | SequenceLocation
property curie: str | None
property chromosome_location: ChromosomeLocation | None
property sequence_location: SequenceLocation | None
property state: SequenceState | LiteralSequenceExpression | DerivedSequenceExpression | RepeatedSequenceExpression
property sequence_state: SequenceState | None
property literal_sequence_expression: LiteralSequenceExpression | None
property derived_sequence_expression: DerivedSequenceExpression | None
property repeated_sequence_expression: RepeatedSequenceExpression | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Haplotype(members: Iterable[Member])[source]

Bases: MessageMixin

class Member(value: Allele | str)[source]

Bases: MessageMixin

property value: Allele | str
property allele: Allele | None
property curie: str | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

property members: MutableSequence[Member]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.CopyNumber(subject: Allele | Haplotype | Gene | LiteralSequenceExpression | DerivedSequenceExpression | RepeatedSequenceExpression | str, copies: Number | IndefiniteRange | DefiniteRange)[source]

Bases: MessageMixin

property subject: Allele | Haplotype | Gene | LiteralSequenceExpression | DerivedSequenceExpression | RepeatedSequenceExpression | str
property allele: Allele | None
property haplotype: Haplotype | None
property gene: Gene | None
property literal_sequence_expression: LiteralSequenceExpression | None
property derived_sequence_expression: DerivedSequenceExpression | None
property repeated_sequence_expression: RepeatedSequenceExpression | None
property curie: str | None
property copies: Number | IndefiniteRange | DefiniteRange
property number: Number | None
property indefinite_range: IndefiniteRange | None
property definite_range: DefiniteRange | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.VariationSet(members: Iterable[Member])[source]

Bases: MessageMixin

class Member(value: str | Allele | Haplotype | CopyNumber | Text)[source]

Bases: MessageMixin

property value: str | Allele | Haplotype | CopyNumber | Text
property curie: str | None
property allele: Allele | None
property haplotype: Haplotype | None
property copy_number: CopyNumber | None
property text: Text | None
property variation_set

Get VariationSet if present or None if value contains a different type.

static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

property members: MutableSequence[Member]
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.

class ppsc.v202.Variation(variation: Allele | Haplotype | CopyNumber | Text | VariationSet)[source]

Bases: MessageMixin

property variation: Allele | Haplotype | CopyNumber | Text | VariationSet
property allele: Allele | None
property haplotype: Haplotype | None
property copy_number: CopyNumber | None
property text: Text | None
property variation_set: VariationSet | None
static field_names() Iterable[str][source]

Get an iterable with the data class field names.

classmethod required_fields() Sequence[str][source]
classmethod from_dict(values: Mapping[str, Any])[source]
to_message() Message[source]

Get a protobuf representation of the class.

classmethod message_type() Type[Message][source]

Get the type of the protobuf element that this class can be decoded from.

classmethod from_message(msg: Message)[source]

Decode the message into a new instance of this class.