Skip to main content

Genetic genealogy tool for tree structure inference

Project description

kgenealogic

kgenealogic is a tool for genetic genealogy. It clusters relatives into a hypothesized family tree based on shared and unshared DNA.

Features

  • Supports GEDmatch pairwise segment and triangulation files
  • Uses both presence and inferred absence of triangulation
  • Allows, but doesn't require, specifying known relatives at each level of the family tree

Usage

kgenealogic init [-p <project-file>]
kgenealogic add [-p <project-file>] ... # files to import
kgenealogic build [-p <project-file>] ... # build crossover probability model and find negative triangulations
kgenealogic cluster [-p <project-file>] [-o <out-file>] <config-file>

kgenealogic --help # general help
kgenealogic <command> --help # help for <command>, e.g. init/add/build/cluster

Algorithms

Clustering

Clustering is performed by recursive greedy approximation of a min-cut of a genetic closeness graph.

Specifically, the sums of the (cM) lengths of pairwise matches form the edge-weights of a base graph. We add to these weights the positive and negative lengths of triangulations for which the "source" kit of the triangle is listed as a "seed" in the clustering configuration file. When processing a particular node of the tree, we use triangulations for seeds at that node or on its path to the root (descendants when viewed as a family tree, ancestors when viewed as a tree data structure).

Having formed this graph at a particular node of the tree, we consider seeds listed in the clustering configuration in the maternal or paternal branches of the node. For each connected component of the graph, if there is at least one seed present in the component, we find an approximate minimum cut separating the maternal and paternal seeds using a greedy algorithm. If there are only, e.g., maternal seeds present and no negative weights (from imputed negative triangulations), then the entire component will be classified as maternal.

Kits that are classified as either maternal or paternal at a particular node are considered recursively in the maternal or paternal branches of that mode.

Inferred negative triangulations

Suppose triangulations and pairwise matches are available for a kit S. And suppose there are kits T1 and T2 that each match pairwise with kit S on a particular segment, but fail to triangulate with S on that segment. Then we have a negative triangulation for source S between T1 and T2, indicating that T1 and T2 likely belong to different branches of the tree. This is represented with a negative weight between T1 and T2 in the graph used for clustering.

We find all negative triangulations for kits S whose triangulations and pairwise matches are available. This is somewhat computationally expensive, because the segments where negative triangulations occur are generally sub-segments of those appearing in the data files.

Project details


Download files

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

Source Distribution

kgenealogic-0.1.1.tar.gz (317.8 kB view details)

Uploaded Source

Built Distribution

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

kgenealogic-0.1.1-py3-none-any.whl (317.3 kB view details)

Uploaded Python 3

File details

Details for the file kgenealogic-0.1.1.tar.gz.

File metadata

  • Download URL: kgenealogic-0.1.1.tar.gz
  • Upload date:
  • Size: 317.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.10 Linux/5.19.0-50-generic

File hashes

Hashes for kgenealogic-0.1.1.tar.gz
Algorithm Hash digest
SHA256 662a99ac4a34b2fabd8a3f9d974f5cdd55bd5a7c9ab8dc78744201148b6f0505
MD5 6acbc1902f1bdbab92693c0afe2d6e06
BLAKE2b-256 265c406e80a01d997e93aed7721ecfe87fee8241dc0e289d224455bc98de6e1b

See more details on using hashes here.

File details

Details for the file kgenealogic-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kgenealogic-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 317.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.10.10 Linux/5.19.0-50-generic

File hashes

Hashes for kgenealogic-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cc1339840c81fb79ff9a4b5c249e7c9be8d1d8cd530f67e32c52cdac2afdeea
MD5 b9d6c07afc2947c758061e66079ffc93
BLAKE2b-256 01a2edac8cc4971c20fb1f5e519bfc5e5446d00e849c7a46b98d333f4f0678c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page