ga4gh / ga4gh/phenopacket-schema

Update documentation about encoding 'sex'

Open Beginner friendly
#438 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
101
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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 #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

Contributor guide

Open the contributing guide

Research direction

Start with the raw .proto definitions and auto-generated documentation referenced in the issue, then review how Phenopackets are represented in JSON and YAML. Update the documentation to explain the FEMALE/MALE integer discrepancy, the string-based JSON/YAML values, and why the protobuf integers should not change. Done means the convention and non-breaking rationale are clear to users.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, yaml
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.