Skip to content

Update documentation about encoding 'sex' #438

Description

@monicacecilia

There is a discrepancy between some PED-related bioinformatics conventions and the architecture of the Phenopackets schema.

1. PEDFILE / PLINK Standard: In standard genetics workflows (like .ped files or PLINK), sex is conventionally encoded using specific integers:

  • 1 = Male (easy to remember: 1 X chromosome)
  • 2 = Female (2 X chromosomes)

2. Phenopackets Protobuf Definition: The Phenopackets schema assigned the internal enum integers differently:

  • FEMALE = 1
  • MALE = 2

We need to update the documentation to clarify things:

  • This discrepancy doesn't actually break anything functionally. When users create a Phenopacket in JSON or YAML, they don't type 1 or 2. They use the string literals "FEMALE" or "MALE".
  • The Protobuf parser handles mapping the string to the internal integer behind the scenes. However, as seen in Issue Is "Sex" correctly labelled in the Pedigree example and Sex documentation  #391, when developers look at the raw .proto files or the auto-generated documentation, they see FEMALE=1 and MALE=2. Because they are used to the PEDFILE standard, they immediately flag this as a "bug" or assume it will cause massive data miscoding.
  • We don't need to actually change the Protobuf integers (which would be a breaking change to the schema's binary serialization), but we do need to add clear documentation so users stop getting confused.

fixes #321

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions