Skip to main content

ga4gh2studio

Draw a GA4GH Pedigree or a Phenopackets Family in Pedigree Studio. It is the reverse of studio2ga4gh: a family drawn, converted to GA4GH and drawn again comes back as the same family.

Files are read through pedigree-ga4gh, the one GA4GH implementation that the lab's pedigree tools share, so ga4gh2studio reads exactly the form that studio2ga4gh, the phenopacket toolkit and the Pedigree workbench write, in either JSON spelling (indexPatients or index_patients).

Installation

pip install ga4gh2studio

It needs Python 3.9 or later and installs pedigree-ga4gh with it.

Usage

ga4gh2studio okafor_ga4gh-pedigree.json                 # writes okafor.studio.json
ga4gh2studio okafor_phenopackets-family.json -o okafor.studio.json

Give either file. A GA4GH Pedigree holds everything a Family does, and more (adoptions, donors, partners), so if you have both, give the Pedigree. The -g FILE and -p FILE options of version 0.3 still work.

Without -o, the drawing is written beside the file, named after it: okafor.studio.json for okafor_ga4gh-pedigree.json. That is often the name of the drawing the GA4GH files were made from, which holds names and notes that they do not, so ga4gh2studio never replaces a file of that name unasked. If one exists, it stops (with exit code 2) and says so: choose another name with -o, or give --force to replace it. A file you name with -o is replaced if it exists, but never the file being read.

Open the result in Pedigree Studio and press Tidy: ga4gh2studio lays the family out simply, and Tidy arranges it properly.

What the files become

In the GA4GH files In Pedigree Studio
biological mother and father (KIN:027, KIN:028, KIN:003) a couple with a solid line to the child
sperm or egg donor (KIN:004, KIN:038) a parent with D in the symbol
surrogate who gave the egg (KIN:006) the mother, with D in the symbol, and a warning that the drawing does not show that she carried the pregnancy
gestational carrier (KIN:005) with no genetic mother recorded drawn in the mother's place, with G in the symbol
adoptive or foster parent (KIN:022, KIN:021) a dashed line, and the child's symbol in brackets
identical or non-identical twins (KIN:010, KIN:011) the matching twin line (triplets and more are drawn from one point)
twins of unknown zygosity (KIN:009) the twin line marked ?
partners, consanguineous or separated partners the matching partnership line
indexPatients, or the Family's proband the proband's arrow, with its P
a consultand, in the narrative the consultand's arrow
vital status DECEASED the slash
diseases and phenotypic features colours named in the colour key, with their term: breast cancer [MONDO:0007254]; two, three or four divide the symbol into halves, thirds or quarters
carriers, pregnancies and the like, in the narrative the matching marks

The marks follow the pedigree nomenclature as corrected in 2025 (Steinhaus French, Bennett and Resta, J Genet Couns 2025;34(2):e2020), which Pedigree Studio draws: G for a gestational carrier, where drawings made before used S, and D for a surrogate, who gives the egg and so is a genetic mother.

The ontology id written in the colour key is what lets studio2ga4gh give the condition the same term when the drawing is converted back.

A child with only one parent recorded gets an "unknown parent" partner, so that the line of descent can be drawn. Relationships Pedigree Studio can't draw without the people in between (cousins or grandparents on their own, for instance) are listed in the notes.

Older files

Files written by studio2ga4gh up to 0.3 or abusua2ga4gh up to 0.2 are not in the standard's form. ga4gh2studio recognises them and asks you to upgrade them first, once, with pedigree-ga4gh upgrade FILE -o NEW.json. Files in the form of the draft of version 1 of the standard, which is not yet approved, are recognised and refused with a message saying so.

In Python

import json
import ga4gh2studio

with open("okafor_ga4gh-pedigree.json") as fh:
    pedigree = json.load(fh)

result = ga4gh2studio.convert(pedigree)        # or convert(None, family)
print(result.summary)
with open("okafor.studio.json", "w") as fh:
    json.dump(result.session, fh, indent=2)

Changes from 0.3

Version 0.3 read only the JSON that studio2ga4gh 0.3 wrote, which was not the standard's form. 0.4 reads the GA4GH Pedigree and the Phenopackets Family through pedigree-ga4gh, takes the file as its argument, writes <name>.studio.json by default, and draws partnerships, adoptions, donors, twins and the marks noted in the narrative. See CHANGELOG.md.

Licence

MIT

Metadata

Release files for ga4gh2studio 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ga4gh2studio 0.4.1
File Size Uploaded Provenance Actions
ga4gh2studio-0.4.1.tar.gz 26.5 kB With provenance Details for ga4gh2studio-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ga4gh2studio 0.4.1
File Interpreter ABI Platform Actions
ga4gh2studio-0.4.1-py3-none-any.whl Python 3 none any Details for ga4gh2studio-0.4.1-py3-none-any.whl

Total release size: 41.5 kB

Release files / ga4gh2studio-0.4.1.tar.gz

Download URL ga4gh2studio-0.4.1.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f52f532976cf473fabdd32e1be4e7a0aa6fcbfee019cbf569a58ed29a5fa805
BLAKE2b-256 checksum
How to use checksums
e9ff952c2d31b87fc66d16a07774365e3cb2b5c32d225c08c19ce3b6c155b989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / ga4gh2studio-0.4.1-py3-none-any.whl

Download URL ga4gh2studio-0.4.1-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b4187535bb173a7c52b66fddf948c1a81f5ba84d1a55a3bc3c84adb708da04c
BLAKE2b-256 checksum
How to use checksums
5d6ba6e71e99a63ec295ec5ce70ae541571b06fc02a6a98f4836ea7d093ccf18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for ga4gh2studio 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ga4gh2studio-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page