Skip to main content

pedview

PyPI version Python versions License: MIT

A lightweight command-line tool for visualizing family pedigrees in genetics and clinical research workflows.

pedview reads standard pedigree files and generates self-contained, interactive HTML reports with publication-ready SVG diagrams. It has zero external runtime dependencies (built purely on Python standard library) and runs completely offline.


Features

  • Zero Runtime Dependencies: Pure Python standard library (math, html, dataclasses, pathlib, argparse).
  • Flexible Input: Auto-detects standard 6-column PLINK .fam/.ped files and extended headered pedigree files.
  • Clinical & Research Attributes: Visualizes affected status, proband indicators, carriers, deceased status, age labels, and genotype calls.
  • Layered Graph Engine: Sugiyama-style layout with barycenter crossing reduction, twin handling, and consanguinity loop routing.
  • Interactive Standalone HTML: Produces a single offline HTML report with pan/zoom navigation, individual detail drawer, and search.
  • Publication Exports: One-click download for vector SVG, journal-styled SVG, and high-resolution PNG.
  • Mendelian Quality Control: Automated parent-child relationship validation and Wright's inbreeding coefficient calculations ($f_a$).

Installation

pip install pedview

Or install from source:

git clone https://github.com/DKunLee/Pedview.git
cd Pedview
pip install .

Quickstart

# 1. Validate pedigree format, integrity, and relationships
pedview validate <input.ped>

# 2. Preview family and cohort summaries directly in the terminal
pedview preview <input.ped>

# 3. Build a standalone interactive HTML report
pedview build <input.ped> -o <output_report.html>

# 4. Render a single family from a multi-family cohort
pedview build <input.ped> --family <family_id> -o <family_report.html>

# 5. Highlight a candidate variant and set ancestor inbreeding coefficient
pedview build <input.ped> --variant-name "<variant_name>" --ancestor-inbreeding 0.02 -o <output_report.html>

Supported Formats

1. Standard Headerless PLINK .fam / .ped (6 Columns)

FAM01 101 0   0   1 1
FAM01 102 0   0   2 1
FAM01 201 101 102 1 2
FAM01 202 101 102 2 1
  • Sex: 1 = Male, 2 = Female, 0 = Unknown.
  • Phenotype: 1 = Unaffected, 2 = Affected, 0 / -9 = Unknown.
  • Missing Parents: 0, ., -9, NA.

2. Headered Extended Pedigree (Tab- or Space-delimited)

famid  id   fid  mid  sex  affected    proband  deceased  age  genotype
FAM01  101  0    0    1    unaffected  0        1         72y  0/0
FAM01  102  0    0    2    unaffected  0        0         68y  0/1
FAM01  201  101  102  1    affected    1        0         14y  0/1

Common column header aliases are resolved automatically:

  • Family: famid, family_id, family, pedigree, fid
  • Individual: id, iid, individual_id, sample_id
  • Father: fid, pat, pid, father, father_id
  • Mother: mid, mat, mother, mother_id
  • Sex: sex, gender
  • Phenotype: affected, phenotype, affection

CLI Reference

Command Description Example
validate Validates file format, parent references, sex codes, and loops pedview validate <input.ped>
preview Prints terminal summary of families, founders, and generations pedview preview <input.ped>
build Generates interactive HTML report pedview build <input.ped> -o <output_report.html>

Build Options

  • -o, --output: Output file path (defaults to <input>.html).
  • --family: Filter report to a specific family ID (<family_id>).
  • --title: Custom title for the HTML report ("<title>").
  • --variant-name: Candidate variant annotation label (e.g. "<variant_name>").
  • --ancestor-inbreeding: Global Wright ancestor inbreeding coefficient ($f_a$). Defaults to 0.0.

License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pedview-1.0.0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pedview-1.0.0-py3-none-any.whl (49.0 kB view details)

Uploaded Python 3

File details

Details for the file pedview-1.0.0.tar.gz.

File metadata

  • Download URL: pedview-1.0.0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pedview-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7989d628cd715985f8079660bd942ece730abd162621afd75b9bee6b55024b71
MD5 4d0c1941ee6dd0824a356aa200aa5c24
BLAKE2b-256 38858799d7a9763f5aaa33eab47dd89036aeea0ed151bd5c1ffc5a9d4b90c51c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pedview-1.0.0.tar.gz:

Publisher: publish.yml on DKunLee/Pedview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pedview-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pedview-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pedview-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2864f65a9ad7f1305aa948c2f956b7dc901ee43d83388e1f0ec6fd4798133d5
MD5 4cb5d3df1016a3c1c04099d3a262b239
BLAKE2b-256 6c00b388749698d6355b6fd403e7c44e98b79e4c29293df1045cfbd1befe92e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pedview-1.0.0-py3-none-any.whl:

Publisher: publish.yml on DKunLee/Pedview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

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